{"version":3,"sources":["node_modules/@angular/animations/fesm2022/browser.mjs","node_modules/@angular/platform-browser/fesm2022/animations.mjs","node_modules/@ngrx/store-devtools/fesm2022/ngrx-store-devtools.mjs","node_modules/@ngrx/router-store/fesm2022/ngrx-router-store.mjs","src/app/core/socket/socket.provider.ts","src/app/core/socket/socket-provider-factory.ts","src/app/core/localization/localization-resources-provider-factory.ts","src/app/core/datadog/services/datadog-rum-factory.ts","node_modules/@datadog/browser-core/esm/tools/display.js","node_modules/@datadog/browser-core/esm/tools/catchUserErrors.js","node_modules/@datadog/browser-core/esm/tools/experimentalFeatures.js","node_modules/@datadog/browser-core/esm/tools/utils/numberUtils.js","node_modules/@datadog/browser-core/esm/tools/utils/timeUtils.js","node_modules/@datadog/browser-core/esm/tools/utils/byteUtils.js","node_modules/@datadog/browser-core/esm/tools/utils/polyfills.js","node_modules/@datadog/browser-core/esm/tools/utils/objectUtils.js","node_modules/@datadog/browser-core/esm/tools/getGlobalObject.js","node_modules/@datadog/browser-core/esm/tools/getZoneJsOriginalValue.js","node_modules/@datadog/browser-core/esm/tools/monitor.js","node_modules/@datadog/browser-core/esm/tools/timer.js","node_modules/@datadog/browser-core/esm/tools/observable.js","node_modules/@datadog/browser-core/esm/tools/utils/functionUtils.js","node_modules/@datadog/browser-core/esm/tools/utils/stringUtils.js","node_modules/@datadog/browser-core/esm/domain/session/sessionConstants.js","node_modules/@datadog/browser-core/esm/browser/cookie.js","node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionStoreStrategy.js","node_modules/@datadog/browser-core/esm/domain/session/sessionState.js","node_modules/@datadog/browser-core/esm/domain/session/oldCookiesMigration.js","node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionInCookie.js","node_modules/@datadog/browser-core/esm/domain/session/storeStrategies/sessionInLocalStorage.js","node_modules/@datadog/browser-core/esm/tools/utils/browserDetection.js","node_modules/@datadog/browser-core/esm/domain/session/sessionStoreOperations.js","node_modules/@datadog/browser-core/esm/domain/session/sessionStore.js","node_modules/@datadog/browser-core/esm/tools/serialisation/jsonStringify.js","node_modules/@datadog/browser-core/esm/tools/utils/urlPolyfill.js","node_modules/@datadog/browser-core/esm/domain/configuration/intakeSites.js","node_modules/@datadog/browser-core/esm/domain/configuration/endpointBuilder.js","node_modules/@datadog/browser-core/esm/domain/configuration/tags.js","node_modules/@datadog/browser-core/esm/domain/configuration/transportConfiguration.js","node_modules/@datadog/browser-core/esm/domain/configuration/configuration.js","node_modules/@datadog/browser-core/esm/domain/tracekit/computeStackTrace.js","node_modules/@datadog/browser-core/esm/tools/instrumentMethod.js","node_modules/@datadog/browser-core/esm/domain/tracekit/tracekit.js","node_modules/@datadog/browser-core/esm/tools/serialisation/sanitize.js","node_modules/@datadog/browser-core/esm/domain/error/error.js","node_modules/@datadog/browser-core/esm/domain/error/error.types.js","node_modules/@datadog/browser-core/esm/domain/error/trackRuntimeError.js","node_modules/@datadog/browser-core/esm/boot/init.js","node_modules/@datadog/browser-core/esm/browser/addEventListener.js","node_modules/@datadog/browser-core/esm/domain/report/reportObservable.js","node_modules/@datadog/browser-core/esm/tools/sendToExtension.js","node_modules/@datadog/browser-core/esm/tools/utils/typeUtils.js","node_modules/@datadog/browser-core/esm/tools/mergeInto.js","node_modules/@datadog/browser-core/esm/domain/telemetry/rawTelemetryEvent.types.js","node_modules/@datadog/browser-core/esm/domain/telemetry/telemetry.js","node_modules/@datadog/browser-core/esm/tools/valueHistory.js","node_modules/@datadog/browser-core/esm/domain/session/sessionManager.js","node_modules/@datadog/browser-core/esm/tools/utils/responseUtils.js","node_modules/@datadog/browser-core/esm/transport/sendWithRetryStrategy.js","node_modules/@datadog/browser-core/esm/transport/httpRequest.js","node_modules/@datadog/browser-core/esm/browser/pageExitObservable.js","node_modules/@datadog/browser-core/esm/transport/batch.js","node_modules/@datadog/browser-core/esm/transport/eventBridge.js","node_modules/@datadog/browser-core/esm/transport/flushController.js","node_modules/@datadog/browser-core/esm/tools/abstractLifeCycle.js","node_modules/@datadog/browser-core/esm/domain/eventRateLimiter/createEventRateLimiter.js","node_modules/@datadog/browser-core/esm/browser/runOnReadyState.js","node_modules/@datadog/browser-core/esm/browser/xhrObservable.js","node_modules/@datadog/browser-core/esm/browser/fetchObservable.js","node_modules/@datadog/browser-core/esm/domain/console/consoleObservable.js","node_modules/@datadog/browser-core/esm/tools/boundedBuffer.js","node_modules/@datadog/browser-core/esm/tools/serialisation/heavyCustomerDataWarning.js","node_modules/@datadog/browser-core/esm/tools/serialisation/contextManager.js","node_modules/@datadog/browser-core/esm/tools/readBytesFromStream.js","node_modules/@datadog/browser-core/esm/domain/synthetics/syntheticsWorkerValues.js","node_modules/@datadog/browser-core/esm/domain/user/user.js","node_modules/@datadog/browser-core/esm/tools/matchOption.js","node_modules/@datadog/browser-rum-core/esm/domain/tracing/tracer.js","node_modules/@datadog/browser-rum-core/esm/domain/configuration.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/commonContext.js","node_modules/@datadog/browser-rum-core/esm/boot/rumPublicApi.js","node_modules/@datadog/browser-rum-core/esm/browser/domMutationObservable.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/resource/resourceUtils.js","node_modules/@datadog/browser-rum-core/esm/browser/htmlDomUtils.js","node_modules/@datadog/browser-rum-core/esm/domain/tracing/getDocumentTraceId.js","node_modules/@datadog/browser-rum-core/esm/browser/performanceCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/syntheticsContext.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/ciTestContext.js","node_modules/@datadog/browser-rum-core/esm/browser/viewportObservable.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/displayContext.js","node_modules/@datadog/browser-rum-core/esm/domain/limitModification.js","node_modules/@datadog/browser-rum-core/esm/domain/assembly.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/foregroundContexts.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/internalContext.js","node_modules/@datadog/browser-rum-core/esm/domain/lifeCycle.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/viewContexts.js","node_modules/@datadog/browser-rum-core/esm/domain/requestCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/trackEventCounts.js","node_modules/@datadog/browser-rum-core/esm/domain/waitPageActivityEnd.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/clickChain.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/getActionNameFromElement.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/getSelectorFromElement.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/listenActionEvents.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/computeFrustration.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/trackClickActions.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/action/actionCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/error/trackConsoleError.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/error/trackReportError.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/error/errorCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/longTask/longTaskCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/resource/matchRequestTiming.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/resource/resourceCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/view/trackFirstHidden.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/view/trackViewMetrics.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/view/trackViewEventCounts.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/view/trackViews.js","node_modules/@datadog/browser-rum-core/esm/domain/rumEventsCollection/view/viewCollection.js","node_modules/@datadog/browser-rum-core/esm/domain/rumSessionManager.js","node_modules/@datadog/browser-rum-core/esm/transport/startRumBatch.js","node_modules/@datadog/browser-rum-core/esm/transport/startRumEventBridge.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/urlContexts.js","node_modules/@datadog/browser-rum-core/esm/browser/locationChangeObservable.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/featureFlagContext.js","node_modules/@datadog/browser-rum-core/esm/domain/startCustomerDataTelemetry.js","node_modules/@datadog/browser-rum-core/esm/domain/contexts/pageStateHistory.js","node_modules/@datadog/browser-rum-core/esm/boot/startRum.js","node_modules/@datadog/browser-rum-core/esm/domain/getSessionReplayUrl.js","node_modules/@datadog/browser-rum/esm/types/sessionReplayConstants.js","node_modules/@datadog/browser-rum/esm/domain/record/assembly.js","node_modules/@datadog/browser-rum/esm/constants.js","node_modules/@datadog/browser-rum/esm/domain/record/privacy.js","node_modules/@datadog/browser-rum/esm/domain/record/serialization/serializationUtils.js","node_modules/@datadog/browser-rum/esm/domain/record/serialization/serializeStyleSheets.js","node_modules/@datadog/browser-rum/esm/domain/record/serialization/serializeAttribute.js","node_modules/@datadog/browser-rum/esm/domain/record/serialization/serializeAttributes.js","node_modules/@datadog/browser-rum/esm/domain/record/serialization/serializeNode.js","node_modules/@datadog/browser-rum/esm/domain/record/serialization/serializeDocument.js","node_modules/@datadog/browser-rum/esm/domain/record/eventsUtils.js","node_modules/@datadog/browser-rum/esm/domain/record/viewports.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/moveObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/scrollObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/mouseInteractionObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/inputObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/styleSheetObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/mediaInteractionObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/frustrationObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/viewportResizeObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/mutationBatch.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/mutationObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/focusObserver.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/recordIds.js","node_modules/@datadog/browser-rum/esm/domain/record/observers/observers.js","node_modules/@datadog/browser-rum/esm/domain/record/elementsScrollPositions.js","node_modules/@datadog/browser-rum/esm/domain/record/shadowRootsController.js","node_modules/@datadog/browser-rum/esm/domain/record/record.js","node_modules/@datadog/browser-rum/esm/domain/segmentCollection/buildReplayPayload.js","node_modules/@datadog/browser-rum/esm/domain/replayStats.js","node_modules/@datadog/browser-rum/esm/domain/segmentCollection/segment.js","node_modules/@datadog/browser-rum/esm/domain/segmentCollection/segmentCollection.js","node_modules/@datadog/browser-rum/esm/domain/segmentCollection/deflateWorker.js","node_modules/@datadog/browser-rum/esm/domain/segmentCollection/startDeflateWorker.js","node_modules/@datadog/browser-rum/esm/boot/startRecording.js","node_modules/@datadog/browser-rum/esm/boot/isBrowserSupported.js","node_modules/@datadog/browser-rum/esm/domain/getSessionReplayLink.js","node_modules/@datadog/browser-rum/esm/boot/recorderApi.js","node_modules/@datadog/browser-rum/esm/entries/main.js","src/app/core/datadog/services/datadog.service.ts","src/app/core/server-middleware-helper/server-middleware-helper.service.ts","src/app/app.component.ts","src/app/app.component.html","src/app/core/auth/auth-guard.service.ts","src/app/shared/layout/feedback-form/feedback-form.component.ts","src/app/shared/layout/feedback-form/feedback-form.component.html","src/app/shared/layout/header/directives/dynamic-menu.directive.ts","node_modules/primeng/fesm2022/primeng-menu.mjs","src/app/shared/layout/header/components/dynamic-menu/dynamic-menu.component.ts","src/app/shared/layout/header/components/dynamic-menu/dynamic-menu.component.html","src/app/shared/directives/click-outside.directive.ts","src/app/shared/layout/profile-popup/profile-popup.component.ts","src/app/shared/layout/profile-popup/profile-popup.component.html","src/app/shared/layout/footer/footer.component.ts","src/app/shared/layout/footer/footer.component.html","src/app/shared/layout/header/header.component.ts","src/app/shared/layout/header/header.component.html","src/app/shared/layout/important-message/important-message.component.ts","src/app/shared/layout/important-message/important-message.component.html","src/app/shared/layout/sidebar/sidebar.component.ts","src/app/shared/layout/sidebar/sidebar.component.html","src/app/shared/layout/full-layout/full-layout.component.ts","src/app/shared/layout/full-layout/full-layout.component.html","src/app/shared/layout/no-sidebar-layout/no-sidebar-layout.component.ts","src/app/shared/layout/no-sidebar-layout/no-sidebar-layout.component.html","src/app/core/auth/login-guard.service.ts","src/app/core/auth/auth.resolver.ts","src/app/shared/components/access-denied-iframe/access-denied-iframe.component.ts","src/app/shared/components/access-denied-iframe/access-denied-iframe.component.html","src/app/shared/state/client-accessible-to-user-state/client-accessible-to-user.selector.ts","src/app/core/auth/client-accessible-to-user-guard.service.ts","src/app/app-routing.module.ts","src/app/shared/state/theme-state/theme-state.module.ts","src/autogen/ez.authentication/contracts/response/login-result-statuses.ts","src/app/state/session-state/session-effects.ts","src/app/state/fail-state/fails.reducer.ts","src/app/state/session-state/session.reducer.ts","src/app/state/app-details-state/app-details.reducer.ts","src/autogen/ez.core/contracts/monitor/response/monitor-performance-info-response.ts","src/autogen/ez.errorlogging/contracts/response/event-log-response.ts","src/app/state/shared-state/shared-state.reducer.ts","src/app/state/socket-state/socket.effects.ts","src/app/shared/route-reuse/custom-route-reuses-strategy.ts","src/app/app.module.ts","src/main.ts"],"sourcesContent":["/**\n * @license Angular v19.1.5\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { ɵAnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE, sequence, AnimationMetadataType, style } from '@angular/animations';\nimport * as i0 from '@angular/core';\nimport { ɵRuntimeError, Injectable } from '@angular/core';\nconst LINE_START = '\\n - ';\nfunction invalidTimingValue(exp) {\n return new ɵRuntimeError(3000 /* RuntimeErrorCode.INVALID_TIMING_VALUE */, ngDevMode && `The provided timing value \"${exp}\" is invalid.`);\n}\nfunction negativeStepValue() {\n return new ɵRuntimeError(3100 /* RuntimeErrorCode.NEGATIVE_STEP_VALUE */, ngDevMode && 'Duration values below 0 are not allowed for this animation step.');\n}\nfunction negativeDelayValue() {\n return new ɵRuntimeError(3101 /* RuntimeErrorCode.NEGATIVE_DELAY_VALUE */, ngDevMode && 'Delay values below 0 are not allowed for this animation step.');\n}\nfunction invalidStyleParams(varName) {\n return new ɵRuntimeError(3001 /* RuntimeErrorCode.INVALID_STYLE_PARAMS */, ngDevMode && `Unable to resolve the local animation param ${varName} in the given list of values`);\n}\nfunction invalidParamValue(varName) {\n return new ɵRuntimeError(3003 /* RuntimeErrorCode.INVALID_PARAM_VALUE */, ngDevMode && `Please provide a value for the animation param ${varName}`);\n}\nfunction invalidNodeType(nodeType) {\n return new ɵRuntimeError(3004 /* RuntimeErrorCode.INVALID_NODE_TYPE */, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`);\n}\nfunction invalidCssUnitValue(userProvidedProperty, value) {\n return new ɵRuntimeError(3005 /* RuntimeErrorCode.INVALID_CSS_UNIT_VALUE */, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);\n}\nfunction invalidTrigger() {\n return new ɵRuntimeError(3006 /* RuntimeErrorCode.INVALID_TRIGGER */, ngDevMode && \"animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))\");\n}\nfunction invalidDefinition() {\n return new ɵRuntimeError(3007 /* RuntimeErrorCode.INVALID_DEFINITION */, ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()');\n}\nfunction invalidState(metadataName, missingSubs) {\n return new ɵRuntimeError(3008 /* RuntimeErrorCode.INVALID_STATE */, ngDevMode && `state(\"${metadataName}\", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`);\n}\nfunction invalidStyleValue(value) {\n return new ɵRuntimeError(3002 /* RuntimeErrorCode.INVALID_STYLE_VALUE */, ngDevMode && `The provided style string value ${value} is not allowed.`);\n}\nfunction invalidProperty(prop) {\n return new ɵRuntimeError(3009 /* RuntimeErrorCode.INVALID_PROPERTY */, ngDevMode && `The provided animation property \"${prop}\" is not a supported CSS property for animations`);\n}\nfunction invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {\n return new ɵRuntimeError(3010 /* RuntimeErrorCode.INVALID_PARALLEL_ANIMATION */, ngDevMode && `The CSS property \"${prop}\" that exists between the times of \"${firstStart}ms\" and \"${firstEnd}ms\" is also being animated in a parallel animation between the times of \"${secondStart}ms\" and \"${secondEnd}ms\"`);\n}\nfunction invalidKeyframes() {\n return new ɵRuntimeError(3011 /* RuntimeErrorCode.INVALID_KEYFRAMES */, ngDevMode && `keyframes() must be placed inside of a call to animate()`);\n}\nfunction invalidOffset() {\n return new ɵRuntimeError(3012 /* RuntimeErrorCode.INVALID_OFFSET */, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`);\n}\nfunction keyframeOffsetsOutOfOrder() {\n return new ɵRuntimeError(3200 /* RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER */, ngDevMode && `Please ensure that all keyframe offsets are in order`);\n}\nfunction keyframesMissingOffsets() {\n return new ɵRuntimeError(3202 /* RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS */, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`);\n}\nfunction invalidStagger() {\n return new ɵRuntimeError(3013 /* RuntimeErrorCode.INVALID_STAGGER */, ngDevMode && `stagger() can only be used inside of query()`);\n}\nfunction invalidQuery(selector) {\n return new ɵRuntimeError(3014 /* RuntimeErrorCode.INVALID_QUERY */, ngDevMode && `\\`query(\"${selector}\")\\` returned zero elements. (Use \\`query(\"${selector}\", { optional: true })\\` if you wish to allow this.)`);\n}\nfunction invalidExpression(expr) {\n return new ɵRuntimeError(3015 /* RuntimeErrorCode.INVALID_EXPRESSION */, ngDevMode && `The provided transition expression \"${expr}\" is not supported`);\n}\nfunction invalidTransitionAlias(alias) {\n return new ɵRuntimeError(3016 /* RuntimeErrorCode.INVALID_TRANSITION_ALIAS */, ngDevMode && `The transition alias value \"${alias}\" is not supported`);\n}\nfunction validationFailed(errors) {\n return new ɵRuntimeError(3500 /* RuntimeErrorCode.VALIDATION_FAILED */, ngDevMode && `animation validation failed:\\n${errors.map(err => err.message).join('\\n')}`);\n}\nfunction buildingFailed(errors) {\n return new ɵRuntimeError(3501 /* RuntimeErrorCode.BUILDING_FAILED */, ngDevMode && `animation building failed:\\n${errors.map(err => err.message).join('\\n')}`);\n}\nfunction triggerBuildFailed(name, errors) {\n return new ɵRuntimeError(3404 /* RuntimeErrorCode.TRIGGER_BUILD_FAILED */, ngDevMode && `The animation trigger \"${name}\" has failed to build due to the following errors:\\n - ${errors.map(err => err.message).join('\\n - ')}`);\n}\nfunction animationFailed(errors) {\n return new ɵRuntimeError(3502 /* RuntimeErrorCode.ANIMATION_FAILED */, ngDevMode && `Unable to animate due to the following errors:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);\n}\nfunction registerFailed(errors) {\n return new ɵRuntimeError(3503 /* RuntimeErrorCode.REGISTRATION_FAILED */, ngDevMode && `Unable to build the animation due to the following errors: ${errors.map(err => err.message).join('\\n')}`);\n}\nfunction missingOrDestroyedAnimation() {\n return new ɵRuntimeError(3300 /* RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION */, ngDevMode && \"The requested animation doesn't exist or has already been destroyed\");\n}\nfunction createAnimationFailed(errors) {\n return new ɵRuntimeError(3504 /* RuntimeErrorCode.CREATE_ANIMATION_FAILED */, ngDevMode && `Unable to create the animation due to the following errors:${errors.map(err => err.message).join('\\n')}`);\n}\nfunction missingPlayer(id) {\n return new ɵRuntimeError(3301 /* RuntimeErrorCode.MISSING_PLAYER */, ngDevMode && `Unable to find the timeline player referenced by ${id}`);\n}\nfunction missingTrigger(phase, name) {\n return new ɵRuntimeError(3302 /* RuntimeErrorCode.MISSING_TRIGGER */, ngDevMode && `Unable to listen on the animation trigger event \"${phase}\" because the animation trigger \"${name}\" doesn\\'t exist!`);\n}\nfunction missingEvent(name) {\n return new ɵRuntimeError(3303 /* RuntimeErrorCode.MISSING_EVENT */, ngDevMode && `Unable to listen on the animation trigger \"${name}\" because the provided event is undefined!`);\n}\nfunction unsupportedTriggerEvent(phase, name) {\n return new ɵRuntimeError(3400 /* RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT */, ngDevMode && `The provided animation trigger event \"${phase}\" for the animation trigger \"${name}\" is not supported!`);\n}\nfunction unregisteredTrigger(name) {\n return new ɵRuntimeError(3401 /* RuntimeErrorCode.UNREGISTERED_TRIGGER */, ngDevMode && `The provided animation trigger \"${name}\" has not been registered!`);\n}\nfunction triggerTransitionsFailed(errors) {\n return new ɵRuntimeError(3402 /* RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED */, ngDevMode && `Unable to process animations due to the following failed trigger transitions\\n ${errors.map(err => err.message).join('\\n')}`);\n}\nfunction triggerParsingFailed(name, errors) {\n return new ɵRuntimeError(3403 /* RuntimeErrorCode.TRIGGER_PARSING_FAILED */, ngDevMode && `Animation parsing for the ${name} trigger have failed:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);\n}\nfunction transitionFailed(name, errors) {\n return new ɵRuntimeError(3505 /* RuntimeErrorCode.TRANSITION_FAILED */, ngDevMode && `@${name} has failed due to:\\n ${errors.map(err => err.message).join('\\n- ')}`);\n}\n\n/**\n * Set of all animatable CSS properties\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties\n */\nconst ANIMATABLE_PROP_SET = /*#__PURE__*/new Set(['-moz-outline-radius', '-moz-outline-radius-bottomleft', '-moz-outline-radius-bottomright', '-moz-outline-radius-topleft', '-moz-outline-radius-topright', '-ms-grid-columns', '-ms-grid-rows', '-webkit-line-clamp', '-webkit-text-fill-color', '-webkit-text-stroke', '-webkit-text-stroke-color', 'accent-color', 'all', 'backdrop-filter', 'background', 'background-color', 'background-position', 'background-size', 'block-size', 'border', 'border-block-end', 'border-block-end-color', 'border-block-end-width', 'border-block-start', 'border-block-start-color', 'border-block-start-width', 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-width', 'border-color', 'border-end-end-radius', 'border-end-start-radius', 'border-image-outset', 'border-image-slice', 'border-image-width', 'border-inline-end', 'border-inline-end-color', 'border-inline-end-width', 'border-inline-start', 'border-inline-start-color', 'border-inline-start-width', 'border-left', 'border-left-color', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-width', 'border-start-end-radius', 'border-start-start-radius', 'border-top', 'border-top-color', 'border-top-left-radius', 'border-top-right-radius', 'border-top-width', 'border-width', 'bottom', 'box-shadow', 'caret-color', 'clip', 'clip-path', 'color', 'column-count', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-width', 'column-width', 'columns', 'filter', 'flex', 'flex-basis', 'flex-grow', 'flex-shrink', 'font', 'font-size', 'font-size-adjust', 'font-stretch', 'font-variation-settings', 'font-weight', 'gap', 'grid-column-gap', 'grid-gap', 'grid-row-gap', 'grid-template-columns', 'grid-template-rows', 'height', 'inline-size', 'input-security', 'inset', 'inset-block', 'inset-block-end', 'inset-block-start', 'inset-inline', 'inset-inline-end', 'inset-inline-start', 'left', 'letter-spacing', 'line-clamp', 'line-height', 'margin', 'margin-block-end', 'margin-block-start', 'margin-bottom', 'margin-inline-end', 'margin-inline-start', 'margin-left', 'margin-right', 'margin-top', 'mask', 'mask-border', 'mask-position', 'mask-size', 'max-block-size', 'max-height', 'max-inline-size', 'max-lines', 'max-width', 'min-block-size', 'min-height', 'min-inline-size', 'min-width', 'object-position', 'offset', 'offset-anchor', 'offset-distance', 'offset-path', 'offset-position', 'offset-rotate', 'opacity', 'order', 'outline', 'outline-color', 'outline-offset', 'outline-width', 'padding', 'padding-block-end', 'padding-block-start', 'padding-bottom', 'padding-inline-end', 'padding-inline-start', 'padding-left', 'padding-right', 'padding-top', 'perspective', 'perspective-origin', 'right', 'rotate', 'row-gap', 'scale', 'scroll-margin', 'scroll-margin-block', 'scroll-margin-block-end', 'scroll-margin-block-start', 'scroll-margin-bottom', 'scroll-margin-inline', 'scroll-margin-inline-end', 'scroll-margin-inline-start', 'scroll-margin-left', 'scroll-margin-right', 'scroll-margin-top', 'scroll-padding', 'scroll-padding-block', 'scroll-padding-block-end', 'scroll-padding-block-start', 'scroll-padding-bottom', 'scroll-padding-inline', 'scroll-padding-inline-end', 'scroll-padding-inline-start', 'scroll-padding-left', 'scroll-padding-right', 'scroll-padding-top', 'scroll-snap-coordinate', 'scroll-snap-destination', 'scrollbar-color', 'shape-image-threshold', 'shape-margin', 'shape-outside', 'tab-size', 'text-decoration', 'text-decoration-color', 'text-decoration-thickness', 'text-emphasis', 'text-emphasis-color', 'text-indent', 'text-shadow', 'text-underline-offset', 'top', 'transform', 'transform-origin', 'translate', 'vertical-align', 'visibility', 'width', 'word-spacing', 'z-index', 'zoom']);\nfunction optimizeGroupPlayer(players) {\n switch (players.length) {\n case 0:\n return new NoopAnimationPlayer();\n case 1:\n return players[0];\n default:\n return new ɵAnimationGroupPlayer(players);\n }\n}\nfunction normalizeKeyframes$1(normalizer, keyframes, preStyles = new Map(), postStyles = new Map()) {\n const errors = [];\n const normalizedKeyframes = [];\n let previousOffset = -1;\n let previousKeyframe = null;\n keyframes.forEach(kf => {\n const offset = kf.get('offset');\n const isSameOffset = offset == previousOffset;\n const normalizedKeyframe = isSameOffset && previousKeyframe || new Map();\n kf.forEach((val, prop) => {\n let normalizedProp = prop;\n let normalizedValue = val;\n if (prop !== 'offset') {\n normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);\n switch (normalizedValue) {\n case ɵPRE_STYLE:\n normalizedValue = preStyles.get(prop);\n break;\n case AUTO_STYLE:\n normalizedValue = postStyles.get(prop);\n break;\n default:\n normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);\n break;\n }\n }\n normalizedKeyframe.set(normalizedProp, normalizedValue);\n });\n if (!isSameOffset) {\n normalizedKeyframes.push(normalizedKeyframe);\n }\n previousKeyframe = normalizedKeyframe;\n previousOffset = offset;\n });\n if (errors.length) {\n throw animationFailed(errors);\n }\n return normalizedKeyframes;\n}\nfunction listenOnPlayer(player, eventName, event, callback) {\n switch (eventName) {\n case 'start':\n player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player)));\n break;\n case 'done':\n player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player)));\n break;\n case 'destroy':\n player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player)));\n break;\n }\n}\nfunction copyAnimationEvent(e, phaseName, player) {\n const totalTime = player.totalTime;\n const disabled = player.disabled ? true : false;\n const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled);\n const data = e['_data'];\n if (data != null) {\n event['_data'] = data;\n }\n return event;\n}\nfunction makeAnimationEvent(element, triggerName, fromState, toState, phaseName = '', totalTime = 0, disabled) {\n return {\n element,\n triggerName,\n fromState,\n toState,\n phaseName,\n totalTime,\n disabled: !!disabled\n };\n}\nfunction getOrSetDefaultValue(map, key, defaultValue) {\n let value = map.get(key);\n if (!value) {\n map.set(key, value = defaultValue);\n }\n return value;\n}\nfunction parseTimelineCommand(command) {\n const separatorPos = command.indexOf(':');\n const id = command.substring(1, separatorPos);\n const action = command.slice(separatorPos + 1);\n return [id, action];\n}\nconst documentElement = /* @__PURE__ */(() => typeof document === 'undefined' ? null : document.documentElement)();\nfunction getParentElement(element) {\n const parent = element.parentNode || element.host || null; // consider host to support shadow DOM\n if (parent === documentElement) {\n return null;\n }\n return parent;\n}\nfunction containsVendorPrefix(prop) {\n // Webkit is the only real popular vendor prefix nowadays\n // cc: http://shouldiprefix.com/\n return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit\n}\nlet _CACHED_BODY = null;\nlet _IS_WEBKIT = false;\nfunction validateStyleProperty(prop) {\n if (!_CACHED_BODY) {\n _CACHED_BODY = getBodyNode() || {};\n _IS_WEBKIT = _CACHED_BODY.style ? 'WebkitAppearance' in _CACHED_BODY.style : false;\n }\n let result = true;\n if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {\n result = prop in _CACHED_BODY.style;\n if (!result && _IS_WEBKIT) {\n const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1);\n result = camelProp in _CACHED_BODY.style;\n }\n }\n return result;\n}\nfunction validateWebAnimatableStyleProperty(prop) {\n return ANIMATABLE_PROP_SET.has(prop);\n}\nfunction getBodyNode() {\n if (typeof document != 'undefined') {\n return document.body;\n }\n return null;\n}\nfunction containsElement(elm1, elm2) {\n while (elm2) {\n if (elm2 === elm1) {\n return true;\n }\n elm2 = getParentElement(elm2);\n }\n return false;\n}\nfunction invokeQuery(element, selector, multi) {\n if (multi) {\n return Array.from(element.querySelectorAll(selector));\n }\n const elem = element.querySelector(selector);\n return elem ? [elem] : [];\n}\nfunction hypenatePropsKeys(original) {\n const newMap = new Map();\n original.forEach((val, prop) => {\n const newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');\n newMap.set(newProp, val);\n });\n return newMap;\n}\n\n/**\n * @publicApi\n *\n * `AnimationDriver` implentation for Noop animations\n */\nlet NoopAnimationDriver = /*#__PURE__*/(() => {\n class NoopAnimationDriver {\n /**\n * @returns Whether `prop` is a valid CSS property\n */\n validateStyleProperty(prop) {\n return validateStyleProperty(prop);\n }\n /**\n *\n * @returns Whether elm1 contains elm2.\n */\n containsElement(elm1, elm2) {\n return containsElement(elm1, elm2);\n }\n /**\n * @returns Rhe parent of the given element or `null` if the element is the `document`\n */\n getParentElement(element) {\n return getParentElement(element);\n }\n /**\n * @returns The result of the query selector on the element. The array will contain up to 1 item\n * if `multi` is `false`.\n */\n query(element, selector, multi) {\n return invokeQuery(element, selector, multi);\n }\n /**\n * @returns The `defaultValue` or empty string\n */\n computeStyle(element, prop, defaultValue) {\n return defaultValue || '';\n }\n /**\n * @returns An `NoopAnimationPlayer`\n */\n animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {\n return new NoopAnimationPlayer(duration, delay);\n }\n static ɵfac = function NoopAnimationDriver_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NoopAnimationDriver)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NoopAnimationDriver,\n factory: NoopAnimationDriver.ɵfac\n });\n }\n return NoopAnimationDriver;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * @publicApi\n */\nclass AnimationDriver {\n /**\n * @deprecated Use the NoopAnimationDriver class.\n */\n static NOOP = /*#__PURE__*/new NoopAnimationDriver();\n}\nclass AnimationStyleNormalizer {}\nclass NoopAnimationStyleNormalizer {\n normalizePropertyName(propertyName, errors) {\n return propertyName;\n }\n normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) {\n return value;\n }\n}\nconst ONE_SECOND = 1000;\nconst SUBSTITUTION_EXPR_START = '{{';\nconst SUBSTITUTION_EXPR_END = '}}';\nconst ENTER_CLASSNAME = 'ng-enter';\nconst LEAVE_CLASSNAME = 'ng-leave';\nconst NG_TRIGGER_CLASSNAME = 'ng-trigger';\nconst NG_TRIGGER_SELECTOR = '.ng-trigger';\nconst NG_ANIMATING_CLASSNAME = 'ng-animating';\nconst NG_ANIMATING_SELECTOR = '.ng-animating';\nfunction resolveTimingValue(value) {\n if (typeof value == 'number') return value;\n const matches = value.match(/^(-?[\\.\\d]+)(m?s)/);\n if (!matches || matches.length < 2) return 0;\n return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n}\nfunction _convertTimeValueToMS(value, unit) {\n switch (unit) {\n case 's':\n return value * ONE_SECOND;\n default:\n // ms or something else\n return value;\n }\n}\nfunction resolveTiming(timings, errors, allowNegativeValues) {\n return timings.hasOwnProperty('duration') ? timings : parseTimeExpression(timings, errors, allowNegativeValues);\n}\nfunction parseTimeExpression(exp, errors, allowNegativeValues) {\n const regex = /^(-?[\\.\\d]+)(m?s)(?:\\s+(-?[\\.\\d]+)(m?s))?(?:\\s+([-a-z]+(?:\\(.+?\\))?))?$/i;\n let duration;\n let delay = 0;\n let easing = '';\n if (typeof exp === 'string') {\n const matches = exp.match(regex);\n if (matches === null) {\n errors.push(invalidTimingValue(exp));\n return {\n duration: 0,\n delay: 0,\n easing: ''\n };\n }\n duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n const delayMatch = matches[3];\n if (delayMatch != null) {\n delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);\n }\n const easingVal = matches[5];\n if (easingVal) {\n easing = easingVal;\n }\n } else {\n duration = exp;\n }\n if (!allowNegativeValues) {\n let containsErrors = false;\n let startIndex = errors.length;\n if (duration < 0) {\n errors.push(negativeStepValue());\n containsErrors = true;\n }\n if (delay < 0) {\n errors.push(negativeDelayValue());\n containsErrors = true;\n }\n if (containsErrors) {\n errors.splice(startIndex, 0, invalidTimingValue(exp));\n }\n }\n return {\n duration,\n delay,\n easing\n };\n}\nfunction normalizeKeyframes(keyframes) {\n if (!keyframes.length) {\n return [];\n }\n if (keyframes[0] instanceof Map) {\n return keyframes;\n }\n return keyframes.map(kf => new Map(Object.entries(kf)));\n}\nfunction normalizeStyles(styles) {\n return Array.isArray(styles) ? new Map(...styles) : new Map(styles);\n}\nfunction setStyles(element, styles, formerStyles) {\n styles.forEach((val, prop) => {\n const camelProp = dashCaseToCamelCase(prop);\n if (formerStyles && !formerStyles.has(prop)) {\n formerStyles.set(prop, element.style[camelProp]);\n }\n element.style[camelProp] = val;\n });\n}\nfunction eraseStyles(element, styles) {\n styles.forEach((_, prop) => {\n const camelProp = dashCaseToCamelCase(prop);\n element.style[camelProp] = '';\n });\n}\nfunction normalizeAnimationEntry(steps) {\n if (Array.isArray(steps)) {\n if (steps.length == 1) return steps[0];\n return sequence(steps);\n }\n return steps;\n}\nfunction validateStyleParams(value, options, errors) {\n const params = options.params || {};\n const matches = extractStyleParams(value);\n if (matches.length) {\n matches.forEach(varName => {\n if (!params.hasOwnProperty(varName)) {\n errors.push(invalidStyleParams(varName));\n }\n });\n }\n}\nconst PARAM_REGEX = /*#__PURE__*/new RegExp(`${SUBSTITUTION_EXPR_START}\\\\s*(.+?)\\\\s*${SUBSTITUTION_EXPR_END}`, 'g');\nfunction extractStyleParams(value) {\n let params = [];\n if (typeof value === 'string') {\n let match;\n while (match = PARAM_REGEX.exec(value)) {\n params.push(match[1]);\n }\n PARAM_REGEX.lastIndex = 0;\n }\n return params;\n}\nfunction interpolateParams(value, params, errors) {\n const original = `${value}`;\n const str = original.replace(PARAM_REGEX, (_, varName) => {\n let localVal = params[varName];\n // this means that the value was never overridden by the data passed in by the user\n if (localVal == null) {\n errors.push(invalidParamValue(varName));\n localVal = '';\n }\n return localVal.toString();\n });\n // we do this to assert that numeric values stay as they are\n return str == original ? value : str;\n}\nconst DASH_CASE_REGEXP = /-+([a-z0-9])/g;\nfunction dashCaseToCamelCase(input) {\n return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());\n}\nfunction camelCaseToDashCase(input) {\n return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\nfunction allowPreviousPlayerStylesMerge(duration, delay) {\n return duration === 0 || delay === 0;\n}\nfunction balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {\n if (previousStyles.size && keyframes.length) {\n let startingKeyframe = keyframes[0];\n let missingStyleProps = [];\n previousStyles.forEach((val, prop) => {\n if (!startingKeyframe.has(prop)) {\n missingStyleProps.push(prop);\n }\n startingKeyframe.set(prop, val);\n });\n if (missingStyleProps.length) {\n for (let i = 1; i < keyframes.length; i++) {\n let kf = keyframes[i];\n missingStyleProps.forEach(prop => kf.set(prop, computeStyle(element, prop)));\n }\n }\n }\n return keyframes;\n}\nfunction visitDslNode(visitor, node, context) {\n switch (node.type) {\n case AnimationMetadataType.Trigger:\n return visitor.visitTrigger(node, context);\n case AnimationMetadataType.State:\n return visitor.visitState(node, context);\n case AnimationMetadataType.Transition:\n return visitor.visitTransition(node, context);\n case AnimationMetadataType.Sequence:\n return visitor.visitSequence(node, context);\n case AnimationMetadataType.Group:\n return visitor.visitGroup(node, context);\n case AnimationMetadataType.Animate:\n return visitor.visitAnimate(node, context);\n case AnimationMetadataType.Keyframes:\n return visitor.visitKeyframes(node, context);\n case AnimationMetadataType.Style:\n return visitor.visitStyle(node, context);\n case AnimationMetadataType.Reference:\n return visitor.visitReference(node, context);\n case AnimationMetadataType.AnimateChild:\n return visitor.visitAnimateChild(node, context);\n case AnimationMetadataType.AnimateRef:\n return visitor.visitAnimateRef(node, context);\n case AnimationMetadataType.Query:\n return visitor.visitQuery(node, context);\n case AnimationMetadataType.Stagger:\n return visitor.visitStagger(node, context);\n default:\n throw invalidNodeType(node.type);\n }\n}\nfunction computeStyle(element, prop) {\n return window.getComputedStyle(element)[prop];\n}\nconst DIMENSIONAL_PROP_SET = /*#__PURE__*/new Set(['width', 'height', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'left', 'top', 'bottom', 'right', 'fontSize', 'outlineWidth', 'outlineOffset', 'paddingTop', 'paddingLeft', 'paddingBottom', 'paddingRight', 'marginTop', 'marginLeft', 'marginBottom', 'marginRight', 'borderRadius', 'borderWidth', 'borderTopWidth', 'borderLeftWidth', 'borderRightWidth', 'borderBottomWidth', 'textIndent', 'perspective']);\nclass WebAnimationsStyleNormalizer extends AnimationStyleNormalizer {\n normalizePropertyName(propertyName, errors) {\n return dashCaseToCamelCase(propertyName);\n }\n normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) {\n let unit = '';\n const strVal = value.toString().trim();\n if (DIMENSIONAL_PROP_SET.has(normalizedProperty) && value !== 0 && value !== '0') {\n if (typeof value === 'number') {\n unit = 'px';\n } else {\n const valAndSuffixMatch = value.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n errors.push(invalidCssUnitValue(userProvidedProperty, value));\n }\n }\n }\n return strVal + unit;\n }\n}\nfunction createListOfWarnings(warnings) {\n const LINE_START = '\\n - ';\n return `${LINE_START}${warnings.filter(Boolean).map(warning => warning).join(LINE_START)}`;\n}\nfunction warnValidation(warnings) {\n console.warn(`animation validation warnings:${createListOfWarnings(warnings)}`);\n}\nfunction warnTriggerBuild(name, warnings) {\n console.warn(`The animation trigger \"${name}\" has built with the following warnings:${createListOfWarnings(warnings)}`);\n}\nfunction warnRegister(warnings) {\n console.warn(`Animation built with the following warnings:${createListOfWarnings(warnings)}`);\n}\nfunction triggerParsingWarnings(name, warnings) {\n console.warn(`Animation parsing for the ${name} trigger presents the following warnings:${createListOfWarnings(warnings)}`);\n}\nfunction pushUnrecognizedPropertiesWarning(warnings, props) {\n if (props.length) {\n warnings.push(`The following provided properties are not recognized: ${props.join(', ')}`);\n }\n}\nconst ANY_STATE = '*';\nfunction parseTransitionExpr(transitionValue, errors) {\n const expressions = [];\n if (typeof transitionValue == 'string') {\n transitionValue.split(/\\s*,\\s*/).forEach(str => parseInnerTransitionStr(str, expressions, errors));\n } else {\n expressions.push(transitionValue);\n }\n return expressions;\n}\nfunction parseInnerTransitionStr(eventStr, expressions, errors) {\n if (eventStr[0] == ':') {\n const result = parseAnimationAlias(eventStr, errors);\n if (typeof result == 'function') {\n expressions.push(result);\n return;\n }\n eventStr = result;\n }\n const match = eventStr.match(/^(\\*|[-\\w]+)\\s*()\\s*(\\*|[-\\w]+)$/);\n if (match == null || match.length < 4) {\n errors.push(invalidExpression(eventStr));\n return expressions;\n }\n const fromState = match[1];\n const separator = match[2];\n const toState = match[3];\n expressions.push(makeLambdaFromStates(fromState, toState));\n const isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;\n if (separator[0] == '<' && !isFullAnyStateExpr) {\n expressions.push(makeLambdaFromStates(toState, fromState));\n }\n return;\n}\nfunction parseAnimationAlias(alias, errors) {\n switch (alias) {\n case ':enter':\n return 'void => *';\n case ':leave':\n return '* => void';\n case ':increment':\n return (fromState, toState) => parseFloat(toState) > parseFloat(fromState);\n case ':decrement':\n return (fromState, toState) => parseFloat(toState) < parseFloat(fromState);\n default:\n errors.push(invalidTransitionAlias(alias));\n return '* => *';\n }\n}\n// DO NOT REFACTOR ... keep the follow set instantiations\n// with the values intact (closure compiler for some reason\n// removes follow-up lines that add the values outside of\n// the constructor...\nconst TRUE_BOOLEAN_VALUES = /*#__PURE__*/new Set(['true', '1']);\nconst FALSE_BOOLEAN_VALUES = /*#__PURE__*/new Set(['false', '0']);\nfunction makeLambdaFromStates(lhs, rhs) {\n const LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);\n const RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);\n return (fromState, toState) => {\n let lhsMatch = lhs == ANY_STATE || lhs == fromState;\n let rhsMatch = rhs == ANY_STATE || rhs == toState;\n if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {\n lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);\n }\n if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {\n rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);\n }\n return lhsMatch && rhsMatch;\n };\n}\nconst SELF_TOKEN = ':self';\nconst SELF_TOKEN_REGEX = /*#__PURE__*/new RegExp(`s*${SELF_TOKEN}s*,?`, 'g');\n/*\n * [Validation]\n * The visitor code below will traverse the animation AST generated by the animation verb functions\n * (the output is a tree of objects) and attempt to perform a series of validations on the data. The\n * following corner-cases will be validated:\n *\n * 1. Overlap of animations\n * Given that a CSS property cannot be animated in more than one place at the same time, it's\n * important that this behavior is detected and validated. The way in which this occurs is that\n * each time a style property is examined, a string-map containing the property will be updated with\n * the start and end times for when the property is used within an animation step.\n *\n * If there are two or more parallel animations that are currently running (these are invoked by the\n * group()) on the same element then the validator will throw an error. Since the start/end timing\n * values are collected for each property then if the current animation step is animating the same\n * property and its timing values fall anywhere into the window of time that the property is\n * currently being animated within then this is what causes an error.\n *\n * 2. Timing values\n * The validator will validate to see if a timing value of `duration delay easing` or\n * `durationNumber` is valid or not.\n *\n * (note that upon validation the code below will replace the timing data with an object containing\n * {duration,delay,easing}.\n *\n * 3. Offset Validation\n * Each of the style() calls are allowed to have an offset value when placed inside of keyframes().\n * Offsets within keyframes() are considered valid when:\n *\n * - No offsets are used at all\n * - Each style() entry contains an offset value\n * - Each offset is between 0 and 1\n * - Each offset is greater to or equal than the previous one\n *\n * Otherwise an error will be thrown.\n */\nfunction buildAnimationAst(driver, metadata, errors, warnings) {\n return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings);\n}\nconst ROOT_SELECTOR = '';\nclass AnimationAstBuilderVisitor {\n _driver;\n constructor(_driver) {\n this._driver = _driver;\n }\n build(metadata, errors, warnings) {\n const context = new AnimationAstBuilderContext(errors);\n this._resetContextStyleTimingState(context);\n const ast = visitDslNode(this, normalizeAnimationEntry(metadata), context);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (context.unsupportedCSSPropertiesFound.size) {\n pushUnrecognizedPropertiesWarning(warnings, [...context.unsupportedCSSPropertiesFound.keys()]);\n }\n }\n return ast;\n }\n _resetContextStyleTimingState(context) {\n context.currentQuerySelector = ROOT_SELECTOR;\n context.collectedStyles = new Map();\n context.collectedStyles.set(ROOT_SELECTOR, new Map());\n context.currentTime = 0;\n }\n visitTrigger(metadata, context) {\n let queryCount = context.queryCount = 0;\n let depCount = context.depCount = 0;\n const states = [];\n const transitions = [];\n if (metadata.name.charAt(0) == '@') {\n context.errors.push(invalidTrigger());\n }\n metadata.definitions.forEach(def => {\n this._resetContextStyleTimingState(context);\n if (def.type == AnimationMetadataType.State) {\n const stateDef = def;\n const name = stateDef.name;\n name.toString().split(/\\s*,\\s*/).forEach(n => {\n stateDef.name = n;\n states.push(this.visitState(stateDef, context));\n });\n stateDef.name = name;\n } else if (def.type == AnimationMetadataType.Transition) {\n const transition = this.visitTransition(def, context);\n queryCount += transition.queryCount;\n depCount += transition.depCount;\n transitions.push(transition);\n } else {\n context.errors.push(invalidDefinition());\n }\n });\n return {\n type: AnimationMetadataType.Trigger,\n name: metadata.name,\n states,\n transitions,\n queryCount,\n depCount,\n options: null\n };\n }\n visitState(metadata, context) {\n const styleAst = this.visitStyle(metadata.styles, context);\n const astParams = metadata.options && metadata.options.params || null;\n if (styleAst.containsDynamicStyles) {\n const missingSubs = new Set();\n const params = astParams || {};\n styleAst.styles.forEach(style => {\n if (style instanceof Map) {\n style.forEach(value => {\n extractStyleParams(value).forEach(sub => {\n if (!params.hasOwnProperty(sub)) {\n missingSubs.add(sub);\n }\n });\n });\n }\n });\n if (missingSubs.size) {\n context.errors.push(invalidState(metadata.name, [...missingSubs.values()]));\n }\n }\n return {\n type: AnimationMetadataType.State,\n name: metadata.name,\n style: styleAst,\n options: astParams ? {\n params: astParams\n } : null\n };\n }\n visitTransition(metadata, context) {\n context.queryCount = 0;\n context.depCount = 0;\n const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);\n const matchers = parseTransitionExpr(metadata.expr, context.errors);\n return {\n type: AnimationMetadataType.Transition,\n matchers,\n animation,\n queryCount: context.queryCount,\n depCount: context.depCount,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitSequence(metadata, context) {\n return {\n type: AnimationMetadataType.Sequence,\n steps: metadata.steps.map(s => visitDslNode(this, s, context)),\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitGroup(metadata, context) {\n const currentTime = context.currentTime;\n let furthestTime = 0;\n const steps = metadata.steps.map(step => {\n context.currentTime = currentTime;\n const innerAst = visitDslNode(this, step, context);\n furthestTime = Math.max(furthestTime, context.currentTime);\n return innerAst;\n });\n context.currentTime = furthestTime;\n return {\n type: AnimationMetadataType.Group,\n steps,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitAnimate(metadata, context) {\n const timingAst = constructTimingAst(metadata.timings, context.errors);\n context.currentAnimateTimings = timingAst;\n let styleAst;\n let styleMetadata = metadata.styles ? metadata.styles : style({});\n if (styleMetadata.type == AnimationMetadataType.Keyframes) {\n styleAst = this.visitKeyframes(styleMetadata, context);\n } else {\n let styleMetadata = metadata.styles;\n let isEmpty = false;\n if (!styleMetadata) {\n isEmpty = true;\n const newStyleData = {};\n if (timingAst.easing) {\n newStyleData['easing'] = timingAst.easing;\n }\n styleMetadata = style(newStyleData);\n }\n context.currentTime += timingAst.duration + timingAst.delay;\n const _styleAst = this.visitStyle(styleMetadata, context);\n _styleAst.isEmptyStep = isEmpty;\n styleAst = _styleAst;\n }\n context.currentAnimateTimings = null;\n return {\n type: AnimationMetadataType.Animate,\n timings: timingAst,\n style: styleAst,\n options: null\n };\n }\n visitStyle(metadata, context) {\n const ast = this._makeStyleAst(metadata, context);\n this._validateStyleAst(ast, context);\n return ast;\n }\n _makeStyleAst(metadata, context) {\n const styles = [];\n const metadataStyles = Array.isArray(metadata.styles) ? metadata.styles : [metadata.styles];\n for (let styleTuple of metadataStyles) {\n if (typeof styleTuple === 'string') {\n if (styleTuple === AUTO_STYLE) {\n styles.push(styleTuple);\n } else {\n context.errors.push(invalidStyleValue(styleTuple));\n }\n } else {\n styles.push(new Map(Object.entries(styleTuple)));\n }\n }\n let containsDynamicStyles = false;\n let collectedEasing = null;\n styles.forEach(styleData => {\n if (styleData instanceof Map) {\n if (styleData.has('easing')) {\n collectedEasing = styleData.get('easing');\n styleData.delete('easing');\n }\n if (!containsDynamicStyles) {\n for (let value of styleData.values()) {\n if (value.toString().indexOf(SUBSTITUTION_EXPR_START) >= 0) {\n containsDynamicStyles = true;\n break;\n }\n }\n }\n }\n });\n return {\n type: AnimationMetadataType.Style,\n styles,\n easing: collectedEasing,\n offset: metadata.offset,\n containsDynamicStyles,\n options: null\n };\n }\n _validateStyleAst(ast, context) {\n const timings = context.currentAnimateTimings;\n let endTime = context.currentTime;\n let startTime = context.currentTime;\n if (timings && startTime > 0) {\n startTime -= timings.duration + timings.delay;\n }\n ast.styles.forEach(tuple => {\n if (typeof tuple === 'string') return;\n tuple.forEach((value, prop) => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._driver.validateStyleProperty(prop)) {\n tuple.delete(prop);\n context.unsupportedCSSPropertiesFound.add(prop);\n return;\n }\n }\n // This is guaranteed to have a defined Map at this querySelector location making it\n // safe to add the assertion here. It is set as a default empty map in prior methods.\n const collectedStyles = context.collectedStyles.get(context.currentQuerySelector);\n const collectedEntry = collectedStyles.get(prop);\n let updateCollectedStyle = true;\n if (collectedEntry) {\n if (startTime != endTime && startTime >= collectedEntry.startTime && endTime <= collectedEntry.endTime) {\n context.errors.push(invalidParallelAnimation(prop, collectedEntry.startTime, collectedEntry.endTime, startTime, endTime));\n updateCollectedStyle = false;\n }\n // we always choose the smaller start time value since we\n // want to have a record of the entire animation window where\n // the style property is being animated in between\n startTime = collectedEntry.startTime;\n }\n if (updateCollectedStyle) {\n collectedStyles.set(prop, {\n startTime,\n endTime\n });\n }\n if (context.options) {\n validateStyleParams(value, context.options, context.errors);\n }\n });\n });\n }\n visitKeyframes(metadata, context) {\n const ast = {\n type: AnimationMetadataType.Keyframes,\n styles: [],\n options: null\n };\n if (!context.currentAnimateTimings) {\n context.errors.push(invalidKeyframes());\n return ast;\n }\n const MAX_KEYFRAME_OFFSET = 1;\n let totalKeyframesWithOffsets = 0;\n const offsets = [];\n let offsetsOutOfOrder = false;\n let keyframesOutOfRange = false;\n let previousOffset = 0;\n const keyframes = metadata.steps.map(styles => {\n const style = this._makeStyleAst(styles, context);\n let offsetVal = style.offset != null ? style.offset : consumeOffset(style.styles);\n let offset = 0;\n if (offsetVal != null) {\n totalKeyframesWithOffsets++;\n offset = style.offset = offsetVal;\n }\n keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1;\n offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset;\n previousOffset = offset;\n offsets.push(offset);\n return style;\n });\n if (keyframesOutOfRange) {\n context.errors.push(invalidOffset());\n }\n if (offsetsOutOfOrder) {\n context.errors.push(keyframeOffsetsOutOfOrder());\n }\n const length = metadata.steps.length;\n let generatedOffset = 0;\n if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {\n context.errors.push(keyframesMissingOffsets());\n } else if (totalKeyframesWithOffsets == 0) {\n generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);\n }\n const limit = length - 1;\n const currentTime = context.currentTime;\n const currentAnimateTimings = context.currentAnimateTimings;\n const animateDuration = currentAnimateTimings.duration;\n keyframes.forEach((kf, i) => {\n const offset = generatedOffset > 0 ? i == limit ? 1 : generatedOffset * i : offsets[i];\n const durationUpToThisFrame = offset * animateDuration;\n context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;\n currentAnimateTimings.duration = durationUpToThisFrame;\n this._validateStyleAst(kf, context);\n kf.offset = offset;\n ast.styles.push(kf);\n });\n return ast;\n }\n visitReference(metadata, context) {\n return {\n type: AnimationMetadataType.Reference,\n animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitAnimateChild(metadata, context) {\n context.depCount++;\n return {\n type: AnimationMetadataType.AnimateChild,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitAnimateRef(metadata, context) {\n return {\n type: AnimationMetadataType.AnimateRef,\n animation: this.visitReference(metadata.animation, context),\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitQuery(metadata, context) {\n const parentSelector = context.currentQuerySelector;\n const options = metadata.options || {};\n context.queryCount++;\n context.currentQuery = metadata;\n const [selector, includeSelf] = normalizeSelector(metadata.selector);\n context.currentQuerySelector = parentSelector.length ? parentSelector + ' ' + selector : selector;\n getOrSetDefaultValue(context.collectedStyles, context.currentQuerySelector, new Map());\n const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);\n context.currentQuery = null;\n context.currentQuerySelector = parentSelector;\n return {\n type: AnimationMetadataType.Query,\n selector,\n limit: options.limit || 0,\n optional: !!options.optional,\n includeSelf,\n animation,\n originalSelector: metadata.selector,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n visitStagger(metadata, context) {\n if (!context.currentQuery) {\n context.errors.push(invalidStagger());\n }\n const timings = metadata.timings === 'full' ? {\n duration: 0,\n delay: 0,\n easing: 'full'\n } : resolveTiming(metadata.timings, context.errors, true);\n return {\n type: AnimationMetadataType.Stagger,\n animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),\n timings,\n options: null\n };\n }\n}\nfunction normalizeSelector(selector) {\n const hasAmpersand = selector.split(/\\s*,\\s*/).find(token => token == SELF_TOKEN) ? true : false;\n if (hasAmpersand) {\n selector = selector.replace(SELF_TOKEN_REGEX, '');\n }\n // Note: the :enter and :leave aren't normalized here since those\n // selectors are filled in at runtime during timeline building\n selector = selector.replace(/@\\*/g, NG_TRIGGER_SELECTOR).replace(/@\\w+/g, match => NG_TRIGGER_SELECTOR + '-' + match.slice(1)).replace(/:animating/g, NG_ANIMATING_SELECTOR);\n return [selector, hasAmpersand];\n}\nfunction normalizeParams(obj) {\n return obj ? {\n ...obj\n } : null;\n}\nclass AnimationAstBuilderContext {\n errors;\n queryCount = 0;\n depCount = 0;\n currentTransition = null;\n currentQuery = null;\n currentQuerySelector = null;\n currentAnimateTimings = null;\n currentTime = 0;\n collectedStyles = /*#__PURE__*/new Map();\n options = null;\n unsupportedCSSPropertiesFound = /*#__PURE__*/new Set();\n constructor(errors) {\n this.errors = errors;\n }\n}\nfunction consumeOffset(styles) {\n if (typeof styles == 'string') return null;\n let offset = null;\n if (Array.isArray(styles)) {\n styles.forEach(styleTuple => {\n if (styleTuple instanceof Map && styleTuple.has('offset')) {\n const obj = styleTuple;\n offset = parseFloat(obj.get('offset'));\n obj.delete('offset');\n }\n });\n } else if (styles instanceof Map && styles.has('offset')) {\n const obj = styles;\n offset = parseFloat(obj.get('offset'));\n obj.delete('offset');\n }\n return offset;\n}\nfunction constructTimingAst(value, errors) {\n if (value.hasOwnProperty('duration')) {\n return value;\n }\n if (typeof value == 'number') {\n const duration = resolveTiming(value, errors).duration;\n return makeTimingAst(duration, 0, '');\n }\n const strValue = value;\n const isDynamic = strValue.split(/\\s+/).some(v => v.charAt(0) == '{' && v.charAt(1) == '{');\n if (isDynamic) {\n const ast = makeTimingAst(0, 0, '');\n ast.dynamic = true;\n ast.strValue = strValue;\n return ast;\n }\n const timings = resolveTiming(strValue, errors);\n return makeTimingAst(timings.duration, timings.delay, timings.easing);\n}\nfunction normalizeAnimationOptions(options) {\n if (options) {\n options = {\n ...options\n };\n if (options['params']) {\n options['params'] = normalizeParams(options['params']);\n }\n } else {\n options = {};\n }\n return options;\n}\nfunction makeTimingAst(duration, delay, easing) {\n return {\n duration,\n delay,\n easing\n };\n}\nfunction createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing = null, subTimeline = false) {\n return {\n type: 1 /* AnimationTransitionInstructionType.TimelineAnimation */,\n element,\n keyframes,\n preStyleProps,\n postStyleProps,\n duration,\n delay,\n totalTime: duration + delay,\n easing,\n subTimeline\n };\n}\nclass ElementInstructionMap {\n _map = /*#__PURE__*/new Map();\n get(element) {\n return this._map.get(element) || [];\n }\n append(element, instructions) {\n let existingInstructions = this._map.get(element);\n if (!existingInstructions) {\n this._map.set(element, existingInstructions = []);\n }\n existingInstructions.push(...instructions);\n }\n has(element) {\n return this._map.has(element);\n }\n clear() {\n this._map.clear();\n }\n}\nconst ONE_FRAME_IN_MILLISECONDS = 1;\nconst ENTER_TOKEN = ':enter';\nconst ENTER_TOKEN_REGEX = /*#__PURE__*/new RegExp(ENTER_TOKEN, 'g');\nconst LEAVE_TOKEN = ':leave';\nconst LEAVE_TOKEN_REGEX = /*#__PURE__*/new RegExp(LEAVE_TOKEN, 'g');\n/*\n * The code within this file aims to generate web-animations-compatible keyframes from Angular's\n * animation DSL code.\n *\n * The code below will be converted from:\n *\n * ```ts\n * sequence([\n * style({ opacity: 0 }),\n * animate(1000, style({ opacity: 0 }))\n * ])\n * ```\n *\n * To:\n * ```ts\n * keyframes = [{ opacity: 0, offset: 0 }, { opacity: 1, offset: 1 }]\n * duration = 1000\n * delay = 0\n * easing = ''\n * ```\n *\n * For this operation to cover the combination of animation verbs (style, animate, group, etc...) a\n * combination of AST traversal and merge-sort-like algorithms are used.\n *\n * [AST Traversal]\n * Each of the animation verbs, when executed, will return an string-map object representing what\n * type of action it is (style, animate, group, etc...) and the data associated with it. This means\n * that when functional composition mix of these functions is evaluated (like in the example above)\n * then it will end up producing a tree of objects representing the animation itself.\n *\n * When this animation object tree is processed by the visitor code below it will visit each of the\n * verb statements within the visitor. And during each visit it will build the context of the\n * animation keyframes by interacting with the `TimelineBuilder`.\n *\n * [TimelineBuilder]\n * This class is responsible for tracking the styles and building a series of keyframe objects for a\n * timeline between a start and end time. The builder starts off with an initial timeline and each\n * time the AST comes across a `group()`, `keyframes()` or a combination of the two within a\n * `sequence()` then it will generate a sub timeline for each step as well as a new one after\n * they are complete.\n *\n * As the AST is traversed, the timing state on each of the timelines will be incremented. If a sub\n * timeline was created (based on one of the cases above) then the parent timeline will attempt to\n * merge the styles used within the sub timelines into itself (only with group() this will happen).\n * This happens with a merge operation (much like how the merge works in mergeSort) and it will only\n * copy the most recently used styles from the sub timelines into the parent timeline. This ensures\n * that if the styles are used later on in another phase of the animation then they will be the most\n * up-to-date values.\n *\n * [How Missing Styles Are Updated]\n * Each timeline has a `backFill` property which is responsible for filling in new styles into\n * already processed keyframes if a new style shows up later within the animation sequence.\n *\n * ```ts\n * sequence([\n * style({ width: 0 }),\n * animate(1000, style({ width: 100 })),\n * animate(1000, style({ width: 200 })),\n * animate(1000, style({ width: 300 }))\n * animate(1000, style({ width: 400, height: 400 })) // notice how `height` doesn't exist anywhere\n * else\n * ])\n * ```\n *\n * What is happening here is that the `height` value is added later in the sequence, but is missing\n * from all previous animation steps. Therefore when a keyframe is created it would also be missing\n * from all previous keyframes up until where it is first used. For the timeline keyframe generation\n * to properly fill in the style it will place the previous value (the value from the parent\n * timeline) or a default value of `*` into the backFill map.\n *\n * When a sub-timeline is created it will have its own backFill property. This is done so that\n * styles present within the sub-timeline do not accidentally seep into the previous/future timeline\n * keyframes\n *\n * [Validation]\n * The code in this file is not responsible for validation. That functionality happens with within\n * the `AnimationValidatorVisitor` code.\n */\nfunction buildAnimationTimelines(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles = new Map(), finalStyles = new Map(), options, subInstructions, errors = []) {\n return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors);\n}\nclass AnimationTimelineBuilderVisitor {\n buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors = []) {\n subInstructions = subInstructions || new ElementInstructionMap();\n const context = new AnimationTimelineContext(driver, rootElement, subInstructions, enterClassName, leaveClassName, errors, []);\n context.options = options;\n const delay = options.delay ? resolveTimingValue(options.delay) : 0;\n context.currentTimeline.delayNextStep(delay);\n context.currentTimeline.setStyles([startingStyles], null, context.errors, options);\n visitDslNode(this, ast, context);\n // this checks to see if an actual animation happened\n const timelines = context.timelines.filter(timeline => timeline.containsAnimation());\n // note: we just want to apply the final styles for the rootElement, so we do not\n // just apply the styles to the last timeline but the last timeline which\n // element is the root one (basically `*`-styles are replaced with the actual\n // state style values only for the root element)\n if (timelines.length && finalStyles.size) {\n let lastRootTimeline;\n for (let i = timelines.length - 1; i >= 0; i--) {\n const timeline = timelines[i];\n if (timeline.element === rootElement) {\n lastRootTimeline = timeline;\n break;\n }\n }\n if (lastRootTimeline && !lastRootTimeline.allowOnlyTimelineStyles()) {\n lastRootTimeline.setStyles([finalStyles], null, context.errors, options);\n }\n }\n return timelines.length ? timelines.map(timeline => timeline.buildKeyframes()) : [createTimelineInstruction(rootElement, [], [], [], 0, delay, '', false)];\n }\n visitTrigger(ast, context) {\n // these values are not visited in this AST\n }\n visitState(ast, context) {\n // these values are not visited in this AST\n }\n visitTransition(ast, context) {\n // these values are not visited in this AST\n }\n visitAnimateChild(ast, context) {\n const elementInstructions = context.subInstructions.get(context.element);\n if (elementInstructions) {\n const innerContext = context.createSubContext(ast.options);\n const startTime = context.currentTimeline.currentTime;\n const endTime = this._visitSubInstructions(elementInstructions, innerContext, innerContext.options);\n if (startTime != endTime) {\n // we do this on the upper context because we created a sub context for\n // the sub child animations\n context.transformIntoNewTimeline(endTime);\n }\n }\n context.previousNode = ast;\n }\n visitAnimateRef(ast, context) {\n const innerContext = context.createSubContext(ast.options);\n innerContext.transformIntoNewTimeline();\n this._applyAnimationRefDelays([ast.options, ast.animation.options], context, innerContext);\n this.visitReference(ast.animation, innerContext);\n context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);\n context.previousNode = ast;\n }\n _applyAnimationRefDelays(animationsRefsOptions, context, innerContext) {\n for (const animationRefOptions of animationsRefsOptions) {\n const animationDelay = animationRefOptions?.delay;\n if (animationDelay) {\n const animationDelayValue = typeof animationDelay === 'number' ? animationDelay : resolveTimingValue(interpolateParams(animationDelay, animationRefOptions?.params ?? {}, context.errors));\n innerContext.delayNextStep(animationDelayValue);\n }\n }\n }\n _visitSubInstructions(instructions, context, options) {\n const startTime = context.currentTimeline.currentTime;\n let furthestTime = startTime;\n // this is a special-case for when a user wants to skip a sub\n // animation from being fired entirely.\n const duration = options.duration != null ? resolveTimingValue(options.duration) : null;\n const delay = options.delay != null ? resolveTimingValue(options.delay) : null;\n if (duration !== 0) {\n instructions.forEach(instruction => {\n const instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay);\n furthestTime = Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);\n });\n }\n return furthestTime;\n }\n visitReference(ast, context) {\n context.updateOptions(ast.options, true);\n visitDslNode(this, ast.animation, context);\n context.previousNode = ast;\n }\n visitSequence(ast, context) {\n const subContextCount = context.subContextCount;\n let ctx = context;\n const options = ast.options;\n if (options && (options.params || options.delay)) {\n ctx = context.createSubContext(options);\n ctx.transformIntoNewTimeline();\n if (options.delay != null) {\n if (ctx.previousNode.type == AnimationMetadataType.Style) {\n ctx.currentTimeline.snapshotCurrentStyles();\n ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n }\n const delay = resolveTimingValue(options.delay);\n ctx.delayNextStep(delay);\n }\n }\n if (ast.steps.length) {\n ast.steps.forEach(s => visitDslNode(this, s, ctx));\n // this is here just in case the inner steps only contain or end with a style() call\n ctx.currentTimeline.applyStylesToKeyframe();\n // this means that some animation function within the sequence\n // ended up creating a sub timeline (which means the current\n // timeline cannot overlap with the contents of the sequence)\n if (ctx.subContextCount > subContextCount) {\n ctx.transformIntoNewTimeline();\n }\n }\n context.previousNode = ast;\n }\n visitGroup(ast, context) {\n const innerTimelines = [];\n let furthestTime = context.currentTimeline.currentTime;\n const delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;\n ast.steps.forEach(s => {\n const innerContext = context.createSubContext(ast.options);\n if (delay) {\n innerContext.delayNextStep(delay);\n }\n visitDslNode(this, s, innerContext);\n furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);\n innerTimelines.push(innerContext.currentTimeline);\n });\n // this operation is run after the AST loop because otherwise\n // if the parent timeline's collected styles were updated then\n // it would pass in invalid data into the new-to-be forked items\n innerTimelines.forEach(timeline => context.currentTimeline.mergeTimelineCollectedStyles(timeline));\n context.transformIntoNewTimeline(furthestTime);\n context.previousNode = ast;\n }\n _visitTiming(ast, context) {\n if (ast.dynamic) {\n const strValue = ast.strValue;\n const timingValue = context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;\n return resolveTiming(timingValue, context.errors);\n } else {\n return {\n duration: ast.duration,\n delay: ast.delay,\n easing: ast.easing\n };\n }\n }\n visitAnimate(ast, context) {\n const timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);\n const timeline = context.currentTimeline;\n if (timings.delay) {\n context.incrementTime(timings.delay);\n timeline.snapshotCurrentStyles();\n }\n const style = ast.style;\n if (style.type == AnimationMetadataType.Keyframes) {\n this.visitKeyframes(style, context);\n } else {\n context.incrementTime(timings.duration);\n this.visitStyle(style, context);\n timeline.applyStylesToKeyframe();\n }\n context.currentAnimateTimings = null;\n context.previousNode = ast;\n }\n visitStyle(ast, context) {\n const timeline = context.currentTimeline;\n const timings = context.currentAnimateTimings;\n // this is a special case for when a style() call\n // directly follows an animate() call (but not inside of an animate() call)\n if (!timings && timeline.hasCurrentStyleProperties()) {\n timeline.forwardFrame();\n }\n const easing = timings && timings.easing || ast.easing;\n if (ast.isEmptyStep) {\n timeline.applyEmptyStep(easing);\n } else {\n timeline.setStyles(ast.styles, easing, context.errors, context.options);\n }\n context.previousNode = ast;\n }\n visitKeyframes(ast, context) {\n const currentAnimateTimings = context.currentAnimateTimings;\n const startTime = context.currentTimeline.duration;\n const duration = currentAnimateTimings.duration;\n const innerContext = context.createSubContext();\n const innerTimeline = innerContext.currentTimeline;\n innerTimeline.easing = currentAnimateTimings.easing;\n ast.styles.forEach(step => {\n const offset = step.offset || 0;\n innerTimeline.forwardTime(offset * duration);\n innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options);\n innerTimeline.applyStylesToKeyframe();\n });\n // this will ensure that the parent timeline gets all the styles from\n // the child even if the new timeline below is not used\n context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);\n // we do this because the window between this timeline and the sub timeline\n // should ensure that the styles within are exactly the same as they were before\n context.transformIntoNewTimeline(startTime + duration);\n context.previousNode = ast;\n }\n visitQuery(ast, context) {\n // in the event that the first step before this is a style step we need\n // to ensure the styles are applied before the children are animated\n const startTime = context.currentTimeline.currentTime;\n const options = ast.options || {};\n const delay = options.delay ? resolveTimingValue(options.delay) : 0;\n if (delay && (context.previousNode.type === AnimationMetadataType.Style || startTime == 0 && context.currentTimeline.hasCurrentStyleProperties())) {\n context.currentTimeline.snapshotCurrentStyles();\n context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n }\n let furthestTime = startTime;\n const elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors);\n context.currentQueryTotal = elms.length;\n let sameElementTimeline = null;\n elms.forEach((element, i) => {\n context.currentQueryIndex = i;\n const innerContext = context.createSubContext(ast.options, element);\n if (delay) {\n innerContext.delayNextStep(delay);\n }\n if (element === context.element) {\n sameElementTimeline = innerContext.currentTimeline;\n }\n visitDslNode(this, ast.animation, innerContext);\n // this is here just incase the inner steps only contain or end\n // with a style() call (which is here to signal that this is a preparatory\n // call to style an element before it is animated again)\n innerContext.currentTimeline.applyStylesToKeyframe();\n const endTime = innerContext.currentTimeline.currentTime;\n furthestTime = Math.max(furthestTime, endTime);\n });\n context.currentQueryIndex = 0;\n context.currentQueryTotal = 0;\n context.transformIntoNewTimeline(furthestTime);\n if (sameElementTimeline) {\n context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);\n context.currentTimeline.snapshotCurrentStyles();\n }\n context.previousNode = ast;\n }\n visitStagger(ast, context) {\n const parentContext = context.parentContext;\n const tl = context.currentTimeline;\n const timings = ast.timings;\n const duration = Math.abs(timings.duration);\n const maxTime = duration * (context.currentQueryTotal - 1);\n let delay = duration * context.currentQueryIndex;\n let staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing;\n switch (staggerTransformer) {\n case 'reverse':\n delay = maxTime - delay;\n break;\n case 'full':\n delay = parentContext.currentStaggerTime;\n break;\n }\n const timeline = context.currentTimeline;\n if (delay) {\n timeline.delayNextStep(delay);\n }\n const startingTime = timeline.currentTime;\n visitDslNode(this, ast.animation, context);\n context.previousNode = ast;\n // time = duration + delay\n // the reason why this computation is so complex is because\n // the inner timeline may either have a delay value or a stretched\n // keyframe depending on if a subtimeline is not used or is used.\n parentContext.currentStaggerTime = tl.currentTime - startingTime + (tl.startTime - parentContext.currentTimeline.startTime);\n }\n}\nconst DEFAULT_NOOP_PREVIOUS_NODE = {};\nclass AnimationTimelineContext {\n _driver;\n element;\n subInstructions;\n _enterClassName;\n _leaveClassName;\n errors;\n timelines;\n parentContext = null;\n currentTimeline;\n currentAnimateTimings = null;\n previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n subContextCount = 0;\n options = {};\n currentQueryIndex = 0;\n currentQueryTotal = 0;\n currentStaggerTime = 0;\n constructor(_driver, element, subInstructions, _enterClassName, _leaveClassName, errors, timelines, initialTimeline) {\n this._driver = _driver;\n this.element = element;\n this.subInstructions = subInstructions;\n this._enterClassName = _enterClassName;\n this._leaveClassName = _leaveClassName;\n this.errors = errors;\n this.timelines = timelines;\n this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0);\n timelines.push(this.currentTimeline);\n }\n get params() {\n return this.options.params;\n }\n updateOptions(options, skipIfExists) {\n if (!options) return;\n const newOptions = options;\n let optionsToUpdate = this.options;\n // NOTE: this will get patched up when other animation methods support duration overrides\n if (newOptions.duration != null) {\n optionsToUpdate.duration = resolveTimingValue(newOptions.duration);\n }\n if (newOptions.delay != null) {\n optionsToUpdate.delay = resolveTimingValue(newOptions.delay);\n }\n const newParams = newOptions.params;\n if (newParams) {\n let paramsToUpdate = optionsToUpdate.params;\n if (!paramsToUpdate) {\n paramsToUpdate = this.options.params = {};\n }\n Object.keys(newParams).forEach(name => {\n if (!skipIfExists || !paramsToUpdate.hasOwnProperty(name)) {\n paramsToUpdate[name] = interpolateParams(newParams[name], paramsToUpdate, this.errors);\n }\n });\n }\n }\n _copyOptions() {\n const options = {};\n if (this.options) {\n const oldParams = this.options.params;\n if (oldParams) {\n const params = options['params'] = {};\n Object.keys(oldParams).forEach(name => {\n params[name] = oldParams[name];\n });\n }\n }\n return options;\n }\n createSubContext(options = null, element, newTime) {\n const target = element || this.element;\n const context = new AnimationTimelineContext(this._driver, target, this.subInstructions, this._enterClassName, this._leaveClassName, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));\n context.previousNode = this.previousNode;\n context.currentAnimateTimings = this.currentAnimateTimings;\n context.options = this._copyOptions();\n context.updateOptions(options);\n context.currentQueryIndex = this.currentQueryIndex;\n context.currentQueryTotal = this.currentQueryTotal;\n context.parentContext = this;\n this.subContextCount++;\n return context;\n }\n transformIntoNewTimeline(newTime) {\n this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n this.currentTimeline = this.currentTimeline.fork(this.element, newTime);\n this.timelines.push(this.currentTimeline);\n return this.currentTimeline;\n }\n appendInstructionToTimeline(instruction, duration, delay) {\n const updatedTimings = {\n duration: duration != null ? duration : instruction.duration,\n delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay,\n easing: ''\n };\n const builder = new SubTimelineBuilder(this._driver, instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);\n this.timelines.push(builder);\n return updatedTimings;\n }\n incrementTime(time) {\n this.currentTimeline.forwardTime(this.currentTimeline.duration + time);\n }\n delayNextStep(delay) {\n // negative delays are not yet supported\n if (delay > 0) {\n this.currentTimeline.delayNextStep(delay);\n }\n }\n invokeQuery(selector, originalSelector, limit, includeSelf, optional, errors) {\n let results = [];\n if (includeSelf) {\n results.push(this.element);\n }\n if (selector.length > 0) {\n // only if :self is used then the selector can be empty\n selector = selector.replace(ENTER_TOKEN_REGEX, '.' + this._enterClassName);\n selector = selector.replace(LEAVE_TOKEN_REGEX, '.' + this._leaveClassName);\n const multi = limit != 1;\n let elements = this._driver.query(this.element, selector, multi);\n if (limit !== 0) {\n elements = limit < 0 ? elements.slice(elements.length + limit, elements.length) : elements.slice(0, limit);\n }\n results.push(...elements);\n }\n if (!optional && results.length == 0) {\n errors.push(invalidQuery(originalSelector));\n }\n return results;\n }\n}\nclass TimelineBuilder {\n _driver;\n element;\n startTime;\n _elementTimelineStylesLookup;\n duration = 0;\n easing = null;\n _previousKeyframe = /*#__PURE__*/new Map();\n _currentKeyframe = /*#__PURE__*/new Map();\n _keyframes = /*#__PURE__*/new Map();\n _styleSummary = /*#__PURE__*/new Map();\n _localTimelineStyles = /*#__PURE__*/new Map();\n _globalTimelineStyles;\n _pendingStyles = /*#__PURE__*/new Map();\n _backFill = /*#__PURE__*/new Map();\n _currentEmptyStepKeyframe = null;\n constructor(_driver, element, startTime, _elementTimelineStylesLookup) {\n this._driver = _driver;\n this.element = element;\n this.startTime = startTime;\n this._elementTimelineStylesLookup = _elementTimelineStylesLookup;\n if (!this._elementTimelineStylesLookup) {\n this._elementTimelineStylesLookup = new Map();\n }\n this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element);\n if (!this._globalTimelineStyles) {\n this._globalTimelineStyles = this._localTimelineStyles;\n this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);\n }\n this._loadKeyframe();\n }\n containsAnimation() {\n switch (this._keyframes.size) {\n case 0:\n return false;\n case 1:\n return this.hasCurrentStyleProperties();\n default:\n return true;\n }\n }\n hasCurrentStyleProperties() {\n return this._currentKeyframe.size > 0;\n }\n get currentTime() {\n return this.startTime + this.duration;\n }\n delayNextStep(delay) {\n // in the event that a style() step is placed right before a stagger()\n // and that style() step is the very first style() value in the animation\n // then we need to make a copy of the keyframe [0, copy, 1] so that the delay\n // properly applies the style() values to work with the stagger...\n const hasPreStyleStep = this._keyframes.size === 1 && this._pendingStyles.size;\n if (this.duration || hasPreStyleStep) {\n this.forwardTime(this.currentTime + delay);\n if (hasPreStyleStep) {\n this.snapshotCurrentStyles();\n }\n } else {\n this.startTime += delay;\n }\n }\n fork(element, currentTime) {\n this.applyStylesToKeyframe();\n return new TimelineBuilder(this._driver, element, currentTime || this.currentTime, this._elementTimelineStylesLookup);\n }\n _loadKeyframe() {\n if (this._currentKeyframe) {\n this._previousKeyframe = this._currentKeyframe;\n }\n this._currentKeyframe = this._keyframes.get(this.duration);\n if (!this._currentKeyframe) {\n this._currentKeyframe = new Map();\n this._keyframes.set(this.duration, this._currentKeyframe);\n }\n }\n forwardFrame() {\n this.duration += ONE_FRAME_IN_MILLISECONDS;\n this._loadKeyframe();\n }\n forwardTime(time) {\n this.applyStylesToKeyframe();\n this.duration = time;\n this._loadKeyframe();\n }\n _updateStyle(prop, value) {\n this._localTimelineStyles.set(prop, value);\n this._globalTimelineStyles.set(prop, value);\n this._styleSummary.set(prop, {\n time: this.currentTime,\n value\n });\n }\n allowOnlyTimelineStyles() {\n return this._currentEmptyStepKeyframe !== this._currentKeyframe;\n }\n applyEmptyStep(easing) {\n if (easing) {\n this._previousKeyframe.set('easing', easing);\n }\n // special case for animate(duration):\n // all missing styles are filled with a `*` value then\n // if any destination styles are filled in later on the same\n // keyframe then they will override the overridden styles\n // We use `_globalTimelineStyles` here because there may be\n // styles in previous keyframes that are not present in this timeline\n for (let [prop, value] of this._globalTimelineStyles) {\n this._backFill.set(prop, value || AUTO_STYLE);\n this._currentKeyframe.set(prop, AUTO_STYLE);\n }\n this._currentEmptyStepKeyframe = this._currentKeyframe;\n }\n setStyles(input, easing, errors, options) {\n if (easing) {\n this._previousKeyframe.set('easing', easing);\n }\n const params = options && options.params || {};\n const styles = flattenStyles(input, this._globalTimelineStyles);\n for (let [prop, value] of styles) {\n const val = interpolateParams(value, params, errors);\n this._pendingStyles.set(prop, val);\n if (!this._localTimelineStyles.has(prop)) {\n this._backFill.set(prop, this._globalTimelineStyles.get(prop) ?? AUTO_STYLE);\n }\n this._updateStyle(prop, val);\n }\n }\n applyStylesToKeyframe() {\n if (this._pendingStyles.size == 0) return;\n this._pendingStyles.forEach((val, prop) => {\n this._currentKeyframe.set(prop, val);\n });\n this._pendingStyles.clear();\n this._localTimelineStyles.forEach((val, prop) => {\n if (!this._currentKeyframe.has(prop)) {\n this._currentKeyframe.set(prop, val);\n }\n });\n }\n snapshotCurrentStyles() {\n for (let [prop, val] of this._localTimelineStyles) {\n this._pendingStyles.set(prop, val);\n this._updateStyle(prop, val);\n }\n }\n getFinalKeyframe() {\n return this._keyframes.get(this.duration);\n }\n get properties() {\n const properties = [];\n for (let prop in this._currentKeyframe) {\n properties.push(prop);\n }\n return properties;\n }\n mergeTimelineCollectedStyles(timeline) {\n timeline._styleSummary.forEach((details1, prop) => {\n const details0 = this._styleSummary.get(prop);\n if (!details0 || details1.time > details0.time) {\n this._updateStyle(prop, details1.value);\n }\n });\n }\n buildKeyframes() {\n this.applyStylesToKeyframe();\n const preStyleProps = new Set();\n const postStyleProps = new Set();\n const isEmpty = this._keyframes.size === 1 && this.duration === 0;\n let finalKeyframes = [];\n this._keyframes.forEach((keyframe, time) => {\n const finalKeyframe = new Map([...this._backFill, ...keyframe]);\n finalKeyframe.forEach((value, prop) => {\n if (value === ɵPRE_STYLE) {\n preStyleProps.add(prop);\n } else if (value === AUTO_STYLE) {\n postStyleProps.add(prop);\n }\n });\n if (!isEmpty) {\n finalKeyframe.set('offset', time / this.duration);\n }\n finalKeyframes.push(finalKeyframe);\n });\n const preProps = [...preStyleProps.values()];\n const postProps = [...postStyleProps.values()];\n // special case for a 0-second animation (which is designed just to place styles onscreen)\n if (isEmpty) {\n const kf0 = finalKeyframes[0];\n const kf1 = new Map(kf0);\n kf0.set('offset', 0);\n kf1.set('offset', 1);\n finalKeyframes = [kf0, kf1];\n }\n return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false);\n }\n}\nclass SubTimelineBuilder extends TimelineBuilder {\n keyframes;\n preStyleProps;\n postStyleProps;\n _stretchStartingKeyframe;\n timings;\n constructor(driver, element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe = false) {\n super(driver, element, timings.delay);\n this.keyframes = keyframes;\n this.preStyleProps = preStyleProps;\n this.postStyleProps = postStyleProps;\n this._stretchStartingKeyframe = _stretchStartingKeyframe;\n this.timings = {\n duration: timings.duration,\n delay: timings.delay,\n easing: timings.easing\n };\n }\n containsAnimation() {\n return this.keyframes.length > 1;\n }\n buildKeyframes() {\n let keyframes = this.keyframes;\n let {\n delay,\n duration,\n easing\n } = this.timings;\n if (this._stretchStartingKeyframe && delay) {\n const newKeyframes = [];\n const totalTime = duration + delay;\n const startingGap = delay / totalTime;\n // the original starting keyframe now starts once the delay is done\n const newFirstKeyframe = new Map(keyframes[0]);\n newFirstKeyframe.set('offset', 0);\n newKeyframes.push(newFirstKeyframe);\n const oldFirstKeyframe = new Map(keyframes[0]);\n oldFirstKeyframe.set('offset', roundOffset(startingGap));\n newKeyframes.push(oldFirstKeyframe);\n /*\n When the keyframe is stretched then it means that the delay before the animation\n starts is gone. Instead the first keyframe is placed at the start of the animation\n and it is then copied to where it starts when the original delay is over. This basically\n means nothing animates during that delay, but the styles are still rendered. For this\n to work the original offset values that exist in the original keyframes must be \"warped\"\n so that they can take the new keyframe + delay into account.\n delay=1000, duration=1000, keyframes = 0 .5 1\n turns into\n delay=0, duration=2000, keyframes = 0 .33 .66 1\n */\n // offsets between 1 ... n -1 are all warped by the keyframe stretch\n const limit = keyframes.length - 1;\n for (let i = 1; i <= limit; i++) {\n let kf = new Map(keyframes[i]);\n const oldOffset = kf.get('offset');\n const timeAtKeyframe = delay + oldOffset * duration;\n kf.set('offset', roundOffset(timeAtKeyframe / totalTime));\n newKeyframes.push(kf);\n }\n // the new starting keyframe should be added at the start\n duration = totalTime;\n delay = 0;\n easing = '';\n keyframes = newKeyframes;\n }\n return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing, true);\n }\n}\nfunction roundOffset(offset, decimalPoints = 3) {\n const mult = Math.pow(10, decimalPoints - 1);\n return Math.round(offset * mult) / mult;\n}\nfunction flattenStyles(input, allStyles) {\n const styles = new Map();\n let allProperties;\n input.forEach(token => {\n if (token === '*') {\n allProperties ??= allStyles.keys();\n for (let prop of allProperties) {\n styles.set(prop, AUTO_STYLE);\n }\n } else {\n for (let [prop, val] of token) {\n styles.set(prop, val);\n }\n }\n });\n return styles;\n}\nfunction createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps, totalTime, errors) {\n return {\n type: 0 /* AnimationTransitionInstructionType.TransitionAnimation */,\n element,\n triggerName,\n isRemovalTransition,\n fromState,\n fromStyles,\n toState,\n toStyles,\n timelines,\n queriedElements,\n preStyleProps,\n postStyleProps,\n totalTime,\n errors\n };\n}\nconst EMPTY_OBJECT = {};\nclass AnimationTransitionFactory {\n _triggerName;\n ast;\n _stateStyles;\n constructor(_triggerName, ast, _stateStyles) {\n this._triggerName = _triggerName;\n this.ast = ast;\n this._stateStyles = _stateStyles;\n }\n match(currentState, nextState, element, params) {\n return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params);\n }\n buildStyles(stateName, params, errors) {\n let styler = this._stateStyles.get('*');\n if (stateName !== undefined) {\n styler = this._stateStyles.get(stateName?.toString()) || styler;\n }\n return styler ? styler.buildStyles(params, errors) : new Map();\n }\n build(driver, element, currentState, nextState, enterClassName, leaveClassName, currentOptions, nextOptions, subInstructions, skipAstBuild) {\n const errors = [];\n const transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT;\n const currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT;\n const currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors);\n const nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT;\n const nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors);\n const queriedElements = new Set();\n const preStyleMap = new Map();\n const postStyleMap = new Map();\n const isRemoval = nextState === 'void';\n const animationOptions = {\n params: applyParamDefaults(nextAnimationParams, transitionAnimationParams),\n delay: this.ast.options?.delay\n };\n const timelines = skipAstBuild ? [] : buildAnimationTimelines(driver, element, this.ast.animation, enterClassName, leaveClassName, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors);\n let totalTime = 0;\n timelines.forEach(tl => {\n totalTime = Math.max(tl.duration + tl.delay, totalTime);\n });\n if (errors.length) {\n return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, [], [], preStyleMap, postStyleMap, totalTime, errors);\n }\n timelines.forEach(tl => {\n const elm = tl.element;\n const preProps = getOrSetDefaultValue(preStyleMap, elm, new Set());\n tl.preStyleProps.forEach(prop => preProps.add(prop));\n const postProps = getOrSetDefaultValue(postStyleMap, elm, new Set());\n tl.postStyleProps.forEach(prop => postProps.add(prop));\n if (elm !== element) {\n queriedElements.add(elm);\n }\n });\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n checkNonAnimatableInTimelines(timelines, this._triggerName, driver);\n }\n return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, [...queriedElements.values()], preStyleMap, postStyleMap, totalTime);\n }\n}\n/**\n * Checks inside a set of timelines if they try to animate a css property which is not considered\n * animatable, in that case it prints a warning on the console.\n * Besides that the function doesn't have any other effect.\n *\n * Note: this check is done here after the timelines are built instead of doing on a lower level so\n * that we can make sure that the warning appears only once per instruction (we can aggregate here\n * all the issues instead of finding them separately).\n *\n * @param timelines The built timelines for the current instruction.\n * @param triggerName The name of the trigger for the current instruction.\n * @param driver Animation driver used to perform the check.\n *\n */\nfunction checkNonAnimatableInTimelines(timelines, triggerName, driver) {\n if (!driver.validateAnimatableStyleProperty) {\n return;\n }\n const allowedNonAnimatableProps = new Set([\n // 'easing' is a utility/synthetic prop we use to represent\n // easing functions, it represents a property of the animation\n // which is not animatable but different values can be used\n // in different steps\n 'easing']);\n const invalidNonAnimatableProps = new Set();\n timelines.forEach(({\n keyframes\n }) => {\n const nonAnimatablePropsInitialValues = new Map();\n keyframes.forEach(keyframe => {\n const entriesToCheck = Array.from(keyframe.entries()).filter(([prop]) => !allowedNonAnimatableProps.has(prop));\n for (const [prop, value] of entriesToCheck) {\n if (!driver.validateAnimatableStyleProperty(prop)) {\n if (nonAnimatablePropsInitialValues.has(prop) && !invalidNonAnimatableProps.has(prop)) {\n const propInitialValue = nonAnimatablePropsInitialValues.get(prop);\n if (propInitialValue !== value) {\n invalidNonAnimatableProps.add(prop);\n }\n } else {\n nonAnimatablePropsInitialValues.set(prop, value);\n }\n }\n }\n });\n });\n if (invalidNonAnimatableProps.size > 0) {\n console.warn(`Warning: The animation trigger \"${triggerName}\" is attempting to animate the following` + ' not animatable properties: ' + Array.from(invalidNonAnimatableProps).join(', ') + '\\n' + '(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)');\n }\n}\nfunction oneOrMoreTransitionsMatch(matchFns, currentState, nextState, element, params) {\n return matchFns.some(fn => fn(currentState, nextState, element, params));\n}\nfunction applyParamDefaults(userParams, defaults) {\n const result = {\n ...defaults\n };\n Object.entries(userParams).forEach(([key, value]) => {\n if (value != null) {\n result[key] = value;\n }\n });\n return result;\n}\nclass AnimationStateStyles {\n styles;\n defaultParams;\n normalizer;\n constructor(styles, defaultParams, normalizer) {\n this.styles = styles;\n this.defaultParams = defaultParams;\n this.normalizer = normalizer;\n }\n buildStyles(params, errors) {\n const finalStyles = new Map();\n const combinedParams = applyParamDefaults(params, this.defaultParams);\n this.styles.styles.forEach(value => {\n if (typeof value !== 'string') {\n value.forEach((val, prop) => {\n if (val) {\n val = interpolateParams(val, combinedParams, errors);\n }\n const normalizedProp = this.normalizer.normalizePropertyName(prop, errors);\n val = this.normalizer.normalizeStyleValue(prop, normalizedProp, val, errors);\n finalStyles.set(prop, val);\n });\n }\n });\n return finalStyles;\n }\n}\nfunction buildTrigger(name, ast, normalizer) {\n return new AnimationTrigger(name, ast, normalizer);\n}\nclass AnimationTrigger {\n name;\n ast;\n _normalizer;\n transitionFactories = [];\n fallbackTransition;\n states = /*#__PURE__*/new Map();\n constructor(name, ast, _normalizer) {\n this.name = name;\n this.ast = ast;\n this._normalizer = _normalizer;\n ast.states.forEach(ast => {\n const defaultParams = ast.options && ast.options.params || {};\n this.states.set(ast.name, new AnimationStateStyles(ast.style, defaultParams, _normalizer));\n });\n balanceProperties(this.states, 'true', '1');\n balanceProperties(this.states, 'false', '0');\n ast.transitions.forEach(ast => {\n this.transitionFactories.push(new AnimationTransitionFactory(name, ast, this.states));\n });\n this.fallbackTransition = createFallbackTransition(name, this.states, this._normalizer);\n }\n get containsQueries() {\n return this.ast.queryCount > 0;\n }\n matchTransition(currentState, nextState, element, params) {\n const entry = this.transitionFactories.find(f => f.match(currentState, nextState, element, params));\n return entry || null;\n }\n matchStyles(currentState, params, errors) {\n return this.fallbackTransition.buildStyles(currentState, params, errors);\n }\n}\nfunction createFallbackTransition(triggerName, states, normalizer) {\n const matchers = [(fromState, toState) => true];\n const animation = {\n type: AnimationMetadataType.Sequence,\n steps: [],\n options: null\n };\n const transition = {\n type: AnimationMetadataType.Transition,\n animation,\n matchers,\n options: null,\n queryCount: 0,\n depCount: 0\n };\n return new AnimationTransitionFactory(triggerName, transition, states);\n}\nfunction balanceProperties(stateMap, key1, key2) {\n if (stateMap.has(key1)) {\n if (!stateMap.has(key2)) {\n stateMap.set(key2, stateMap.get(key1));\n }\n } else if (stateMap.has(key2)) {\n stateMap.set(key1, stateMap.get(key2));\n }\n}\nconst EMPTY_INSTRUCTION_MAP = /*#__PURE__*/new ElementInstructionMap();\nclass TimelineAnimationEngine {\n bodyNode;\n _driver;\n _normalizer;\n _animations = /*#__PURE__*/new Map();\n _playersById = /*#__PURE__*/new Map();\n players = [];\n constructor(bodyNode, _driver, _normalizer) {\n this.bodyNode = bodyNode;\n this._driver = _driver;\n this._normalizer = _normalizer;\n }\n register(id, metadata) {\n const errors = [];\n const warnings = [];\n const ast = buildAnimationAst(this._driver, metadata, errors, warnings);\n if (errors.length) {\n throw registerFailed(errors);\n } else {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (warnings.length) {\n warnRegister(warnings);\n }\n }\n this._animations.set(id, ast);\n }\n }\n _buildPlayer(i, preStyles, postStyles) {\n const element = i.element;\n const keyframes = normalizeKeyframes$1(this._normalizer, i.keyframes, preStyles, postStyles);\n return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, [], true);\n }\n create(id, element, options = {}) {\n const errors = [];\n const ast = this._animations.get(id);\n let instructions;\n const autoStylesMap = new Map();\n if (ast) {\n instructions = buildAnimationTimelines(this._driver, element, ast, ENTER_CLASSNAME, LEAVE_CLASSNAME, new Map(), new Map(), options, EMPTY_INSTRUCTION_MAP, errors);\n instructions.forEach(inst => {\n const styles = getOrSetDefaultValue(autoStylesMap, inst.element, new Map());\n inst.postStyleProps.forEach(prop => styles.set(prop, null));\n });\n } else {\n errors.push(missingOrDestroyedAnimation());\n instructions = [];\n }\n if (errors.length) {\n throw createAnimationFailed(errors);\n }\n autoStylesMap.forEach((styles, element) => {\n styles.forEach((_, prop) => {\n styles.set(prop, this._driver.computeStyle(element, prop, AUTO_STYLE));\n });\n });\n const players = instructions.map(i => {\n const styles = autoStylesMap.get(i.element);\n return this._buildPlayer(i, new Map(), styles);\n });\n const player = optimizeGroupPlayer(players);\n this._playersById.set(id, player);\n player.onDestroy(() => this.destroy(id));\n this.players.push(player);\n return player;\n }\n destroy(id) {\n const player = this._getPlayer(id);\n player.destroy();\n this._playersById.delete(id);\n const index = this.players.indexOf(player);\n if (index >= 0) {\n this.players.splice(index, 1);\n }\n }\n _getPlayer(id) {\n const player = this._playersById.get(id);\n if (!player) {\n throw missingPlayer(id);\n }\n return player;\n }\n listen(id, element, eventName, callback) {\n // triggerName, fromState, toState are all ignored for timeline animations\n const baseEvent = makeAnimationEvent(element, '', '', '');\n listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback);\n return () => {};\n }\n command(id, element, command, args) {\n if (command == 'register') {\n this.register(id, args[0]);\n return;\n }\n if (command == 'create') {\n const options = args[0] || {};\n this.create(id, element, options);\n return;\n }\n const player = this._getPlayer(id);\n switch (command) {\n case 'play':\n player.play();\n break;\n case 'pause':\n player.pause();\n break;\n case 'reset':\n player.reset();\n break;\n case 'restart':\n player.restart();\n break;\n case 'finish':\n player.finish();\n break;\n case 'init':\n player.init();\n break;\n case 'setPosition':\n player.setPosition(parseFloat(args[0]));\n break;\n case 'destroy':\n this.destroy(id);\n break;\n }\n }\n}\nconst QUEUED_CLASSNAME = 'ng-animate-queued';\nconst QUEUED_SELECTOR = '.ng-animate-queued';\nconst DISABLED_CLASSNAME = 'ng-animate-disabled';\nconst DISABLED_SELECTOR = '.ng-animate-disabled';\nconst STAR_CLASSNAME = 'ng-star-inserted';\nconst STAR_SELECTOR = '.ng-star-inserted';\nconst EMPTY_PLAYER_ARRAY = [];\nconst NULL_REMOVAL_STATE = {\n namespaceId: '',\n setForRemoval: false,\n setForMove: false,\n hasAnimation: false,\n removedBeforeQueried: false\n};\nconst NULL_REMOVED_QUERIED_STATE = {\n namespaceId: '',\n setForMove: false,\n setForRemoval: false,\n hasAnimation: false,\n removedBeforeQueried: true\n};\nconst REMOVAL_FLAG = '__ng_removed';\nclass StateValue {\n namespaceId;\n value;\n options;\n get params() {\n return this.options.params;\n }\n constructor(input, namespaceId = '') {\n this.namespaceId = namespaceId;\n const isObj = input && input.hasOwnProperty('value');\n const value = isObj ? input['value'] : input;\n this.value = normalizeTriggerValue(value);\n if (isObj) {\n // we drop the value property from options.\n const {\n value,\n ...options\n } = input;\n this.options = options;\n } else {\n this.options = {};\n }\n if (!this.options.params) {\n this.options.params = {};\n }\n }\n absorbOptions(options) {\n const newParams = options.params;\n if (newParams) {\n const oldParams = this.options.params;\n Object.keys(newParams).forEach(prop => {\n if (oldParams[prop] == null) {\n oldParams[prop] = newParams[prop];\n }\n });\n }\n }\n}\nconst VOID_VALUE = 'void';\nconst DEFAULT_STATE_VALUE = /*#__PURE__*/new StateValue(VOID_VALUE);\nclass AnimationTransitionNamespace {\n id;\n hostElement;\n _engine;\n players = [];\n _triggers = /*#__PURE__*/new Map();\n _queue = [];\n _elementListeners = /*#__PURE__*/new Map();\n _hostClassName;\n constructor(id, hostElement, _engine) {\n this.id = id;\n this.hostElement = hostElement;\n this._engine = _engine;\n this._hostClassName = 'ng-tns-' + id;\n addClass(hostElement, this._hostClassName);\n }\n listen(element, name, phase, callback) {\n if (!this._triggers.has(name)) {\n throw missingTrigger(phase, name);\n }\n if (phase == null || phase.length == 0) {\n throw missingEvent(name);\n }\n if (!isTriggerEventValid(phase)) {\n throw unsupportedTriggerEvent(phase, name);\n }\n const listeners = getOrSetDefaultValue(this._elementListeners, element, []);\n const data = {\n name,\n phase,\n callback\n };\n listeners.push(data);\n const triggersWithStates = getOrSetDefaultValue(this._engine.statesByElement, element, new Map());\n if (!triggersWithStates.has(name)) {\n addClass(element, NG_TRIGGER_CLASSNAME);\n addClass(element, NG_TRIGGER_CLASSNAME + '-' + name);\n triggersWithStates.set(name, DEFAULT_STATE_VALUE);\n }\n return () => {\n // the event listener is removed AFTER the flush has occurred such\n // that leave animations callbacks can fire (otherwise if the node\n // is removed in between then the listeners would be deregistered)\n this._engine.afterFlush(() => {\n const index = listeners.indexOf(data);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n if (!this._triggers.has(name)) {\n triggersWithStates.delete(name);\n }\n });\n };\n }\n register(name, ast) {\n if (this._triggers.has(name)) {\n // throw\n return false;\n } else {\n this._triggers.set(name, ast);\n return true;\n }\n }\n _getTrigger(name) {\n const trigger = this._triggers.get(name);\n if (!trigger) {\n throw unregisteredTrigger(name);\n }\n return trigger;\n }\n trigger(element, triggerName, value, defaultToFallback = true) {\n const trigger = this._getTrigger(triggerName);\n const player = new TransitionAnimationPlayer(this.id, triggerName, element);\n let triggersWithStates = this._engine.statesByElement.get(element);\n if (!triggersWithStates) {\n addClass(element, NG_TRIGGER_CLASSNAME);\n addClass(element, NG_TRIGGER_CLASSNAME + '-' + triggerName);\n this._engine.statesByElement.set(element, triggersWithStates = new Map());\n }\n let fromState = triggersWithStates.get(triggerName);\n const toState = new StateValue(value, this.id);\n const isObj = value && value.hasOwnProperty('value');\n if (!isObj && fromState) {\n toState.absorbOptions(fromState.options);\n }\n triggersWithStates.set(triggerName, toState);\n if (!fromState) {\n fromState = DEFAULT_STATE_VALUE;\n }\n const isRemoval = toState.value === VOID_VALUE;\n // normally this isn't reached by here, however, if an object expression\n // is passed in then it may be a new object each time. Comparing the value\n // is important since that will stay the same despite there being a new object.\n // The removal arc here is special cased because the same element is triggered\n // twice in the event that it contains animations on the outer/inner portions\n // of the host container\n if (!isRemoval && fromState.value === toState.value) {\n // this means that despite the value not changing, some inner params\n // have changed which means that the animation final styles need to be applied\n if (!objEquals(fromState.params, toState.params)) {\n const errors = [];\n const fromStyles = trigger.matchStyles(fromState.value, fromState.params, errors);\n const toStyles = trigger.matchStyles(toState.value, toState.params, errors);\n if (errors.length) {\n this._engine.reportError(errors);\n } else {\n this._engine.afterFlush(() => {\n eraseStyles(element, fromStyles);\n setStyles(element, toStyles);\n });\n }\n }\n return;\n }\n const playersOnElement = getOrSetDefaultValue(this._engine.playersByElement, element, []);\n playersOnElement.forEach(player => {\n // only remove the player if it is queued on the EXACT same trigger/namespace\n // we only also deal with queued players here because if the animation has\n // started then we want to keep the player alive until the flush happens\n // (which is where the previousPlayers are passed into the new player)\n if (player.namespaceId == this.id && player.triggerName == triggerName && player.queued) {\n player.destroy();\n }\n });\n let transition = trigger.matchTransition(fromState.value, toState.value, element, toState.params);\n let isFallbackTransition = false;\n if (!transition) {\n if (!defaultToFallback) return;\n transition = trigger.fallbackTransition;\n isFallbackTransition = true;\n }\n this._engine.totalQueuedPlayers++;\n this._queue.push({\n element,\n triggerName,\n transition,\n fromState,\n toState,\n player,\n isFallbackTransition\n });\n if (!isFallbackTransition) {\n addClass(element, QUEUED_CLASSNAME);\n player.onStart(() => {\n removeClass(element, QUEUED_CLASSNAME);\n });\n }\n player.onDone(() => {\n let index = this.players.indexOf(player);\n if (index >= 0) {\n this.players.splice(index, 1);\n }\n const players = this._engine.playersByElement.get(element);\n if (players) {\n let index = players.indexOf(player);\n if (index >= 0) {\n players.splice(index, 1);\n }\n }\n });\n this.players.push(player);\n playersOnElement.push(player);\n return player;\n }\n deregister(name) {\n this._triggers.delete(name);\n this._engine.statesByElement.forEach(stateMap => stateMap.delete(name));\n this._elementListeners.forEach((listeners, element) => {\n this._elementListeners.set(element, listeners.filter(entry => {\n return entry.name != name;\n }));\n });\n }\n clearElementCache(element) {\n this._engine.statesByElement.delete(element);\n this._elementListeners.delete(element);\n const elementPlayers = this._engine.playersByElement.get(element);\n if (elementPlayers) {\n elementPlayers.forEach(player => player.destroy());\n this._engine.playersByElement.delete(element);\n }\n }\n _signalRemovalForInnerTriggers(rootElement, context) {\n const elements = this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true);\n // emulate a leave animation for all inner nodes within this node.\n // If there are no animations found for any of the nodes then clear the cache\n // for the element.\n elements.forEach(elm => {\n // this means that an inner remove() operation has already kicked off\n // the animation on this element...\n if (elm[REMOVAL_FLAG]) return;\n const namespaces = this._engine.fetchNamespacesByElement(elm);\n if (namespaces.size) {\n namespaces.forEach(ns => ns.triggerLeaveAnimation(elm, context, false, true));\n } else {\n this.clearElementCache(elm);\n }\n });\n // If the child elements were removed along with the parent, their animations might not\n // have completed. Clear all the elements from the cache so we don't end up with a memory leak.\n this._engine.afterFlushAnimationsDone(() => elements.forEach(elm => this.clearElementCache(elm)));\n }\n triggerLeaveAnimation(element, context, destroyAfterComplete, defaultToFallback) {\n const triggerStates = this._engine.statesByElement.get(element);\n const previousTriggersValues = new Map();\n if (triggerStates) {\n const players = [];\n triggerStates.forEach((state, triggerName) => {\n previousTriggersValues.set(triggerName, state.value);\n // this check is here in the event that an element is removed\n // twice (both on the host level and the component level)\n if (this._triggers.has(triggerName)) {\n const player = this.trigger(element, triggerName, VOID_VALUE, defaultToFallback);\n if (player) {\n players.push(player);\n }\n }\n });\n if (players.length) {\n this._engine.markElementAsRemoved(this.id, element, true, context, previousTriggersValues);\n if (destroyAfterComplete) {\n optimizeGroupPlayer(players).onDone(() => this._engine.processLeaveNode(element));\n }\n return true;\n }\n }\n return false;\n }\n prepareLeaveAnimationListeners(element) {\n const listeners = this._elementListeners.get(element);\n const elementStates = this._engine.statesByElement.get(element);\n // if this statement fails then it means that the element was picked up\n // by an earlier flush (or there are no listeners at all to track the leave).\n if (listeners && elementStates) {\n const visitedTriggers = new Set();\n listeners.forEach(listener => {\n const triggerName = listener.name;\n if (visitedTriggers.has(triggerName)) return;\n visitedTriggers.add(triggerName);\n const trigger = this._triggers.get(triggerName);\n const transition = trigger.fallbackTransition;\n const fromState = elementStates.get(triggerName) || DEFAULT_STATE_VALUE;\n const toState = new StateValue(VOID_VALUE);\n const player = new TransitionAnimationPlayer(this.id, triggerName, element);\n this._engine.totalQueuedPlayers++;\n this._queue.push({\n element,\n triggerName,\n transition,\n fromState,\n toState,\n player,\n isFallbackTransition: true\n });\n });\n }\n }\n removeNode(element, context) {\n const engine = this._engine;\n if (element.childElementCount) {\n this._signalRemovalForInnerTriggers(element, context);\n }\n // this means that a * => VOID animation was detected and kicked off\n if (this.triggerLeaveAnimation(element, context, true)) return;\n // find the player that is animating and make sure that the\n // removal is delayed until that player has completed\n let containsPotentialParentTransition = false;\n if (engine.totalAnimations) {\n const currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : [];\n // when this `if statement` does not continue forward it means that\n // a previous animation query has selected the current element and\n // is animating it. In this situation want to continue forwards and\n // allow the element to be queued up for animation later.\n if (currentPlayers && currentPlayers.length) {\n containsPotentialParentTransition = true;\n } else {\n let parent = element;\n while (parent = parent.parentNode) {\n const triggers = engine.statesByElement.get(parent);\n if (triggers) {\n containsPotentialParentTransition = true;\n break;\n }\n }\n }\n }\n // at this stage we know that the element will either get removed\n // during flush or will be picked up by a parent query. Either way\n // we need to fire the listeners for this element when it DOES get\n // removed (once the query parent animation is done or after flush)\n this.prepareLeaveAnimationListeners(element);\n // whether or not a parent has an animation we need to delay the deferral of the leave\n // operation until we have more information (which we do after flush() has been called)\n if (containsPotentialParentTransition) {\n engine.markElementAsRemoved(this.id, element, false, context);\n } else {\n const removalFlag = element[REMOVAL_FLAG];\n if (!removalFlag || removalFlag === NULL_REMOVAL_STATE) {\n // we do this after the flush has occurred such\n // that the callbacks can be fired\n engine.afterFlush(() => this.clearElementCache(element));\n engine.destroyInnerAnimations(element);\n engine._onRemovalComplete(element, context);\n }\n }\n }\n insertNode(element, parent) {\n addClass(element, this._hostClassName);\n }\n drainQueuedTransitions(microtaskId) {\n const instructions = [];\n this._queue.forEach(entry => {\n const player = entry.player;\n if (player.destroyed) return;\n const element = entry.element;\n const listeners = this._elementListeners.get(element);\n if (listeners) {\n listeners.forEach(listener => {\n if (listener.name == entry.triggerName) {\n const baseEvent = makeAnimationEvent(element, entry.triggerName, entry.fromState.value, entry.toState.value);\n baseEvent['_data'] = microtaskId;\n listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);\n }\n });\n }\n if (player.markedForDestroy) {\n this._engine.afterFlush(() => {\n // now we can destroy the element properly since the event listeners have\n // been bound to the player\n player.destroy();\n });\n } else {\n instructions.push(entry);\n }\n });\n this._queue = [];\n return instructions.sort((a, b) => {\n // if depCount == 0 them move to front\n // otherwise if a contains b then move back\n const d0 = a.transition.ast.depCount;\n const d1 = b.transition.ast.depCount;\n if (d0 == 0 || d1 == 0) {\n return d0 - d1;\n }\n return this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;\n });\n }\n destroy(context) {\n this.players.forEach(p => p.destroy());\n this._signalRemovalForInnerTriggers(this.hostElement, context);\n }\n}\nclass TransitionAnimationEngine {\n bodyNode;\n driver;\n _normalizer;\n players = [];\n newHostElements = /*#__PURE__*/new Map();\n playersByElement = /*#__PURE__*/new Map();\n playersByQueriedElement = /*#__PURE__*/new Map();\n statesByElement = /*#__PURE__*/new Map();\n disabledNodes = /*#__PURE__*/new Set();\n totalAnimations = 0;\n totalQueuedPlayers = 0;\n _namespaceLookup = {};\n _namespaceList = [];\n _flushFns = [];\n _whenQuietFns = [];\n namespacesByHostElement = /*#__PURE__*/new Map();\n collectedEnterElements = [];\n collectedLeaveElements = [];\n // this method is designed to be overridden by the code that uses this engine\n onRemovalComplete = (element, context) => {};\n /** @internal */\n _onRemovalComplete(element, context) {\n this.onRemovalComplete(element, context);\n }\n constructor(bodyNode, driver, _normalizer) {\n this.bodyNode = bodyNode;\n this.driver = driver;\n this._normalizer = _normalizer;\n }\n get queuedPlayers() {\n const players = [];\n this._namespaceList.forEach(ns => {\n ns.players.forEach(player => {\n if (player.queued) {\n players.push(player);\n }\n });\n });\n return players;\n }\n createNamespace(namespaceId, hostElement) {\n const ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);\n if (this.bodyNode && this.driver.containsElement(this.bodyNode, hostElement)) {\n this._balanceNamespaceList(ns, hostElement);\n } else {\n // defer this later until flush during when the host element has\n // been inserted so that we know exactly where to place it in\n // the namespace list\n this.newHostElements.set(hostElement, ns);\n // given that this host element is a part of the animation code, it\n // may or may not be inserted by a parent node that is of an\n // animation renderer type. If this happens then we can still have\n // access to this item when we query for :enter nodes. If the parent\n // is a renderer then the set data-structure will normalize the entry\n this.collectEnterElement(hostElement);\n }\n return this._namespaceLookup[namespaceId] = ns;\n }\n _balanceNamespaceList(ns, hostElement) {\n const namespaceList = this._namespaceList;\n const namespacesByHostElement = this.namespacesByHostElement;\n const limit = namespaceList.length - 1;\n if (limit >= 0) {\n let found = false;\n // Find the closest ancestor with an existing namespace so we can then insert `ns` after it,\n // establishing a top-down ordering of namespaces in `this._namespaceList`.\n let ancestor = this.driver.getParentElement(hostElement);\n while (ancestor) {\n const ancestorNs = namespacesByHostElement.get(ancestor);\n if (ancestorNs) {\n // An animation namespace has been registered for this ancestor, so we insert `ns`\n // right after it to establish top-down ordering of animation namespaces.\n const index = namespaceList.indexOf(ancestorNs);\n namespaceList.splice(index + 1, 0, ns);\n found = true;\n break;\n }\n ancestor = this.driver.getParentElement(ancestor);\n }\n if (!found) {\n // No namespace exists that is an ancestor of `ns`, so `ns` is inserted at the front to\n // ensure that any existing descendants are ordered after `ns`, retaining the desired\n // top-down ordering.\n namespaceList.unshift(ns);\n }\n } else {\n namespaceList.push(ns);\n }\n namespacesByHostElement.set(hostElement, ns);\n return ns;\n }\n register(namespaceId, hostElement) {\n let ns = this._namespaceLookup[namespaceId];\n if (!ns) {\n ns = this.createNamespace(namespaceId, hostElement);\n }\n return ns;\n }\n registerTrigger(namespaceId, name, trigger) {\n let ns = this._namespaceLookup[namespaceId];\n if (ns && ns.register(name, trigger)) {\n this.totalAnimations++;\n }\n }\n destroy(namespaceId, context) {\n if (!namespaceId) return;\n this.afterFlush(() => {});\n this.afterFlushAnimationsDone(() => {\n const ns = this._fetchNamespace(namespaceId);\n this.namespacesByHostElement.delete(ns.hostElement);\n const index = this._namespaceList.indexOf(ns);\n if (index >= 0) {\n this._namespaceList.splice(index, 1);\n }\n ns.destroy(context);\n delete this._namespaceLookup[namespaceId];\n });\n }\n _fetchNamespace(id) {\n return this._namespaceLookup[id];\n }\n fetchNamespacesByElement(element) {\n // normally there should only be one namespace per element, however\n // if @triggers are placed on both the component element and then\n // its host element (within the component code) then there will be\n // two namespaces returned. We use a set here to simply deduplicate\n // the namespaces in case (for the reason described above) there are multiple triggers\n const namespaces = new Set();\n const elementStates = this.statesByElement.get(element);\n if (elementStates) {\n for (let stateValue of elementStates.values()) {\n if (stateValue.namespaceId) {\n const ns = this._fetchNamespace(stateValue.namespaceId);\n if (ns) {\n namespaces.add(ns);\n }\n }\n }\n }\n return namespaces;\n }\n trigger(namespaceId, element, name, value) {\n if (isElementNode(element)) {\n const ns = this._fetchNamespace(namespaceId);\n if (ns) {\n ns.trigger(element, name, value);\n return true;\n }\n }\n return false;\n }\n insertNode(namespaceId, element, parent, insertBefore) {\n if (!isElementNode(element)) return;\n // special case for when an element is removed and reinserted (move operation)\n // when this occurs we do not want to use the element for deletion later\n const details = element[REMOVAL_FLAG];\n if (details && details.setForRemoval) {\n details.setForRemoval = false;\n details.setForMove = true;\n const index = this.collectedLeaveElements.indexOf(element);\n if (index >= 0) {\n this.collectedLeaveElements.splice(index, 1);\n }\n }\n // in the event that the namespaceId is blank then the caller\n // code does not contain any animation code in it, but it is\n // just being called so that the node is marked as being inserted\n if (namespaceId) {\n const ns = this._fetchNamespace(namespaceId);\n // This if-statement is a workaround for router issue #21947.\n // The router sometimes hits a race condition where while a route\n // is being instantiated a new navigation arrives, triggering leave\n // animation of DOM that has not been fully initialized, until this\n // is resolved, we need to handle the scenario when DOM is not in a\n // consistent state during the animation.\n if (ns) {\n ns.insertNode(element, parent);\n }\n }\n // only *directives and host elements are inserted before\n if (insertBefore) {\n this.collectEnterElement(element);\n }\n }\n collectEnterElement(element) {\n this.collectedEnterElements.push(element);\n }\n markElementAsDisabled(element, value) {\n if (value) {\n if (!this.disabledNodes.has(element)) {\n this.disabledNodes.add(element);\n addClass(element, DISABLED_CLASSNAME);\n }\n } else if (this.disabledNodes.has(element)) {\n this.disabledNodes.delete(element);\n removeClass(element, DISABLED_CLASSNAME);\n }\n }\n removeNode(namespaceId, element, context) {\n if (isElementNode(element)) {\n const ns = namespaceId ? this._fetchNamespace(namespaceId) : null;\n if (ns) {\n ns.removeNode(element, context);\n } else {\n this.markElementAsRemoved(namespaceId, element, false, context);\n }\n const hostNS = this.namespacesByHostElement.get(element);\n if (hostNS && hostNS.id !== namespaceId) {\n hostNS.removeNode(element, context);\n }\n } else {\n this._onRemovalComplete(element, context);\n }\n }\n markElementAsRemoved(namespaceId, element, hasAnimation, context, previousTriggersValues) {\n this.collectedLeaveElements.push(element);\n element[REMOVAL_FLAG] = {\n namespaceId,\n setForRemoval: context,\n hasAnimation,\n removedBeforeQueried: false,\n previousTriggersValues\n };\n }\n listen(namespaceId, element, name, phase, callback) {\n if (isElementNode(element)) {\n return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);\n }\n return () => {};\n }\n _buildInstruction(entry, subTimelines, enterClassName, leaveClassName, skipBuildAst) {\n return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, enterClassName, leaveClassName, entry.fromState.options, entry.toState.options, subTimelines, skipBuildAst);\n }\n destroyInnerAnimations(containerElement) {\n let elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);\n elements.forEach(element => this.destroyActiveAnimationsForElement(element));\n if (this.playersByQueriedElement.size == 0) return;\n elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);\n elements.forEach(element => this.finishActiveQueriedAnimationOnElement(element));\n }\n destroyActiveAnimationsForElement(element) {\n const players = this.playersByElement.get(element);\n if (players) {\n players.forEach(player => {\n // special case for when an element is set for destruction, but hasn't started.\n // in this situation we want to delay the destruction until the flush occurs\n // so that any event listeners attached to the player are triggered.\n if (player.queued) {\n player.markedForDestroy = true;\n } else {\n player.destroy();\n }\n });\n }\n }\n finishActiveQueriedAnimationOnElement(element) {\n const players = this.playersByQueriedElement.get(element);\n if (players) {\n players.forEach(player => player.finish());\n }\n }\n whenRenderingDone() {\n return new Promise(resolve => {\n if (this.players.length) {\n return optimizeGroupPlayer(this.players).onDone(() => resolve());\n } else {\n resolve();\n }\n });\n }\n processLeaveNode(element) {\n const details = element[REMOVAL_FLAG];\n if (details && details.setForRemoval) {\n // this will prevent it from removing it twice\n element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;\n if (details.namespaceId) {\n this.destroyInnerAnimations(element);\n const ns = this._fetchNamespace(details.namespaceId);\n if (ns) {\n ns.clearElementCache(element);\n }\n }\n this._onRemovalComplete(element, details.setForRemoval);\n }\n if (element.classList?.contains(DISABLED_CLASSNAME)) {\n this.markElementAsDisabled(element, false);\n }\n this.driver.query(element, DISABLED_SELECTOR, true).forEach(node => {\n this.markElementAsDisabled(node, false);\n });\n }\n flush(microtaskId = -1) {\n let players = [];\n if (this.newHostElements.size) {\n this.newHostElements.forEach((ns, element) => this._balanceNamespaceList(ns, element));\n this.newHostElements.clear();\n }\n if (this.totalAnimations && this.collectedEnterElements.length) {\n for (let i = 0; i < this.collectedEnterElements.length; i++) {\n const elm = this.collectedEnterElements[i];\n addClass(elm, STAR_CLASSNAME);\n }\n }\n if (this._namespaceList.length && (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {\n const cleanupFns = [];\n try {\n players = this._flushAnimations(cleanupFns, microtaskId);\n } finally {\n for (let i = 0; i < cleanupFns.length; i++) {\n cleanupFns[i]();\n }\n }\n } else {\n for (let i = 0; i < this.collectedLeaveElements.length; i++) {\n const element = this.collectedLeaveElements[i];\n this.processLeaveNode(element);\n }\n }\n this.totalQueuedPlayers = 0;\n this.collectedEnterElements.length = 0;\n this.collectedLeaveElements.length = 0;\n this._flushFns.forEach(fn => fn());\n this._flushFns = [];\n if (this._whenQuietFns.length) {\n // we move these over to a variable so that\n // if any new callbacks are registered in another\n // flush they do not populate the existing set\n const quietFns = this._whenQuietFns;\n this._whenQuietFns = [];\n if (players.length) {\n optimizeGroupPlayer(players).onDone(() => {\n quietFns.forEach(fn => fn());\n });\n } else {\n quietFns.forEach(fn => fn());\n }\n }\n }\n reportError(errors) {\n throw triggerTransitionsFailed(errors);\n }\n _flushAnimations(cleanupFns, microtaskId) {\n const subTimelines = new ElementInstructionMap();\n const skippedPlayers = [];\n const skippedPlayersMap = new Map();\n const queuedInstructions = [];\n const queriedElements = new Map();\n const allPreStyleElements = new Map();\n const allPostStyleElements = new Map();\n const disabledElementsSet = new Set();\n this.disabledNodes.forEach(node => {\n disabledElementsSet.add(node);\n const nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true);\n for (let i = 0; i < nodesThatAreDisabled.length; i++) {\n disabledElementsSet.add(nodesThatAreDisabled[i]);\n }\n });\n const bodyNode = this.bodyNode;\n const allTriggerElements = Array.from(this.statesByElement.keys());\n const enterNodeMap = buildRootMap(allTriggerElements, this.collectedEnterElements);\n // this must occur before the instructions are built below such that\n // the :enter queries match the elements (since the timeline queries\n // are fired during instruction building).\n const enterNodeMapIds = new Map();\n let i = 0;\n enterNodeMap.forEach((nodes, root) => {\n const className = ENTER_CLASSNAME + i++;\n enterNodeMapIds.set(root, className);\n nodes.forEach(node => addClass(node, className));\n });\n const allLeaveNodes = [];\n const mergedLeaveNodes = new Set();\n const leaveNodesWithoutAnimations = new Set();\n for (let i = 0; i < this.collectedLeaveElements.length; i++) {\n const element = this.collectedLeaveElements[i];\n const details = element[REMOVAL_FLAG];\n if (details && details.setForRemoval) {\n allLeaveNodes.push(element);\n mergedLeaveNodes.add(element);\n if (details.hasAnimation) {\n this.driver.query(element, STAR_SELECTOR, true).forEach(elm => mergedLeaveNodes.add(elm));\n } else {\n leaveNodesWithoutAnimations.add(element);\n }\n }\n }\n const leaveNodeMapIds = new Map();\n const leaveNodeMap = buildRootMap(allTriggerElements, Array.from(mergedLeaveNodes));\n leaveNodeMap.forEach((nodes, root) => {\n const className = LEAVE_CLASSNAME + i++;\n leaveNodeMapIds.set(root, className);\n nodes.forEach(node => addClass(node, className));\n });\n cleanupFns.push(() => {\n enterNodeMap.forEach((nodes, root) => {\n const className = enterNodeMapIds.get(root);\n nodes.forEach(node => removeClass(node, className));\n });\n leaveNodeMap.forEach((nodes, root) => {\n const className = leaveNodeMapIds.get(root);\n nodes.forEach(node => removeClass(node, className));\n });\n allLeaveNodes.forEach(element => {\n this.processLeaveNode(element);\n });\n });\n const allPlayers = [];\n const erroneousTransitions = [];\n for (let i = this._namespaceList.length - 1; i >= 0; i--) {\n const ns = this._namespaceList[i];\n ns.drainQueuedTransitions(microtaskId).forEach(entry => {\n const player = entry.player;\n const element = entry.element;\n allPlayers.push(player);\n if (this.collectedEnterElements.length) {\n const details = element[REMOVAL_FLAG];\n // animations for move operations (elements being removed and reinserted,\n // e.g. when the order of an *ngFor list changes) are currently not supported\n if (details && details.setForMove) {\n if (details.previousTriggersValues && details.previousTriggersValues.has(entry.triggerName)) {\n const previousValue = details.previousTriggersValues.get(entry.triggerName);\n // we need to restore the previous trigger value since the element has\n // only been moved and hasn't actually left the DOM\n const triggersWithStates = this.statesByElement.get(entry.element);\n if (triggersWithStates && triggersWithStates.has(entry.triggerName)) {\n const state = triggersWithStates.get(entry.triggerName);\n state.value = previousValue;\n triggersWithStates.set(entry.triggerName, state);\n }\n }\n player.destroy();\n return;\n }\n }\n const nodeIsOrphaned = !bodyNode || !this.driver.containsElement(bodyNode, element);\n const leaveClassName = leaveNodeMapIds.get(element);\n const enterClassName = enterNodeMapIds.get(element);\n const instruction = this._buildInstruction(entry, subTimelines, enterClassName, leaveClassName, nodeIsOrphaned);\n if (instruction.errors && instruction.errors.length) {\n erroneousTransitions.push(instruction);\n return;\n }\n // even though the element may not be in the DOM, it may still\n // be added at a later point (due to the mechanics of content\n // projection and/or dynamic component insertion) therefore it's\n // important to still style the element.\n if (nodeIsOrphaned) {\n player.onStart(() => eraseStyles(element, instruction.fromStyles));\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n skippedPlayers.push(player);\n return;\n }\n // if an unmatched transition is queued and ready to go\n // then it SHOULD NOT render an animation and cancel the\n // previously running animations.\n if (entry.isFallbackTransition) {\n player.onStart(() => eraseStyles(element, instruction.fromStyles));\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n skippedPlayers.push(player);\n return;\n }\n // this means that if a parent animation uses this animation as a sub-trigger\n // then it will instruct the timeline builder not to add a player delay, but\n // instead stretch the first keyframe gap until the animation starts. This is\n // important in order to prevent extra initialization styles from being\n // required by the user for the animation.\n const timelines = [];\n instruction.timelines.forEach(tl => {\n tl.stretchStartingKeyframe = true;\n if (!this.disabledNodes.has(tl.element)) {\n timelines.push(tl);\n }\n });\n instruction.timelines = timelines;\n subTimelines.append(element, instruction.timelines);\n const tuple = {\n instruction,\n player,\n element\n };\n queuedInstructions.push(tuple);\n instruction.queriedElements.forEach(element => getOrSetDefaultValue(queriedElements, element, []).push(player));\n instruction.preStyleProps.forEach((stringMap, element) => {\n if (stringMap.size) {\n let setVal = allPreStyleElements.get(element);\n if (!setVal) {\n allPreStyleElements.set(element, setVal = new Set());\n }\n stringMap.forEach((_, prop) => setVal.add(prop));\n }\n });\n instruction.postStyleProps.forEach((stringMap, element) => {\n let setVal = allPostStyleElements.get(element);\n if (!setVal) {\n allPostStyleElements.set(element, setVal = new Set());\n }\n stringMap.forEach((_, prop) => setVal.add(prop));\n });\n });\n }\n if (erroneousTransitions.length) {\n const errors = [];\n erroneousTransitions.forEach(instruction => {\n errors.push(transitionFailed(instruction.triggerName, instruction.errors));\n });\n allPlayers.forEach(player => player.destroy());\n this.reportError(errors);\n }\n const allPreviousPlayersMap = new Map();\n // this map tells us which element in the DOM tree is contained by\n // which animation. Further down this map will get populated once\n // the players are built and in doing so we can use it to efficiently\n // figure out if a sub player is skipped due to a parent player having priority.\n const animationElementMap = new Map();\n queuedInstructions.forEach(entry => {\n const element = entry.element;\n if (subTimelines.has(element)) {\n animationElementMap.set(element, element);\n this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);\n }\n });\n skippedPlayers.forEach(player => {\n const element = player.element;\n const previousPlayers = this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);\n previousPlayers.forEach(prevPlayer => {\n getOrSetDefaultValue(allPreviousPlayersMap, element, []).push(prevPlayer);\n prevPlayer.destroy();\n });\n });\n // this is a special case for nodes that will be removed either by\n // having their own leave animations or by being queried in a container\n // that will be removed once a parent animation is complete. The idea\n // here is that * styles must be identical to ! styles because of\n // backwards compatibility (* is also filled in by default in many places).\n // Otherwise * styles will return an empty value or \"auto\" since the element\n // passed to getComputedStyle will not be visible (since * === destination)\n const replaceNodes = allLeaveNodes.filter(node => {\n return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);\n });\n // POST STAGE: fill the * styles\n const postStylesMap = new Map();\n const allLeaveQueriedNodes = cloakAndComputeStyles(postStylesMap, this.driver, leaveNodesWithoutAnimations, allPostStyleElements, AUTO_STYLE);\n allLeaveQueriedNodes.forEach(node => {\n if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {\n replaceNodes.push(node);\n }\n });\n // PRE STAGE: fill the ! styles\n const preStylesMap = new Map();\n enterNodeMap.forEach((nodes, root) => {\n cloakAndComputeStyles(preStylesMap, this.driver, new Set(nodes), allPreStyleElements, ɵPRE_STYLE);\n });\n replaceNodes.forEach(node => {\n const post = postStylesMap.get(node);\n const pre = preStylesMap.get(node);\n postStylesMap.set(node, new Map([...(post?.entries() ?? []), ...(pre?.entries() ?? [])]));\n });\n const rootPlayers = [];\n const subPlayers = [];\n const NO_PARENT_ANIMATION_ELEMENT_DETECTED = {};\n queuedInstructions.forEach(entry => {\n const {\n element,\n player,\n instruction\n } = entry;\n // this means that it was never consumed by a parent animation which\n // means that it is independent and therefore should be set for animation\n if (subTimelines.has(element)) {\n if (disabledElementsSet.has(element)) {\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n player.disabled = true;\n player.overrideTotalTime(instruction.totalTime);\n skippedPlayers.push(player);\n return;\n }\n // this will flow up the DOM and query the map to figure out\n // if a parent animation has priority over it. In the situation\n // that a parent is detected then it will cancel the loop. If\n // nothing is detected, or it takes a few hops to find a parent,\n // then it will fill in the missing nodes and signal them as having\n // a detected parent (or a NO_PARENT value via a special constant).\n let parentWithAnimation = NO_PARENT_ANIMATION_ELEMENT_DETECTED;\n if (animationElementMap.size > 1) {\n let elm = element;\n const parentsToAdd = [];\n while (elm = elm.parentNode) {\n const detectedParent = animationElementMap.get(elm);\n if (detectedParent) {\n parentWithAnimation = detectedParent;\n break;\n }\n parentsToAdd.push(elm);\n }\n parentsToAdd.forEach(parent => animationElementMap.set(parent, parentWithAnimation));\n }\n const innerPlayer = this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap);\n player.setRealPlayer(innerPlayer);\n if (parentWithAnimation === NO_PARENT_ANIMATION_ELEMENT_DETECTED) {\n rootPlayers.push(player);\n } else {\n const parentPlayers = this.playersByElement.get(parentWithAnimation);\n if (parentPlayers && parentPlayers.length) {\n player.parentPlayer = optimizeGroupPlayer(parentPlayers);\n }\n skippedPlayers.push(player);\n }\n } else {\n eraseStyles(element, instruction.fromStyles);\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n // there still might be a ancestor player animating this\n // element therefore we will still add it as a sub player\n // even if its animation may be disabled\n subPlayers.push(player);\n if (disabledElementsSet.has(element)) {\n skippedPlayers.push(player);\n }\n }\n });\n // find all of the sub players' corresponding inner animation players\n subPlayers.forEach(player => {\n // even if no players are found for a sub animation it\n // will still complete itself after the next tick since it's Noop\n const playersForElement = skippedPlayersMap.get(player.element);\n if (playersForElement && playersForElement.length) {\n const innerPlayer = optimizeGroupPlayer(playersForElement);\n player.setRealPlayer(innerPlayer);\n }\n });\n // the reason why we don't actually play the animation is\n // because all that a skipped player is designed to do is to\n // fire the start/done transition callback events\n skippedPlayers.forEach(player => {\n if (player.parentPlayer) {\n player.syncPlayerEvents(player.parentPlayer);\n } else {\n player.destroy();\n }\n });\n // run through all of the queued removals and see if they\n // were picked up by a query. If not then perform the removal\n // operation right away unless a parent animation is ongoing.\n for (let i = 0; i < allLeaveNodes.length; i++) {\n const element = allLeaveNodes[i];\n const details = element[REMOVAL_FLAG];\n removeClass(element, LEAVE_CLASSNAME);\n // this means the element has a removal animation that is being\n // taken care of and therefore the inner elements will hang around\n // until that animation is over (or the parent queried animation)\n if (details && details.hasAnimation) continue;\n let players = [];\n // if this element is queried or if it contains queried children\n // then we want for the element not to be removed from the page\n // until the queried animations have finished\n if (queriedElements.size) {\n let queriedPlayerResults = queriedElements.get(element);\n if (queriedPlayerResults && queriedPlayerResults.length) {\n players.push(...queriedPlayerResults);\n }\n let queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);\n for (let j = 0; j < queriedInnerElements.length; j++) {\n let queriedPlayers = queriedElements.get(queriedInnerElements[j]);\n if (queriedPlayers && queriedPlayers.length) {\n players.push(...queriedPlayers);\n }\n }\n }\n const activePlayers = players.filter(p => !p.destroyed);\n if (activePlayers.length) {\n removeNodesAfterAnimationDone(this, element, activePlayers);\n } else {\n this.processLeaveNode(element);\n }\n }\n // this is required so the cleanup method doesn't remove them\n allLeaveNodes.length = 0;\n rootPlayers.forEach(player => {\n this.players.push(player);\n player.onDone(() => {\n player.destroy();\n const index = this.players.indexOf(player);\n this.players.splice(index, 1);\n });\n player.play();\n });\n return rootPlayers;\n }\n afterFlush(callback) {\n this._flushFns.push(callback);\n }\n afterFlushAnimationsDone(callback) {\n this._whenQuietFns.push(callback);\n }\n _getPreviousPlayers(element, isQueriedElement, namespaceId, triggerName, toStateValue) {\n let players = [];\n if (isQueriedElement) {\n const queriedElementPlayers = this.playersByQueriedElement.get(element);\n if (queriedElementPlayers) {\n players = queriedElementPlayers;\n }\n } else {\n const elementPlayers = this.playersByElement.get(element);\n if (elementPlayers) {\n const isRemovalAnimation = !toStateValue || toStateValue == VOID_VALUE;\n elementPlayers.forEach(player => {\n if (player.queued) return;\n if (!isRemovalAnimation && player.triggerName != triggerName) return;\n players.push(player);\n });\n }\n }\n if (namespaceId || triggerName) {\n players = players.filter(player => {\n if (namespaceId && namespaceId != player.namespaceId) return false;\n if (triggerName && triggerName != player.triggerName) return false;\n return true;\n });\n }\n return players;\n }\n _beforeAnimationBuild(namespaceId, instruction, allPreviousPlayersMap) {\n const triggerName = instruction.triggerName;\n const rootElement = instruction.element;\n // when a removal animation occurs, ALL previous players are collected\n // and destroyed (even if they are outside of the current namespace)\n const targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId;\n const targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName;\n for (const timelineInstruction of instruction.timelines) {\n const element = timelineInstruction.element;\n const isQueriedElement = element !== rootElement;\n const players = getOrSetDefaultValue(allPreviousPlayersMap, element, []);\n const previousPlayers = this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);\n previousPlayers.forEach(player => {\n const realPlayer = player.getRealPlayer();\n if (realPlayer.beforeDestroy) {\n realPlayer.beforeDestroy();\n }\n player.destroy();\n players.push(player);\n });\n }\n // this needs to be done so that the PRE/POST styles can be\n // computed properly without interfering with the previous animation\n eraseStyles(rootElement, instruction.fromStyles);\n }\n _buildAnimation(namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) {\n const triggerName = instruction.triggerName;\n const rootElement = instruction.element;\n // we first run this so that the previous animation player\n // data can be passed into the successive animation players\n const allQueriedPlayers = [];\n const allConsumedElements = new Set();\n const allSubElements = new Set();\n const allNewPlayers = instruction.timelines.map(timelineInstruction => {\n const element = timelineInstruction.element;\n allConsumedElements.add(element);\n // FIXME (matsko): make sure to-be-removed animations are removed properly\n const details = element[REMOVAL_FLAG];\n if (details && details.removedBeforeQueried) return new NoopAnimationPlayer(timelineInstruction.duration, timelineInstruction.delay);\n const isQueriedElement = element !== rootElement;\n const previousPlayers = flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY).map(p => p.getRealPlayer())).filter(p => {\n // the `element` is not apart of the AnimationPlayer definition, but\n // Mock/WebAnimations\n // use the element within their implementation. This will be added in Angular5 to\n // AnimationPlayer\n const pp = p;\n return pp.element ? pp.element === element : false;\n });\n const preStyles = preStylesMap.get(element);\n const postStyles = postStylesMap.get(element);\n const keyframes = normalizeKeyframes$1(this._normalizer, timelineInstruction.keyframes, preStyles, postStyles);\n const player = this._buildPlayer(timelineInstruction, keyframes, previousPlayers);\n // this means that this particular player belongs to a sub trigger. It is\n // important that we match this player up with the corresponding (@trigger.listener)\n if (timelineInstruction.subTimeline && skippedPlayersMap) {\n allSubElements.add(element);\n }\n if (isQueriedElement) {\n const wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);\n wrappedPlayer.setRealPlayer(player);\n allQueriedPlayers.push(wrappedPlayer);\n }\n return player;\n });\n allQueriedPlayers.forEach(player => {\n getOrSetDefaultValue(this.playersByQueriedElement, player.element, []).push(player);\n player.onDone(() => deleteOrUnsetInMap(this.playersByQueriedElement, player.element, player));\n });\n allConsumedElements.forEach(element => addClass(element, NG_ANIMATING_CLASSNAME));\n const player = optimizeGroupPlayer(allNewPlayers);\n player.onDestroy(() => {\n allConsumedElements.forEach(element => removeClass(element, NG_ANIMATING_CLASSNAME));\n setStyles(rootElement, instruction.toStyles);\n });\n // this basically makes all of the callbacks for sub element animations\n // be dependent on the upper players for when they finish\n allSubElements.forEach(element => {\n getOrSetDefaultValue(skippedPlayersMap, element, []).push(player);\n });\n return player;\n }\n _buildPlayer(instruction, keyframes, previousPlayers) {\n if (keyframes.length > 0) {\n return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers);\n }\n // special case for when an empty transition|definition is provided\n // ... there is no point in rendering an empty animation\n return new NoopAnimationPlayer(instruction.duration, instruction.delay);\n }\n}\nclass TransitionAnimationPlayer {\n namespaceId;\n triggerName;\n element;\n _player = /*#__PURE__*/new NoopAnimationPlayer();\n _containsRealPlayer = false;\n _queuedCallbacks = /*#__PURE__*/new Map();\n destroyed = false;\n parentPlayer = null;\n markedForDestroy = false;\n disabled = false;\n queued = true;\n totalTime = 0;\n constructor(namespaceId, triggerName, element) {\n this.namespaceId = namespaceId;\n this.triggerName = triggerName;\n this.element = element;\n }\n setRealPlayer(player) {\n if (this._containsRealPlayer) return;\n this._player = player;\n this._queuedCallbacks.forEach((callbacks, phase) => {\n callbacks.forEach(callback => listenOnPlayer(player, phase, undefined, callback));\n });\n this._queuedCallbacks.clear();\n this._containsRealPlayer = true;\n this.overrideTotalTime(player.totalTime);\n this.queued = false;\n }\n getRealPlayer() {\n return this._player;\n }\n overrideTotalTime(totalTime) {\n this.totalTime = totalTime;\n }\n syncPlayerEvents(player) {\n const p = this._player;\n if (p.triggerCallback) {\n player.onStart(() => p.triggerCallback('start'));\n }\n player.onDone(() => this.finish());\n player.onDestroy(() => this.destroy());\n }\n _queueEvent(name, callback) {\n getOrSetDefaultValue(this._queuedCallbacks, name, []).push(callback);\n }\n onDone(fn) {\n if (this.queued) {\n this._queueEvent('done', fn);\n }\n this._player.onDone(fn);\n }\n onStart(fn) {\n if (this.queued) {\n this._queueEvent('start', fn);\n }\n this._player.onStart(fn);\n }\n onDestroy(fn) {\n if (this.queued) {\n this._queueEvent('destroy', fn);\n }\n this._player.onDestroy(fn);\n }\n init() {\n this._player.init();\n }\n hasStarted() {\n return this.queued ? false : this._player.hasStarted();\n }\n play() {\n !this.queued && this._player.play();\n }\n pause() {\n !this.queued && this._player.pause();\n }\n restart() {\n !this.queued && this._player.restart();\n }\n finish() {\n this._player.finish();\n }\n destroy() {\n this.destroyed = true;\n this._player.destroy();\n }\n reset() {\n !this.queued && this._player.reset();\n }\n setPosition(p) {\n if (!this.queued) {\n this._player.setPosition(p);\n }\n }\n getPosition() {\n return this.queued ? 0 : this._player.getPosition();\n }\n /** @internal */\n triggerCallback(phaseName) {\n const p = this._player;\n if (p.triggerCallback) {\n p.triggerCallback(phaseName);\n }\n }\n}\nfunction deleteOrUnsetInMap(map, key, value) {\n let currentValues = map.get(key);\n if (currentValues) {\n if (currentValues.length) {\n const index = currentValues.indexOf(value);\n currentValues.splice(index, 1);\n }\n if (currentValues.length == 0) {\n map.delete(key);\n }\n }\n return currentValues;\n}\nfunction normalizeTriggerValue(value) {\n // we use `!= null` here because it's the most simple\n // way to test against a \"falsy\" value without mixing\n // in empty strings or a zero value. DO NOT OPTIMIZE.\n return value != null ? value : null;\n}\nfunction isElementNode(node) {\n return node && node['nodeType'] === 1;\n}\nfunction isTriggerEventValid(eventName) {\n return eventName == 'start' || eventName == 'done';\n}\nfunction cloakElement(element, value) {\n const oldValue = element.style.display;\n element.style.display = value != null ? value : 'none';\n return oldValue;\n}\nfunction cloakAndComputeStyles(valuesMap, driver, elements, elementPropsMap, defaultStyle) {\n const cloakVals = [];\n elements.forEach(element => cloakVals.push(cloakElement(element)));\n const failedElements = [];\n elementPropsMap.forEach((props, element) => {\n const styles = new Map();\n props.forEach(prop => {\n const value = driver.computeStyle(element, prop, defaultStyle);\n styles.set(prop, value);\n // there is no easy way to detect this because a sub element could be removed\n // by a parent animation element being detached.\n if (!value || value.length == 0) {\n element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;\n failedElements.push(element);\n }\n });\n valuesMap.set(element, styles);\n });\n // we use a index variable here since Set.forEach(a, i) does not return\n // an index value for the closure (but instead just the value)\n let i = 0;\n elements.forEach(element => cloakElement(element, cloakVals[i++]));\n return failedElements;\n}\n/*\nSince the Angular renderer code will return a collection of inserted\nnodes in all areas of a DOM tree, it's up to this algorithm to figure\nout which nodes are roots for each animation @trigger.\n\nBy placing each inserted node into a Set and traversing upwards, it\nis possible to find the @trigger elements and well any direct *star\ninsertion nodes, if a @trigger root is found then the enter element\nis placed into the Map[@trigger] spot.\n */\nfunction buildRootMap(roots, nodes) {\n const rootMap = new Map();\n roots.forEach(root => rootMap.set(root, []));\n if (nodes.length == 0) return rootMap;\n const NULL_NODE = 1;\n const nodeSet = new Set(nodes);\n const localRootMap = new Map();\n function getRoot(node) {\n if (!node) return NULL_NODE;\n let root = localRootMap.get(node);\n if (root) return root;\n const parent = node.parentNode;\n if (rootMap.has(parent)) {\n // ngIf inside @trigger\n root = parent;\n } else if (nodeSet.has(parent)) {\n // ngIf inside ngIf\n root = NULL_NODE;\n } else {\n // recurse upwards\n root = getRoot(parent);\n }\n localRootMap.set(node, root);\n return root;\n }\n nodes.forEach(node => {\n const root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root).push(node);\n }\n });\n return rootMap;\n}\nfunction addClass(element, className) {\n element.classList?.add(className);\n}\nfunction removeClass(element, className) {\n element.classList?.remove(className);\n}\nfunction removeNodesAfterAnimationDone(engine, element, players) {\n optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));\n}\nfunction flattenGroupPlayers(players) {\n const finalPlayers = [];\n _flattenGroupPlayersRecur(players, finalPlayers);\n return finalPlayers;\n}\nfunction _flattenGroupPlayersRecur(players, finalPlayers) {\n for (let i = 0; i < players.length; i++) {\n const player = players[i];\n if (player instanceof ɵAnimationGroupPlayer) {\n _flattenGroupPlayersRecur(player.players, finalPlayers);\n } else {\n finalPlayers.push(player);\n }\n }\n}\nfunction objEquals(a, b) {\n const k1 = Object.keys(a);\n const k2 = Object.keys(b);\n if (k1.length != k2.length) return false;\n for (let i = 0; i < k1.length; i++) {\n const prop = k1[i];\n if (!b.hasOwnProperty(prop) || a[prop] !== b[prop]) return false;\n }\n return true;\n}\nfunction replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElements) {\n const postEntry = allPostStyleElements.get(element);\n if (!postEntry) return false;\n let preEntry = allPreStyleElements.get(element);\n if (preEntry) {\n postEntry.forEach(data => preEntry.add(data));\n } else {\n allPreStyleElements.set(element, postEntry);\n }\n allPostStyleElements.delete(element);\n return true;\n}\nclass AnimationEngine {\n _driver;\n _normalizer;\n _transitionEngine;\n _timelineEngine;\n _triggerCache = {};\n // this method is designed to be overridden by the code that uses this engine\n onRemovalComplete = (element, context) => {};\n constructor(doc, _driver, _normalizer) {\n this._driver = _driver;\n this._normalizer = _normalizer;\n this._transitionEngine = new TransitionAnimationEngine(doc.body, _driver, _normalizer);\n this._timelineEngine = new TimelineAnimationEngine(doc.body, _driver, _normalizer);\n this._transitionEngine.onRemovalComplete = (element, context) => this.onRemovalComplete(element, context);\n }\n registerTrigger(componentId, namespaceId, hostElement, name, metadata) {\n const cacheKey = componentId + '-' + name;\n let trigger = this._triggerCache[cacheKey];\n if (!trigger) {\n const errors = [];\n const warnings = [];\n const ast = buildAnimationAst(this._driver, metadata, errors, warnings);\n if (errors.length) {\n throw triggerBuildFailed(name, errors);\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (warnings.length) {\n warnTriggerBuild(name, warnings);\n }\n }\n trigger = buildTrigger(name, ast, this._normalizer);\n this._triggerCache[cacheKey] = trigger;\n }\n this._transitionEngine.registerTrigger(namespaceId, name, trigger);\n }\n register(namespaceId, hostElement) {\n this._transitionEngine.register(namespaceId, hostElement);\n }\n destroy(namespaceId, context) {\n this._transitionEngine.destroy(namespaceId, context);\n }\n onInsert(namespaceId, element, parent, insertBefore) {\n this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);\n }\n onRemove(namespaceId, element, context) {\n this._transitionEngine.removeNode(namespaceId, element, context);\n }\n disableAnimations(element, disable) {\n this._transitionEngine.markElementAsDisabled(element, disable);\n }\n process(namespaceId, element, property, value) {\n if (property.charAt(0) == '@') {\n const [id, action] = parseTimelineCommand(property);\n const args = value;\n this._timelineEngine.command(id, element, action, args);\n } else {\n this._transitionEngine.trigger(namespaceId, element, property, value);\n }\n }\n listen(namespaceId, element, eventName, eventPhase, callback) {\n // @@listen\n if (eventName.charAt(0) == '@') {\n const [id, action] = parseTimelineCommand(eventName);\n return this._timelineEngine.listen(id, element, action, callback);\n }\n return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);\n }\n flush(microtaskId = -1) {\n this._transitionEngine.flush(microtaskId);\n }\n get players() {\n return [...this._transitionEngine.players, ...this._timelineEngine.players];\n }\n whenRenderingDone() {\n return this._transitionEngine.whenRenderingDone();\n }\n afterFlushAnimationsDone(cb) {\n this._transitionEngine.afterFlushAnimationsDone(cb);\n }\n}\n\n/**\n * Returns an instance of `SpecialCasedStyles` if and when any special (non animateable) styles are\n * detected.\n *\n * In CSS there exist properties that cannot be animated within a keyframe animation\n * (whether it be via CSS keyframes or web-animations) and the animation implementation\n * will ignore them. This function is designed to detect those special cased styles and\n * return a container that will be executed at the start and end of the animation.\n *\n * @returns an instance of `SpecialCasedStyles` if any special styles are detected otherwise `null`\n */\nfunction packageNonAnimatableStyles(element, styles) {\n let startStyles = null;\n let endStyles = null;\n if (Array.isArray(styles) && styles.length) {\n startStyles = filterNonAnimatableStyles(styles[0]);\n if (styles.length > 1) {\n endStyles = filterNonAnimatableStyles(styles[styles.length - 1]);\n }\n } else if (styles instanceof Map) {\n startStyles = filterNonAnimatableStyles(styles);\n }\n return startStyles || endStyles ? new SpecialCasedStyles(element, startStyles, endStyles) : null;\n}\n/**\n * Designed to be executed during a keyframe-based animation to apply any special-cased styles.\n *\n * When started (when the `start()` method is run) then the provided `startStyles`\n * will be applied. When finished (when the `finish()` method is called) the\n * `endStyles` will be applied as well any any starting styles. Finally when\n * `destroy()` is called then all styles will be removed.\n */\nlet SpecialCasedStyles = /*#__PURE__*/(() => {\n class SpecialCasedStyles {\n _element;\n _startStyles;\n _endStyles;\n static initialStylesByElement = /* @__PURE__ */new WeakMap();\n _state = 0 /* SpecialCasedStylesState.Pending */;\n _initialStyles;\n constructor(_element, _startStyles, _endStyles) {\n this._element = _element;\n this._startStyles = _startStyles;\n this._endStyles = _endStyles;\n let initialStyles = SpecialCasedStyles.initialStylesByElement.get(_element);\n if (!initialStyles) {\n SpecialCasedStyles.initialStylesByElement.set(_element, initialStyles = new Map());\n }\n this._initialStyles = initialStyles;\n }\n start() {\n if (this._state < 1 /* SpecialCasedStylesState.Started */) {\n if (this._startStyles) {\n setStyles(this._element, this._startStyles, this._initialStyles);\n }\n this._state = 1 /* SpecialCasedStylesState.Started */;\n }\n }\n finish() {\n this.start();\n if (this._state < 2 /* SpecialCasedStylesState.Finished */) {\n setStyles(this._element, this._initialStyles);\n if (this._endStyles) {\n setStyles(this._element, this._endStyles);\n this._endStyles = null;\n }\n this._state = 1 /* SpecialCasedStylesState.Started */;\n }\n }\n destroy() {\n this.finish();\n if (this._state < 3 /* SpecialCasedStylesState.Destroyed */) {\n SpecialCasedStyles.initialStylesByElement.delete(this._element);\n if (this._startStyles) {\n eraseStyles(this._element, this._startStyles);\n this._endStyles = null;\n }\n if (this._endStyles) {\n eraseStyles(this._element, this._endStyles);\n this._endStyles = null;\n }\n setStyles(this._element, this._initialStyles);\n this._state = 3 /* SpecialCasedStylesState.Destroyed */;\n }\n }\n }\n return SpecialCasedStyles;\n})();\nfunction filterNonAnimatableStyles(styles) {\n let result = null;\n styles.forEach((val, prop) => {\n if (isNonAnimatableStyle(prop)) {\n result = result || new Map();\n result.set(prop, val);\n }\n });\n return result;\n}\nfunction isNonAnimatableStyle(prop) {\n return prop === 'display' || prop === 'position';\n}\nclass WebAnimationsPlayer {\n element;\n keyframes;\n options;\n _specialStyles;\n _onDoneFns = [];\n _onStartFns = [];\n _onDestroyFns = [];\n _duration;\n _delay;\n _initialized = false;\n _finished = false;\n _started = false;\n _destroyed = false;\n _finalKeyframe;\n // the following original fns are persistent copies of the _onStartFns and _onDoneFns\n // and are used to reset the fns to their original values upon reset()\n // (since the _onStartFns and _onDoneFns get deleted after they are called)\n _originalOnDoneFns = [];\n _originalOnStartFns = [];\n // using non-null assertion because it's re(set) by init();\n domPlayer;\n time = 0;\n parentPlayer = null;\n currentSnapshot = /*#__PURE__*/new Map();\n constructor(element, keyframes, options, _specialStyles) {\n this.element = element;\n this.keyframes = keyframes;\n this.options = options;\n this._specialStyles = _specialStyles;\n this._duration = options['duration'];\n this._delay = options['delay'] || 0;\n this.time = this._duration + this._delay;\n }\n _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n init() {\n this._buildPlayer();\n this._preparePlayerBeforeStart();\n }\n _buildPlayer() {\n if (this._initialized) return;\n this._initialized = true;\n const keyframes = this.keyframes;\n // @ts-expect-error overwriting a readonly property\n this.domPlayer = this._triggerWebAnimation(this.element, keyframes, this.options);\n this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : new Map();\n const onFinish = () => this._onFinish();\n this.domPlayer.addEventListener('finish', onFinish);\n this.onDestroy(() => {\n // We must remove the `finish` event listener once an animation has completed all its\n // iterations. This action is necessary to prevent a memory leak since the listener captures\n // `this`, creating a closure that prevents `this` from being garbage collected.\n this.domPlayer.removeEventListener('finish', onFinish);\n });\n }\n _preparePlayerBeforeStart() {\n // this is required so that the player doesn't start to animate right away\n if (this._delay) {\n this._resetDomPlayerState();\n } else {\n this.domPlayer.pause();\n }\n }\n _convertKeyframesToObject(keyframes) {\n const kfs = [];\n keyframes.forEach(frame => {\n kfs.push(Object.fromEntries(frame));\n });\n return kfs;\n }\n /** @internal */\n _triggerWebAnimation(element, keyframes, options) {\n return element.animate(this._convertKeyframesToObject(keyframes), options);\n }\n onStart(fn) {\n this._originalOnStartFns.push(fn);\n this._onStartFns.push(fn);\n }\n onDone(fn) {\n this._originalOnDoneFns.push(fn);\n this._onDoneFns.push(fn);\n }\n onDestroy(fn) {\n this._onDestroyFns.push(fn);\n }\n play() {\n this._buildPlayer();\n if (!this.hasStarted()) {\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n this._started = true;\n if (this._specialStyles) {\n this._specialStyles.start();\n }\n }\n this.domPlayer.play();\n }\n pause() {\n this.init();\n this.domPlayer.pause();\n }\n finish() {\n this.init();\n if (this._specialStyles) {\n this._specialStyles.finish();\n }\n this._onFinish();\n this.domPlayer.finish();\n }\n reset() {\n this._resetDomPlayerState();\n this._destroyed = false;\n this._finished = false;\n this._started = false;\n this._onStartFns = this._originalOnStartFns;\n this._onDoneFns = this._originalOnDoneFns;\n }\n _resetDomPlayerState() {\n if (this.domPlayer) {\n this.domPlayer.cancel();\n }\n }\n restart() {\n this.reset();\n this.play();\n }\n hasStarted() {\n return this._started;\n }\n destroy() {\n if (!this._destroyed) {\n this._destroyed = true;\n this._resetDomPlayerState();\n this._onFinish();\n if (this._specialStyles) {\n this._specialStyles.destroy();\n }\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n setPosition(p) {\n if (this.domPlayer === undefined) {\n this.init();\n }\n this.domPlayer.currentTime = p * this.time;\n }\n getPosition() {\n // tsc is complaining with TS2362 without the conversion to number\n return +(this.domPlayer.currentTime ?? 0) / this.time;\n }\n get totalTime() {\n return this._delay + this._duration;\n }\n beforeDestroy() {\n const styles = new Map();\n if (this.hasStarted()) {\n // note: this code is invoked only when the `play` function was called prior to this\n // (thus `hasStarted` returns true), this implies that the code that initializes\n // `_finalKeyframe` has also been executed and the non-null assertion can be safely used here\n const finalKeyframe = this._finalKeyframe;\n finalKeyframe.forEach((val, prop) => {\n if (prop !== 'offset') {\n styles.set(prop, this._finished ? val : computeStyle(this.element, prop));\n }\n });\n }\n this.currentSnapshot = styles;\n }\n /** @internal */\n triggerCallback(phaseName) {\n const methods = phaseName === 'start' ? this._onStartFns : this._onDoneFns;\n methods.forEach(fn => fn());\n methods.length = 0;\n }\n}\nclass WebAnimationsDriver {\n validateStyleProperty(prop) {\n // Perform actual validation in dev mode only, in prod mode this check is a noop.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n return validateStyleProperty(prop);\n }\n return true;\n }\n validateAnimatableStyleProperty(prop) {\n // Perform actual validation in dev mode only, in prod mode this check is a noop.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const cssProp = camelCaseToDashCase(prop);\n return validateWebAnimatableStyleProperty(cssProp);\n }\n return true;\n }\n containsElement(elm1, elm2) {\n return containsElement(elm1, elm2);\n }\n getParentElement(element) {\n return getParentElement(element);\n }\n query(element, selector, multi) {\n return invokeQuery(element, selector, multi);\n }\n computeStyle(element, prop, defaultValue) {\n return computeStyle(element, prop);\n }\n animate(element, keyframes, duration, delay, easing, previousPlayers = []) {\n const fill = delay == 0 ? 'both' : 'forwards';\n const playerOptions = {\n duration,\n delay,\n fill\n };\n // we check for this to avoid having a null|undefined value be present\n // for the easing (which results in an error for certain browsers #9752)\n if (easing) {\n playerOptions['easing'] = easing;\n }\n const previousStyles = new Map();\n const previousWebAnimationPlayers = previousPlayers.filter(player => player instanceof WebAnimationsPlayer);\n if (allowPreviousPlayerStylesMerge(duration, delay)) {\n previousWebAnimationPlayers.forEach(player => {\n player.currentSnapshot.forEach((val, prop) => previousStyles.set(prop, val));\n });\n }\n let _keyframes = normalizeKeyframes(keyframes).map(styles => new Map(styles));\n _keyframes = balancePreviousStylesIntoKeyframes(element, _keyframes, previousStyles);\n const specialStyles = packageNonAnimatableStyles(element, _keyframes);\n return new WebAnimationsPlayer(element, _keyframes, playerOptions, specialStyles);\n }\n}\nfunction createEngine(type, doc) {\n // TODO: find a way to make this tree shakable.\n if (type === 'noop') {\n return new AnimationEngine(doc, new NoopAnimationDriver(), new NoopAnimationStyleNormalizer());\n }\n return new AnimationEngine(doc, new WebAnimationsDriver(), new WebAnimationsStyleNormalizer());\n}\nclass Animation {\n _driver;\n _animationAst;\n constructor(_driver, input) {\n this._driver = _driver;\n const errors = [];\n const warnings = [];\n const ast = buildAnimationAst(_driver, input, errors, warnings);\n if (errors.length) {\n throw validationFailed(errors);\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (warnings.length) {\n warnValidation(warnings);\n }\n }\n this._animationAst = ast;\n }\n buildTimelines(element, startingStyles, destinationStyles, options, subInstructions) {\n const start = Array.isArray(startingStyles) ? normalizeStyles(startingStyles) : startingStyles;\n const dest = Array.isArray(destinationStyles) ? normalizeStyles(destinationStyles) : destinationStyles;\n const errors = [];\n subInstructions = subInstructions || new ElementInstructionMap();\n const result = buildAnimationTimelines(this._driver, element, this._animationAst, ENTER_CLASSNAME, LEAVE_CLASSNAME, start, dest, options, subInstructions, errors);\n if (errors.length) {\n throw buildingFailed(errors);\n }\n return result;\n }\n}\nconst ANIMATION_PREFIX = '@';\nconst DISABLE_ANIMATIONS_FLAG = '@.disabled';\nclass BaseAnimationRenderer {\n namespaceId;\n delegate;\n engine;\n _onDestroy;\n // We need to explicitly type this property because of an api-extractor bug\n // See https://github.com/microsoft/rushstack/issues/4390\n ɵtype = 0 /* AnimationRendererType.Regular */;\n constructor(namespaceId, delegate, engine, _onDestroy) {\n this.namespaceId = namespaceId;\n this.delegate = delegate;\n this.engine = engine;\n this._onDestroy = _onDestroy;\n }\n get data() {\n return this.delegate.data;\n }\n destroyNode(node) {\n this.delegate.destroyNode?.(node);\n }\n destroy() {\n this.engine.destroy(this.namespaceId, this.delegate);\n this.engine.afterFlushAnimationsDone(() => {\n // Call the renderer destroy method after the animations has finished as otherwise\n // styles will be removed too early which will cause an unstyled animation.\n queueMicrotask(() => {\n this.delegate.destroy();\n });\n });\n this._onDestroy?.();\n }\n createElement(name, namespace) {\n return this.delegate.createElement(name, namespace);\n }\n createComment(value) {\n return this.delegate.createComment(value);\n }\n createText(value) {\n return this.delegate.createText(value);\n }\n appendChild(parent, newChild) {\n this.delegate.appendChild(parent, newChild);\n this.engine.onInsert(this.namespaceId, newChild, parent, false);\n }\n insertBefore(parent, newChild, refChild, isMove = true) {\n this.delegate.insertBefore(parent, newChild, refChild);\n // If `isMove` true than we should animate this insert.\n this.engine.onInsert(this.namespaceId, newChild, parent, isMove);\n }\n removeChild(parent, oldChild, isHostElement) {\n // Prior to the changes in #57203, this method wasn't being called at all by `core` if the child\n // doesn't have a parent. There appears to be some animation-specific downstream logic that\n // depends on the null check happening before the animation engine. This check keeps the old\n // behavior while allowing `core` to not have to check for the parent element anymore.\n if (this.parentNode(oldChild)) {\n this.engine.onRemove(this.namespaceId, oldChild, this.delegate);\n }\n }\n selectRootElement(selectorOrNode, preserveContent) {\n return this.delegate.selectRootElement(selectorOrNode, preserveContent);\n }\n parentNode(node) {\n return this.delegate.parentNode(node);\n }\n nextSibling(node) {\n return this.delegate.nextSibling(node);\n }\n setAttribute(el, name, value, namespace) {\n this.delegate.setAttribute(el, name, value, namespace);\n }\n removeAttribute(el, name, namespace) {\n this.delegate.removeAttribute(el, name, namespace);\n }\n addClass(el, name) {\n this.delegate.addClass(el, name);\n }\n removeClass(el, name) {\n this.delegate.removeClass(el, name);\n }\n setStyle(el, style, value, flags) {\n this.delegate.setStyle(el, style, value, flags);\n }\n removeStyle(el, style, flags) {\n this.delegate.removeStyle(el, style, flags);\n }\n setProperty(el, name, value) {\n if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) {\n this.disableAnimations(el, !!value);\n } else {\n this.delegate.setProperty(el, name, value);\n }\n }\n setValue(node, value) {\n this.delegate.setValue(node, value);\n }\n listen(target, eventName, callback, options) {\n return this.delegate.listen(target, eventName, callback, options);\n }\n disableAnimations(element, value) {\n this.engine.disableAnimations(element, value);\n }\n}\nclass AnimationRenderer extends BaseAnimationRenderer {\n factory;\n constructor(factory, namespaceId, delegate, engine, onDestroy) {\n super(namespaceId, delegate, engine, onDestroy);\n this.factory = factory;\n this.namespaceId = namespaceId;\n }\n setProperty(el, name, value) {\n if (name.charAt(0) == ANIMATION_PREFIX) {\n if (name.charAt(1) == '.' && name == DISABLE_ANIMATIONS_FLAG) {\n value = value === undefined ? true : !!value;\n this.disableAnimations(el, value);\n } else {\n this.engine.process(this.namespaceId, el, name.slice(1), value);\n }\n } else {\n this.delegate.setProperty(el, name, value);\n }\n }\n listen(target, eventName, callback, options) {\n if (eventName.charAt(0) == ANIMATION_PREFIX) {\n const element = resolveElementFromTarget(target);\n let name = eventName.slice(1);\n let phase = '';\n // @listener.phase is for trigger animation callbacks\n // @@listener is for animation builder callbacks\n if (name.charAt(0) != ANIMATION_PREFIX) {\n [name, phase] = parseTriggerCallbackName(name);\n }\n return this.engine.listen(this.namespaceId, element, name, phase, event => {\n const countId = event['_data'] || -1;\n this.factory.scheduleListenerCallback(countId, callback, event);\n });\n }\n return this.delegate.listen(target, eventName, callback, options);\n }\n}\nfunction resolveElementFromTarget(target) {\n switch (target) {\n case 'body':\n return document.body;\n case 'document':\n return document;\n case 'window':\n return window;\n default:\n return target;\n }\n}\nfunction parseTriggerCallbackName(triggerName) {\n const dotIndex = triggerName.indexOf('.');\n const trigger = triggerName.substring(0, dotIndex);\n const phase = triggerName.slice(dotIndex + 1);\n return [trigger, phase];\n}\nclass AnimationRendererFactory {\n delegate;\n engine;\n _zone;\n _currentId = 0;\n _microtaskId = 1;\n _animationCallbacksBuffer = [];\n _rendererCache = /*#__PURE__*/new Map();\n _cdRecurDepth = 0;\n constructor(delegate, engine, _zone) {\n this.delegate = delegate;\n this.engine = engine;\n this._zone = _zone;\n engine.onRemovalComplete = (element, delegate) => {\n delegate?.removeChild(null, element);\n };\n }\n createRenderer(hostElement, type) {\n const EMPTY_NAMESPACE_ID = '';\n // cache the delegates to find out which cached delegate can\n // be used by which cached renderer\n const delegate = this.delegate.createRenderer(hostElement, type);\n if (!hostElement || !type?.data?.['animation']) {\n const cache = this._rendererCache;\n let renderer = cache.get(delegate);\n if (!renderer) {\n // Ensure that the renderer is removed from the cache on destroy\n // since it may contain references to detached DOM nodes.\n const onRendererDestroy = () => cache.delete(delegate);\n renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine, onRendererDestroy);\n // only cache this result when the base renderer is used\n cache.set(delegate, renderer);\n }\n return renderer;\n }\n const componentId = type.id;\n const namespaceId = type.id + '-' + this._currentId;\n this._currentId++;\n this.engine.register(namespaceId, hostElement);\n const registerTrigger = trigger => {\n if (Array.isArray(trigger)) {\n trigger.forEach(registerTrigger);\n } else {\n this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger);\n }\n };\n const animationTriggers = type.data['animation'];\n animationTriggers.forEach(registerTrigger);\n return new AnimationRenderer(this, namespaceId, delegate, this.engine);\n }\n begin() {\n this._cdRecurDepth++;\n if (this.delegate.begin) {\n this.delegate.begin();\n }\n }\n _scheduleCountTask() {\n queueMicrotask(() => {\n this._microtaskId++;\n });\n }\n /** @internal */\n scheduleListenerCallback(count, fn, data) {\n if (count >= 0 && count < this._microtaskId) {\n this._zone.run(() => fn(data));\n return;\n }\n const animationCallbacksBuffer = this._animationCallbacksBuffer;\n if (animationCallbacksBuffer.length == 0) {\n queueMicrotask(() => {\n this._zone.run(() => {\n animationCallbacksBuffer.forEach(tuple => {\n const [fn, data] = tuple;\n fn(data);\n });\n this._animationCallbacksBuffer = [];\n });\n });\n }\n animationCallbacksBuffer.push([fn, data]);\n }\n end() {\n this._cdRecurDepth--;\n // this is to prevent animations from running twice when an inner\n // component does CD when a parent component instead has inserted it\n if (this._cdRecurDepth == 0) {\n this._zone.runOutsideAngular(() => {\n this._scheduleCountTask();\n this.engine.flush(this._microtaskId);\n });\n }\n if (this.delegate.end) {\n this.delegate.end();\n }\n }\n whenRenderingDone() {\n return this.engine.whenRenderingDone();\n }\n /**\n * Used during HMR to clear any cached data about a component.\n * @param componentId ID of the component that is being replaced.\n */\n componentReplaced(componentId) {\n // Flush the engine since the renderer destruction waits for animations to be done.\n this.engine.flush();\n this.delegate.componentReplaced?.(componentId);\n }\n}\n\n/**\n * @module\n * @description\n * Entry point for all animation APIs of the animation browser package.\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file is not used to build this module. It is only used during editing\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { AnimationDriver, NoopAnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, BaseAnimationRenderer as ɵBaseAnimationRenderer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, camelCaseToDashCase as ɵcamelCaseToDashCase, containsElement as ɵcontainsElement, createEngine as ɵcreateEngine, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, normalizeKeyframes as ɵnormalizeKeyframes, validateStyleProperty as ɵvalidateStyleProperty, validateWebAnimatableStyleProperty as ɵvalidateWebAnimatableStyleProperty };\n","/**\n * @license Angular v19.1.5\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { Injectable, Inject, RendererFactory2, NgZone, ANIMATION_MODULE_TYPE, NgModule, ɵperformanceMarkFeature } from '@angular/core';\nexport { ANIMATION_MODULE_TYPE } from '@angular/core';\nimport { ɵDomRendererFactory2, BrowserModule } from '@angular/platform-browser';\nimport * as i1 from '@angular/animations/browser';\nimport { ɵAnimationEngine, ɵWebAnimationsStyleNormalizer, ɵAnimationRendererFactory, ɵAnimationStyleNormalizer, AnimationDriver, ɵWebAnimationsDriver, NoopAnimationDriver } from '@angular/animations/browser';\nimport { DOCUMENT } from '@angular/common';\nlet InjectableAnimationEngine = /*#__PURE__*/(() => {\n class InjectableAnimationEngine extends ɵAnimationEngine {\n // The `ApplicationRef` is injected here explicitly to force the dependency ordering.\n // Since the `ApplicationRef` should be created earlier before the `AnimationEngine`, they\n // both have `ngOnDestroy` hooks and `flush()` must be called after all views are destroyed.\n constructor(doc, driver, normalizer) {\n super(doc, driver, normalizer);\n }\n ngOnDestroy() {\n this.flush();\n }\n static ɵfac = function InjectableAnimationEngine_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || InjectableAnimationEngine)(i0.ɵɵinject(DOCUMENT), i0.ɵɵinject(i1.AnimationDriver), i0.ɵɵinject(i1.ɵAnimationStyleNormalizer));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: InjectableAnimationEngine,\n factory: InjectableAnimationEngine.ɵfac\n });\n }\n return InjectableAnimationEngine;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nfunction instantiateDefaultStyleNormalizer() {\n return new ɵWebAnimationsStyleNormalizer();\n}\nfunction instantiateRendererFactory(renderer, engine, zone) {\n return new ɵAnimationRendererFactory(renderer, engine, zone);\n}\nconst SHARED_ANIMATION_PROVIDERS = [{\n provide: ɵAnimationStyleNormalizer,\n useFactory: instantiateDefaultStyleNormalizer\n}, {\n provide: ɵAnimationEngine,\n useClass: InjectableAnimationEngine\n}, {\n provide: RendererFactory2,\n useFactory: instantiateRendererFactory,\n deps: [ɵDomRendererFactory2, ɵAnimationEngine, NgZone]\n}];\n/**\n * Separate providers from the actual module so that we can do a local modification in Google3 to\n * include them in the BrowserModule.\n */\nconst BROWSER_ANIMATIONS_PROVIDERS = [{\n provide: AnimationDriver,\n useFactory: () => new ɵWebAnimationsDriver()\n}, {\n provide: ANIMATION_MODULE_TYPE,\n useValue: 'BrowserAnimations'\n}, ...SHARED_ANIMATION_PROVIDERS];\n/**\n * Separate providers from the actual module so that we can do a local modification in Google3 to\n * include them in the BrowserTestingModule.\n */\nconst BROWSER_NOOP_ANIMATIONS_PROVIDERS = [{\n provide: AnimationDriver,\n useClass: NoopAnimationDriver\n}, {\n provide: ANIMATION_MODULE_TYPE,\n useValue: 'NoopAnimations'\n}, ...SHARED_ANIMATION_PROVIDERS];\n\n/**\n * Exports `BrowserModule` with additional dependency-injection providers\n * for use with animations. See [Animations](guide/animations).\n * @publicApi\n */\nlet BrowserAnimationsModule = /*#__PURE__*/(() => {\n class BrowserAnimationsModule {\n /**\n * Configures the module based on the specified object.\n *\n * @param config Object used to configure the behavior of the `BrowserAnimationsModule`.\n * @see {@link BrowserAnimationsModuleConfig}\n *\n * @usageNotes\n * When registering the `BrowserAnimationsModule`, you can use the `withConfig`\n * function as follows:\n * ```ts\n * @NgModule({\n * imports: [BrowserAnimationsModule.withConfig(config)]\n * })\n * class MyNgModule {}\n * ```\n */\n static withConfig(config) {\n return {\n ngModule: BrowserAnimationsModule,\n providers: config.disableAnimations ? BROWSER_NOOP_ANIMATIONS_PROVIDERS : BROWSER_ANIMATIONS_PROVIDERS\n };\n }\n static ɵfac = function BrowserAnimationsModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || BrowserAnimationsModule)();\n };\n static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: BrowserAnimationsModule\n });\n static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n providers: BROWSER_ANIMATIONS_PROVIDERS,\n imports: [BrowserModule]\n });\n }\n return BrowserAnimationsModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Returns the set of dependency-injection providers\n * to enable animations in an application. See [animations guide](guide/animations)\n * to learn more about animations in Angular.\n *\n * @usageNotes\n *\n * The function is useful when you want to enable animations in an application\n * bootstrapped using the `bootstrapApplication` function. In this scenario there\n * is no need to import the `BrowserAnimationsModule` NgModule at all, just add\n * providers returned by this function to the `providers` list as show below.\n *\n * ```ts\n * bootstrapApplication(RootComponent, {\n * providers: [\n * provideAnimations()\n * ]\n * });\n * ```\n *\n * @publicApi\n */\nfunction provideAnimations() {\n ɵperformanceMarkFeature('NgEagerAnimations');\n // Return a copy to prevent changes to the original array in case any in-place\n // alterations are performed to the `provideAnimations` call results in app code.\n return [...BROWSER_ANIMATIONS_PROVIDERS];\n}\n/**\n * A null player that must be imported to allow disabling of animations.\n * @publicApi\n */\nlet NoopAnimationsModule = /*#__PURE__*/(() => {\n class NoopAnimationsModule {\n static ɵfac = function NoopAnimationsModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NoopAnimationsModule)();\n };\n static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: NoopAnimationsModule\n });\n static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({\n providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,\n imports: [BrowserModule]\n });\n }\n return NoopAnimationsModule;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Returns the set of dependency-injection providers\n * to disable animations in an application. See [animations guide](guide/animations)\n * to learn more about animations in Angular.\n *\n * @usageNotes\n *\n * The function is useful when you want to bootstrap an application using\n * the `bootstrapApplication` function, but you need to disable animations\n * (for example, when running tests).\n *\n * ```ts\n * bootstrapApplication(RootComponent, {\n * providers: [\n * provideNoopAnimations()\n * ]\n * });\n * ```\n *\n * @publicApi\n */\nfunction provideNoopAnimations() {\n // Return a copy to prevent changes to the original array in case any in-place\n // alterations are performed to the `provideNoopAnimations` call results in app code.\n return [...BROWSER_NOOP_ANIMATIONS_PROVIDERS];\n}\n\n/**\n * @module\n * @description\n * Entry point for all animation APIs of the animation browser package.\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\n\n// This file is not used to build this module. It is only used during editing\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BrowserAnimationsModule, NoopAnimationsModule, provideAnimations, provideNoopAnimations, InjectableAnimationEngine as ɵInjectableAnimationEngine };\n","import * as i0 from '@angular/core';\nimport { InjectionToken, inject, NgZone, Injectable, Inject, makeEnvironmentProviders, NgModule } from '@angular/core';\nimport * as i2 from '@ngrx/store';\nimport { ActionsSubject, UPDATE, INIT, INITIAL_STATE, StateObservable, ReducerManagerDispatcher } from '@ngrx/store';\nimport { EMPTY, Observable, of, merge, queueScheduler, ReplaySubject } from 'rxjs';\nimport { share, filter, map, concatMap, timeout, debounceTime, catchError, take, takeUntil, switchMap, skip, observeOn, withLatestFrom, scan } from 'rxjs/operators';\nimport { toSignal } from '@angular/core/rxjs-interop';\nconst PERFORM_ACTION = 'PERFORM_ACTION';\nconst REFRESH = 'REFRESH';\nconst RESET = 'RESET';\nconst ROLLBACK = 'ROLLBACK';\nconst COMMIT = 'COMMIT';\nconst SWEEP = 'SWEEP';\nconst TOGGLE_ACTION = 'TOGGLE_ACTION';\nconst SET_ACTIONS_ACTIVE = 'SET_ACTIONS_ACTIVE';\nconst JUMP_TO_STATE = 'JUMP_TO_STATE';\nconst JUMP_TO_ACTION = 'JUMP_TO_ACTION';\nconst IMPORT_STATE = 'IMPORT_STATE';\nconst LOCK_CHANGES = 'LOCK_CHANGES';\nconst PAUSE_RECORDING = 'PAUSE_RECORDING';\nclass PerformAction {\n constructor(action, timestamp) {\n this.action = action;\n this.timestamp = timestamp;\n this.type = PERFORM_ACTION;\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n }\n}\nclass Refresh {\n constructor() {\n this.type = REFRESH;\n }\n}\nclass Reset {\n constructor(timestamp) {\n this.timestamp = timestamp;\n this.type = RESET;\n }\n}\nclass Rollback {\n constructor(timestamp) {\n this.timestamp = timestamp;\n this.type = ROLLBACK;\n }\n}\nclass Commit {\n constructor(timestamp) {\n this.timestamp = timestamp;\n this.type = COMMIT;\n }\n}\nclass Sweep {\n constructor() {\n this.type = SWEEP;\n }\n}\nclass ToggleAction {\n constructor(id) {\n this.id = id;\n this.type = TOGGLE_ACTION;\n }\n}\nclass SetActionsActive {\n constructor(start, end, active = true) {\n this.start = start;\n this.end = end;\n this.active = active;\n this.type = SET_ACTIONS_ACTIVE;\n }\n}\nclass JumpToState {\n constructor(index) {\n this.index = index;\n this.type = JUMP_TO_STATE;\n }\n}\nclass JumpToAction {\n constructor(actionId) {\n this.actionId = actionId;\n this.type = JUMP_TO_ACTION;\n }\n}\nclass ImportState {\n constructor(nextLiftedState) {\n this.nextLiftedState = nextLiftedState;\n this.type = IMPORT_STATE;\n }\n}\nclass LockChanges {\n constructor(status) {\n this.status = status;\n this.type = LOCK_CHANGES;\n }\n}\nclass PauseRecording {\n constructor(status) {\n this.status = status;\n this.type = PAUSE_RECORDING;\n }\n}\n\n/**\n * Chrome extension documentation\n * @see https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md\n * Firefox extension documentation\n * @see https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md\n */\nclass StoreDevtoolsConfig {\n constructor() {\n /**\n * Maximum allowed actions to be stored in the history tree (default: `false`)\n */\n this.maxAge = false;\n }\n}\nconst STORE_DEVTOOLS_CONFIG = new InjectionToken('@ngrx/store-devtools Options');\n/**\n * Used to provide a `StoreDevtoolsConfig` for the store-devtools.\n */\nconst INITIAL_OPTIONS = new InjectionToken('@ngrx/store-devtools Initial Config');\nfunction noMonitor() {\n return null;\n}\nconst DEFAULT_NAME = 'NgRx Store DevTools';\nfunction createConfig(optionsInput) {\n const DEFAULT_OPTIONS = {\n maxAge: false,\n monitor: noMonitor,\n actionSanitizer: undefined,\n stateSanitizer: undefined,\n name: DEFAULT_NAME,\n serialize: false,\n logOnly: false,\n autoPause: false,\n trace: false,\n traceLimit: 75,\n // Add all features explicitly. This prevent buggy behavior for\n // options like \"lock\" which might otherwise not show up.\n features: {\n pause: true,\n // Start/pause recording of dispatched actions\n lock: true,\n // Lock/unlock dispatching actions and side effects\n persist: true,\n // Persist states on page reloading\n export: true,\n // Export history of actions in a file\n import: 'custom',\n // Import history of actions from a file\n jump: true,\n // Jump back and forth (time travelling)\n skip: true,\n // Skip (cancel) actions\n reorder: true,\n // Drag and drop actions in the history list\n dispatch: true,\n // Dispatch custom actions or action creators\n test: true // Generate tests for the selected actions\n },\n connectInZone: false\n };\n const options = typeof optionsInput === 'function' ? optionsInput() : optionsInput;\n const logOnly = options.logOnly ? {\n pause: true,\n export: true,\n test: true\n } : false;\n const features = options.features || logOnly || DEFAULT_OPTIONS.features;\n if (features.import === true) {\n features.import = 'custom';\n }\n const config = Object.assign({}, DEFAULT_OPTIONS, {\n features\n }, options);\n if (config.maxAge && config.maxAge < 2) {\n throw new Error(`Devtools 'maxAge' cannot be less than 2, got ${config.maxAge}`);\n }\n return config;\n}\nfunction difference(first, second) {\n return first.filter(item => second.indexOf(item) < 0);\n}\n/**\n * Provides an app's view into the state of the lifted store.\n */\nfunction unliftState(liftedState) {\n const {\n computedStates,\n currentStateIndex\n } = liftedState;\n // At start up NgRx dispatches init actions,\n // When these init actions are being filtered out by the predicate or safe/block list options\n // we don't have a complete computed states yet.\n // At this point it could happen that we're out of bounds, when this happens we fall back to the last known state\n if (currentStateIndex >= computedStates.length) {\n const {\n state\n } = computedStates[computedStates.length - 1];\n return state;\n }\n const {\n state\n } = computedStates[currentStateIndex];\n return state;\n}\nfunction unliftAction(liftedState) {\n return liftedState.actionsById[liftedState.nextActionId - 1];\n}\n/**\n * Lifts an app's action into an action on the lifted store.\n */\nfunction liftAction(action) {\n return new PerformAction(action, +Date.now());\n}\n/**\n * Sanitizes given actions with given function.\n */\nfunction sanitizeActions(actionSanitizer, actions) {\n return Object.keys(actions).reduce((sanitizedActions, actionIdx) => {\n const idx = Number(actionIdx);\n sanitizedActions[idx] = sanitizeAction(actionSanitizer, actions[idx], idx);\n return sanitizedActions;\n }, {});\n}\n/**\n * Sanitizes given action with given function.\n */\nfunction sanitizeAction(actionSanitizer, action, actionIdx) {\n return {\n ...action,\n action: actionSanitizer(action.action, actionIdx)\n };\n}\n/**\n * Sanitizes given states with given function.\n */\nfunction sanitizeStates(stateSanitizer, states) {\n return states.map((computedState, idx) => ({\n state: sanitizeState(stateSanitizer, computedState.state, idx),\n error: computedState.error\n }));\n}\n/**\n * Sanitizes given state with given function.\n */\nfunction sanitizeState(stateSanitizer, state, stateIdx) {\n return stateSanitizer(state, stateIdx);\n}\n/**\n * Read the config and tell if actions should be filtered\n */\nfunction shouldFilterActions(config) {\n return config.predicate || config.actionsSafelist || config.actionsBlocklist;\n}\n/**\n * Return a full filtered lifted state\n */\nfunction filterLiftedState(liftedState, predicate, safelist, blocklist) {\n const filteredStagedActionIds = [];\n const filteredActionsById = {};\n const filteredComputedStates = [];\n liftedState.stagedActionIds.forEach((id, idx) => {\n const liftedAction = liftedState.actionsById[id];\n if (!liftedAction) return;\n if (idx && isActionFiltered(liftedState.computedStates[idx], liftedAction, predicate, safelist, blocklist)) {\n return;\n }\n filteredActionsById[id] = liftedAction;\n filteredStagedActionIds.push(id);\n filteredComputedStates.push(liftedState.computedStates[idx]);\n });\n return {\n ...liftedState,\n stagedActionIds: filteredStagedActionIds,\n actionsById: filteredActionsById,\n computedStates: filteredComputedStates\n };\n}\n/**\n * Return true is the action should be ignored\n */\nfunction isActionFiltered(state, action, predicate, safelist, blockedlist) {\n const predicateMatch = predicate && !predicate(state, action.action);\n const safelistMatch = safelist && !action.action.type.match(safelist.map(s => escapeRegExp(s)).join('|'));\n const blocklistMatch = blockedlist && action.action.type.match(blockedlist.map(s => escapeRegExp(s)).join('|'));\n return predicateMatch || safelistMatch || blocklistMatch;\n}\n/**\n * Return string with escaped RegExp special characters\n * https://stackoverflow.com/a/6969486/1337347\n */\nfunction escapeRegExp(s) {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nfunction injectZoneConfig(connectInZone) {\n const ngZone = connectInZone ? inject(NgZone) : null;\n return {\n ngZone,\n connectInZone\n };\n}\nlet DevtoolsDispatcher = /*#__PURE__*/(() => {\n class DevtoolsDispatcher extends ActionsSubject {\n /** @nocollapse */static {\n this.ɵfac = /* @__PURE__ */(() => {\n let ɵDevtoolsDispatcher_BaseFactory;\n return function DevtoolsDispatcher_Factory(__ngFactoryType__) {\n return (ɵDevtoolsDispatcher_BaseFactory || (ɵDevtoolsDispatcher_BaseFactory = i0.ɵɵgetInheritedFactory(DevtoolsDispatcher)))(__ngFactoryType__ || DevtoolsDispatcher);\n };\n })();\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: DevtoolsDispatcher,\n factory: DevtoolsDispatcher.ɵfac\n });\n }\n }\n return DevtoolsDispatcher;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nconst ExtensionActionTypes = {\n START: 'START',\n DISPATCH: 'DISPATCH',\n STOP: 'STOP',\n ACTION: 'ACTION'\n};\nconst REDUX_DEVTOOLS_EXTENSION = new InjectionToken('@ngrx/store-devtools Redux Devtools Extension');\nlet DevtoolsExtension = /*#__PURE__*/(() => {\n class DevtoolsExtension {\n constructor(devtoolsExtension, config, dispatcher) {\n this.config = config;\n this.dispatcher = dispatcher;\n this.zoneConfig = injectZoneConfig(this.config.connectInZone);\n this.devtoolsExtension = devtoolsExtension;\n this.createActionStreams();\n }\n notify(action, state) {\n if (!this.devtoolsExtension) {\n return;\n }\n // Check to see if the action requires a full update of the liftedState.\n // If it is a simple action generated by the user's app and the recording\n // is not locked/paused, only send the action and the current state (fast).\n //\n // A full liftedState update (slow: serializes the entire liftedState) is\n // only required when:\n // a) redux-devtools-extension fires the @@Init action (ignored by\n // @ngrx/store-devtools)\n // b) an action is generated by an @ngrx module (e.g. @ngrx/effects/init\n // or @ngrx/store/update-reducers)\n // c) the state has been recomputed due to time-traveling\n // d) any action that is not a PerformAction to err on the side of\n // caution.\n if (action.type === PERFORM_ACTION) {\n if (state.isLocked || state.isPaused) {\n return;\n }\n const currentState = unliftState(state);\n if (shouldFilterActions(this.config) && isActionFiltered(currentState, action, this.config.predicate, this.config.actionsSafelist, this.config.actionsBlocklist)) {\n return;\n }\n const sanitizedState = this.config.stateSanitizer ? sanitizeState(this.config.stateSanitizer, currentState, state.currentStateIndex) : currentState;\n const sanitizedAction = this.config.actionSanitizer ? sanitizeAction(this.config.actionSanitizer, action, state.nextActionId) : action;\n this.sendToReduxDevtools(() => this.extensionConnection.send(sanitizedAction, sanitizedState));\n } else {\n // Requires full state update\n const sanitizedLiftedState = {\n ...state,\n stagedActionIds: state.stagedActionIds,\n actionsById: this.config.actionSanitizer ? sanitizeActions(this.config.actionSanitizer, state.actionsById) : state.actionsById,\n computedStates: this.config.stateSanitizer ? sanitizeStates(this.config.stateSanitizer, state.computedStates) : state.computedStates\n };\n this.sendToReduxDevtools(() => this.devtoolsExtension.send(null, sanitizedLiftedState, this.getExtensionConfig(this.config)));\n }\n }\n createChangesObservable() {\n if (!this.devtoolsExtension) {\n return EMPTY;\n }\n return new Observable(subscriber => {\n const connection = this.zoneConfig.connectInZone ?\n // To reduce change detection cycles, we need to run the `connect` method\n // outside of the Angular zone. The `connect` method adds a `message`\n // event listener to communicate with an extension using `window.postMessage`\n // and handle message events.\n this.zoneConfig.ngZone.runOutsideAngular(() => this.devtoolsExtension.connect(this.getExtensionConfig(this.config))) : this.devtoolsExtension.connect(this.getExtensionConfig(this.config));\n this.extensionConnection = connection;\n connection.init();\n connection.subscribe(change => subscriber.next(change));\n return connection.unsubscribe;\n });\n }\n createActionStreams() {\n // Listens to all changes\n const changes$ = this.createChangesObservable().pipe(share());\n // Listen for the start action\n const start$ = changes$.pipe(filter(change => change.type === ExtensionActionTypes.START));\n // Listen for the stop action\n const stop$ = changes$.pipe(filter(change => change.type === ExtensionActionTypes.STOP));\n // Listen for lifted actions\n const liftedActions$ = changes$.pipe(filter(change => change.type === ExtensionActionTypes.DISPATCH), map(change => this.unwrapAction(change.payload)), concatMap(action => {\n if (action.type === IMPORT_STATE) {\n // State imports may happen in two situations:\n // 1. Explicitly by user\n // 2. User activated the \"persist state accross reloads\" option\n // and now the state is imported during reload.\n // Because of option 2, we need to give possible\n // lazy loaded reducers time to instantiate.\n // As soon as there is no UPDATE action within 1 second,\n // it is assumed that all reducers are loaded.\n return this.dispatcher.pipe(filter(action => action.type === UPDATE), timeout(1000), debounceTime(1000), map(() => action), catchError(() => of(action)), take(1));\n } else {\n return of(action);\n }\n }));\n // Listen for unlifted actions\n const actions$ = changes$.pipe(filter(change => change.type === ExtensionActionTypes.ACTION), map(change => this.unwrapAction(change.payload)));\n const actionsUntilStop$ = actions$.pipe(takeUntil(stop$));\n const liftedUntilStop$ = liftedActions$.pipe(takeUntil(stop$));\n this.start$ = start$.pipe(takeUntil(stop$));\n // Only take the action sources between the start/stop events\n this.actions$ = this.start$.pipe(switchMap(() => actionsUntilStop$));\n this.liftedActions$ = this.start$.pipe(switchMap(() => liftedUntilStop$));\n }\n unwrapAction(action) {\n // indirect eval according to https://esbuild.github.io/content-types/#direct-eval\n return typeof action === 'string' ? (0, eval)(`(${action})`) : action;\n }\n getExtensionConfig(config) {\n const extensionOptions = {\n name: config.name,\n features: config.features,\n serialize: config.serialize,\n autoPause: config.autoPause ?? false,\n trace: config.trace ?? false,\n traceLimit: config.traceLimit ?? 75\n // The action/state sanitizers are not added to the config\n // because sanitation is done in this class already.\n // It is done before sending it to the devtools extension for consistency:\n // - If we call extensionConnection.send(...),\n // the extension would call the sanitizers.\n // - If we call devtoolsExtension.send(...) (aka full state update),\n // the extension would NOT call the sanitizers, so we have to do it ourselves.\n };\n if (config.maxAge !== false /* support === 0 */) {\n extensionOptions.maxAge = config.maxAge;\n }\n return extensionOptions;\n }\n sendToReduxDevtools(send) {\n try {\n send();\n } catch (err) {\n console.warn('@ngrx/store-devtools: something went wrong inside the redux devtools', err);\n }\n }\n /** @nocollapse */\n static {\n this.ɵfac = function DevtoolsExtension_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || DevtoolsExtension)(i0.ɵɵinject(REDUX_DEVTOOLS_EXTENSION), i0.ɵɵinject(STORE_DEVTOOLS_CONFIG), i0.ɵɵinject(DevtoolsDispatcher));\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: DevtoolsExtension,\n factory: DevtoolsExtension.ɵfac\n });\n }\n }\n return DevtoolsExtension;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nconst INIT_ACTION = {\n type: INIT\n};\nconst RECOMPUTE = '@ngrx/store-devtools/recompute';\nconst RECOMPUTE_ACTION = {\n type: RECOMPUTE\n};\n/**\n * Computes the next entry in the log by applying an action.\n */\nfunction computeNextEntry(reducer, action, state, error, errorHandler) {\n if (error) {\n return {\n state,\n error: 'Interrupted by an error up the chain'\n };\n }\n let nextState = state;\n let nextError;\n try {\n nextState = reducer(state, action);\n } catch (err) {\n nextError = err.toString();\n errorHandler.handleError(err);\n }\n return {\n state: nextState,\n error: nextError\n };\n}\n/**\n * Runs the reducer on invalidated actions to get a fresh computation log.\n */\nfunction recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused) {\n // Optimization: exit early and return the same reference\n // if we know nothing could have changed.\n if (minInvalidatedStateIndex >= computedStates.length && computedStates.length === stagedActionIds.length) {\n return computedStates;\n }\n const nextComputedStates = computedStates.slice(0, minInvalidatedStateIndex);\n // If the recording is paused, recompute all states up until the pause state,\n // else recompute all states.\n const lastIncludedActionId = stagedActionIds.length - (isPaused ? 1 : 0);\n for (let i = minInvalidatedStateIndex; i < lastIncludedActionId; i++) {\n const actionId = stagedActionIds[i];\n const action = actionsById[actionId].action;\n const previousEntry = nextComputedStates[i - 1];\n const previousState = previousEntry ? previousEntry.state : committedState;\n const previousError = previousEntry ? previousEntry.error : undefined;\n const shouldSkip = skippedActionIds.indexOf(actionId) > -1;\n const entry = shouldSkip ? previousEntry : computeNextEntry(reducer, action, previousState, previousError, errorHandler);\n nextComputedStates.push(entry);\n }\n // If the recording is paused, the last state will not be recomputed,\n // because it's essentially not part of the state history.\n if (isPaused) {\n nextComputedStates.push(computedStates[computedStates.length - 1]);\n }\n return nextComputedStates;\n}\nfunction liftInitialState(initialCommittedState, monitorReducer) {\n return {\n monitorState: monitorReducer(undefined, {}),\n nextActionId: 1,\n actionsById: {\n 0: liftAction(INIT_ACTION)\n },\n stagedActionIds: [0],\n skippedActionIds: [],\n committedState: initialCommittedState,\n currentStateIndex: 0,\n computedStates: [],\n isLocked: false,\n isPaused: false\n };\n}\n/**\n * Creates a history state reducer from an app's reducer.\n */\nfunction liftReducerWith(initialCommittedState, initialLiftedState, errorHandler, monitorReducer, options = {}) {\n /**\n * Manages how the history actions modify the history state.\n */\n return reducer => (liftedState, liftedAction) => {\n let {\n monitorState,\n actionsById,\n nextActionId,\n stagedActionIds,\n skippedActionIds,\n committedState,\n currentStateIndex,\n computedStates,\n isLocked,\n isPaused\n } = liftedState || initialLiftedState;\n if (!liftedState) {\n // Prevent mutating initialLiftedState\n actionsById = Object.create(actionsById);\n }\n function commitExcessActions(n) {\n // Auto-commits n-number of excess actions.\n let excess = n;\n let idsToDelete = stagedActionIds.slice(1, excess + 1);\n for (let i = 0; i < idsToDelete.length; i++) {\n if (computedStates[i + 1].error) {\n // Stop if error is found. Commit actions up to error.\n excess = i;\n idsToDelete = stagedActionIds.slice(1, excess + 1);\n break;\n } else {\n delete actionsById[idsToDelete[i]];\n }\n }\n skippedActionIds = skippedActionIds.filter(id => idsToDelete.indexOf(id) === -1);\n stagedActionIds = [0, ...stagedActionIds.slice(excess + 1)];\n committedState = computedStates[excess].state;\n computedStates = computedStates.slice(excess);\n currentStateIndex = currentStateIndex > excess ? currentStateIndex - excess : 0;\n }\n function commitChanges() {\n // Consider the last committed state the new starting point.\n // Squash any staged actions into a single committed state.\n actionsById = {\n 0: liftAction(INIT_ACTION)\n };\n nextActionId = 1;\n stagedActionIds = [0];\n skippedActionIds = [];\n committedState = computedStates[currentStateIndex].state;\n currentStateIndex = 0;\n computedStates = [];\n }\n // By default, aggressively recompute every state whatever happens.\n // This has O(n) performance, so we'll override this to a sensible\n // value whenever we feel like we don't have to recompute the states.\n let minInvalidatedStateIndex = 0;\n switch (liftedAction.type) {\n case LOCK_CHANGES:\n {\n isLocked = liftedAction.status;\n minInvalidatedStateIndex = Infinity;\n break;\n }\n case PAUSE_RECORDING:\n {\n isPaused = liftedAction.status;\n if (isPaused) {\n // Add a pause action to signal the devtools-user the recording is paused.\n // The corresponding state will be overwritten on each update to always contain\n // the latest state (see Actions.PERFORM_ACTION).\n stagedActionIds = [...stagedActionIds, nextActionId];\n actionsById[nextActionId] = new PerformAction({\n type: '@ngrx/devtools/pause'\n }, +Date.now());\n nextActionId++;\n minInvalidatedStateIndex = stagedActionIds.length - 1;\n computedStates = computedStates.concat(computedStates[computedStates.length - 1]);\n if (currentStateIndex === stagedActionIds.length - 2) {\n currentStateIndex++;\n }\n minInvalidatedStateIndex = Infinity;\n } else {\n commitChanges();\n }\n break;\n }\n case RESET:\n {\n // Get back to the state the store was created with.\n actionsById = {\n 0: liftAction(INIT_ACTION)\n };\n nextActionId = 1;\n stagedActionIds = [0];\n skippedActionIds = [];\n committedState = initialCommittedState;\n currentStateIndex = 0;\n computedStates = [];\n break;\n }\n case COMMIT:\n {\n commitChanges();\n break;\n }\n case ROLLBACK:\n {\n // Forget about any staged actions.\n // Start again from the last committed state.\n actionsById = {\n 0: liftAction(INIT_ACTION)\n };\n nextActionId = 1;\n stagedActionIds = [0];\n skippedActionIds = [];\n currentStateIndex = 0;\n computedStates = [];\n break;\n }\n case TOGGLE_ACTION:\n {\n // Toggle whether an action with given ID is skipped.\n // Being skipped means it is a no-op during the computation.\n const {\n id: actionId\n } = liftedAction;\n const index = skippedActionIds.indexOf(actionId);\n if (index === -1) {\n skippedActionIds = [actionId, ...skippedActionIds];\n } else {\n skippedActionIds = skippedActionIds.filter(id => id !== actionId);\n }\n // Optimization: we know history before this action hasn't changed\n minInvalidatedStateIndex = stagedActionIds.indexOf(actionId);\n break;\n }\n case SET_ACTIONS_ACTIVE:\n {\n // Toggle whether an action with given ID is skipped.\n // Being skipped means it is a no-op during the computation.\n const {\n start,\n end,\n active\n } = liftedAction;\n const actionIds = [];\n for (let i = start; i < end; i++) actionIds.push(i);\n if (active) {\n skippedActionIds = difference(skippedActionIds, actionIds);\n } else {\n skippedActionIds = [...skippedActionIds, ...actionIds];\n }\n // Optimization: we know history before this action hasn't changed\n minInvalidatedStateIndex = stagedActionIds.indexOf(start);\n break;\n }\n case JUMP_TO_STATE:\n {\n // Without recomputing anything, move the pointer that tell us\n // which state is considered the current one. Useful for sliders.\n currentStateIndex = liftedAction.index;\n // Optimization: we know the history has not changed.\n minInvalidatedStateIndex = Infinity;\n break;\n }\n case JUMP_TO_ACTION:\n {\n // Jumps to a corresponding state to a specific action.\n // Useful when filtering actions.\n const index = stagedActionIds.indexOf(liftedAction.actionId);\n if (index !== -1) currentStateIndex = index;\n minInvalidatedStateIndex = Infinity;\n break;\n }\n case SWEEP:\n {\n // Forget any actions that are currently being skipped.\n stagedActionIds = difference(stagedActionIds, skippedActionIds);\n skippedActionIds = [];\n currentStateIndex = Math.min(currentStateIndex, stagedActionIds.length - 1);\n break;\n }\n case PERFORM_ACTION:\n {\n // Ignore action and return state as is if recording is locked\n if (isLocked) {\n return liftedState || initialLiftedState;\n }\n if (isPaused || liftedState && isActionFiltered(liftedState.computedStates[currentStateIndex], liftedAction, options.predicate, options.actionsSafelist, options.actionsBlocklist)) {\n // If recording is paused or if the action should be ignored, overwrite the last state\n // (corresponds to the pause action) and keep everything else as is.\n // This way, the app gets the new current state while the devtools\n // do not record another action.\n const lastState = computedStates[computedStates.length - 1];\n computedStates = [...computedStates.slice(0, -1), computeNextEntry(reducer, liftedAction.action, lastState.state, lastState.error, errorHandler)];\n minInvalidatedStateIndex = Infinity;\n break;\n }\n // Auto-commit as new actions come in.\n if (options.maxAge && stagedActionIds.length === options.maxAge) {\n commitExcessActions(1);\n }\n if (currentStateIndex === stagedActionIds.length - 1) {\n currentStateIndex++;\n }\n const actionId = nextActionId++;\n // Mutation! This is the hottest path, and we optimize on purpose.\n // It is safe because we set a new key in a cache dictionary.\n actionsById[actionId] = liftedAction;\n stagedActionIds = [...stagedActionIds, actionId];\n // Optimization: we know that only the new action needs computing.\n minInvalidatedStateIndex = stagedActionIds.length - 1;\n break;\n }\n case IMPORT_STATE:\n {\n // Completely replace everything.\n ({\n monitorState,\n actionsById,\n nextActionId,\n stagedActionIds,\n skippedActionIds,\n committedState,\n currentStateIndex,\n computedStates,\n isLocked,\n isPaused\n } = liftedAction.nextLiftedState);\n break;\n }\n case INIT:\n {\n // Always recompute states on hot reload and init.\n minInvalidatedStateIndex = 0;\n if (options.maxAge && stagedActionIds.length > options.maxAge) {\n // States must be recomputed before committing excess.\n computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused);\n commitExcessActions(stagedActionIds.length - options.maxAge);\n // Avoid double computation.\n minInvalidatedStateIndex = Infinity;\n }\n break;\n }\n case UPDATE:\n {\n const stateHasErrors = computedStates.filter(state => state.error).length > 0;\n if (stateHasErrors) {\n // Recompute all states\n minInvalidatedStateIndex = 0;\n if (options.maxAge && stagedActionIds.length > options.maxAge) {\n // States must be recomputed before committing excess.\n computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused);\n commitExcessActions(stagedActionIds.length - options.maxAge);\n // Avoid double computation.\n minInvalidatedStateIndex = Infinity;\n }\n } else {\n // If not paused/locked, add a new action to signal devtools-user\n // that there was a reducer update.\n if (!isPaused && !isLocked) {\n if (currentStateIndex === stagedActionIds.length - 1) {\n currentStateIndex++;\n }\n // Add a new action to only recompute state\n const actionId = nextActionId++;\n actionsById[actionId] = new PerformAction(liftedAction, +Date.now());\n stagedActionIds = [...stagedActionIds, actionId];\n minInvalidatedStateIndex = stagedActionIds.length - 1;\n computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused);\n }\n // Recompute state history with latest reducer and update action\n computedStates = computedStates.map(cmp => ({\n ...cmp,\n state: reducer(cmp.state, RECOMPUTE_ACTION)\n }));\n currentStateIndex = stagedActionIds.length - 1;\n if (options.maxAge && stagedActionIds.length > options.maxAge) {\n commitExcessActions(stagedActionIds.length - options.maxAge);\n }\n // Avoid double computation.\n minInvalidatedStateIndex = Infinity;\n }\n break;\n }\n default:\n {\n // If the action is not recognized, it's a monitor action.\n // Optimization: a monitor action can't change history.\n minInvalidatedStateIndex = Infinity;\n break;\n }\n }\n computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, errorHandler, isPaused);\n monitorState = monitorReducer(monitorState, liftedAction);\n return {\n monitorState,\n actionsById,\n nextActionId,\n stagedActionIds,\n skippedActionIds,\n committedState,\n currentStateIndex,\n computedStates,\n isLocked,\n isPaused\n };\n };\n}\nlet StoreDevtools = /*#__PURE__*/(() => {\n class StoreDevtools {\n constructor(dispatcher, actions$, reducers$, extension, scannedActions, errorHandler, initialState, config) {\n const liftedInitialState = liftInitialState(initialState, config.monitor);\n const liftReducer = liftReducerWith(initialState, liftedInitialState, errorHandler, config.monitor, config);\n const liftedAction$ = merge(merge(actions$.asObservable().pipe(skip(1)), extension.actions$).pipe(map(liftAction)), dispatcher, extension.liftedActions$).pipe(observeOn(queueScheduler));\n const liftedReducer$ = reducers$.pipe(map(liftReducer));\n const zoneConfig = injectZoneConfig(config.connectInZone);\n const liftedStateSubject = new ReplaySubject(1);\n this.liftedStateSubscription = liftedAction$.pipe(withLatestFrom(liftedReducer$),\n // The extension would post messages back outside of the Angular zone\n // because we call `connect()` wrapped with `runOutsideAngular`. We run change\n // detection only once at the end after all the required asynchronous tasks have\n // been processed (for instance, `setInterval` scheduled by the `timeout` operator).\n // We have to re-enter the Angular zone before the `scan` since it runs the reducer\n // which must be run within the Angular zone.\n emitInZone(zoneConfig), scan(({\n state: liftedState\n }, [action, reducer]) => {\n let reducedLiftedState = reducer(liftedState, action);\n // On full state update\n // If we have actions filters, we must filter completely our lifted state to be sync with the extension\n if (action.type !== PERFORM_ACTION && shouldFilterActions(config)) {\n reducedLiftedState = filterLiftedState(reducedLiftedState, config.predicate, config.actionsSafelist, config.actionsBlocklist);\n }\n // Extension should be sent the sanitized lifted state\n extension.notify(action, reducedLiftedState);\n return {\n state: reducedLiftedState,\n action\n };\n }, {\n state: liftedInitialState,\n action: null\n })).subscribe(({\n state,\n action\n }) => {\n liftedStateSubject.next(state);\n if (action.type === PERFORM_ACTION) {\n const unliftedAction = action.action;\n scannedActions.next(unliftedAction);\n }\n });\n this.extensionStartSubscription = extension.start$.pipe(emitInZone(zoneConfig)).subscribe(() => {\n this.refresh();\n });\n const liftedState$ = liftedStateSubject.asObservable();\n const state$ = liftedState$.pipe(map(unliftState));\n Object.defineProperty(state$, 'state', {\n value: toSignal(state$, {\n manualCleanup: true,\n requireSync: true\n })\n });\n this.dispatcher = dispatcher;\n this.liftedState = liftedState$;\n this.state = state$;\n }\n ngOnDestroy() {\n // Even though the store devtools plugin is recommended to be\n // used only in development mode, it can still cause a memory leak\n // in microfrontend applications that are being created and destroyed\n // multiple times during development. This results in excessive memory\n // consumption, as it prevents entire apps from being garbage collected.\n this.liftedStateSubscription.unsubscribe();\n this.extensionStartSubscription.unsubscribe();\n }\n dispatch(action) {\n this.dispatcher.next(action);\n }\n next(action) {\n this.dispatcher.next(action);\n }\n error(error) {}\n complete() {}\n performAction(action) {\n this.dispatch(new PerformAction(action, +Date.now()));\n }\n refresh() {\n this.dispatch(new Refresh());\n }\n reset() {\n this.dispatch(new Reset(+Date.now()));\n }\n rollback() {\n this.dispatch(new Rollback(+Date.now()));\n }\n commit() {\n this.dispatch(new Commit(+Date.now()));\n }\n sweep() {\n this.dispatch(new Sweep());\n }\n toggleAction(id) {\n this.dispatch(new ToggleAction(id));\n }\n jumpToAction(actionId) {\n this.dispatch(new JumpToAction(actionId));\n }\n jumpToState(index) {\n this.dispatch(new JumpToState(index));\n }\n importState(nextLiftedState) {\n this.dispatch(new ImportState(nextLiftedState));\n }\n lockChanges(status) {\n this.dispatch(new LockChanges(status));\n }\n pauseRecording(status) {\n this.dispatch(new PauseRecording(status));\n }\n /** @nocollapse */\n static {\n this.ɵfac = function StoreDevtools_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || StoreDevtools)(i0.ɵɵinject(DevtoolsDispatcher), i0.ɵɵinject(i2.ActionsSubject), i0.ɵɵinject(i2.ReducerObservable), i0.ɵɵinject(DevtoolsExtension), i0.ɵɵinject(i2.ScannedActionsSubject), i0.ɵɵinject(i0.ErrorHandler), i0.ɵɵinject(INITIAL_STATE), i0.ɵɵinject(STORE_DEVTOOLS_CONFIG));\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: StoreDevtools,\n factory: StoreDevtools.ɵfac\n });\n }\n }\n return StoreDevtools;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * If the devtools extension is connected out of the Angular zone,\n * this operator will emit all events within the zone.\n */\nfunction emitInZone({\n ngZone,\n connectInZone\n}) {\n return source => connectInZone ? new Observable(subscriber => source.subscribe({\n next: value => ngZone.run(() => subscriber.next(value)),\n error: error => ngZone.run(() => subscriber.error(error)),\n complete: () => ngZone.run(() => subscriber.complete())\n })) : source;\n}\nconst IS_EXTENSION_OR_MONITOR_PRESENT = new InjectionToken('@ngrx/store-devtools Is Devtools Extension or Monitor Present');\nfunction createIsExtensionOrMonitorPresent(extension, config) {\n return Boolean(extension) || config.monitor !== noMonitor;\n}\nfunction createReduxDevtoolsExtension() {\n const extensionKey = '__REDUX_DEVTOOLS_EXTENSION__';\n if (typeof window === 'object' && typeof window[extensionKey] !== 'undefined') {\n return window[extensionKey];\n } else {\n return null;\n }\n}\nfunction createStateObservable(devtools) {\n return devtools.state;\n}\n/**\n * Provides developer tools and instrumentation for `Store`.\n *\n * @usageNotes\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideStoreDevtools({\n * maxAge: 25,\n * logOnly: !isDevMode(),\n * }),\n * ],\n * });\n * ```\n */\nfunction provideStoreDevtools(options = {}) {\n return makeEnvironmentProviders([DevtoolsExtension, DevtoolsDispatcher, StoreDevtools, {\n provide: INITIAL_OPTIONS,\n useValue: options\n }, {\n provide: IS_EXTENSION_OR_MONITOR_PRESENT,\n deps: [REDUX_DEVTOOLS_EXTENSION, STORE_DEVTOOLS_CONFIG],\n useFactory: createIsExtensionOrMonitorPresent\n }, {\n provide: REDUX_DEVTOOLS_EXTENSION,\n useFactory: createReduxDevtoolsExtension\n }, {\n provide: STORE_DEVTOOLS_CONFIG,\n deps: [INITIAL_OPTIONS],\n useFactory: createConfig\n }, {\n provide: StateObservable,\n deps: [StoreDevtools],\n useFactory: createStateObservable\n }, {\n provide: ReducerManagerDispatcher,\n useExisting: DevtoolsDispatcher\n }]);\n}\nlet StoreDevtoolsModule = /*#__PURE__*/(() => {\n class StoreDevtoolsModule {\n static instrument(options = {}) {\n return {\n ngModule: StoreDevtoolsModule,\n providers: [provideStoreDevtools(options)]\n };\n }\n /** @nocollapse */\n static {\n this.ɵfac = function StoreDevtoolsModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || StoreDevtoolsModule)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: StoreDevtoolsModule\n });\n }\n /** @nocollapse */\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n }\n return StoreDevtoolsModule;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n/**\n * DO NOT EDIT\n *\n * This file is automatically generated at build\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { INITIAL_OPTIONS, RECOMPUTE, REDUX_DEVTOOLS_EXTENSION, StoreDevtools, StoreDevtoolsConfig, StoreDevtoolsModule, provideStoreDevtools };\n","import * as i1 from '@ngrx/store';\nimport { createAction, props, isNgrxMockEnvironment, select, ACTIVE_RUNTIME_CHECKS, createFeatureSelector, createSelector } from '@ngrx/store';\nimport * as i0 from '@angular/core';\nimport { InjectionToken, isDevMode, Injectable, Inject, makeEnvironmentProviders, ENVIRONMENT_INITIALIZER, inject, NgModule } from '@angular/core';\nimport * as i2 from '@angular/router';\nimport { NavigationStart, RoutesRecognized, NavigationCancel, NavigationError, NavigationEnd } from '@angular/router';\nimport { withLatestFrom } from 'rxjs/operators';\n\n/**\n * An action dispatched when a router navigation request is fired.\n */\nconst ROUTER_REQUEST = '@ngrx/router-store/request';\nconst routerRequestAction = createAction(ROUTER_REQUEST, props());\n/**\n * An action dispatched when the router navigates.\n */\nconst ROUTER_NAVIGATION = '@ngrx/router-store/navigation';\nconst routerNavigationAction = createAction(ROUTER_NAVIGATION, props());\n/**\n * An action dispatched when the router cancels navigation.\n */\nconst ROUTER_CANCEL = '@ngrx/router-store/cancel';\nconst routerCancelAction = createAction(ROUTER_CANCEL, props());\n/**\n * An action dispatched when the router errors.\n */\nconst ROUTER_ERROR = '@ngrx/router-store/error';\nconst routerErrorAction = createAction(ROUTER_ERROR, props());\n/**\n * An action dispatched after navigation has ended and new route is active.\n */\nconst ROUTER_NAVIGATED = '@ngrx/router-store/navigated';\nconst routerNavigatedAction = createAction(ROUTER_NAVIGATED, props());\nfunction routerReducer(state, action) {\n // Allow compilation with strictFunctionTypes - ref: #1344\n const routerAction = action;\n switch (routerAction.type) {\n case ROUTER_NAVIGATION:\n case ROUTER_ERROR:\n case ROUTER_CANCEL:\n return {\n state: routerAction.payload.routerState,\n navigationId: routerAction.payload.event.id\n };\n default:\n return state;\n }\n}\nclass MinimalRouterStateSerializer {\n serialize(routerState) {\n return {\n root: this.serializeRoute(routerState.root),\n url: routerState.url\n };\n }\n serializeRoute(route) {\n const children = route.children.map(c => this.serializeRoute(c));\n return {\n params: route.params,\n data: route.data,\n url: route.url,\n outlet: route.outlet,\n title: route.title,\n routeConfig: route.routeConfig ? {\n path: route.routeConfig.path,\n pathMatch: route.routeConfig.pathMatch,\n redirectTo: route.routeConfig.redirectTo,\n outlet: route.routeConfig.outlet,\n title: typeof route.routeConfig.title === 'string' ? route.routeConfig.title : undefined\n } : null,\n queryParams: route.queryParams,\n fragment: route.fragment,\n firstChild: children[0],\n children\n };\n }\n}\nvar NavigationActionTiming = /*#__PURE__*/function (NavigationActionTiming) {\n NavigationActionTiming[NavigationActionTiming[\"PreActivation\"] = 1] = \"PreActivation\";\n NavigationActionTiming[NavigationActionTiming[\"PostActivation\"] = 2] = \"PostActivation\";\n return NavigationActionTiming;\n}(NavigationActionTiming || {});\nconst DEFAULT_ROUTER_FEATURENAME = 'router';\nconst _ROUTER_CONFIG = new InjectionToken('@ngrx/router-store Internal Configuration');\nconst ROUTER_CONFIG = new InjectionToken('@ngrx/router-store Configuration');\n/**\n * Minimal = Serializes the router event with MinimalRouterStateSerializer\n * Full = Serializes the router event with FullRouterStateSerializer\n */\nvar RouterState = /*#__PURE__*/function (RouterState) {\n RouterState[RouterState[\"Full\"] = 0] = \"Full\";\n RouterState[RouterState[\"Minimal\"] = 1] = \"Minimal\";\n return RouterState;\n}(RouterState || {});\nfunction _createRouterConfig(config) {\n return {\n stateKey: DEFAULT_ROUTER_FEATURENAME,\n serializer: MinimalRouterStateSerializer,\n navigationActionTiming: NavigationActionTiming.PreActivation,\n ...config\n };\n}\nclass FullRouterStateSerializer {\n serialize(routerState) {\n return {\n root: this.serializeRoute(routerState.root),\n url: routerState.url\n };\n }\n serializeRoute(route) {\n const children = route.children.map(c => this.serializeRoute(c));\n return {\n params: route.params,\n paramMap: route.paramMap,\n data: route.data,\n url: route.url,\n outlet: route.outlet,\n title: route.title,\n routeConfig: route.routeConfig ? {\n component: route.routeConfig.component,\n path: route.routeConfig.path,\n pathMatch: route.routeConfig.pathMatch,\n redirectTo: route.routeConfig.redirectTo,\n outlet: route.routeConfig.outlet,\n title: route.routeConfig.title\n } : null,\n queryParams: route.queryParams,\n queryParamMap: route.queryParamMap,\n fragment: route.fragment,\n component: route.routeConfig ? route.routeConfig.component : undefined,\n root: undefined,\n parent: undefined,\n firstChild: children[0],\n pathFromRoot: undefined,\n children\n };\n }\n}\nclass RouterStateSerializer {}\nvar RouterTrigger = /*#__PURE__*/function (RouterTrigger) {\n RouterTrigger[RouterTrigger[\"NONE\"] = 1] = \"NONE\";\n RouterTrigger[RouterTrigger[\"ROUTER\"] = 2] = \"ROUTER\";\n RouterTrigger[RouterTrigger[\"STORE\"] = 3] = \"STORE\";\n return RouterTrigger;\n}(RouterTrigger || {});\n/**\n * Shared router initialization logic used alongside both the StoreRouterConnectingModule and the provideRouterStore\n * function\n */\nlet StoreRouterConnectingService = /*#__PURE__*/(() => {\n class StoreRouterConnectingService {\n constructor(store, router, serializer, errorHandler, config, activeRuntimeChecks) {\n this.store = store;\n this.router = router;\n this.serializer = serializer;\n this.errorHandler = errorHandler;\n this.config = config;\n this.activeRuntimeChecks = activeRuntimeChecks;\n this.lastEvent = null;\n this.routerState = null;\n this.trigger = RouterTrigger.NONE;\n this.stateKey = this.config.stateKey;\n if (!isNgrxMockEnvironment() && isDevMode() && (activeRuntimeChecks?.strictActionSerializability || activeRuntimeChecks?.strictStateSerializability) && this.serializer instanceof FullRouterStateSerializer) {\n console.warn('@ngrx/router-store: The serializability runtime checks cannot be enabled ' + 'with the FullRouterStateSerializer. The FullRouterStateSerializer ' + 'has an unserializable router state and actions that are not serializable. ' + 'To use the serializability runtime checks either use ' + 'the MinimalRouterStateSerializer or implement a custom router state serializer.');\n }\n this.setUpStoreStateListener();\n this.setUpRouterEventsListener();\n }\n setUpStoreStateListener() {\n this.store.pipe(select(this.stateKey), withLatestFrom(this.store)).subscribe(([routerStoreState, storeState]) => {\n this.navigateIfNeeded(routerStoreState, storeState);\n });\n }\n navigateIfNeeded(routerStoreState, storeState) {\n if (!routerStoreState || !routerStoreState.state) {\n return;\n }\n if (this.trigger === RouterTrigger.ROUTER) {\n return;\n }\n if (this.lastEvent instanceof NavigationStart) {\n return;\n }\n const url = routerStoreState.state.url;\n if (!isSameUrl(this.router.url, url)) {\n this.storeState = storeState;\n this.trigger = RouterTrigger.STORE;\n this.router.navigateByUrl(url).catch(error => {\n this.errorHandler.handleError(error);\n });\n }\n }\n setUpRouterEventsListener() {\n const dispatchNavLate = this.config.navigationActionTiming === NavigationActionTiming.PostActivation;\n let routesRecognized;\n this.router.events.pipe(withLatestFrom(this.store)).subscribe(([event, storeState]) => {\n this.lastEvent = event;\n if (event instanceof NavigationStart) {\n this.routerState = this.serializer.serialize(this.router.routerState.snapshot);\n if (this.trigger !== RouterTrigger.STORE) {\n this.storeState = storeState;\n this.dispatchRouterRequest(event);\n }\n } else if (event instanceof RoutesRecognized) {\n routesRecognized = event;\n if (!dispatchNavLate && this.trigger !== RouterTrigger.STORE) {\n this.dispatchRouterNavigation(event);\n }\n } else if (event instanceof NavigationCancel) {\n this.dispatchRouterCancel(event);\n this.reset();\n } else if (event instanceof NavigationError) {\n this.dispatchRouterError(event);\n this.reset();\n } else if (event instanceof NavigationEnd) {\n if (this.trigger !== RouterTrigger.STORE) {\n if (dispatchNavLate) {\n this.dispatchRouterNavigation(routesRecognized);\n }\n this.dispatchRouterNavigated(event);\n }\n this.reset();\n }\n });\n }\n dispatchRouterRequest(event) {\n this.dispatchRouterAction(ROUTER_REQUEST, {\n event\n });\n }\n dispatchRouterNavigation(lastRoutesRecognized) {\n const nextRouterState = this.serializer.serialize(lastRoutesRecognized.state);\n this.dispatchRouterAction(ROUTER_NAVIGATION, {\n routerState: nextRouterState,\n event: new RoutesRecognized(lastRoutesRecognized.id, lastRoutesRecognized.url, lastRoutesRecognized.urlAfterRedirects, nextRouterState)\n });\n }\n dispatchRouterCancel(event) {\n this.dispatchRouterAction(ROUTER_CANCEL, {\n storeState: this.storeState,\n event\n });\n }\n dispatchRouterError(event) {\n this.dispatchRouterAction(ROUTER_ERROR, {\n storeState: this.storeState,\n event: new NavigationError(event.id, event.url, `${event}`)\n });\n }\n dispatchRouterNavigated(event) {\n const routerState = this.serializer.serialize(this.router.routerState.snapshot);\n this.dispatchRouterAction(ROUTER_NAVIGATED, {\n event,\n routerState\n });\n }\n dispatchRouterAction(type, payload) {\n this.trigger = RouterTrigger.ROUTER;\n try {\n this.store.dispatch({\n type,\n payload: {\n routerState: this.routerState,\n ...payload,\n event: this.config.routerState === RouterState.Full ? payload.event : {\n id: payload.event.id,\n url: payload.event.url,\n // safe, as it will just be `undefined` for non-NavigationEnd router events\n urlAfterRedirects: payload.event.urlAfterRedirects\n }\n }\n });\n } finally {\n this.trigger = RouterTrigger.NONE;\n }\n }\n reset() {\n this.trigger = RouterTrigger.NONE;\n this.storeState = null;\n this.routerState = null;\n }\n /** @nocollapse */\n static {\n this.ɵfac = function StoreRouterConnectingService_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || StoreRouterConnectingService)(i0.ɵɵinject(i1.Store), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterStateSerializer), i0.ɵɵinject(i0.ErrorHandler), i0.ɵɵinject(ROUTER_CONFIG), i0.ɵɵinject(ACTIVE_RUNTIME_CHECKS));\n };\n }\n /** @nocollapse */\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: StoreRouterConnectingService,\n factory: StoreRouterConnectingService.ɵfac\n });\n }\n }\n return StoreRouterConnectingService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Check if the URLs are matching. Accounts for the possibility of trailing \"/\" in url.\n */\nfunction isSameUrl(first, second) {\n return stripTrailingSlash(first) === stripTrailingSlash(second);\n}\nfunction stripTrailingSlash(text) {\n if (text?.length > 0 && text[text.length - 1] === '/') {\n return text.substring(0, text.length - 1);\n }\n return text;\n}\n\n/**\n * Connects the Angular Router to the Store.\n *\n * @usageNotes\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideStore({ router: routerReducer }),\n * provideRouterStore(),\n * ],\n * });\n * ```\n */\nfunction provideRouterStore(config = {}) {\n return makeEnvironmentProviders([{\n provide: _ROUTER_CONFIG,\n useValue: config\n }, {\n provide: ROUTER_CONFIG,\n useFactory: _createRouterConfig,\n deps: [_ROUTER_CONFIG]\n }, {\n provide: RouterStateSerializer,\n useClass: config.serializer ? config.serializer : config.routerState === RouterState.Full ? FullRouterStateSerializer : MinimalRouterStateSerializer\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory() {\n return () => inject(StoreRouterConnectingService);\n }\n }, StoreRouterConnectingService]);\n}\n\n/**\n * Connects RouterModule with StoreModule.\n *\n * During the navigation, before any guards or resolvers run, the router will dispatch\n * a ROUTER_NAVIGATION action, which has the following signature:\n *\n * ```\n * export type RouterNavigationPayload = {\n * routerState: SerializedRouterStateSnapshot,\n * event: RoutesRecognized\n * }\n * ```\n *\n * Either a reducer or an effect can be invoked in response to this action.\n * If the invoked reducer throws, the navigation will be canceled.\n *\n * If navigation gets canceled because of a guard, a ROUTER_CANCEL action will be\n * dispatched. If navigation results in an error, a ROUTER_ERROR action will be dispatched.\n *\n * Both ROUTER_CANCEL and ROUTER_ERROR contain the store state before the navigation\n * which can be used to restore the consistency of the store.\n *\n * Usage:\n *\n * ```typescript\n * @NgModule({\n * declarations: [AppCmp, SimpleCmp],\n * imports: [\n * BrowserModule,\n * StoreModule.forRoot(mapOfReducers),\n * RouterModule.forRoot([\n * { path: '', component: SimpleCmp },\n * { path: 'next', component: SimpleCmp }\n * ]),\n * StoreRouterConnectingModule.forRoot()\n * ],\n * bootstrap: [AppCmp]\n * })\n * export class AppModule {\n * }\n * ```\n */\nlet StoreRouterConnectingModule = /*#__PURE__*/(() => {\n class StoreRouterConnectingModule {\n static forRoot(config = {}) {\n return {\n ngModule: StoreRouterConnectingModule,\n providers: [provideRouterStore(config)]\n };\n }\n /** @nocollapse */\n static {\n this.ɵfac = function StoreRouterConnectingModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || StoreRouterConnectingModule)();\n };\n }\n /** @nocollapse */\n static {\n this.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: StoreRouterConnectingModule\n });\n }\n /** @nocollapse */\n static {\n this.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n }\n }\n return StoreRouterConnectingModule;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nfunction createRouterSelector() {\n return createFeatureSelector(DEFAULT_ROUTER_FEATURENAME);\n}\nfunction getRouterSelectors(selectState = createRouterSelector()) {\n const selectRouterState = createSelector(selectState, router => router && router.state);\n const selectRootRoute = createSelector(selectRouterState, routerState => routerState && routerState.root);\n const selectCurrentRoute = createSelector(selectRootRoute, rootRoute => {\n if (!rootRoute) {\n return undefined;\n }\n let route = rootRoute;\n while (route.firstChild) {\n route = route.firstChild;\n }\n return route;\n });\n const selectFragment = createSelector(selectRootRoute, route => route && route.fragment);\n const selectQueryParams = createSelector(selectRootRoute, route => route && route.queryParams);\n const selectQueryParam = param => createSelector(selectQueryParams, params => params && params[param]);\n const selectRouteParams = createSelector(selectCurrentRoute, route => route && route.params);\n const selectRouteParam = param => createSelector(selectRouteParams, params => params && params[param]);\n const selectRouteData = createSelector(selectCurrentRoute, route => route && route.data);\n const selectRouteDataParam = param => createSelector(selectRouteData, data => data && data[param]);\n const selectUrl = createSelector(selectRouterState, routerState => routerState && routerState.url);\n const selectTitle = createSelector(selectCurrentRoute, route => {\n if (!route?.routeConfig) {\n return undefined;\n }\n return typeof route.routeConfig.title === 'string' ? route.routeConfig.title // static title\n : route.title; // resolved title\n });\n return {\n selectCurrentRoute,\n selectFragment,\n selectQueryParams,\n selectQueryParam,\n selectRouteParams,\n selectRouteParam,\n selectRouteData,\n selectRouteDataParam,\n selectUrl,\n selectTitle\n };\n}\n\n/**\n * DO NOT EDIT\n *\n * This file is automatically generated at build\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { DEFAULT_ROUTER_FEATURENAME, FullRouterStateSerializer, MinimalRouterStateSerializer, NavigationActionTiming, ROUTER_CANCEL, ROUTER_CONFIG, ROUTER_ERROR, ROUTER_NAVIGATED, ROUTER_NAVIGATION, ROUTER_REQUEST, RouterState, RouterStateSerializer, StoreRouterConnectingModule, createRouterSelector, getRouterSelectors, provideRouterStore, routerCancelAction, routerErrorAction, routerNavigatedAction, routerNavigationAction, routerReducer, routerRequestAction };\n","import { Injectable } from '@angular/core';\nimport { filter, take } from 'rxjs/operators';\nimport { SocketHelperService } from './socket-helper.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SocketProvider {\n\n constructor(private socketHelperService: SocketHelperService) { }\n\n initHubConnection() {\n this.socketHelperService.initSocket();\n\n return new Promise((resolve) => {\n this.socketHelperService.hubConnected$.pipe(\n filter(connected => connected),\n take(1)\n ).subscribe((connected: boolean) => {\n return resolve(connected);\n });\n });\n }\n}\n","import { SocketProvider } from './socket.provider';\n\nexport function socketProviderFactory(provider: SocketProvider) {\n return () => provider.initHubConnection();\n}\n","import { LocalizationService } from '@app-core/localization/localization.service';\n\nexport function localizationResourcesFactory(localizationService: LocalizationService) {\n return (): Promise => localizationService.init();\n}\n","import { DatadogService } from './datadog.service';\nexport function datadogRumFactory(provider: DatadogService) {\n return () => provider.startSessionReplayRecording();\n}","/* eslint-disable local-rules/disallow-side-effects */\n/**\n * Keep references on console methods to avoid triggering patched behaviors\n *\n * NB: in some setup, console could already be patched by another SDK.\n * In this case, some display messages can be sent by the other SDK\n * but we should be safe from infinite loop nonetheless.\n */\nexport var ConsoleApiName = {\n log: 'log',\n debug: 'debug',\n info: 'info',\n warn: 'warn',\n error: 'error'\n};\nexport var display = function (api) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!Object.prototype.hasOwnProperty.call(ConsoleApiName, api)) {\n api = ConsoleApiName.log;\n }\n display[api].apply(display, args);\n};\n/**\n * When building JS bundles, some users might use a plugin[1] or configuration[2] to remove\n * \"console.*\" references. This causes some issue as we expect `console.*` to be defined.\n * As a workaround, let's use a variable alias, so those expressions won't be taken into account by\n * simple static analysis.\n *\n * [1]: https://babeljs.io/docs/babel-plugin-transform-remove-console/\n * [2]: https://github.com/terser/terser#compress-options (look for drop_console)\n */\nexport var globalConsole = console;\ndisplay.debug = globalConsole.debug.bind(globalConsole);\ndisplay.log = globalConsole.log.bind(globalConsole);\ndisplay.info = globalConsole.info.bind(globalConsole);\ndisplay.warn = globalConsole.warn.bind(globalConsole);\ndisplay.error = globalConsole.error.bind(globalConsole);\n","import { display } from './display';\nexport function catchUserErrors(fn, errorMsg) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n try {\n return fn.apply(void 0, args);\n } catch (err) {\n display.error(errorMsg, err);\n }\n };\n}\n","/**\n * LIMITATION:\n * For NPM setup, this feature flag singleton is shared between RUM and Logs product.\n * This means that an experimental flag set on the RUM product will be set on the Logs product.\n * So keep in mind that in certain configurations, your experimental feature flag may affect other products.\n *\n * FORMAT:\n * All feature flags should be snake_cased\n */\n// We want to use a real enum (i.e. not a const enum) here, to be able to check whether an arbitrary\n// string is an expected feature flag\n// eslint-disable-next-line no-restricted-syntax\nexport var ExperimentalFeature = /*#__PURE__*/function (ExperimentalFeature) {\n ExperimentalFeature[\"PAGEHIDE\"] = \"pagehide\";\n ExperimentalFeature[\"FEATURE_FLAGS\"] = \"feature_flags\";\n ExperimentalFeature[\"RESOURCE_PAGE_STATES\"] = \"resource_page_states\";\n ExperimentalFeature[\"PAGE_STATES\"] = \"page_states\";\n ExperimentalFeature[\"COLLECT_FLUSH_REASON\"] = \"collect_flush_reason\";\n ExperimentalFeature[\"NO_RESOURCE_DURATION_FROZEN_STATE\"] = \"no_resource_duration_frozen_state\";\n return ExperimentalFeature;\n}(ExperimentalFeature || {});\nvar enabledExperimentalFeatures = new Set();\nexport function addExperimentalFeatures(enabledFeatures) {\n enabledFeatures.forEach(function (flag) {\n enabledExperimentalFeatures.add(flag);\n });\n}\nexport function isExperimentalFeatureEnabled(featureName) {\n return enabledExperimentalFeatures.has(featureName);\n}\nexport function resetExperimentalFeatures() {\n enabledExperimentalFeatures.clear();\n}\nexport function getExperimentalFeatures() {\n return enabledExperimentalFeatures;\n}\n","/**\n * Return true if the draw is successful\n * @param threshold between 0 and 100\n */\nexport function performDraw(threshold) {\n return threshold !== 0 && Math.random() * 100 <= threshold;\n}\nexport function round(num, decimals) {\n return +num.toFixed(decimals);\n}\nexport function isPercentage(value) {\n return isNumber(value) && value >= 0 && value <= 100;\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\n","import { isNumber, round } from './numberUtils';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = 60 * ONE_SECOND;\nexport var ONE_HOUR = 60 * ONE_MINUTE;\nexport var ONE_DAY = 24 * ONE_HOUR;\nexport var ONE_YEAR = 365 * ONE_DAY;\nexport function relativeToClocks(relative) {\n return {\n relative: relative,\n timeStamp: getCorrectedTimeStamp(relative)\n };\n}\nfunction getCorrectedTimeStamp(relativeTime) {\n var correctedOrigin = dateNow() - performance.now();\n // apply correction only for positive drift\n if (correctedOrigin > getNavigationStart()) {\n return Math.round(addDuration(correctedOrigin, relativeTime));\n }\n return getTimeStamp(relativeTime);\n}\nexport function currentDrift() {\n return Math.round(dateNow() - addDuration(getNavigationStart(), performance.now()));\n}\nexport function toServerDuration(duration) {\n if (!isNumber(duration)) {\n return duration;\n }\n return round(duration * 1e6, 0);\n}\nexport function dateNow() {\n // Do not use `Date.now` because sometimes websites are wrongly \"polyfilling\" it. For example, we\n // had some users using a very old version of `datejs`, which patched `Date.now` to return a Date\n // instance instead of a timestamp[1]. Those users are unlikely to fix this, so let's handle this\n // case ourselves.\n // [1]: https://github.com/datejs/Datejs/blob/97f5c7c58c5bc5accdab8aa7602b6ac56462d778/src/core-debug.js#L14-L16\n return new Date().getTime();\n}\nexport function timeStampNow() {\n return dateNow();\n}\nexport function relativeNow() {\n return performance.now();\n}\nexport function clocksNow() {\n return {\n relative: relativeNow(),\n timeStamp: timeStampNow()\n };\n}\nexport function clocksOrigin() {\n return {\n relative: 0,\n timeStamp: getNavigationStart()\n };\n}\nexport function elapsed(start, end) {\n return end - start;\n}\nexport function addDuration(a, b) {\n return a + b;\n}\n/**\n * Get the time since the navigation was started.\n *\n * Note: this does not use `performance.timeOrigin` because it doesn't seem to reflect the actual\n * time on which the navigation has started: it may be much farther in the past, at least in Firefox 71.\n * Related issue in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1429926\n */\nexport function getRelativeTime(timestamp) {\n return timestamp - getNavigationStart();\n}\nexport function getTimeStamp(relativeTime) {\n return Math.round(addDuration(getNavigationStart(), relativeTime));\n}\nexport function looksLikeRelativeTime(time) {\n return time < ONE_YEAR;\n}\n/**\n * Navigation start slightly change on some rare cases\n */\nvar navigationStart;\nfunction getNavigationStart() {\n if (navigationStart === undefined) {\n navigationStart = performance.timing.navigationStart;\n }\n return navigationStart;\n}\nexport function resetNavigationStart() {\n navigationStart = undefined;\n}\n","export var ONE_KIBI_BYTE = 1024;\nexport var ONE_MEBI_BYTE = 1024 * ONE_KIBI_BYTE;\n// eslint-disable-next-line no-control-regex\nvar HAS_MULTI_BYTES_CHARACTERS = /[^\\u0000-\\u007F]/;\nexport function computeBytesCount(candidate) {\n // Accurate bytes count computations can degrade performances when there is a lot of events to process\n if (!HAS_MULTI_BYTES_CHARACTERS.test(candidate)) {\n return candidate.length;\n }\n if (window.TextEncoder !== undefined) {\n return new TextEncoder().encode(candidate).length;\n }\n return new Blob([candidate]).size;\n}\n","export function includes(candidate, search) {\n return candidate.indexOf(search) !== -1;\n}\nexport function arrayFrom(arrayLike) {\n if (Array.from) {\n return Array.from(arrayLike);\n }\n var array = [];\n if (arrayLike instanceof Set) {\n arrayLike.forEach(function (item) {\n return array.push(item);\n });\n } else {\n for (var i = 0; i < arrayLike.length; i++) {\n array.push(arrayLike[i]);\n }\n }\n return array;\n}\nexport function find(array, predicate) {\n for (var i = 0; i < array.length; i += 1) {\n var item = array[i];\n if (predicate(item, i)) {\n return item;\n }\n }\n return undefined;\n}\nexport function findLast(array, predicate) {\n for (var i = array.length - 1; i >= 0; i -= 1) {\n var item = array[i];\n if (predicate(item, i, array)) {\n return item;\n }\n }\n return undefined;\n}\nexport function forEach(list, callback) {\n Array.prototype.forEach.call(list, callback);\n}\nexport function objectValues(object) {\n return Object.keys(object).map(function (key) {\n return object[key];\n });\n}\nexport function objectEntries(object) {\n return Object.keys(object).map(function (key) {\n return [key, object[key]];\n });\n}\nexport function startsWith(candidate, search) {\n return candidate.slice(0, search.length) === search;\n}\nexport function endsWith(candidate, search) {\n return candidate.slice(-search.length) === search;\n}\nexport function elementMatches(element, selector) {\n if (element.matches) {\n return element.matches(selector);\n }\n // IE11 support\n if (element.msMatchesSelector) {\n return element.msMatchesSelector(selector);\n }\n return false;\n}\n// https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/selector/escapeSelector.js\nexport function cssEscape(str) {\n if (window.CSS && window.CSS.escape) {\n return window.CSS.escape(str);\n }\n // eslint-disable-next-line no-control-regex\n return str.replace(/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g, function (ch, asCodePoint) {\n if (asCodePoint) {\n // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n if (ch === '\\0') {\n return '\\uFFFD';\n }\n // Control characters and (dependent upon position) numbers get escaped as code points\n return \"\".concat(ch.slice(0, -1), \"\\\\\").concat(ch.charCodeAt(ch.length - 1).toString(16), \" \");\n }\n // Other potentially-special ASCII characters get backslash-escaped\n return \"\\\\\".concat(ch);\n });\n}\nexport function assign(target) {\n var toAssign = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n toAssign[_i - 1] = arguments[_i];\n }\n toAssign.forEach(function (source) {\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n });\n return target;\n}\n","import { assign } from './polyfills';\nexport function shallowClone(object) {\n return assign({}, object);\n}\nexport function objectHasValue(object, value) {\n return Object.keys(object).some(function (key) {\n return object[key] === value;\n });\n}\nexport function isEmptyObject(object) {\n return Object.keys(object).length === 0;\n}\nexport function mapValues(object, fn) {\n var newObject = {};\n for (var _i = 0, _a = Object.keys(object); _i < _a.length; _i++) {\n var key = _a[_i];\n newObject[key] = fn(object[key]);\n }\n return newObject;\n}\n","/**\n * inspired by https://mathiasbynens.be/notes/globalthis\n */\nexport function getGlobalObject() {\n if (typeof globalThis === 'object') {\n return globalThis;\n }\n Object.defineProperty(Object.prototype, '_dd_temp_', {\n get: function () {\n return this;\n },\n configurable: true\n });\n // @ts-ignore _dd_temp is defined using defineProperty\n var globalObject = _dd_temp_;\n // @ts-ignore _dd_temp is defined using defineProperty\n delete Object.prototype._dd_temp_;\n if (typeof globalObject !== 'object') {\n // on safari _dd_temp_ is available on window but not globally\n // fallback on other browser globals check\n if (typeof self === 'object') {\n globalObject = self;\n } else if (typeof window === 'object') {\n globalObject = window;\n } else {\n globalObject = {};\n }\n }\n return globalObject;\n}\n","import { getGlobalObject } from './getGlobalObject';\n/**\n * Gets the original value for a DOM API that was potentially patched by Zone.js.\n *\n * Zone.js[1] is a library that patches a bunch of JS and DOM APIs. It usually stores the original\n * value of the patched functions/constructors/methods in a hidden property prefixed by\n * __zone_symbol__.\n *\n * In multiple occasions, we observed that Zone.js is the culprit of important issues leading to\n * browser resource exhaustion (memory leak, high CPU usage). This method is used as a workaround to\n * use the original DOM API instead of the one patched by Zone.js.\n *\n * [1]: https://github.com/angular/angular/tree/main/packages/zone.js\n */\nexport function getZoneJsOriginalValue(target, name) {\n var browserWindow = getGlobalObject();\n var original;\n if (browserWindow.Zone && typeof browserWindow.Zone.__symbol__ === 'function') {\n original = target[browserWindow.Zone.__symbol__(name)];\n }\n if (!original) {\n original = target[name];\n }\n return original;\n}\n","var __spreadArray = this && this.__spreadArray || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { ConsoleApiName, display } from './display';\nvar onMonitorErrorCollected;\nvar debugMode = false;\nexport function startMonitorErrorCollection(newOnMonitorErrorCollected) {\n onMonitorErrorCollected = newOnMonitorErrorCollected;\n}\nexport function setDebugMode(newDebugMode) {\n debugMode = newDebugMode;\n}\nexport function resetMonitor() {\n onMonitorErrorCollected = undefined;\n debugMode = false;\n}\nexport function monitored(_, __, descriptor) {\n var originalMethod = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var decorated = onMonitorErrorCollected ? monitor(originalMethod) : originalMethod;\n return decorated.apply(this, args);\n };\n}\nexport function monitor(fn) {\n return function () {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return callMonitored(fn, this, arguments);\n }; // consider output type has input type\n}\nexport function callMonitored(fn, context, args) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return fn.apply(context, args);\n } catch (e) {\n displayIfDebugEnabled(ConsoleApiName.error, e);\n if (onMonitorErrorCollected) {\n try {\n onMonitorErrorCollected(e);\n } catch (e) {\n displayIfDebugEnabled(ConsoleApiName.error, e);\n }\n }\n }\n}\nexport function displayIfDebugEnabled(api) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (debugMode) {\n display.apply(void 0, __spreadArray([api, '[MONITOR]'], args, false));\n }\n}\n","import { getZoneJsOriginalValue } from './getZoneJsOriginalValue';\nimport { monitor } from './monitor';\nimport { getGlobalObject } from './getGlobalObject';\nexport function setTimeout(callback, delay) {\n return getZoneJsOriginalValue(getGlobalObject(), 'setTimeout')(monitor(callback), delay);\n}\nexport function clearTimeout(timeoutId) {\n getZoneJsOriginalValue(getGlobalObject(), 'clearTimeout')(timeoutId);\n}\nexport function setInterval(callback, delay) {\n return getZoneJsOriginalValue(window, 'setInterval')(monitor(callback), delay);\n}\nexport function clearInterval(timeoutId) {\n getZoneJsOriginalValue(window, 'clearInterval')(timeoutId);\n}\n","var Observable = /** @class */function () {\n function Observable(onFirstSubscribe) {\n this.onFirstSubscribe = onFirstSubscribe;\n this.observers = [];\n }\n Observable.prototype.subscribe = function (f) {\n var _this = this;\n if (!this.observers.length && this.onFirstSubscribe) {\n this.onLastUnsubscribe = this.onFirstSubscribe() || undefined;\n }\n this.observers.push(f);\n return {\n unsubscribe: function () {\n _this.observers = _this.observers.filter(function (other) {\n return f !== other;\n });\n if (!_this.observers.length && _this.onLastUnsubscribe) {\n _this.onLastUnsubscribe();\n }\n }\n };\n };\n Observable.prototype.notify = function (data) {\n this.observers.forEach(function (observer) {\n return observer(data);\n });\n };\n return Observable;\n}();\nexport { Observable };\nexport function mergeObservables() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var globalObservable = new Observable(function () {\n var subscriptions = observables.map(function (observable) {\n return observable.subscribe(function (data) {\n return globalObservable.notify(data);\n });\n });\n return function () {\n return subscriptions.forEach(function (subscription) {\n return subscription.unsubscribe();\n });\n };\n });\n return globalObservable;\n}\n","import { setTimeout, clearTimeout } from '../timer';\n// use lodash API\nexport function throttle(fn, wait, options) {\n var needLeadingExecution = options && options.leading !== undefined ? options.leading : true;\n var needTrailingExecution = options && options.trailing !== undefined ? options.trailing : true;\n var inWaitPeriod = false;\n var pendingExecutionWithParameters;\n var pendingTimeoutId;\n return {\n throttled: function () {\n var parameters = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n parameters[_i] = arguments[_i];\n }\n if (inWaitPeriod) {\n pendingExecutionWithParameters = parameters;\n return;\n }\n if (needLeadingExecution) {\n fn.apply(void 0, parameters);\n } else {\n pendingExecutionWithParameters = parameters;\n }\n inWaitPeriod = true;\n pendingTimeoutId = setTimeout(function () {\n if (needTrailingExecution && pendingExecutionWithParameters) {\n fn.apply(void 0, pendingExecutionWithParameters);\n }\n inWaitPeriod = false;\n pendingExecutionWithParameters = undefined;\n }, wait);\n },\n cancel: function () {\n clearTimeout(pendingTimeoutId);\n inWaitPeriod = false;\n pendingExecutionWithParameters = undefined;\n }\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport function noop() {}\n","/**\n * UUID v4\n * from https://gist.github.com/jed/982883\n */\nexport function generateUUID(placeholder) {\n return placeholder ?\n // eslint-disable-next-line no-bitwise\n (parseInt(placeholder, 10) ^ Math.random() * 16 >> parseInt(placeholder, 10) / 4).toString(16) : \"\".concat(1e7, \"-\").concat(1e3, \"-\").concat(4e3, \"-\").concat(8e3, \"-\").concat(1e11).replace(/[018]/g, generateUUID);\n}\nexport function findCommaSeparatedValue(rawString, name) {\n var regex = new RegExp(\"(?:^|;)\\\\s*\".concat(name, \"\\\\s*=\\\\s*([^;]+)\"));\n var matches = regex.exec(rawString);\n return matches ? matches[1] : undefined;\n}\nexport function safeTruncate(candidate, length, suffix) {\n if (suffix === void 0) {\n suffix = '';\n }\n var lastChar = candidate.charCodeAt(length - 1);\n var isLastCharSurrogatePair = lastChar >= 0xd800 && lastChar <= 0xdbff;\n var correctedLength = isLastCharSurrogatePair ? length + 1 : length;\n if (candidate.length <= correctedLength) {\n return candidate;\n }\n return \"\".concat(candidate.slice(0, correctedLength)).concat(suffix);\n}\n","import { ONE_HOUR, ONE_MINUTE } from '../../tools/utils/timeUtils';\nexport var SESSION_TIME_OUT_DELAY = 4 * ONE_HOUR;\nexport var SESSION_EXPIRATION_DELAY = 15 * ONE_MINUTE;\n","import { display } from '../tools/display';\nimport { ONE_MINUTE, ONE_SECOND } from '../tools/utils/timeUtils';\nimport { findCommaSeparatedValue, generateUUID } from '../tools/utils/stringUtils';\nexport function setCookie(name, value, expireDelay, options) {\n var date = new Date();\n date.setTime(date.getTime() + expireDelay);\n var expires = \"expires=\".concat(date.toUTCString());\n var sameSite = options && options.crossSite ? 'none' : 'strict';\n var domain = options && options.domain ? \";domain=\".concat(options.domain) : '';\n var secure = options && options.secure ? ';secure' : '';\n document.cookie = \"\".concat(name, \"=\").concat(value, \";\").concat(expires, \";path=/;samesite=\").concat(sameSite).concat(domain).concat(secure);\n}\nexport function getCookie(name) {\n return findCommaSeparatedValue(document.cookie, name);\n}\nexport function deleteCookie(name, options) {\n setCookie(name, '', 0, options);\n}\nexport function areCookiesAuthorized(options) {\n if (document.cookie === undefined || document.cookie === null) {\n return false;\n }\n try {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = \"dd_cookie_test_\".concat(generateUUID());\n var testCookieValue = 'test';\n setCookie(testCookieName, testCookieValue, ONE_MINUTE, options);\n var isCookieCorrectlySet = getCookie(testCookieName) === testCookieValue;\n deleteCookie(testCookieName, options);\n return isCookieCorrectlySet;\n } catch (error) {\n display.error(error);\n return false;\n }\n}\n/**\n * No API to retrieve it, number of levels for subdomain and suffix are unknown\n * strategy: find the minimal domain on which cookies are allowed to be set\n * https://web.dev/same-site-same-origin/#site\n */\nvar getCurrentSiteCache;\nexport function getCurrentSite() {\n if (getCurrentSiteCache === undefined) {\n // Use a unique cookie name to avoid issues when the SDK is initialized multiple times during\n // the test cookie lifetime\n var testCookieName = \"dd_site_test_\".concat(generateUUID());\n var testCookieValue = 'test';\n var domainLevels = window.location.hostname.split('.');\n var candidateDomain = domainLevels.pop();\n while (domainLevels.length && !getCookie(testCookieName)) {\n candidateDomain = \"\".concat(domainLevels.pop(), \".\").concat(candidateDomain);\n setCookie(testCookieName, testCookieValue, ONE_SECOND, {\n domain: candidateDomain\n });\n }\n deleteCookie(testCookieName, {\n domain: candidateDomain\n });\n getCurrentSiteCache = candidateDomain;\n }\n return getCurrentSiteCache;\n}\n","export var SESSION_STORE_KEY = '_dd_s';\n","import { isEmptyObject } from '../../tools/utils/objectUtils';\nimport { objectEntries } from '../../tools/utils/polyfills';\nimport { dateNow } from '../../tools/utils/timeUtils';\nimport { SESSION_EXPIRATION_DELAY } from './sessionConstants';\nvar SESSION_ENTRY_REGEXP = /^([a-z]+)=([a-z0-9-]+)$/;\nvar SESSION_ENTRY_SEPARATOR = '&';\nexport function isSessionInExpiredState(session) {\n return isEmptyObject(session);\n}\nexport function expandSessionState(session) {\n session.expire = String(dateNow() + SESSION_EXPIRATION_DELAY);\n}\nexport function toSessionString(session) {\n return objectEntries(session).map(function (_a) {\n var key = _a[0],\n value = _a[1];\n return \"\".concat(key, \"=\").concat(value);\n }).join(SESSION_ENTRY_SEPARATOR);\n}\nexport function toSessionState(sessionString) {\n var session = {};\n if (isValidSessionString(sessionString)) {\n sessionString.split(SESSION_ENTRY_SEPARATOR).forEach(function (entry) {\n var matches = SESSION_ENTRY_REGEXP.exec(entry);\n if (matches !== null) {\n var key = matches[1],\n value = matches[2];\n session[key] = value;\n }\n });\n }\n return session;\n}\nfunction isValidSessionString(sessionString) {\n return !!sessionString && (sessionString.indexOf(SESSION_ENTRY_SEPARATOR) !== -1 || SESSION_ENTRY_REGEXP.test(sessionString));\n}\n","import { getCookie } from '../../browser/cookie';\nimport { SESSION_STORE_KEY } from './storeStrategies/sessionStoreStrategy';\nimport { expandSessionState, isSessionInExpiredState } from './sessionState';\nexport var OLD_SESSION_COOKIE_NAME = '_dd';\nexport var OLD_RUM_COOKIE_NAME = '_dd_r';\nexport var OLD_LOGS_COOKIE_NAME = '_dd_l';\n// duplicate values to avoid dependency issues\nexport var RUM_SESSION_KEY = 'rum';\nexport var LOGS_SESSION_KEY = 'logs';\n/**\n * This migration should remain in the codebase as long as older versions are available/live\n * to allow older sdk versions to be upgraded to newer versions without compatibility issues.\n */\nexport function tryOldCookiesMigration(cookieStoreStrategy) {\n var sessionString = getCookie(SESSION_STORE_KEY);\n if (!sessionString) {\n var oldSessionId = getCookie(OLD_SESSION_COOKIE_NAME);\n var oldRumType = getCookie(OLD_RUM_COOKIE_NAME);\n var oldLogsType = getCookie(OLD_LOGS_COOKIE_NAME);\n var session = {};\n if (oldSessionId) {\n session.id = oldSessionId;\n }\n if (oldLogsType && /^[01]$/.test(oldLogsType)) {\n session[LOGS_SESSION_KEY] = oldLogsType;\n }\n if (oldRumType && /^[012]$/.test(oldRumType)) {\n session[RUM_SESSION_KEY] = oldRumType;\n }\n if (!isSessionInExpiredState(session)) {\n expandSessionState(session);\n cookieStoreStrategy.persistSession(session);\n }\n }\n}\n","import { getCurrentSite, areCookiesAuthorized, deleteCookie, getCookie, setCookie } from '../../../browser/cookie';\nimport { tryOldCookiesMigration } from '../oldCookiesMigration';\nimport { SESSION_EXPIRATION_DELAY } from '../sessionConstants';\nimport { toSessionString, toSessionState } from '../sessionState';\nimport { SESSION_STORE_KEY } from './sessionStoreStrategy';\nexport function selectCookieStrategy(initConfiguration) {\n var cookieOptions = buildCookieOptions(initConfiguration);\n return areCookiesAuthorized(cookieOptions) ? {\n type: 'Cookie',\n cookieOptions: cookieOptions\n } : undefined;\n}\nexport function initCookieStrategy(cookieOptions) {\n var cookieStore = {\n persistSession: persistSessionCookie(cookieOptions),\n retrieveSession: retrieveSessionCookie,\n clearSession: deleteSessionCookie(cookieOptions)\n };\n tryOldCookiesMigration(cookieStore);\n return cookieStore;\n}\nfunction persistSessionCookie(options) {\n return function (session) {\n setCookie(SESSION_STORE_KEY, toSessionString(session), SESSION_EXPIRATION_DELAY, options);\n };\n}\nfunction retrieveSessionCookie() {\n var sessionString = getCookie(SESSION_STORE_KEY);\n return toSessionState(sessionString);\n}\nfunction deleteSessionCookie(options) {\n return function () {\n deleteCookie(SESSION_STORE_KEY, options);\n };\n}\nexport function buildCookieOptions(initConfiguration) {\n var cookieOptions = {};\n cookieOptions.secure = !!initConfiguration.useSecureSessionCookie || !!initConfiguration.useCrossSiteSessionCookie;\n cookieOptions.crossSite = !!initConfiguration.useCrossSiteSessionCookie;\n if (initConfiguration.trackSessionAcrossSubdomains) {\n cookieOptions.domain = getCurrentSite();\n }\n return cookieOptions;\n}\n","import { generateUUID } from '../../../tools/utils/stringUtils';\nimport { toSessionString, toSessionState } from '../sessionState';\nimport { SESSION_STORE_KEY } from './sessionStoreStrategy';\nvar LOCAL_STORAGE_TEST_KEY = '_dd_test_';\nexport function selectLocalStorageStrategy() {\n try {\n var id = generateUUID();\n var testKey = \"\".concat(LOCAL_STORAGE_TEST_KEY).concat(id);\n localStorage.setItem(testKey, id);\n var retrievedId = localStorage.getItem(testKey);\n localStorage.removeItem(testKey);\n return id === retrievedId ? {\n type: 'LocalStorage'\n } : undefined;\n } catch (e) {\n return undefined;\n }\n}\nexport function initLocalStorageStrategy() {\n return {\n persistSession: persistInLocalStorage,\n retrieveSession: retrieveSessionFromLocalStorage,\n clearSession: clearSessionFromLocalStorage\n };\n}\nfunction persistInLocalStorage(sessionState) {\n localStorage.setItem(SESSION_STORE_KEY, toSessionString(sessionState));\n}\nfunction retrieveSessionFromLocalStorage() {\n var sessionString = localStorage.getItem(SESSION_STORE_KEY);\n return toSessionState(sessionString);\n}\nfunction clearSessionFromLocalStorage() {\n localStorage.removeItem(SESSION_STORE_KEY);\n}\n","export function isIE() {\n return Boolean(document.documentMode);\n}\nexport function isChromium() {\n return !!window.chrome || /HeadlessChrome/.test(window.navigator.userAgent);\n}\n","import { setTimeout } from '../../tools/timer';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { isChromium } from '../../tools/utils/browserDetection';\nimport { expandSessionState, isSessionInExpiredState } from './sessionState';\nexport var LOCK_RETRY_DELAY = 10;\nexport var LOCK_MAX_TRIES = 100;\nvar bufferedOperations = [];\nvar ongoingOperations;\nexport function processSessionStoreOperations(operations, sessionStoreStrategy, numberOfRetries) {\n var _a;\n if (numberOfRetries === void 0) {\n numberOfRetries = 0;\n }\n var retrieveSession = sessionStoreStrategy.retrieveSession,\n persistSession = sessionStoreStrategy.persistSession,\n clearSession = sessionStoreStrategy.clearSession;\n var lockEnabled = isLockEnabled();\n if (!ongoingOperations) {\n ongoingOperations = operations;\n }\n if (operations !== ongoingOperations) {\n bufferedOperations.push(operations);\n return;\n }\n if (lockEnabled && numberOfRetries >= LOCK_MAX_TRIES) {\n next(sessionStoreStrategy);\n return;\n }\n var currentLock;\n var currentSession = retrieveSession();\n if (lockEnabled) {\n // if someone has lock, retry later\n if (currentSession.lock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n // acquire lock\n currentLock = generateUUID();\n currentSession.lock = currentLock;\n persistSession(currentSession);\n // if lock is not acquired, retry later\n currentSession = retrieveSession();\n if (currentSession.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n }\n var processedSession = operations.process(currentSession);\n if (lockEnabled) {\n // if lock corrupted after process, retry later\n currentSession = retrieveSession();\n if (currentSession.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n }\n if (processedSession) {\n if (isSessionInExpiredState(processedSession)) {\n clearSession();\n } else {\n expandSessionState(processedSession);\n persistSession(processedSession);\n }\n }\n if (lockEnabled) {\n // correctly handle lock around expiration would require to handle this case properly at several levels\n // since we don't have evidence of lock issues around expiration, let's just not do the corruption check for it\n if (!(processedSession && isSessionInExpiredState(processedSession))) {\n // if lock corrupted after persist, retry later\n currentSession = retrieveSession();\n if (currentSession.lock !== currentLock) {\n retryLater(operations, sessionStoreStrategy, numberOfRetries);\n return;\n }\n delete currentSession.lock;\n persistSession(currentSession);\n processedSession = currentSession;\n }\n }\n // call after even if session is not persisted in order to perform operations on\n // up-to-date session state value => the value could have been modified by another tab\n (_a = operations.after) === null || _a === void 0 ? void 0 : _a.call(operations, processedSession || currentSession);\n next(sessionStoreStrategy);\n}\n/**\n * Lock strategy allows mitigating issues due to concurrent access to cookie.\n * This issue concerns only chromium browsers and enabling this on firefox increases cookie write failures.\n */\nexport var isLockEnabled = function () {\n return isChromium();\n};\nfunction retryLater(operations, sessionStore, currentNumberOfRetries) {\n setTimeout(function () {\n processSessionStoreOperations(operations, sessionStore, currentNumberOfRetries + 1);\n }, LOCK_RETRY_DELAY);\n}\nfunction next(sessionStore) {\n ongoingOperations = undefined;\n var nextOperations = bufferedOperations.shift();\n if (nextOperations) {\n processSessionStoreOperations(nextOperations, sessionStore);\n }\n}\n","import { clearInterval, setInterval } from '../../tools/timer';\nimport { Observable } from '../../tools/observable';\nimport { ONE_SECOND, dateNow } from '../../tools/utils/timeUtils';\nimport { throttle } from '../../tools/utils/functionUtils';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { SESSION_TIME_OUT_DELAY } from './sessionConstants';\nimport { selectCookieStrategy, initCookieStrategy } from './storeStrategies/sessionInCookie';\nimport { initLocalStorageStrategy, selectLocalStorageStrategy } from './storeStrategies/sessionInLocalStorage';\nimport { processSessionStoreOperations } from './sessionStoreOperations';\n/**\n * Every second, the storage will be polled to check for any change that can occur\n * to the session state in another browser tab, or another window.\n * This value has been determined from our previous cookie-only implementation.\n */\nexport var STORAGE_POLL_DELAY = ONE_SECOND;\n/**\n * Checks if cookies are available as the preferred storage\n * Else, checks if LocalStorage is allowed and available\n */\nexport function selectSessionStoreStrategyType(initConfiguration) {\n var sessionStoreStrategyType = selectCookieStrategy(initConfiguration);\n if (!sessionStoreStrategyType && initConfiguration.allowFallbackToLocalStorage) {\n sessionStoreStrategyType = selectLocalStorageStrategy();\n }\n return sessionStoreStrategyType;\n}\n/**\n * Different session concepts:\n * - tracked, the session has an id and is updated along the user navigation\n * - not tracked, the session does not have an id but it is updated along the user navigation\n * - inactive, no session in store or session expired, waiting for a renew session\n */\nexport function startSessionStore(sessionStoreStrategyType, productKey, computeSessionState) {\n var renewObservable = new Observable();\n var expireObservable = new Observable();\n var sessionStoreStrategy = sessionStoreStrategyType.type === 'Cookie' ? initCookieStrategy(sessionStoreStrategyType.cookieOptions) : initLocalStorageStrategy();\n var clearSession = sessionStoreStrategy.clearSession,\n retrieveSession = sessionStoreStrategy.retrieveSession;\n var watchSessionTimeoutId = setInterval(watchSession, STORAGE_POLL_DELAY);\n var sessionCache = retrieveActiveSession();\n function expandOrRenewSession() {\n var isTracked;\n processSessionStoreOperations({\n process: function (sessionState) {\n var synchronizedSession = synchronizeSession(sessionState);\n isTracked = expandOrRenewSessionState(synchronizedSession);\n return synchronizedSession;\n },\n after: function (sessionState) {\n if (isTracked && !hasSessionInCache()) {\n renewSessionInCache(sessionState);\n }\n sessionCache = sessionState;\n }\n }, sessionStoreStrategy);\n }\n function expandSession() {\n processSessionStoreOperations({\n process: function (sessionState) {\n return hasSessionInCache() ? synchronizeSession(sessionState) : undefined;\n }\n }, sessionStoreStrategy);\n }\n /**\n * allows two behaviors:\n * - if the session is active, synchronize the session cache without updating the session store\n * - if the session is not active, clear the session store and expire the session cache\n */\n function watchSession() {\n processSessionStoreOperations({\n process: function (sessionState) {\n return !isActiveSession(sessionState) ? {} : undefined;\n },\n after: synchronizeSession\n }, sessionStoreStrategy);\n }\n function synchronizeSession(sessionState) {\n if (!isActiveSession(sessionState)) {\n sessionState = {};\n }\n if (hasSessionInCache()) {\n if (isSessionInCacheOutdated(sessionState)) {\n expireSessionInCache();\n } else {\n sessionCache = sessionState;\n }\n }\n return sessionState;\n }\n function expandOrRenewSessionState(sessionState) {\n var _a = computeSessionState(sessionState[productKey]),\n trackingType = _a.trackingType,\n isTracked = _a.isTracked;\n sessionState[productKey] = trackingType;\n if (isTracked && !sessionState.id) {\n sessionState.id = generateUUID();\n sessionState.created = String(dateNow());\n }\n return isTracked;\n }\n function hasSessionInCache() {\n return sessionCache[productKey] !== undefined;\n }\n function isSessionInCacheOutdated(sessionState) {\n return sessionCache.id !== sessionState.id || sessionCache[productKey] !== sessionState[productKey];\n }\n function expireSessionInCache() {\n sessionCache = {};\n expireObservable.notify();\n }\n function renewSessionInCache(sessionState) {\n sessionCache = sessionState;\n renewObservable.notify();\n }\n function retrieveActiveSession() {\n var session = retrieveSession();\n if (isActiveSession(session)) {\n return session;\n }\n return {};\n }\n function isActiveSession(sessionState) {\n // created and expire can be undefined for versions which was not storing them\n // these checks could be removed when older versions will not be available/live anymore\n return (sessionState.created === undefined || dateNow() - Number(sessionState.created) < SESSION_TIME_OUT_DELAY) && (sessionState.expire === undefined || dateNow() < Number(sessionState.expire));\n }\n return {\n expandOrRenewSession: throttle(expandOrRenewSession, STORAGE_POLL_DELAY).throttled,\n expandSession: expandSession,\n getSession: function () {\n return sessionCache;\n },\n renewObservable: renewObservable,\n expireObservable: expireObservable,\n expire: function () {\n clearSession();\n synchronizeSession({});\n },\n stop: function () {\n clearInterval(watchSessionTimeoutId);\n }\n };\n}\n","import { noop } from '../utils/functionUtils';\n/**\n * Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that\n * because some sites badly override toJSON on certain objects. Removing all toJSON methods from\n * nested values would be too costly, so we just detach them from the root value, and native classes\n * used to build JSON values (Array and Object).\n *\n * Note: this still assumes that JSON.stringify is correct.\n */\nexport function jsonStringify(value, replacer, space) {\n if (typeof value !== 'object' || value === null) {\n return JSON.stringify(value);\n }\n // Note: The order matter here. We need to detach toJSON methods on parent classes before their\n // subclasses.\n var restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);\n var restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);\n var restoreValuePrototypeToJson = detachToJsonMethod(Object.getPrototypeOf(value));\n var restoreValueToJson = detachToJsonMethod(value);\n try {\n return JSON.stringify(value, replacer, space);\n } catch (_a) {\n return '';\n } finally {\n restoreObjectPrototypeToJson();\n restoreArrayPrototypeToJson();\n restoreValuePrototypeToJson();\n restoreValueToJson();\n }\n}\nexport function detachToJsonMethod(value) {\n var object = value;\n var objectToJson = object.toJSON;\n if (objectToJson) {\n delete object.toJSON;\n return function () {\n object.toJSON = objectToJson;\n };\n }\n return noop;\n}\n","import { jsonStringify } from '../serialisation/jsonStringify';\nexport function normalizeUrl(url) {\n return buildUrl(url, getLocationOrigin()).href;\n}\nexport function isValidUrl(url) {\n try {\n return !!buildUrl(url);\n } catch (_a) {\n return false;\n }\n}\nexport function haveSameOrigin(url1, url2) {\n return getOrigin(url1) === getOrigin(url2);\n}\nexport function getOrigin(url) {\n return getLinkElementOrigin(buildUrl(url));\n}\nexport function getPathName(url) {\n var pathname = buildUrl(url).pathname;\n return pathname[0] === '/' ? pathname : \"/\".concat(pathname);\n}\nexport function getSearch(url) {\n return buildUrl(url).search;\n}\nexport function getHash(url) {\n return buildUrl(url).hash;\n}\nexport function buildUrl(url, base) {\n var supportedURL = getSupportedUrl();\n if (supportedURL) {\n try {\n return base !== undefined ? new supportedURL(url, base) : new supportedURL(url);\n } catch (error) {\n throw new Error(\"Failed to construct URL: \".concat(String(error), \" \").concat(jsonStringify({\n url: url,\n base: base\n })));\n }\n }\n if (base === undefined && !/:/.test(url)) {\n throw new Error(\"Invalid URL: '\".concat(url, \"'\"));\n }\n var doc = document;\n var anchorElement = doc.createElement('a');\n if (base !== undefined) {\n doc = document.implementation.createHTMLDocument('');\n var baseElement = doc.createElement('base');\n baseElement.href = base;\n doc.head.appendChild(baseElement);\n doc.body.appendChild(anchorElement);\n }\n anchorElement.href = url;\n return anchorElement;\n}\nvar originalURL = URL;\nvar isURLSupported;\nfunction getSupportedUrl() {\n if (isURLSupported === undefined) {\n try {\n var url = new originalURL('http://test/path');\n isURLSupported = url.href === 'http://test/path';\n } catch (_a) {\n isURLSupported = false;\n }\n }\n return isURLSupported ? originalURL : undefined;\n}\nexport function getLocationOrigin() {\n return getLinkElementOrigin(window.location);\n}\n/**\n * IE fallback\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin\n */\nexport function getLinkElementOrigin(element) {\n if (element.origin) {\n return element.origin;\n }\n var sanitizedHost = element.host.replace(/(:80|:443)$/, '');\n return \"\".concat(element.protocol, \"//\").concat(sanitizedHost);\n}\n","export var INTAKE_SITE_STAGING = 'datad0g.com';\nexport var INTAKE_SITE_US1 = 'datadoghq.com';\nexport var INTAKE_SITE_EU1 = 'datadoghq.eu';\nexport var INTAKE_SITE_AP1 = 'ap1.datadoghq.com';\nexport var INTAKE_SITE_US1_FED = 'ddog-gov.com';\n","import { timeStampNow } from '../../tools/utils/timeUtils';\nimport { normalizeUrl } from '../../tools/utils/urlPolyfill';\nimport { ExperimentalFeature, isExperimentalFeatureEnabled } from '../../tools/experimentalFeatures';\nimport { generateUUID } from '../../tools/utils/stringUtils';\nimport { INTAKE_SITE_AP1, INTAKE_SITE_US1 } from './intakeSites';\nexport var ENDPOINTS = {\n logs: 'logs',\n rum: 'rum',\n sessionReplay: 'session-replay'\n};\nvar INTAKE_TRACKS = {\n logs: 'logs',\n rum: 'rum',\n sessionReplay: 'replay'\n};\nexport function createEndpointBuilder(initConfiguration, endpointType, configurationTags) {\n var buildUrlWithParameters = createEndpointUrlWithParametersBuilder(initConfiguration, endpointType);\n return {\n build: function (api, flushReason, retry) {\n var parameters = buildEndpointParameters(initConfiguration, endpointType, configurationTags, api, flushReason, retry);\n return buildUrlWithParameters(parameters);\n },\n urlPrefix: buildUrlWithParameters(''),\n endpointType: endpointType\n };\n}\n/**\n * Create a function used to build a full endpoint url from provided parameters. The goal of this\n * function is to pre-compute some parts of the URL to avoid re-computing everything on every\n * request, as only parameters are changing.\n */\nfunction createEndpointUrlWithParametersBuilder(initConfiguration, endpointType) {\n var path = \"/api/v2/\".concat(INTAKE_TRACKS[endpointType]);\n var proxy = initConfiguration.proxy,\n proxyUrl = initConfiguration.proxyUrl;\n if (proxy) {\n var normalizedProxyUrl_1 = normalizeUrl(proxy);\n return function (parameters) {\n return \"\".concat(normalizedProxyUrl_1, \"?ddforward=\").concat(encodeURIComponent(\"\".concat(path, \"?\").concat(parameters)));\n };\n }\n var host = buildEndpointHost(initConfiguration, endpointType);\n if (proxy === undefined && proxyUrl) {\n // TODO: remove this in a future major.\n var normalizedProxyUrl_2 = normalizeUrl(proxyUrl);\n return function (parameters) {\n return \"\".concat(normalizedProxyUrl_2, \"?ddforward=\").concat(encodeURIComponent(\"https://\".concat(host).concat(path, \"?\").concat(parameters)));\n };\n }\n return function (parameters) {\n return \"https://\".concat(host).concat(path, \"?\").concat(parameters);\n };\n}\nfunction buildEndpointHost(initConfiguration, endpointType) {\n var _a = initConfiguration.site,\n site = _a === void 0 ? INTAKE_SITE_US1 : _a,\n internalAnalyticsSubdomain = initConfiguration.internalAnalyticsSubdomain;\n if (internalAnalyticsSubdomain && site === INTAKE_SITE_US1) {\n return \"\".concat(internalAnalyticsSubdomain, \".\").concat(INTAKE_SITE_US1);\n }\n var domainParts = site.split('.');\n var extension = domainParts.pop();\n var subdomain = site !== INTAKE_SITE_AP1 ? \"\".concat(ENDPOINTS[endpointType], \".\") : '';\n return \"\".concat(subdomain, \"browser-intake-\").concat(domainParts.join('-'), \".\").concat(extension);\n}\n/**\n * Build parameters to be used for an intake request. Parameters should be re-built for each\n * request, as they change randomly.\n */\nfunction buildEndpointParameters(_a, endpointType, configurationTags, api, flushReason, retry) {\n var clientToken = _a.clientToken,\n internalAnalyticsSubdomain = _a.internalAnalyticsSubdomain;\n var tags = [\"sdk_version:\".concat(\"4.43.0\"), \"api:\".concat(api)].concat(configurationTags);\n if (flushReason && isExperimentalFeatureEnabled(ExperimentalFeature.COLLECT_FLUSH_REASON)) {\n tags.push(\"flush_reason:\".concat(flushReason));\n }\n if (retry) {\n tags.push(\"retry_count:\".concat(retry.count), \"retry_after:\".concat(retry.lastFailureStatus));\n }\n var parameters = ['ddsource=browser', \"ddtags=\".concat(encodeURIComponent(tags.join(','))), \"dd-api-key=\".concat(clientToken), \"dd-evp-origin-version=\".concat(encodeURIComponent(\"4.43.0\")), 'dd-evp-origin=browser', \"dd-request-id=\".concat(generateUUID())];\n if (endpointType === 'rum') {\n parameters.push(\"batch_time=\".concat(timeStampNow()));\n }\n if (internalAnalyticsSubdomain) {\n parameters.reverse();\n }\n return parameters.join('&');\n}\n","import { display } from '../../tools/display';\nexport var TAG_SIZE_LIMIT = 200;\nexport function buildTags(configuration) {\n var env = configuration.env,\n service = configuration.service,\n version = configuration.version,\n datacenter = configuration.datacenter;\n var tags = [];\n if (env) {\n tags.push(buildTag('env', env));\n }\n if (service) {\n tags.push(buildTag('service', service));\n }\n if (version) {\n tags.push(buildTag('version', version));\n }\n if (datacenter) {\n tags.push(buildTag('datacenter', datacenter));\n }\n return tags;\n}\nvar FORBIDDEN_CHARACTERS = /[^a-z0-9_:./-]/;\nexport function buildTag(key, rawValue) {\n // See https://docs.datadoghq.com/getting_started/tagging/#defining-tags for tags syntax. Note\n // that the backend may not follow the exact same rules, so we only want to display an informal\n // warning.\n var valueSizeLimit = TAG_SIZE_LIMIT - key.length - 1;\n if (rawValue.length > valueSizeLimit || FORBIDDEN_CHARACTERS.test(rawValue)) {\n display.warn(\"\".concat(key, \" value doesn't meet tag requirements and will be sanitized\"));\n }\n // Let the backend do most of the sanitization, but still make sure multiple tags can't be crafted\n // by forging a value containing commas.\n var sanitizedValue = rawValue.replace(/,/g, '_');\n return \"\".concat(key, \":\").concat(sanitizedValue);\n}\n","import { objectValues, assign } from '../../tools/utils/polyfills';\nimport { createEndpointBuilder } from './endpointBuilder';\nimport { buildTags } from './tags';\nimport { INTAKE_SITE_US1 } from './intakeSites';\nexport function computeTransportConfiguration(initConfiguration) {\n var tags = buildTags(initConfiguration);\n var endpointBuilders = computeEndpointBuilders(initConfiguration, tags);\n var intakeUrlPrefixes = objectValues(endpointBuilders).map(function (builder) {\n return builder.urlPrefix;\n });\n var replicaConfiguration = computeReplicaConfiguration(initConfiguration, intakeUrlPrefixes, tags);\n return assign({\n isIntakeUrl: function (url) {\n return intakeUrlPrefixes.some(function (intakeEndpoint) {\n return url.indexOf(intakeEndpoint) === 0;\n });\n },\n replica: replicaConfiguration,\n site: initConfiguration.site || INTAKE_SITE_US1\n }, endpointBuilders);\n}\nfunction computeEndpointBuilders(initConfiguration, tags) {\n return {\n logsEndpointBuilder: createEndpointBuilder(initConfiguration, 'logs', tags),\n rumEndpointBuilder: createEndpointBuilder(initConfiguration, 'rum', tags),\n sessionReplayEndpointBuilder: createEndpointBuilder(initConfiguration, 'sessionReplay', tags)\n };\n}\nfunction computeReplicaConfiguration(initConfiguration, intakeUrlPrefixes, tags) {\n if (!initConfiguration.replica) {\n return;\n }\n var replicaConfiguration = assign({}, initConfiguration, {\n site: INTAKE_SITE_US1,\n clientToken: initConfiguration.replica.clientToken\n });\n var replicaEndpointBuilders = {\n logsEndpointBuilder: createEndpointBuilder(replicaConfiguration, 'logs', tags),\n rumEndpointBuilder: createEndpointBuilder(replicaConfiguration, 'rum', tags)\n };\n intakeUrlPrefixes.push.apply(intakeUrlPrefixes, objectValues(replicaEndpointBuilders).map(function (builder) {\n return builder.urlPrefix;\n }));\n return assign({\n applicationId: initConfiguration.replica.applicationId\n }, replicaEndpointBuilders);\n}\n","import { catchUserErrors } from '../../tools/catchUserErrors';\nimport { display } from '../../tools/display';\nimport { ExperimentalFeature, addExperimentalFeatures } from '../../tools/experimentalFeatures';\nimport { ONE_SECOND } from '../../tools/utils/timeUtils';\nimport { isPercentage } from '../../tools/utils/numberUtils';\nimport { ONE_KIBI_BYTE } from '../../tools/utils/byteUtils';\nimport { objectHasValue } from '../../tools/utils/objectUtils';\nimport { assign } from '../../tools/utils/polyfills';\nimport { selectSessionStoreStrategyType } from '../session/sessionStore';\nimport { computeTransportConfiguration } from './transportConfiguration';\nexport var DefaultPrivacyLevel = {\n ALLOW: 'allow',\n MASK: 'mask',\n MASK_USER_INPUT: 'mask-user-input'\n};\nexport function validateAndBuildConfiguration(initConfiguration) {\n var _a, _b, _c;\n if (!initConfiguration || !initConfiguration.clientToken) {\n display.error('Client Token is not configured, we will not send any data.');\n return;\n }\n var sessionSampleRate = (_a = initConfiguration.sessionSampleRate) !== null && _a !== void 0 ? _a : initConfiguration.sampleRate;\n if (sessionSampleRate !== undefined && !isPercentage(sessionSampleRate)) {\n display.error('Session Sample Rate should be a number between 0 and 100');\n return;\n }\n if (initConfiguration.telemetrySampleRate !== undefined && !isPercentage(initConfiguration.telemetrySampleRate)) {\n display.error('Telemetry Sample Rate should be a number between 0 and 100');\n return;\n }\n if (initConfiguration.telemetryConfigurationSampleRate !== undefined && !isPercentage(initConfiguration.telemetryConfigurationSampleRate)) {\n display.error('Telemetry Configuration Sample Rate should be a number between 0 and 100');\n return;\n }\n // Set the experimental feature flags as early as possible, so we can use them in most places\n if (Array.isArray(initConfiguration.enableExperimentalFeatures)) {\n addExperimentalFeatures(initConfiguration.enableExperimentalFeatures.filter(function (flag) {\n return objectHasValue(ExperimentalFeature, flag);\n }));\n }\n return assign({\n beforeSend: initConfiguration.beforeSend && catchUserErrors(initConfiguration.beforeSend, 'beforeSend threw an error:'),\n sessionStoreStrategyType: selectSessionStoreStrategyType(initConfiguration),\n sessionSampleRate: sessionSampleRate !== null && sessionSampleRate !== void 0 ? sessionSampleRate : 100,\n telemetrySampleRate: (_b = initConfiguration.telemetrySampleRate) !== null && _b !== void 0 ? _b : 20,\n telemetryConfigurationSampleRate: (_c = initConfiguration.telemetryConfigurationSampleRate) !== null && _c !== void 0 ? _c : 5,\n service: initConfiguration.service,\n silentMultipleInit: !!initConfiguration.silentMultipleInit,\n /**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\n batchBytesLimit: 16 * ONE_KIBI_BYTE,\n eventRateLimiterThreshold: 3000,\n maxTelemetryEventsPerPage: 15,\n /**\n * flush automatically, aim to be lower than ALB connection timeout\n * to maximize connection reuse.\n */\n flushTimeout: 30 * ONE_SECOND,\n /**\n * Logs intake limit\n */\n batchMessagesLimit: 50,\n messageBytesLimit: 256 * ONE_KIBI_BYTE\n }, computeTransportConfiguration(initConfiguration));\n}\nexport function serializeConfiguration(initConfiguration) {\n var _a, _b;\n var proxy = (_a = initConfiguration.proxy) !== null && _a !== void 0 ? _a : initConfiguration.proxyUrl;\n return {\n session_sample_rate: (_b = initConfiguration.sessionSampleRate) !== null && _b !== void 0 ? _b : initConfiguration.sampleRate,\n telemetry_sample_rate: initConfiguration.telemetrySampleRate,\n telemetry_configuration_sample_rate: initConfiguration.telemetryConfigurationSampleRate,\n use_before_send: !!initConfiguration.beforeSend,\n use_cross_site_session_cookie: initConfiguration.useCrossSiteSessionCookie,\n use_secure_session_cookie: initConfiguration.useSecureSessionCookie,\n use_proxy: proxy !== undefined ? !!proxy : undefined,\n silent_multiple_init: initConfiguration.silentMultipleInit,\n track_session_across_subdomains: initConfiguration.trackSessionAcrossSubdomains,\n track_resources: initConfiguration.trackResources,\n track_long_task: initConfiguration.trackLongTasks,\n allow_fallback_to_local_storage: !!initConfiguration.allowFallbackToLocalStorage\n };\n}\n","import { startsWith } from '../../tools/utils/polyfills';\nvar UNKNOWN_FUNCTION = '?';\n/**\n * Computes a stack trace for an exception.\n */\nexport function computeStackTrace(ex) {\n var stack = [];\n var stackProperty = tryToGetString(ex, 'stack');\n var exString = String(ex);\n if (stackProperty && startsWith(stackProperty, exString)) {\n stackProperty = stackProperty.slice(exString.length);\n }\n if (stackProperty) {\n stackProperty.split('\\n').forEach(function (line) {\n var stackFrame = parseChromeLine(line) || parseChromeAnonymousLine(line) || parseWinLine(line) || parseGeckoLine(line);\n if (stackFrame) {\n if (!stackFrame.func && stackFrame.line) {\n stackFrame.func = UNKNOWN_FUNCTION;\n }\n stack.push(stackFrame);\n }\n });\n }\n return {\n message: tryToGetString(ex, 'message'),\n name: tryToGetString(ex, 'name'),\n stack: stack\n };\n}\nvar fileUrl = '((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet||\\\\w+\\\\.|\\\\/).*?)';\nvar filePosition = '(?::(\\\\d+))';\nvar CHROME_LINE_RE = new RegExp(\"^\\\\s*at (.*?) ?\\\\(\".concat(fileUrl).concat(filePosition, \"?\").concat(filePosition, \"?\\\\)?\\\\s*$\"), 'i');\nvar CHROME_EVAL_RE = new RegExp(\"\\\\((\\\\S*)\".concat(filePosition).concat(filePosition, \"\\\\)\"));\nfunction parseChromeLine(line) {\n var parts = CHROME_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n var submatch = CHROME_EVAL_RE.exec(parts[2]);\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n return {\n args: isNative ? [parts[2]] : [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[3] ? +parts[3] : undefined,\n url: !isNative ? parts[2] : undefined\n };\n}\nvar CHROME_ANONYMOUS_FUNCTION_RE = new RegExp(\"^\\\\s*at ?\".concat(fileUrl).concat(filePosition, \"?\").concat(filePosition, \"??\\\\s*$\"), 'i');\nfunction parseChromeAnonymousLine(line) {\n var parts = CHROME_ANONYMOUS_FUNCTION_RE.exec(line);\n if (!parts) {\n return;\n }\n return {\n args: [],\n column: parts[3] ? +parts[3] : undefined,\n func: UNKNOWN_FUNCTION,\n line: parts[2] ? +parts[2] : undefined,\n url: parts[1]\n };\n}\nvar WINJS_LINE_RE = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nfunction parseWinLine(line) {\n var parts = WINJS_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n return {\n args: [],\n column: parts[4] ? +parts[4] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: +parts[3],\n url: parts[2]\n };\n}\nvar GECKO_LINE_RE = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar GECKO_EVAL_RE = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nfunction parseGeckoLine(line) {\n var parts = GECKO_LINE_RE.exec(line);\n if (!parts) {\n return;\n }\n var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n var submatch = GECKO_EVAL_RE.exec(parts[3]);\n if (isEval && submatch) {\n // throw out eval line/column and use top-most line number\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = undefined; // no column when eval\n }\n return {\n args: parts[2] ? parts[2].split(',') : [],\n column: parts[5] ? +parts[5] : undefined,\n func: parts[1] || UNKNOWN_FUNCTION,\n line: parts[4] ? +parts[4] : undefined,\n url: parts[3]\n };\n}\nfunction tryToGetString(candidate, property) {\n if (typeof candidate !== 'object' || !candidate || !(property in candidate)) {\n return undefined;\n }\n var value = candidate[property];\n return typeof value === 'string' ? value : undefined;\n}\n","import { setTimeout } from './timer';\nimport { callMonitored } from './monitor';\nimport { noop } from './utils/functionUtils';\nexport function instrumentMethod(object, method, instrumentationFactory) {\n var original = object[method];\n var instrumentation = instrumentationFactory(original);\n var instrumentationWrapper = function () {\n if (typeof instrumentation !== 'function') {\n return undefined;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return instrumentation.apply(this, arguments);\n };\n object[method] = instrumentationWrapper;\n return {\n stop: function () {\n if (object[method] === instrumentationWrapper) {\n object[method] = original;\n } else {\n instrumentation = original;\n }\n }\n };\n}\nexport function instrumentMethodAndCallOriginal(object, method, _a) {\n var before = _a.before,\n after = _a.after;\n return instrumentMethod(object, method, function (original) {\n return function () {\n var args = arguments;\n var result;\n if (before) {\n callMonitored(before, this, args);\n }\n if (typeof original === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n result = original.apply(this, args);\n }\n if (after) {\n callMonitored(after, this, args);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return result;\n };\n });\n}\nexport function instrumentSetter(object, property, after) {\n var originalDescriptor = Object.getOwnPropertyDescriptor(object, property);\n if (!originalDescriptor || !originalDescriptor.set || !originalDescriptor.configurable) {\n return {\n stop: noop\n };\n }\n var instrumentation = function (thisObject, value) {\n // put hooked setter into event loop to avoid of set latency\n setTimeout(function () {\n after(thisObject, value);\n }, 0);\n };\n var instrumentationWrapper = function (value) {\n originalDescriptor.set.call(this, value);\n instrumentation(this, value);\n };\n Object.defineProperty(object, property, {\n set: instrumentationWrapper\n });\n return {\n stop: function () {\n var _a;\n if (((_a = Object.getOwnPropertyDescriptor(object, property)) === null || _a === void 0 ? void 0 : _a.set) === instrumentationWrapper) {\n Object.defineProperty(object, property, originalDescriptor);\n } else {\n instrumentation = noop;\n }\n }\n };\n}\n","import { instrumentMethodAndCallOriginal } from '../../tools/instrumentMethod';\nimport { computeStackTrace } from './computeStackTrace';\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types\nvar ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;\n/**\n * Cross-browser collection of unhandled errors\n *\n * Supports:\n * - Firefox: full stack trace with line numbers, plus column number\n * on top frame; column number is not guaranteed\n * - Opera: full stack trace with line and column numbers\n * - Chrome: full stack trace with line and column numbers\n * - Safari: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n * - IE: line and column number for the top frame only; some frames\n * may be missing, and column number is not guaranteed\n *\n * In theory, TraceKit should work on all of the following versions:\n * - IE5.5+ (only 8.0 tested)\n * - Firefox 0.9+ (only 3.5+ tested)\n * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require\n * Exceptions Have Stacktrace to be enabled in opera:config)\n * - Safari 3+ (only 4+ tested)\n * - Chrome 1+ (only 5+ tested)\n * - Konqueror 3.5+ (untested)\n *\n * Tries to catch all unhandled errors and report them to the\n * callback.\n *\n * Callbacks receive a StackTrace object as described in the\n * computeStackTrace docs.\n *\n * @memberof TraceKit\n * @namespace\n */\nexport function startUnhandledErrorCollection(callback) {\n var stopInstrumentingOnError = instrumentOnError(callback).stop;\n var stopInstrumentingOnUnhandledRejection = instrumentUnhandledRejection(callback).stop;\n return {\n stop: function () {\n stopInstrumentingOnError();\n stopInstrumentingOnUnhandledRejection();\n }\n };\n}\n/**\n * Install a global onerror handler\n */\nfunction instrumentOnError(callback) {\n return instrumentMethodAndCallOriginal(window, 'onerror', {\n before: function (messageObj, url, line, column, errorObj) {\n var stackTrace;\n if (errorObj instanceof Error) {\n stackTrace = computeStackTrace(errorObj);\n } else {\n var stack = [{\n url: url,\n column: column,\n line: line\n }];\n var _a = tryToParseMessage(messageObj),\n name_1 = _a.name,\n message = _a.message;\n stackTrace = {\n name: name_1,\n message: message,\n stack: stack\n };\n }\n callback(stackTrace, errorObj !== null && errorObj !== void 0 ? errorObj : messageObj);\n }\n });\n}\nfunction tryToParseMessage(messageObj) {\n var _a;\n var name;\n var message;\n if ({}.toString.call(messageObj) === '[object String]') {\n ;\n _a = ERROR_TYPES_RE.exec(messageObj), name = _a[1], message = _a[2];\n }\n return {\n name: name,\n message: message\n };\n}\n/**\n * Install a global onunhandledrejection handler\n */\nfunction instrumentUnhandledRejection(callback) {\n return instrumentMethodAndCallOriginal(window, 'onunhandledrejection', {\n before: function (e) {\n var reason = e.reason || 'Empty reason';\n var stack = computeStackTrace(reason);\n callback(stack, reason);\n }\n });\n}\n","import { display } from '../display';\nimport { ONE_KIBI_BYTE } from '../utils/byteUtils';\nimport { detachToJsonMethod } from './jsonStringify';\n// The maximum size of a single event is 256KiB. By default, we ensure that user-provided data\n// going through sanitize fits inside our events, while leaving room for other contexts, metadata, ...\nvar SANITIZE_DEFAULT_MAX_CHARACTER_COUNT = 220 * ONE_KIBI_BYTE;\n// Symbol for the root element of the JSONPath used for visited objects\nvar JSON_PATH_ROOT_ELEMENT = '$';\n// When serializing (using JSON.stringify) a key of an object, { key: 42 } gets wrapped in quotes as \"key\".\n// With the separator (:), we need to add 3 characters to the count.\nvar KEY_DECORATION_LENGTH = 3;\nexport function sanitize(source, maxCharacterCount) {\n var _a;\n if (maxCharacterCount === void 0) {\n maxCharacterCount = SANITIZE_DEFAULT_MAX_CHARACTER_COUNT;\n }\n // Unbind any toJSON function we may have on [] or {} prototypes\n var restoreObjectPrototypeToJson = detachToJsonMethod(Object.prototype);\n var restoreArrayPrototypeToJson = detachToJsonMethod(Array.prototype);\n // Initial call to sanitizeProcessor - will populate containerQueue if source is an Array or a plain Object\n var containerQueue = [];\n var visitedObjectsWithPath = new WeakMap();\n var sanitizedData = sanitizeProcessor(source, JSON_PATH_ROOT_ELEMENT, undefined, containerQueue, visitedObjectsWithPath);\n var accumulatedCharacterCount = ((_a = JSON.stringify(sanitizedData)) === null || _a === void 0 ? void 0 : _a.length) || 0;\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'discarded', source);\n return undefined;\n }\n while (containerQueue.length > 0 && accumulatedCharacterCount < maxCharacterCount) {\n var containerToProcess = containerQueue.shift();\n var separatorLength = 0; // 0 for the first element, 1 for subsequent elements\n // Arrays and Objects have to be handled distinctly to ensure\n // we do not pick up non-numerical properties from Arrays\n if (Array.isArray(containerToProcess.source)) {\n for (var key = 0; key < containerToProcess.source.length; key++) {\n var targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);\n if (targetData !== undefined) {\n accumulatedCharacterCount += JSON.stringify(targetData).length;\n } else {\n // When an element of an Array (targetData) is undefined, it is serialized as null:\n // JSON.stringify([undefined]) => '[null]' - This accounts for 4 characters\n accumulatedCharacterCount += 4;\n }\n accumulatedCharacterCount += separatorLength;\n separatorLength = 1;\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'truncated', source);\n break;\n }\n ;\n containerToProcess.target[key] = targetData;\n }\n } else {\n for (var key in containerToProcess.source) {\n if (Object.prototype.hasOwnProperty.call(containerToProcess.source, key)) {\n var targetData = sanitizeProcessor(containerToProcess.source[key], containerToProcess.path, key, containerQueue, visitedObjectsWithPath);\n // When a property of an object has an undefined value, it will be dropped during serialization:\n // JSON.stringify({a:undefined}) => '{}'\n if (targetData !== undefined) {\n accumulatedCharacterCount += JSON.stringify(targetData).length + separatorLength + key.length + KEY_DECORATION_LENGTH;\n separatorLength = 1;\n }\n if (accumulatedCharacterCount > maxCharacterCount) {\n warnOverCharacterLimit(maxCharacterCount, 'truncated', source);\n break;\n }\n ;\n containerToProcess.target[key] = targetData;\n }\n }\n }\n }\n // Rebind detached toJSON functions\n restoreObjectPrototypeToJson();\n restoreArrayPrototypeToJson();\n return sanitizedData;\n}\n/**\n * Internal function to factorize the process common to the\n * initial call to sanitize, and iterations for Arrays and Objects\n *\n */\nfunction sanitizeProcessor(source, parentPath, key, queue, visitedObjectsWithPath) {\n // Start by handling toJSON, as we want to sanitize its output\n var sourceToSanitize = tryToApplyToJSON(source);\n if (!sourceToSanitize || typeof sourceToSanitize !== 'object') {\n return sanitizePrimitivesAndFunctions(sourceToSanitize);\n }\n var sanitizedSource = sanitizeObjects(sourceToSanitize);\n if (sanitizedSource !== '[Object]' && sanitizedSource !== '[Array]' && sanitizedSource !== '[Error]') {\n return sanitizedSource;\n }\n // Handle potential cyclic references\n // We need to use source as sourceToSanitize could be a reference to a new object\n // At this stage, we know the source is an object type\n var sourceAsObject = source;\n if (visitedObjectsWithPath.has(sourceAsObject)) {\n return \"[Reference seen at \".concat(visitedObjectsWithPath.get(sourceAsObject), \"]\");\n }\n // Add processed source to queue\n var currentPath = key !== undefined ? \"\".concat(parentPath, \".\").concat(key) : parentPath;\n var target = Array.isArray(sourceToSanitize) ? [] : {};\n visitedObjectsWithPath.set(sourceAsObject, currentPath);\n queue.push({\n source: sourceToSanitize,\n target: target,\n path: currentPath\n });\n return target;\n}\n/**\n * Handles sanitization of simple, non-object types\n *\n */\nfunction sanitizePrimitivesAndFunctions(value) {\n // BigInt cannot be serialized by JSON.stringify(), convert it to a string representation\n if (typeof value === 'bigint') {\n return \"[BigInt] \".concat(value.toString());\n }\n // Functions cannot be serialized by JSON.stringify(). Moreover, if a faulty toJSON is present, it needs to be converted\n // so it won't prevent stringify from serializing later\n if (typeof value === 'function') {\n return \"[Function] \".concat(value.name || 'unknown');\n }\n // JSON.stringify() does not serialize symbols.\n if (typeof value === 'symbol') {\n return \"[Symbol] \".concat(value.description || value.toString());\n }\n return value;\n}\n/**\n * Handles sanitization of object types\n *\n * LIMITATIONS\n * - If a class defines a toStringTag Symbol, it will fall in the catch-all method and prevent enumeration of properties.\n * To avoid this, a toJSON method can be defined.\n * - IE11 does not return a distinct type for objects such as Map, WeakMap, ... These objects will pass through and their\n * properties enumerated if any.\n *\n */\nfunction sanitizeObjects(value) {\n try {\n // Handle events - Keep a simple implementation to avoid breaking changes\n if (value instanceof Event) {\n return {\n isTrusted: value.isTrusted\n };\n }\n // Handle all remaining object types in a generic way\n var result = Object.prototype.toString.call(value);\n var match = result.match(/\\[object (.*)\\]/);\n if (match && match[1]) {\n return \"[\".concat(match[1], \"]\");\n }\n } catch (_a) {\n // If the previous serialization attempts failed, and we cannot convert using\n // Object.prototype.toString, declare the value unserializable\n }\n return '[Unserializable]';\n}\n/**\n * Checks if a toJSON function exists and tries to execute it\n *\n */\nfunction tryToApplyToJSON(value) {\n var object = value;\n if (object && typeof object.toJSON === 'function') {\n try {\n return object.toJSON();\n } catch (_a) {\n // If toJSON fails, we continue by trying to serialize the value manually\n }\n }\n return value;\n}\n/**\n * Helper function to display the warning when the accumulated character count is over the limit\n */\nfunction warnOverCharacterLimit(maxCharacterCount, changeType, source) {\n display.warn(\"The data provided has been \".concat(changeType, \" as it is over the limit of \").concat(maxCharacterCount, \" characters:\"), source);\n}\n","import { computeStackTrace } from '../tracekit';\nimport { callMonitored } from '../../tools/monitor';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { noop } from '../../tools/utils/functionUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nexport var NO_ERROR_STACK_PRESENT_MESSAGE = 'No stack, consider using an instance of Error';\nexport function computeRawError(_a) {\n var stackTrace = _a.stackTrace,\n originalError = _a.originalError,\n handlingStack = _a.handlingStack,\n startClocks = _a.startClocks,\n nonErrorPrefix = _a.nonErrorPrefix,\n source = _a.source,\n handling = _a.handling;\n var isErrorInstance = originalError instanceof Error;\n var message = computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError);\n var stack = hasUsableStack(isErrorInstance, stackTrace) ? toStackTraceString(stackTrace) : NO_ERROR_STACK_PRESENT_MESSAGE;\n var causes = isErrorInstance ? flattenErrorCauses(originalError, source) : undefined;\n var type = stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name;\n var fingerprint = tryToGetFingerprint(originalError);\n return {\n startClocks: startClocks,\n source: source,\n handling: handling,\n handlingStack: handlingStack,\n originalError: originalError,\n type: type,\n message: message,\n stack: stack,\n causes: causes,\n fingerprint: fingerprint\n };\n}\nfunction computeMessage(stackTrace, isErrorInstance, nonErrorPrefix, originalError) {\n // Favor stackTrace message only if tracekit has really been able to extract something meaningful (message + name)\n // TODO rework tracekit integration to avoid scattering error building logic\n return (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.message) && (stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name) ? stackTrace.message : !isErrorInstance ? \"\".concat(nonErrorPrefix, \" \").concat(jsonStringify(sanitize(originalError))) : 'Empty message';\n}\nfunction hasUsableStack(isErrorInstance, stackTrace) {\n if (stackTrace === undefined) {\n return false;\n }\n if (isErrorInstance) {\n return true;\n }\n // handle cases where tracekit return stack = [] or stack = [{url: undefined, line: undefined, column: undefined}]\n // TODO rework tracekit integration to avoid generating those unusable stack\n return stackTrace.stack.length > 0 && (stackTrace.stack.length > 1 || stackTrace.stack[0].url !== undefined);\n}\nexport function tryToGetFingerprint(originalError) {\n return originalError instanceof Error && 'dd_fingerprint' in originalError ? String(originalError.dd_fingerprint) : undefined;\n}\nexport function toStackTraceString(stack) {\n var result = formatErrorMessage(stack);\n stack.stack.forEach(function (frame) {\n var func = frame.func === '?' ? '' : frame.func;\n var args = frame.args && frame.args.length > 0 ? \"(\".concat(frame.args.join(', '), \")\") : '';\n var line = frame.line ? \":\".concat(frame.line) : '';\n var column = frame.line && frame.column ? \":\".concat(frame.column) : '';\n result += \"\\n at \".concat(func).concat(args, \" @ \").concat(frame.url).concat(line).concat(column);\n });\n return result;\n}\nexport function getFileFromStackTraceString(stack) {\n var _a;\n return (_a = /@ (.+)/.exec(stack)) === null || _a === void 0 ? void 0 : _a[1];\n}\nexport function formatErrorMessage(stack) {\n return \"\".concat(stack.name || 'Error', \": \").concat(stack.message);\n}\n/**\n Creates a stacktrace without SDK internal frames.\n \n Constraints:\n - Has to be called at the utmost position of the call stack.\n - No monitored function should encapsulate it, that is why we need to use callMonitored inside it.\n */\nexport function createHandlingStack() {\n /**\n * Skip the two internal frames:\n * - SDK API (console.error, ...)\n * - this function\n * in order to keep only the user calls\n */\n var internalFramesToSkip = 2;\n var error = new Error();\n var formattedStack;\n // IE needs to throw the error to fill in the stack trace\n if (!error.stack) {\n try {\n throw error;\n } catch (e) {\n noop();\n }\n }\n callMonitored(function () {\n var stackTrace = computeStackTrace(error);\n stackTrace.stack = stackTrace.stack.slice(internalFramesToSkip);\n formattedStack = toStackTraceString(stackTrace);\n });\n return formattedStack;\n}\nexport function flattenErrorCauses(error, parentSource) {\n var currentError = error;\n var causes = [];\n while ((currentError === null || currentError === void 0 ? void 0 : currentError.cause) instanceof Error && causes.length < 10) {\n var stackTrace = computeStackTrace(currentError.cause);\n causes.push({\n message: currentError.cause.message,\n source: parentSource,\n type: stackTrace === null || stackTrace === void 0 ? void 0 : stackTrace.name,\n stack: stackTrace && toStackTraceString(stackTrace)\n });\n currentError = currentError.cause;\n }\n return causes.length ? causes : undefined;\n}\n","export var ErrorSource = {\n AGENT: 'agent',\n CONSOLE: 'console',\n CUSTOM: 'custom',\n LOGGER: 'logger',\n NETWORK: 'network',\n SOURCE: 'source',\n REPORT: 'report'\n};\n","import { clocksNow } from '../../tools/utils/timeUtils';\nimport { startUnhandledErrorCollection } from '../tracekit';\nimport { computeRawError } from './error';\nimport { ErrorSource } from './error.types';\nexport function trackRuntimeError(errorObservable) {\n return startUnhandledErrorCollection(function (stackTrace, originalError) {\n errorObservable.notify(computeRawError({\n stackTrace: stackTrace,\n originalError: originalError,\n startClocks: clocksNow(),\n nonErrorPrefix: \"Uncaught\" /* NonErrorPrefix.UNCAUGHT */,\n source: ErrorSource.SOURCE,\n handling: \"unhandled\" /* ErrorHandling.UNHANDLED */\n }));\n });\n}\n","import { catchUserErrors } from '../tools/catchUserErrors';\nimport { setDebugMode } from '../tools/monitor';\nimport { assign } from '../tools/utils/polyfills';\nexport function makePublicApi(stub) {\n var publicApi = assign({\n version: \"4.43.0\",\n // This API method is intentionally not monitored, since the only thing executed is the\n // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and\n // we don't want to interfere with the user uncaught exceptions.\n onReady: function (callback) {\n callback();\n }\n }, stub);\n // Add a \"hidden\" property to set debug mode. We define it that way to hide it\n // as much as possible but of course it's not a real protection.\n Object.defineProperty(publicApi, '_setDebug', {\n get: function () {\n return setDebugMode;\n },\n enumerable: false\n });\n return publicApi;\n}\nexport function defineGlobal(global, name, api) {\n var existingGlobalVariable = global[name];\n global[name] = api;\n if (existingGlobalVariable && existingGlobalVariable.q) {\n existingGlobalVariable.q.forEach(function (fn) {\n return catchUserErrors(fn, 'onReady callback threw an error:')();\n });\n }\n}\n","import { monitor } from '../tools/monitor';\nimport { getZoneJsOriginalValue } from '../tools/getZoneJsOriginalValue';\n/**\n * Add an event listener to an event target object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by: using an option object only if needed and emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n */\nexport function addEventListener(eventTarget, eventName, listener, options) {\n return addEventListeners(eventTarget, [eventName], listener, options);\n}\n/**\n * Add event listeners to an event target object (Window, Element, mock object...). This provides\n * a few conveniences compared to using `element.addEventListener` directly:\n *\n * * supports IE11 by: using an option object only if needed and emulating the `once` option\n *\n * * wraps the listener with a `monitor` function\n *\n * * returns a `stop` function to remove the listener\n *\n * * with `once: true`, the listener will be called at most once, even if different events are listened\n */\nexport function addEventListeners(eventTarget, eventNames, listener, _a) {\n var _b = _a === void 0 ? {} : _a,\n once = _b.once,\n capture = _b.capture,\n passive = _b.passive;\n var wrappedListener = monitor(once ? function (event) {\n stop();\n listener(event);\n } : listener);\n var options = passive ? {\n capture: capture,\n passive: passive\n } : capture;\n var add = getZoneJsOriginalValue(eventTarget, 'addEventListener');\n eventNames.forEach(function (eventName) {\n return add.call(eventTarget, eventName, wrappedListener, options);\n });\n function stop() {\n var remove = getZoneJsOriginalValue(eventTarget, 'removeEventListener');\n eventNames.forEach(function (eventName) {\n return remove.call(eventTarget, eventName, wrappedListener, options);\n });\n }\n return {\n stop: stop\n };\n}\n","import { toStackTraceString } from '../error/error';\nimport { monitor } from '../../tools/monitor';\nimport { mergeObservables, Observable } from '../../tools/observable';\nimport { addEventListener } from '../../browser/addEventListener';\nimport { includes } from '../../tools/utils/polyfills';\nimport { safeTruncate } from '../../tools/utils/stringUtils';\nexport var RawReportType = {\n intervention: 'intervention',\n deprecation: 'deprecation',\n cspViolation: 'csp_violation'\n};\nexport function initReportObservable(apis) {\n var observables = [];\n if (includes(apis, RawReportType.cspViolation)) {\n observables.push(createCspViolationReportObservable());\n }\n var reportTypes = apis.filter(function (api) {\n return api !== RawReportType.cspViolation;\n });\n if (reportTypes.length) {\n observables.push(createReportObservable(reportTypes));\n }\n return mergeObservables.apply(void 0, observables);\n}\nfunction createReportObservable(reportTypes) {\n var observable = new Observable(function () {\n if (!window.ReportingObserver) {\n return;\n }\n var handleReports = monitor(function (reports) {\n return reports.forEach(function (report) {\n observable.notify(buildRawReportFromReport(report));\n });\n });\n var observer = new window.ReportingObserver(handleReports, {\n types: reportTypes,\n buffered: true\n });\n observer.observe();\n return function () {\n observer.disconnect();\n };\n });\n return observable;\n}\nfunction createCspViolationReportObservable() {\n var observable = new Observable(function () {\n var stop = addEventListener(document, \"securitypolicyviolation\" /* DOM_EVENT.SECURITY_POLICY_VIOLATION */, function (event) {\n observable.notify(buildRawReportFromCspViolation(event));\n }).stop;\n return stop;\n });\n return observable;\n}\nfunction buildRawReportFromReport(_a) {\n var type = _a.type,\n body = _a.body;\n return {\n type: type,\n subtype: body.id,\n message: \"\".concat(type, \": \").concat(body.message),\n stack: buildStack(body.id, body.message, body.sourceFile, body.lineNumber, body.columnNumber)\n };\n}\nfunction buildRawReportFromCspViolation(event) {\n var type = RawReportType.cspViolation;\n var message = \"'\".concat(event.blockedURI, \"' blocked by '\").concat(event.effectiveDirective, \"' directive\");\n return {\n type: RawReportType.cspViolation,\n subtype: event.effectiveDirective,\n message: \"\".concat(type, \": \").concat(message),\n stack: buildStack(event.effectiveDirective, event.originalPolicy ? \"\".concat(message, \" of the policy \\\"\").concat(safeTruncate(event.originalPolicy, 100, '...'), \"\\\"\") : 'no policy', event.sourceFile, event.lineNumber, event.columnNumber)\n };\n}\nfunction buildStack(name, message, sourceFile, lineNumber, columnNumber) {\n return sourceFile && toStackTraceString({\n name: name,\n message: message,\n stack: [{\n func: '?',\n url: sourceFile,\n line: lineNumber,\n column: columnNumber\n }]\n });\n}\n","export function sendToExtension(type, payload) {\n var callback = window.__ddBrowserSdkExtensionCallback;\n if (callback) {\n callback({\n type: type,\n payload: payload\n });\n }\n}\n","/**\n * Similar to `typeof`, but distinguish plain objects from `null` and arrays\n */\nexport function getType(value) {\n if (value === null) {\n return 'null';\n }\n if (Array.isArray(value)) {\n return 'array';\n }\n return typeof value;\n}\n","import { getType } from './utils/typeUtils';\n/**\n * Iterate over source and affect its sub values into destination, recursively.\n * If the source and destination can't be merged, return source.\n */\nexport function mergeInto(destination, source, circularReferenceChecker) {\n if (circularReferenceChecker === void 0) {\n circularReferenceChecker = createCircularReferenceChecker();\n }\n // ignore the source if it is undefined\n if (source === undefined) {\n return destination;\n }\n if (typeof source !== 'object' || source === null) {\n // primitive values - just return source\n return source;\n } else if (source instanceof Date) {\n return new Date(source.getTime());\n } else if (source instanceof RegExp) {\n var flags = source.flags ||\n // old browsers compatibility\n [source.global ? 'g' : '', source.ignoreCase ? 'i' : '', source.multiline ? 'm' : '', source.sticky ? 'y' : '', source.unicode ? 'u' : ''].join('');\n return new RegExp(source.source, flags);\n }\n if (circularReferenceChecker.hasAlreadyBeenSeen(source)) {\n // remove circular references\n return undefined;\n } else if (Array.isArray(source)) {\n var merged_1 = Array.isArray(destination) ? destination : [];\n for (var i = 0; i < source.length; ++i) {\n merged_1[i] = mergeInto(merged_1[i], source[i], circularReferenceChecker);\n }\n return merged_1;\n }\n var merged = getType(destination) === 'object' ? destination : {};\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n merged[key] = mergeInto(merged[key], source[key], circularReferenceChecker);\n }\n }\n return merged;\n}\n/**\n * A simplistic implementation of a deep clone algorithm.\n * Caveats:\n * - It doesn't maintain prototype chains - don't use with instances of custom classes.\n * - It doesn't handle Map and Set\n */\nexport function deepClone(value) {\n return mergeInto(undefined, value);\n}\nexport function combine() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n var destination;\n for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {\n var source = sources_1[_a];\n // Ignore any undefined or null sources.\n if (source === undefined || source === null) {\n continue;\n }\n destination = mergeInto(destination, source);\n }\n return destination;\n}\nfunction createCircularReferenceChecker() {\n if (typeof WeakSet !== 'undefined') {\n var set_1 = new WeakSet();\n return {\n hasAlreadyBeenSeen: function (value) {\n var has = set_1.has(value);\n if (!has) {\n set_1.add(value);\n }\n return has;\n }\n };\n }\n var array = [];\n return {\n hasAlreadyBeenSeen: function (value) {\n var has = array.indexOf(value) >= 0;\n if (!has) {\n array.push(value);\n }\n return has;\n }\n };\n}\n","export var TelemetryType = {\n log: 'log',\n configuration: 'configuration'\n};\n","import { ConsoleApiName } from '../../tools/display';\nimport { toStackTraceString, NO_ERROR_STACK_PRESENT_MESSAGE } from '../error/error';\nimport { getExperimentalFeatures } from '../../tools/experimentalFeatures';\nimport { INTAKE_SITE_STAGING, INTAKE_SITE_US1_FED } from '../configuration';\nimport { computeStackTrace } from '../tracekit';\nimport { Observable } from '../../tools/observable';\nimport { timeStampNow } from '../../tools/utils/timeUtils';\nimport { displayIfDebugEnabled, startMonitorErrorCollection } from '../../tools/monitor';\nimport { sendToExtension } from '../../tools/sendToExtension';\nimport { startsWith, arrayFrom, includes, assign } from '../../tools/utils/polyfills';\nimport { performDraw } from '../../tools/utils/numberUtils';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nimport { combine } from '../../tools/mergeInto';\nimport { TelemetryType } from './rawTelemetryEvent.types';\nvar ALLOWED_FRAME_URLS = ['https://www.datadoghq-browser-agent.com', 'https://www.datad0g-browser-agent.com', 'https://d3uc069fcn7uxw.cloudfront.net', 'https://d20xtzwzcl0ceb.cloudfront.net', 'http://localhost', ''];\nvar TELEMETRY_EXCLUDED_SITES = [INTAKE_SITE_US1_FED];\nvar telemetryConfiguration = {\n maxEventsPerPage: 0,\n sentEventCount: 0,\n telemetryEnabled: false,\n telemetryConfigurationEnabled: false\n};\nvar onRawTelemetryEventCollected;\nexport function startTelemetry(telemetryService, configuration) {\n var contextProvider;\n var observable = new Observable();\n telemetryConfiguration.telemetryEnabled = !includes(TELEMETRY_EXCLUDED_SITES, configuration.site) && performDraw(configuration.telemetrySampleRate);\n telemetryConfiguration.telemetryConfigurationEnabled = telemetryConfiguration.telemetryEnabled && performDraw(configuration.telemetryConfigurationSampleRate);\n onRawTelemetryEventCollected = function (rawEvent) {\n if (telemetryConfiguration.telemetryEnabled) {\n var event_1 = toTelemetryEvent(telemetryService, rawEvent);\n observable.notify(event_1);\n sendToExtension('telemetry', event_1);\n }\n };\n startMonitorErrorCollection(addTelemetryError);\n assign(telemetryConfiguration, {\n maxEventsPerPage: configuration.maxTelemetryEventsPerPage,\n sentEventCount: 0\n });\n function toTelemetryEvent(telemetryService, event) {\n return combine({\n type: 'telemetry',\n date: timeStampNow(),\n service: telemetryService,\n version: \"4.43.0\",\n source: 'browser',\n _dd: {\n format_version: 2\n },\n telemetry: event,\n experimental_features: arrayFrom(getExperimentalFeatures())\n }, contextProvider !== undefined ? contextProvider() : {});\n }\n return {\n setContextProvider: function (provider) {\n contextProvider = provider;\n },\n observable: observable,\n enabled: telemetryConfiguration.telemetryEnabled\n };\n}\nexport function startFakeTelemetry() {\n var events = [];\n assign(telemetryConfiguration, {\n maxEventsPerPage: Infinity,\n sentEventCount: 0\n });\n onRawTelemetryEventCollected = function (event) {\n events.push(event);\n };\n return events;\n}\nexport function resetTelemetry() {\n onRawTelemetryEventCollected = undefined;\n}\n/**\n * Avoid mixing telemetry events from different data centers\n * but keep replicating staging events for reliability\n */\nexport function isTelemetryReplicationAllowed(configuration) {\n return configuration.site === INTAKE_SITE_STAGING;\n}\nexport function addTelemetryDebug(message, context) {\n displayIfDebugEnabled(ConsoleApiName.debug, message, context);\n addTelemetry(assign({\n type: TelemetryType.log,\n message: message,\n status: \"debug\" /* StatusType.debug */\n }, context));\n}\nexport function addTelemetryError(e) {\n addTelemetry(assign({\n type: TelemetryType.log,\n status: \"error\" /* StatusType.error */\n }, formatError(e)));\n}\nexport function addTelemetryConfiguration(configuration) {\n if (telemetryConfiguration.telemetryConfigurationEnabled) {\n addTelemetry({\n type: TelemetryType.configuration,\n configuration: configuration\n });\n }\n}\nfunction addTelemetry(event) {\n if (onRawTelemetryEventCollected && telemetryConfiguration.sentEventCount < telemetryConfiguration.maxEventsPerPage) {\n telemetryConfiguration.sentEventCount += 1;\n onRawTelemetryEventCollected(event);\n }\n}\nexport function formatError(e) {\n if (e instanceof Error) {\n var stackTrace = computeStackTrace(e);\n return {\n error: {\n kind: stackTrace.name,\n stack: toStackTraceString(scrubCustomerFrames(stackTrace))\n },\n message: stackTrace.message\n };\n }\n return {\n error: {\n stack: NO_ERROR_STACK_PRESENT_MESSAGE\n },\n message: \"\".concat(\"Uncaught\" /* NonErrorPrefix.UNCAUGHT */, \" \").concat(jsonStringify(e))\n };\n}\nexport function scrubCustomerFrames(stackTrace) {\n stackTrace.stack = stackTrace.stack.filter(function (frame) {\n return !frame.url || ALLOWED_FRAME_URLS.some(function (allowedFrameUrl) {\n return startsWith(frame.url, allowedFrameUrl);\n });\n });\n return stackTrace;\n}\n","import { setInterval, clearInterval } from './timer';\nimport { addDuration, relativeNow, ONE_MINUTE } from './utils/timeUtils';\nvar END_OF_TIMES = Infinity;\nexport var CLEAR_OLD_VALUES_INTERVAL = ONE_MINUTE;\n/**\n * Store and keep track of values spans. This whole class assumes that values are added in\n * chronological order (i.e. all entries have an increasing start time).\n */\nvar ValueHistory = /** @class */function () {\n function ValueHistory(expireDelay, maxEntries) {\n var _this = this;\n this.expireDelay = expireDelay;\n this.maxEntries = maxEntries;\n this.entries = [];\n this.clearOldValuesInterval = setInterval(function () {\n return _this.clearOldValues();\n }, CLEAR_OLD_VALUES_INTERVAL);\n }\n /**\n * Add a value to the history associated with a start time. Returns a reference to this newly\n * added entry that can be removed or closed.\n */\n ValueHistory.prototype.add = function (value, startTime) {\n var _this = this;\n var entry = {\n value: value,\n startTime: startTime,\n endTime: END_OF_TIMES,\n remove: function () {\n var index = _this.entries.indexOf(entry);\n if (index >= 0) {\n _this.entries.splice(index, 1);\n }\n },\n close: function (endTime) {\n entry.endTime = endTime;\n }\n };\n if (this.maxEntries && this.entries.length >= this.maxEntries) {\n this.entries.pop();\n }\n this.entries.unshift(entry);\n return entry;\n };\n /**\n * Return the latest value that was active during `startTime`, or the currently active value\n * if no `startTime` is provided. This method assumes that entries are not overlapping.\n */\n ValueHistory.prototype.find = function (startTime) {\n if (startTime === void 0) {\n startTime = END_OF_TIMES;\n }\n for (var _i = 0, _a = this.entries; _i < _a.length; _i++) {\n var entry = _a[_i];\n if (entry.startTime <= startTime) {\n if (startTime <= entry.endTime) {\n return entry.value;\n }\n break;\n }\n }\n };\n /**\n * Helper function to close the currently active value, if any. This method assumes that entries\n * are not overlapping.\n */\n ValueHistory.prototype.closeActive = function (endTime) {\n var latestEntry = this.entries[0];\n if (latestEntry && latestEntry.endTime === END_OF_TIMES) {\n latestEntry.close(endTime);\n }\n };\n /**\n * Return all values with an active period overlapping with the duration,\n * or all values that were active during `startTime` if no duration is provided,\n * or all currently active values if no `startTime` is provided.\n */\n ValueHistory.prototype.findAll = function (startTime, duration) {\n if (startTime === void 0) {\n startTime = END_OF_TIMES;\n }\n if (duration === void 0) {\n duration = 0;\n }\n var endTime = addDuration(startTime, duration);\n return this.entries.filter(function (entry) {\n return entry.startTime <= endTime && startTime <= entry.endTime;\n }).map(function (entry) {\n return entry.value;\n });\n };\n /**\n * Remove all entries from this collection.\n */\n ValueHistory.prototype.reset = function () {\n this.entries = [];\n };\n /**\n * Stop internal garbage collection of past entries.\n */\n ValueHistory.prototype.stop = function () {\n clearInterval(this.clearOldValuesInterval);\n };\n ValueHistory.prototype.clearOldValues = function () {\n var oldTimeThreshold = relativeNow() - this.expireDelay;\n while (this.entries.length > 0 && this.entries[this.entries.length - 1].endTime < oldTimeThreshold) {\n this.entries.pop();\n }\n };\n return ValueHistory;\n}();\nexport { ValueHistory };\n","import { ValueHistory } from '../../tools/valueHistory';\nimport { relativeNow, clocksOrigin, ONE_MINUTE } from '../../tools/utils/timeUtils';\nimport { addEventListener, addEventListeners } from '../../browser/addEventListener';\nimport { clearInterval, setInterval } from '../../tools/timer';\nimport { SESSION_TIME_OUT_DELAY } from './sessionConstants';\nimport { startSessionStore } from './sessionStore';\nexport var VISIBILITY_CHECK_DELAY = ONE_MINUTE;\nvar SESSION_CONTEXT_TIMEOUT_DELAY = SESSION_TIME_OUT_DELAY;\nvar stopCallbacks = [];\nexport function startSessionManager(sessionStoreStrategyType, productKey, computeSessionState) {\n var sessionStore = startSessionStore(sessionStoreStrategyType, productKey, computeSessionState);\n stopCallbacks.push(function () {\n return sessionStore.stop();\n });\n var sessionContextHistory = new ValueHistory(SESSION_CONTEXT_TIMEOUT_DELAY);\n stopCallbacks.push(function () {\n return sessionContextHistory.stop();\n });\n sessionStore.renewObservable.subscribe(function () {\n sessionContextHistory.add(buildSessionContext(), relativeNow());\n });\n sessionStore.expireObservable.subscribe(function () {\n sessionContextHistory.closeActive(relativeNow());\n });\n sessionStore.expandOrRenewSession();\n sessionContextHistory.add(buildSessionContext(), clocksOrigin().relative);\n trackActivity(function () {\n return sessionStore.expandOrRenewSession();\n });\n trackVisibility(function () {\n return sessionStore.expandSession();\n });\n function buildSessionContext() {\n return {\n id: sessionStore.getSession().id,\n trackingType: sessionStore.getSession()[productKey]\n };\n }\n return {\n findActiveSession: function (startTime) {\n return sessionContextHistory.find(startTime);\n },\n renewObservable: sessionStore.renewObservable,\n expireObservable: sessionStore.expireObservable,\n expire: sessionStore.expire\n };\n}\nexport function stopSessionManager() {\n stopCallbacks.forEach(function (e) {\n return e();\n });\n stopCallbacks = [];\n}\nfunction trackActivity(expandOrRenewSession) {\n var stop = addEventListeners(window, [\"click\" /* DOM_EVENT.CLICK */, \"touchstart\" /* DOM_EVENT.TOUCH_START */, \"keydown\" /* DOM_EVENT.KEY_DOWN */, \"scroll\" /* DOM_EVENT.SCROLL */], expandOrRenewSession, {\n capture: true,\n passive: true\n }).stop;\n stopCallbacks.push(stop);\n}\nfunction trackVisibility(expandSession) {\n var expandSessionWhenVisible = function () {\n if (document.visibilityState === 'visible') {\n expandSession();\n }\n };\n var stop = addEventListener(document, \"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */, expandSessionWhenVisible).stop;\n stopCallbacks.push(stop);\n var visibilityCheckInterval = setInterval(expandSessionWhenVisible, VISIBILITY_CHECK_DELAY);\n stopCallbacks.push(function () {\n clearInterval(visibilityCheckInterval);\n });\n}\n","export function isServerError(status) {\n return status >= 500;\n}\nexport function tryToClone(response) {\n try {\n return response.clone();\n } catch (e) {\n // clone can throw if the response has already been used by another instrumentation or is disturbed\n return;\n }\n}\n","import { setTimeout } from '../tools/timer';\nimport { clocksNow, ONE_MINUTE, ONE_SECOND } from '../tools/utils/timeUtils';\nimport { ONE_MEBI_BYTE, ONE_KIBI_BYTE } from '../tools/utils/byteUtils';\nimport { isServerError } from '../tools/utils/responseUtils';\nimport { ErrorSource } from '../domain/error/error.types';\nexport var MAX_ONGOING_BYTES_COUNT = 80 * ONE_KIBI_BYTE;\nexport var MAX_ONGOING_REQUESTS = 32;\nexport var MAX_QUEUE_BYTES_COUNT = 3 * ONE_MEBI_BYTE;\nexport var MAX_BACKOFF_TIME = ONE_MINUTE;\nexport var INITIAL_BACKOFF_TIME = ONE_SECOND;\nexport function sendWithRetryStrategy(payload, state, sendStrategy, endpointType, reportError) {\n if (state.transportStatus === 0 /* TransportStatus.UP */ && state.queuedPayloads.size() === 0 && state.bandwidthMonitor.canHandle(payload)) {\n send(payload, state, sendStrategy, {\n onSuccess: function () {\n return retryQueuedPayloads(0 /* RetryReason.AFTER_SUCCESS */, state, sendStrategy, endpointType, reportError);\n },\n onFailure: function () {\n state.queuedPayloads.enqueue(payload);\n scheduleRetry(state, sendStrategy, endpointType, reportError);\n }\n });\n } else {\n state.queuedPayloads.enqueue(payload);\n }\n}\nfunction scheduleRetry(state, sendStrategy, endpointType, reportError) {\n if (state.transportStatus !== 2 /* TransportStatus.DOWN */) {\n return;\n }\n setTimeout(function () {\n var payload = state.queuedPayloads.first();\n send(payload, state, sendStrategy, {\n onSuccess: function () {\n state.queuedPayloads.dequeue();\n state.currentBackoffTime = INITIAL_BACKOFF_TIME;\n retryQueuedPayloads(1 /* RetryReason.AFTER_RESUME */, state, sendStrategy, endpointType, reportError);\n },\n onFailure: function () {\n state.currentBackoffTime = Math.min(MAX_BACKOFF_TIME, state.currentBackoffTime * 2);\n scheduleRetry(state, sendStrategy, endpointType, reportError);\n }\n });\n }, state.currentBackoffTime);\n}\nfunction send(payload, state, sendStrategy, _a) {\n var onSuccess = _a.onSuccess,\n onFailure = _a.onFailure;\n state.bandwidthMonitor.add(payload);\n sendStrategy(payload, function (response) {\n state.bandwidthMonitor.remove(payload);\n if (!shouldRetryRequest(response)) {\n state.transportStatus = 0 /* TransportStatus.UP */;\n onSuccess();\n } else {\n // do not consider transport down if another ongoing request could succeed\n state.transportStatus = state.bandwidthMonitor.ongoingRequestCount > 0 ? 1 /* TransportStatus.FAILURE_DETECTED */ : 2 /* TransportStatus.DOWN */;\n payload.retry = {\n count: payload.retry ? payload.retry.count + 1 : 1,\n lastFailureStatus: response.status\n };\n onFailure();\n }\n });\n}\nfunction retryQueuedPayloads(reason, state, sendStrategy, endpointType, reportError) {\n if (reason === 0 /* RetryReason.AFTER_SUCCESS */ && state.queuedPayloads.isFull() && !state.queueFullReported) {\n reportError({\n message: \"Reached max \".concat(endpointType, \" events size queued for upload: \").concat(MAX_QUEUE_BYTES_COUNT / ONE_MEBI_BYTE, \"MiB\"),\n source: ErrorSource.AGENT,\n startClocks: clocksNow()\n });\n state.queueFullReported = true;\n }\n var previousQueue = state.queuedPayloads;\n state.queuedPayloads = newPayloadQueue();\n while (previousQueue.size() > 0) {\n sendWithRetryStrategy(previousQueue.dequeue(), state, sendStrategy, endpointType, reportError);\n }\n}\nfunction shouldRetryRequest(response) {\n return response.type !== 'opaque' && (response.status === 0 && !navigator.onLine || response.status === 408 || response.status === 429 || isServerError(response.status));\n}\nexport function newRetryState() {\n return {\n transportStatus: 0 /* TransportStatus.UP */,\n currentBackoffTime: INITIAL_BACKOFF_TIME,\n bandwidthMonitor: newBandwidthMonitor(),\n queuedPayloads: newPayloadQueue(),\n queueFullReported: false\n };\n}\nfunction newPayloadQueue() {\n var queue = [];\n return {\n bytesCount: 0,\n enqueue: function (payload) {\n if (this.isFull()) {\n return;\n }\n queue.push(payload);\n this.bytesCount += payload.bytesCount;\n },\n first: function () {\n return queue[0];\n },\n dequeue: function () {\n var payload = queue.shift();\n if (payload) {\n this.bytesCount -= payload.bytesCount;\n }\n return payload;\n },\n size: function () {\n return queue.length;\n },\n isFull: function () {\n return this.bytesCount >= MAX_QUEUE_BYTES_COUNT;\n }\n };\n}\nfunction newBandwidthMonitor() {\n return {\n ongoingRequestCount: 0,\n ongoingByteCount: 0,\n canHandle: function (payload) {\n return this.ongoingRequestCount === 0 || this.ongoingByteCount + payload.bytesCount <= MAX_ONGOING_BYTES_COUNT && this.ongoingRequestCount < MAX_ONGOING_REQUESTS;\n },\n add: function (payload) {\n this.ongoingRequestCount += 1;\n this.ongoingByteCount += payload.bytesCount;\n },\n remove: function (payload) {\n this.ongoingRequestCount -= 1;\n this.ongoingByteCount -= payload.bytesCount;\n }\n };\n}\n","import { addTelemetryError } from '../domain/telemetry';\nimport { monitor } from '../tools/monitor';\nimport { addEventListener } from '../browser/addEventListener';\nimport { newRetryState, sendWithRetryStrategy } from './sendWithRetryStrategy';\nexport function createHttpRequest(endpointBuilder, bytesLimit, reportError) {\n var retryState = newRetryState();\n var sendStrategyForRetry = function (payload, onResponse) {\n return fetchKeepAliveStrategy(endpointBuilder, bytesLimit, payload, onResponse);\n };\n return {\n send: function (payload) {\n sendWithRetryStrategy(payload, retryState, sendStrategyForRetry, endpointBuilder.endpointType, reportError);\n },\n /**\n * Since fetch keepalive behaves like regular fetch on Firefox,\n * keep using sendBeaconStrategy on exit\n */\n sendOnExit: function (payload) {\n sendBeaconStrategy(endpointBuilder, bytesLimit, payload);\n }\n };\n}\nfunction sendBeaconStrategy(endpointBuilder, bytesLimit, _a) {\n var data = _a.data,\n bytesCount = _a.bytesCount,\n flushReason = _a.flushReason;\n var canUseBeacon = !!navigator.sendBeacon && bytesCount < bytesLimit;\n if (canUseBeacon) {\n try {\n var beaconUrl = endpointBuilder.build('beacon', flushReason);\n var isQueued = navigator.sendBeacon(beaconUrl, data);\n if (isQueued) {\n return;\n }\n } catch (e) {\n reportBeaconError(e);\n }\n }\n var xhrUrl = endpointBuilder.build('xhr', flushReason);\n sendXHR(xhrUrl, data);\n}\nvar hasReportedBeaconError = false;\nfunction reportBeaconError(e) {\n if (!hasReportedBeaconError) {\n hasReportedBeaconError = true;\n addTelemetryError(e);\n }\n}\nexport function fetchKeepAliveStrategy(endpointBuilder, bytesLimit, _a, onResponse) {\n var data = _a.data,\n bytesCount = _a.bytesCount,\n flushReason = _a.flushReason,\n retry = _a.retry;\n var canUseKeepAlive = isKeepAliveSupported() && bytesCount < bytesLimit;\n if (canUseKeepAlive) {\n var fetchUrl = endpointBuilder.build('fetch', flushReason, retry);\n fetch(fetchUrl, {\n method: 'POST',\n body: data,\n keepalive: true,\n mode: 'cors'\n }).then(monitor(function (response) {\n return onResponse === null || onResponse === void 0 ? void 0 : onResponse({\n status: response.status,\n type: response.type\n });\n }), monitor(function () {\n var xhrUrl = endpointBuilder.build('xhr', flushReason, retry);\n // failed to queue the request\n sendXHR(xhrUrl, data, onResponse);\n }));\n } else {\n var xhrUrl = endpointBuilder.build('xhr', flushReason, retry);\n sendXHR(xhrUrl, data, onResponse);\n }\n}\nfunction isKeepAliveSupported() {\n // Request can throw, cf https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#errors\n try {\n return window.Request && 'keepalive' in new Request('http://a');\n } catch (_a) {\n return false;\n }\n}\nexport function sendXHR(url, data, onResponse) {\n var request = new XMLHttpRequest();\n request.open('POST', url, true);\n addEventListener(request, 'loadend', function () {\n onResponse === null || onResponse === void 0 ? void 0 : onResponse({\n status: request.status\n });\n }, {\n // prevent multiple onResponse callbacks\n // if the xhr instance is reused by a third party\n once: true\n });\n request.send(data);\n}\n","import { isExperimentalFeatureEnabled, ExperimentalFeature } from '../tools/experimentalFeatures';\nimport { Observable } from '../tools/observable';\nimport { objectValues, includes } from '../tools/utils/polyfills';\nimport { noop } from '../tools/utils/functionUtils';\nimport { addEventListeners, addEventListener } from './addEventListener';\nexport var PageExitReason = {\n HIDDEN: 'visibility_hidden',\n UNLOADING: 'before_unload',\n PAGEHIDE: 'page_hide',\n FROZEN: 'page_frozen'\n};\nexport function createPageExitObservable() {\n var observable = new Observable(function () {\n var pagehideEnabled = isExperimentalFeatureEnabled(ExperimentalFeature.PAGEHIDE);\n var stopListeners = addEventListeners(window, [\"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */, \"freeze\" /* DOM_EVENT.FREEZE */, \"pagehide\" /* DOM_EVENT.PAGE_HIDE */], function (event) {\n if (event.type === \"pagehide\" /* DOM_EVENT.PAGE_HIDE */ && pagehideEnabled) {\n /**\n * Only event that detect page unload events while being compatible with the back/forward cache (bfcache)\n */\n observable.notify({\n reason: PageExitReason.PAGEHIDE\n });\n } else if (event.type === \"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */ && document.visibilityState === 'hidden') {\n /**\n * Only event that guarantee to fire on mobile devices when the page transitions to background state\n * (e.g. when user switches to a different application, goes to homescreen, etc), or is being unloaded.\n */\n observable.notify({\n reason: PageExitReason.HIDDEN\n });\n } else if (event.type === \"freeze\" /* DOM_EVENT.FREEZE */) {\n /**\n * After transitioning in background a tab can be freezed to preserve resources. (cf: https://developer.chrome.com/blog/page-lifecycle-api)\n * Allow to collect events happening between hidden and frozen state.\n */\n observable.notify({\n reason: PageExitReason.FROZEN\n });\n }\n }, {\n capture: true\n }).stop;\n var stopBeforeUnloadListener = noop;\n if (!pagehideEnabled) {\n stopBeforeUnloadListener = addEventListener(window, \"beforeunload\" /* DOM_EVENT.BEFORE_UNLOAD */, function () {\n observable.notify({\n reason: PageExitReason.UNLOADING\n });\n }).stop;\n }\n return function () {\n stopListeners();\n stopBeforeUnloadListener();\n };\n });\n return observable;\n}\nexport function isPageExitReason(reason) {\n return includes(objectValues(PageExitReason), reason);\n}\n","import { display } from '../tools/display';\nimport { objectValues } from '../tools/utils/polyfills';\nimport { isPageExitReason } from '../browser/pageExitObservable';\nimport { computeBytesCount } from '../tools/utils/byteUtils';\nimport { jsonStringify } from '../tools/serialisation/jsonStringify';\nvar Batch = /** @class */function () {\n function Batch(request, flushController, messageBytesLimit) {\n var _this = this;\n this.request = request;\n this.flushController = flushController;\n this.messageBytesLimit = messageBytesLimit;\n this.pushOnlyBuffer = [];\n this.upsertBuffer = {};\n this.flushController.flushObservable.subscribe(function (event) {\n return _this.flush(event);\n });\n }\n Batch.prototype.add = function (message) {\n this.addOrUpdate(message);\n };\n Batch.prototype.upsert = function (message, key) {\n this.addOrUpdate(message, key);\n };\n Batch.prototype.flush = function (event) {\n var messages = this.pushOnlyBuffer.concat(objectValues(this.upsertBuffer));\n this.pushOnlyBuffer = [];\n this.upsertBuffer = {};\n var payload = {\n data: messages.join('\\n'),\n bytesCount: event.bytesCount,\n flushReason: event.reason\n };\n if (isPageExitReason(event.reason)) {\n this.request.sendOnExit(payload);\n } else {\n this.request.send(payload);\n }\n };\n Batch.prototype.addOrUpdate = function (message, key) {\n var _a = this.process(message),\n processedMessage = _a.processedMessage,\n messageBytesCount = _a.messageBytesCount;\n if (messageBytesCount >= this.messageBytesLimit) {\n display.warn(\"Discarded a message whose size was bigger than the maximum allowed size \".concat(this.messageBytesLimit, \"KB.\"));\n return;\n }\n if (this.hasMessageFor(key)) {\n this.remove(key);\n }\n this.push(processedMessage, messageBytesCount, key);\n };\n Batch.prototype.process = function (message) {\n var processedMessage = jsonStringify(message);\n var messageBytesCount = computeBytesCount(processedMessage);\n return {\n processedMessage: processedMessage,\n messageBytesCount: messageBytesCount\n };\n };\n Batch.prototype.push = function (processedMessage, messageBytesCount, key) {\n // If there are other messages, a '\\n' will be added at serialization\n var separatorBytesCount = this.flushController.messagesCount > 0 ? 1 : 0;\n this.flushController.notifyBeforeAddMessage(messageBytesCount + separatorBytesCount);\n if (key !== undefined) {\n this.upsertBuffer[key] = processedMessage;\n } else {\n this.pushOnlyBuffer.push(processedMessage);\n }\n this.flushController.notifyAfterAddMessage();\n };\n Batch.prototype.remove = function (key) {\n var removedMessage = this.upsertBuffer[key];\n delete this.upsertBuffer[key];\n var messageBytesCount = computeBytesCount(removedMessage);\n // If there are other messages, a '\\n' will be added at serialization\n var separatorBytesCount = this.flushController.messagesCount > 1 ? 1 : 0;\n this.flushController.notifyAfterRemoveMessage(messageBytesCount + separatorBytesCount);\n };\n Batch.prototype.hasMessageFor = function (key) {\n return key !== undefined && this.upsertBuffer[key] !== undefined;\n };\n return Batch;\n}();\nexport { Batch };\n","import { endsWith } from '../tools/utils/polyfills';\nimport { getGlobalObject } from '../tools/getGlobalObject';\nexport function getEventBridge() {\n var eventBridgeGlobal = getEventBridgeGlobal();\n if (!eventBridgeGlobal) {\n return;\n }\n return {\n getAllowedWebViewHosts: function () {\n return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts());\n },\n send: function (eventType, event) {\n eventBridgeGlobal.send(JSON.stringify({\n eventType: eventType,\n event: event\n }));\n }\n };\n}\nexport function canUseEventBridge(currentHost) {\n var _a;\n if (currentHost === void 0) {\n currentHost = (_a = getGlobalObject().location) === null || _a === void 0 ? void 0 : _a.hostname;\n }\n var bridge = getEventBridge();\n return !!bridge && bridge.getAllowedWebViewHosts().some(function (allowedHost) {\n return currentHost === allowedHost || endsWith(currentHost, \".\".concat(allowedHost));\n });\n}\nfunction getEventBridgeGlobal() {\n return getGlobalObject().DatadogEventBridge;\n}\n","import { Observable } from '../tools/observable';\nimport { clearTimeout, setTimeout } from '../tools/timer';\n/**\n * Returns a \"flush controller\", responsible of notifying when flushing a pool of pending data needs\n * to happen. The implementation is designed to support both synchronous and asynchronous usages,\n * but relies on invariants described in each method documentation to keep a coherent state.\n */\nexport function createFlushController(_a) {\n var messagesLimit = _a.messagesLimit,\n bytesLimit = _a.bytesLimit,\n durationLimit = _a.durationLimit,\n pageExitObservable = _a.pageExitObservable,\n sessionExpireObservable = _a.sessionExpireObservable;\n var flushObservable = new Observable();\n pageExitObservable.subscribe(function (event) {\n return flush(event.reason);\n });\n sessionExpireObservable.subscribe(function () {\n return flush('session_expire');\n });\n var currentBytesCount = 0;\n var currentMessagesCount = 0;\n function flush(flushReason) {\n if (currentMessagesCount === 0) {\n return;\n }\n var messagesCount = currentMessagesCount;\n var bytesCount = currentBytesCount;\n currentMessagesCount = 0;\n currentBytesCount = 0;\n cancelDurationLimitTimeout();\n flushObservable.notify({\n reason: flushReason,\n messagesCount: messagesCount,\n bytesCount: bytesCount\n });\n }\n var durationLimitTimeoutId;\n function scheduleDurationLimitTimeout() {\n if (durationLimitTimeoutId === undefined) {\n durationLimitTimeoutId = setTimeout(function () {\n flush('duration_limit');\n }, durationLimit);\n }\n }\n function cancelDurationLimitTimeout() {\n clearTimeout(durationLimitTimeoutId);\n durationLimitTimeoutId = undefined;\n }\n return {\n flushObservable: flushObservable,\n get messagesCount() {\n return currentMessagesCount;\n },\n /**\n * Notifies that a message will be added to a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right before adding the message, so no flush\n * event can happen after `notifyBeforeAddMessage` and before adding the message.\n */\n notifyBeforeAddMessage: function (messageBytesCount) {\n if (currentBytesCount + messageBytesCount >= bytesLimit) {\n flush('bytes_limit');\n }\n // Consider the message to be added now rather than in `notifyAfterAddMessage`, because if no\n // message was added yet and `notifyAfterAddMessage` is called asynchronously, we still want\n // to notify when a flush is needed (for example on page exit).\n currentMessagesCount += 1;\n currentBytesCount += messageBytesCount;\n scheduleDurationLimitTimeout();\n },\n /**\n * Notifies that a message *was* added to a pool of pending messages waiting to be flushed.\n *\n * This function can be called asynchronously after the message was added, but in this case it\n * should not be called if a flush event occurred in between.\n */\n notifyAfterAddMessage: function () {\n if (currentMessagesCount >= messagesLimit) {\n flush('messages_limit');\n } else if (currentBytesCount >= bytesLimit) {\n flush('bytes_limit');\n }\n },\n /**\n * Notifies that a message was removed from a pool of pending messages waiting to be flushed.\n *\n * This function needs to be called synchronously, right after removing the message, so no flush\n * event can happen after removing the message and before `notifyAfterRemoveMessage`.\n */\n notifyAfterRemoveMessage: function (messageBytesCount) {\n currentBytesCount -= messageBytesCount;\n currentMessagesCount -= 1;\n if (currentMessagesCount === 0) {\n cancelDurationLimitTimeout();\n }\n }\n };\n}\n","var AbstractLifeCycle = /** @class */function () {\n function AbstractLifeCycle() {\n this.callbacks = {};\n }\n AbstractLifeCycle.prototype.notify = function (eventType, data) {\n var eventCallbacks = this.callbacks[eventType];\n if (eventCallbacks) {\n eventCallbacks.forEach(function (callback) {\n return callback(data);\n });\n }\n };\n AbstractLifeCycle.prototype.subscribe = function (eventType, callback) {\n var _this = this;\n if (!this.callbacks[eventType]) {\n this.callbacks[eventType] = [];\n }\n this.callbacks[eventType].push(callback);\n return {\n unsubscribe: function () {\n _this.callbacks[eventType] = _this.callbacks[eventType].filter(function (other) {\n return callback !== other;\n });\n }\n };\n };\n return AbstractLifeCycle;\n}();\nexport { AbstractLifeCycle };\n","import { setTimeout } from '../../tools/timer';\nimport { clocksNow, ONE_MINUTE } from '../../tools/utils/timeUtils';\nimport { ErrorSource } from '../error/error.types';\nexport function createEventRateLimiter(eventType, limit, onLimitReached) {\n var eventCount = 0;\n var allowNextEvent = false;\n return {\n isLimitReached: function () {\n if (eventCount === 0) {\n setTimeout(function () {\n eventCount = 0;\n }, ONE_MINUTE);\n }\n eventCount += 1;\n if (eventCount <= limit || allowNextEvent) {\n allowNextEvent = false;\n return false;\n }\n if (eventCount === limit + 1) {\n allowNextEvent = true;\n try {\n onLimitReached({\n message: \"Reached max number of \".concat(eventType, \"s by minute: \").concat(limit),\n source: ErrorSource.AGENT,\n startClocks: clocksNow()\n });\n } finally {\n allowNextEvent = false;\n }\n }\n return true;\n }\n };\n}\n","import { addEventListener } from './addEventListener';\nexport function runOnReadyState(expectedReadyState, callback) {\n if (document.readyState === expectedReadyState || document.readyState === 'complete') {\n callback();\n } else {\n var eventName = expectedReadyState === 'complete' ? \"load\" /* DOM_EVENT.LOAD */ : \"DOMContentLoaded\" /* DOM_EVENT.DOM_CONTENT_LOADED */;\n addEventListener(window, eventName, callback, {\n once: true\n });\n }\n}\n","import { instrumentMethodAndCallOriginal } from '../tools/instrumentMethod';\nimport { Observable } from '../tools/observable';\nimport { elapsed, relativeNow, clocksNow, timeStampNow } from '../tools/utils/timeUtils';\nimport { normalizeUrl } from '../tools/utils/urlPolyfill';\nimport { shallowClone } from '../tools/utils/objectUtils';\nimport { addEventListener } from './addEventListener';\nvar xhrObservable;\nvar xhrContexts = new WeakMap();\nexport function initXhrObservable() {\n if (!xhrObservable) {\n xhrObservable = createXhrObservable();\n }\n return xhrObservable;\n}\nfunction createXhrObservable() {\n var observable = new Observable(function () {\n var stopInstrumentingStart = instrumentMethodAndCallOriginal(XMLHttpRequest.prototype, 'open', {\n before: openXhr\n }).stop;\n var stopInstrumentingSend = instrumentMethodAndCallOriginal(XMLHttpRequest.prototype, 'send', {\n before: function () {\n sendXhr.call(this, observable);\n }\n }).stop;\n var stopInstrumentingAbort = instrumentMethodAndCallOriginal(XMLHttpRequest.prototype, 'abort', {\n before: abortXhr\n }).stop;\n return function () {\n stopInstrumentingStart();\n stopInstrumentingSend();\n stopInstrumentingAbort();\n };\n });\n return observable;\n}\nfunction openXhr(method, url) {\n xhrContexts.set(this, {\n state: 'open',\n method: method,\n url: normalizeUrl(String(url))\n });\n}\nfunction sendXhr(observable) {\n var _this = this;\n var context = xhrContexts.get(this);\n if (!context) {\n return;\n }\n var startContext = context;\n startContext.state = 'start';\n startContext.startTime = relativeNow();\n startContext.startClocks = clocksNow();\n startContext.isAborted = false;\n startContext.xhr = this;\n var hasBeenReported = false;\n var stopInstrumentingOnReadyStateChange = instrumentMethodAndCallOriginal(this, 'onreadystatechange', {\n before: function () {\n if (this.readyState === XMLHttpRequest.DONE) {\n // Try to report the XHR as soon as possible, because the XHR may be mutated by the\n // application during a future event. For example, Angular is calling .abort() on\n // completed requests during a onreadystatechange event, so the status becomes '0'\n // before the request is collected.\n onEnd();\n }\n }\n }).stop;\n var onEnd = function () {\n unsubscribeLoadEndListener();\n stopInstrumentingOnReadyStateChange();\n if (hasBeenReported) {\n return;\n }\n hasBeenReported = true;\n var completeContext = context;\n completeContext.state = 'complete';\n completeContext.duration = elapsed(startContext.startClocks.timeStamp, timeStampNow());\n completeContext.status = _this.status;\n observable.notify(shallowClone(completeContext));\n };\n var unsubscribeLoadEndListener = addEventListener(this, 'loadend', onEnd).stop;\n observable.notify(startContext);\n}\nfunction abortXhr() {\n var context = xhrContexts.get(this);\n if (context) {\n context.isAborted = true;\n }\n}\n","import { instrumentMethod } from '../tools/instrumentMethod';\nimport { callMonitored, monitor } from '../tools/monitor';\nimport { Observable } from '../tools/observable';\nimport { clocksNow } from '../tools/utils/timeUtils';\nimport { normalizeUrl } from '../tools/utils/urlPolyfill';\nvar fetchObservable;\nexport function initFetchObservable() {\n if (!fetchObservable) {\n fetchObservable = createFetchObservable();\n }\n return fetchObservable;\n}\nfunction createFetchObservable() {\n var observable = new Observable(function () {\n if (!window.fetch) {\n return;\n }\n var stop = instrumentMethod(window, 'fetch', function (originalFetch) {\n return function (input, init) {\n var responsePromise;\n var context = callMonitored(beforeSend, null, [observable, input, init]);\n if (context) {\n responsePromise = originalFetch.call(this, context.input, context.init);\n callMonitored(afterSend, null, [observable, responsePromise, context]);\n } else {\n responsePromise = originalFetch.call(this, input, init);\n }\n return responsePromise;\n };\n }).stop;\n return stop;\n });\n return observable;\n}\nfunction beforeSend(observable, input, init) {\n var method = init && init.method || input instanceof Request && input.method || 'GET';\n var url = input instanceof Request ? input.url : normalizeUrl(String(input));\n var startClocks = clocksNow();\n var context = {\n state: 'start',\n init: init,\n input: input,\n method: method,\n startClocks: startClocks,\n url: url\n };\n observable.notify(context);\n return context;\n}\nfunction afterSend(observable, responsePromise, startContext) {\n var reportFetch = function (response) {\n var context = startContext;\n context.state = 'resolve';\n if ('stack' in response || response instanceof Error) {\n context.status = 0;\n context.isAborted = response instanceof DOMException && response.code === DOMException.ABORT_ERR;\n context.error = response;\n } else if ('status' in response) {\n context.response = response;\n context.responseType = response.type;\n context.status = response.status;\n context.isAborted = false;\n }\n observable.notify(context);\n };\n responsePromise.then(monitor(reportFetch), monitor(reportFetch));\n}\n","import { computeStackTrace } from '../tracekit';\nimport { createHandlingStack, formatErrorMessage, toStackTraceString, tryToGetFingerprint } from '../error/error';\nimport { mergeObservables, Observable } from '../../tools/observable';\nimport { ConsoleApiName, globalConsole } from '../../tools/display';\nimport { callMonitored } from '../../tools/monitor';\nimport { sanitize } from '../../tools/serialisation/sanitize';\nimport { find } from '../../tools/utils/polyfills';\nimport { jsonStringify } from '../../tools/serialisation/jsonStringify';\nvar consoleObservablesByApi = {};\nexport function initConsoleObservable(apis) {\n var consoleObservables = apis.map(function (api) {\n if (!consoleObservablesByApi[api]) {\n consoleObservablesByApi[api] = createConsoleObservable(api);\n }\n return consoleObservablesByApi[api];\n });\n return mergeObservables.apply(void 0, consoleObservables);\n}\nexport function resetConsoleObservable() {\n consoleObservablesByApi = {};\n}\nfunction createConsoleObservable(api) {\n var observable = new Observable(function () {\n var originalConsoleApi = globalConsole[api];\n globalConsole[api] = function () {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n originalConsoleApi.apply(console, params);\n var handlingStack = createHandlingStack();\n callMonitored(function () {\n observable.notify(buildConsoleLog(params, api, handlingStack));\n });\n };\n return function () {\n globalConsole[api] = originalConsoleApi;\n };\n });\n return observable;\n}\nfunction buildConsoleLog(params, api, handlingStack) {\n // Todo: remove console error prefix in the next major version\n var message = params.map(function (param) {\n return formatConsoleParameters(param);\n }).join(' ');\n var stack;\n var fingerprint;\n if (api === ConsoleApiName.error) {\n var firstErrorParam = find(params, function (param) {\n return param instanceof Error;\n });\n stack = firstErrorParam ? toStackTraceString(computeStackTrace(firstErrorParam)) : undefined;\n fingerprint = tryToGetFingerprint(firstErrorParam);\n message = \"console error: \".concat(message);\n }\n return {\n api: api,\n message: message,\n stack: stack,\n handlingStack: handlingStack,\n fingerprint: fingerprint\n };\n}\nfunction formatConsoleParameters(param) {\n if (typeof param === 'string') {\n return sanitize(param);\n }\n if (param instanceof Error) {\n return formatErrorMessage(computeStackTrace(param));\n }\n return jsonStringify(sanitize(param), undefined, 2);\n}\n","var BUFFER_LIMIT = 500;\nvar BoundedBuffer = /** @class */function () {\n function BoundedBuffer() {\n this.buffer = [];\n }\n BoundedBuffer.prototype.add = function (callback) {\n var length = this.buffer.push(callback);\n if (length > BUFFER_LIMIT) {\n this.buffer.splice(0, 1);\n }\n };\n BoundedBuffer.prototype.drain = function () {\n this.buffer.forEach(function (callback) {\n return callback();\n });\n this.buffer.length = 0;\n };\n return BoundedBuffer;\n}();\nexport { BoundedBuffer };\n","import { ONE_KIBI_BYTE } from '../utils/byteUtils';\nimport { display } from '../display';\n// RUM and logs batch bytes limit is 16KB\n// ensure that we leave room for other event attributes and maintain a decent amount of event per batch\n// (3KB (customer data) + 1KB (other attributes)) * 4 (events per batch) = 16KB\nexport var CUSTOMER_DATA_BYTES_LIMIT = 3 * ONE_KIBI_BYTE;\nexport function warnIfCustomerDataLimitReached(bytesCount, customerDataType) {\n if (bytesCount > CUSTOMER_DATA_BYTES_LIMIT) {\n display.warn(\"The \".concat(customerDataType, \" data is over \").concat(CUSTOMER_DATA_BYTES_LIMIT / ONE_KIBI_BYTE, \"KiB. On low connectivity, the SDK has the potential to exhaust the user's upload bandwidth.\"));\n return true;\n }\n return false;\n}\n","import { computeBytesCount } from '../utils/byteUtils';\nimport { throttle } from '../utils/functionUtils';\nimport { deepClone } from '../mergeInto';\nimport { jsonStringify } from './jsonStringify';\nimport { sanitize } from './sanitize';\nimport { warnIfCustomerDataLimitReached } from './heavyCustomerDataWarning';\nexport var BYTES_COMPUTATION_THROTTLING_DELAY = 200;\nexport function createContextManager(customerDataType, computeBytesCountImpl) {\n if (computeBytesCountImpl === void 0) {\n computeBytesCountImpl = computeBytesCount;\n }\n var context = {};\n var bytesCountCache;\n var alreadyWarned = false;\n // Throttle the bytes computation to minimize the impact on performance.\n // Especially useful if the user call context APIs synchronously multiple times in a row\n var computeBytesCountThrottled = throttle(function (context) {\n bytesCountCache = computeBytesCountImpl(jsonStringify(context));\n if (!alreadyWarned) {\n alreadyWarned = warnIfCustomerDataLimitReached(bytesCountCache, customerDataType);\n }\n }, BYTES_COMPUTATION_THROTTLING_DELAY).throttled;\n return {\n getBytesCount: function () {\n return bytesCountCache;\n },\n /** @deprecated use getContext instead */\n get: function () {\n return context;\n },\n /** @deprecated use setContextProperty instead */\n add: function (key, value) {\n context[key] = value;\n computeBytesCountThrottled(context);\n },\n /** @deprecated renamed to removeContextProperty */\n remove: function (key) {\n delete context[key];\n computeBytesCountThrottled(context);\n },\n /** @deprecated use setContext instead */\n set: function (newContext) {\n context = newContext;\n computeBytesCountThrottled(context);\n },\n getContext: function () {\n return deepClone(context);\n },\n setContext: function (newContext) {\n context = sanitize(newContext);\n computeBytesCountThrottled(context);\n },\n setContextProperty: function (key, property) {\n context[key] = sanitize(property);\n computeBytesCountThrottled(context);\n },\n removeContextProperty: function (key) {\n delete context[key];\n computeBytesCountThrottled(context);\n },\n clearContext: function () {\n context = {};\n bytesCountCache = 0;\n }\n };\n}\n","import { monitor } from './monitor';\nimport { noop } from './utils/functionUtils';\n/**\n * Read bytes from a ReadableStream until at least `limit` bytes have been read (or until the end of\n * the stream). The callback is invoked with the at most `limit` bytes, and indicates that the limit\n * has been exceeded if more bytes were available.\n */\nexport function readBytesFromStream(stream, callback, options) {\n var reader = stream.getReader();\n var chunks = [];\n var readBytesCount = 0;\n readMore();\n function readMore() {\n reader.read().then(monitor(function (result) {\n if (result.done) {\n onDone();\n return;\n }\n if (options.collectStreamBody) {\n chunks.push(result.value);\n }\n readBytesCount += result.value.length;\n if (readBytesCount > options.bytesLimit) {\n onDone();\n } else {\n readMore();\n }\n }), monitor(function (error) {\n return callback(error);\n }));\n }\n function onDone() {\n reader.cancel().catch(\n // we don't care if cancel fails, but we still need to catch the error to avoid reporting it\n // as an unhandled rejection\n noop);\n var bytes;\n var limitExceeded;\n if (options.collectStreamBody) {\n var completeBuffer_1;\n if (chunks.length === 1) {\n // optimization: if the response is small enough to fit in a single buffer (provided by the browser), just\n // use it directly.\n completeBuffer_1 = chunks[0];\n } else {\n // else, we need to copy buffers into a larger buffer to concatenate them.\n completeBuffer_1 = new Uint8Array(readBytesCount);\n var offset_1 = 0;\n chunks.forEach(function (chunk) {\n completeBuffer_1.set(chunk, offset_1);\n offset_1 += chunk.length;\n });\n }\n bytes = completeBuffer_1.slice(0, options.bytesLimit);\n limitExceeded = completeBuffer_1.length > options.bytesLimit;\n }\n callback(undefined, bytes, limitExceeded);\n }\n}\n","import { getCookie } from '../../browser/cookie';\nexport var SYNTHETICS_TEST_ID_COOKIE_NAME = 'datadog-synthetics-public-id';\nexport var SYNTHETICS_RESULT_ID_COOKIE_NAME = 'datadog-synthetics-result-id';\nexport var SYNTHETICS_INJECTS_RUM_COOKIE_NAME = 'datadog-synthetics-injects-rum';\nexport function willSyntheticsInjectRum() {\n return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM || getCookie(SYNTHETICS_INJECTS_RUM_COOKIE_NAME));\n}\nexport function getSyntheticsTestId() {\n var value = window._DATADOG_SYNTHETICS_PUBLIC_ID || getCookie(SYNTHETICS_TEST_ID_COOKIE_NAME);\n return typeof value === 'string' ? value : undefined;\n}\nexport function getSyntheticsResultId() {\n var value = window._DATADOG_SYNTHETICS_RESULT_ID || getCookie(SYNTHETICS_RESULT_ID_COOKIE_NAME);\n return typeof value === 'string' ? value : undefined;\n}\n","import { display } from '../../tools/display';\nimport { getType } from '../../tools/utils/typeUtils';\nimport { assign } from '../../tools/utils/polyfills';\n/**\n * Clone input data and ensure known user properties (id, name, email)\n * are strings, as defined here:\n * https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#user-related-attributes\n */\nexport function sanitizeUser(newUser) {\n // We shallow clone only to prevent mutation of user data.\n var user = assign({}, newUser);\n var keys = ['id', 'name', 'email'];\n keys.forEach(function (key) {\n if (key in user) {\n user[key] = String(user[key]);\n }\n });\n return user;\n}\n/**\n * Simple check to ensure user is valid\n */\nexport function checkUser(newUser) {\n var isValid = getType(newUser) === 'object';\n if (!isValid) {\n display.error('Unsupported user:', newUser);\n }\n return isValid;\n}\n","import { startsWith } from './utils/polyfills';\nimport { display } from './display';\nimport { getType } from './utils/typeUtils';\nexport function isMatchOption(item) {\n var itemType = getType(item);\n return itemType === 'string' || itemType === 'function' || item instanceof RegExp;\n}\n/**\n * Returns true if value can be matched by at least one of the provided MatchOptions.\n * When comparing strings, setting useStartsWith to true will compare the value with the start of\n * the option, instead of requiring an exact match.\n */\nexport function matchList(list, value, useStartsWith) {\n if (useStartsWith === void 0) {\n useStartsWith = false;\n }\n return list.some(function (item) {\n try {\n if (typeof item === 'function') {\n return item(value);\n } else if (item instanceof RegExp) {\n return item.test(value);\n } else if (typeof item === 'string') {\n return useStartsWith ? startsWith(value, item) : item === value;\n }\n } catch (e) {\n display.error(e);\n }\n return false;\n });\n}\n","import { objectEntries, shallowClone, performDraw, isNumber, assign, find, getType, isMatchOption, matchList } from '@datadog/browser-core';\nexport function isTracingOption(item) {\n var expectedItem = item;\n return getType(expectedItem) === 'object' && isMatchOption(expectedItem.match) && Array.isArray(expectedItem.propagatorTypes);\n}\n/**\n * Clear tracing information to avoid incomplete traces. Ideally, we should do it when the\n * request did not reach the server, but the browser does not expose this. So, we clear tracing\n * information if the request ended with status 0 without being aborted by the application.\n *\n * Reasoning:\n *\n * * Applications are usually aborting requests after a bit of time, for example when the user is\n * typing (autocompletion) or navigating away (in a SPA). With a performant device and good\n * network conditions, the request is likely to reach the server before being canceled.\n *\n * * Requests aborted otherwise (ex: lack of internet, CORS issue, blocked by a privacy extension)\n * are likely to finish quickly and without reaching the server.\n *\n * Of course, it might not be the case every time, but it should limit having incomplete traces a\n * bit.\n * */\nexport function clearTracingIfNeeded(context) {\n if (context.status === 0 && !context.isAborted) {\n context.traceId = undefined;\n context.spanId = undefined;\n context.traceSampled = undefined;\n }\n}\nexport function startTracer(configuration, sessionManager) {\n return {\n clearTracingIfNeeded: clearTracingIfNeeded,\n traceFetch: function (context) {\n return injectHeadersIfTracingAllowed(configuration, context, sessionManager, function (tracingHeaders) {\n var _a;\n if (context.input instanceof Request && !((_a = context.init) === null || _a === void 0 ? void 0 : _a.headers)) {\n context.input = new Request(context.input);\n Object.keys(tracingHeaders).forEach(function (key) {\n ;\n context.input.headers.append(key, tracingHeaders[key]);\n });\n } else {\n context.init = shallowClone(context.init);\n var headers_1 = [];\n if (context.init.headers instanceof Headers) {\n context.init.headers.forEach(function (value, key) {\n headers_1.push([key, value]);\n });\n } else if (Array.isArray(context.init.headers)) {\n context.init.headers.forEach(function (header) {\n headers_1.push(header);\n });\n } else if (context.init.headers) {\n Object.keys(context.init.headers).forEach(function (key) {\n headers_1.push([key, context.init.headers[key]]);\n });\n }\n context.init.headers = headers_1.concat(objectEntries(tracingHeaders));\n }\n });\n },\n traceXhr: function (context, xhr) {\n return injectHeadersIfTracingAllowed(configuration, context, sessionManager, function (tracingHeaders) {\n Object.keys(tracingHeaders).forEach(function (name) {\n xhr.setRequestHeader(name, tracingHeaders[name]);\n });\n });\n }\n };\n}\nfunction injectHeadersIfTracingAllowed(configuration, context, sessionManager, inject) {\n if (!isTracingSupported() || !sessionManager.findTrackedSession()) {\n return;\n }\n var tracingOption = find(configuration.allowedTracingUrls, function (tracingOption) {\n return matchList([tracingOption.match], context.url, true);\n });\n if (!tracingOption) {\n return;\n }\n context.traceId = new TraceIdentifier();\n context.spanId = new TraceIdentifier();\n context.traceSampled = !isNumber(configuration.traceSampleRate) || performDraw(configuration.traceSampleRate);\n inject(makeTracingHeaders(context.traceId, context.spanId, context.traceSampled, tracingOption.propagatorTypes));\n}\nexport function isTracingSupported() {\n return getCrypto() !== undefined;\n}\nfunction getCrypto() {\n return window.crypto || window.msCrypto;\n}\n/**\n * When trace is not sampled, set priority to '0' instead of not adding the tracing headers\n * to prepare the implementation for sampling delegation.\n */\nfunction makeTracingHeaders(traceId, spanId, traceSampled, propagatorTypes) {\n var tracingHeaders = {};\n propagatorTypes.forEach(function (propagatorType) {\n switch (propagatorType) {\n case 'datadog':\n {\n assign(tracingHeaders, {\n 'x-datadog-origin': 'rum',\n 'x-datadog-parent-id': spanId.toDecimalString(),\n 'x-datadog-sampling-priority': traceSampled ? '1' : '0',\n 'x-datadog-trace-id': traceId.toDecimalString()\n });\n break;\n }\n // https://www.w3.org/TR/trace-context/\n case 'tracecontext':\n {\n assign(tracingHeaders, {\n traceparent: \"00-0000000000000000\".concat(traceId.toPaddedHexadecimalString(), \"-\").concat(spanId.toPaddedHexadecimalString(), \"-0\").concat(traceSampled ? '1' : '0')\n });\n break;\n }\n // https://github.com/openzipkin/b3-propagation\n case 'b3':\n {\n assign(tracingHeaders, {\n b3: \"\".concat(traceId.toPaddedHexadecimalString(), \"-\").concat(spanId.toPaddedHexadecimalString(), \"-\").concat(traceSampled ? '1' : '0')\n });\n break;\n }\n case 'b3multi':\n {\n assign(tracingHeaders, {\n 'X-B3-TraceId': traceId.toPaddedHexadecimalString(),\n 'X-B3-SpanId': spanId.toPaddedHexadecimalString(),\n 'X-B3-Sampled': traceSampled ? '1' : '0'\n });\n break;\n }\n }\n });\n return tracingHeaders;\n}\n/* eslint-disable no-bitwise */\nvar TraceIdentifier = /** @class */function () {\n function TraceIdentifier() {\n this.buffer = new Uint8Array(8);\n getCrypto().getRandomValues(this.buffer);\n this.buffer[0] = this.buffer[0] & 0x7f; // force 63-bit\n }\n TraceIdentifier.prototype.toString = function (radix) {\n var high = this.readInt32(0);\n var low = this.readInt32(4);\n var str = '';\n do {\n var mod = high % radix * 4294967296 + low;\n high = Math.floor(high / radix);\n low = Math.floor(mod / radix);\n str = (mod % radix).toString(radix) + str;\n } while (high || low);\n return str;\n };\n /**\n * Format used everywhere except the trace intake\n */\n TraceIdentifier.prototype.toDecimalString = function () {\n return this.toString(10);\n };\n /**\n * Format used by OTel headers\n */\n TraceIdentifier.prototype.toPaddedHexadecimalString = function () {\n var traceId = this.toString(16);\n return Array(17 - traceId.length).join('0') + traceId;\n };\n TraceIdentifier.prototype.readInt32 = function (offset) {\n return this.buffer[offset] * 16777216 + (this.buffer[offset + 1] << 16) + (this.buffer[offset + 2] << 8) + this.buffer[offset + 3];\n };\n return TraceIdentifier;\n}();\nexport { TraceIdentifier };\n/* eslint-enable no-bitwise */\n","import { getType, arrayFrom, getOrigin, isMatchOption, serializeConfiguration, assign, DefaultPrivacyLevel, display, isPercentage, objectHasValue, validateAndBuildConfiguration } from '@datadog/browser-core';\nimport { isTracingOption } from './tracing/tracer';\nexport function validateAndBuildRumConfiguration(initConfiguration) {\n var _a, _b, _c, _d, _e, _f;\n if (!initConfiguration.applicationId) {\n display.error('Application ID is not configured, no RUM data will be collected.');\n return;\n }\n if (initConfiguration.sessionReplaySampleRate !== undefined && !isPercentage(initConfiguration.sessionReplaySampleRate)) {\n display.error('Session Replay Sample Rate should be a number between 0 and 100');\n return;\n }\n // TODO remove fallback in next major\n var premiumSampleRate = (_a = initConfiguration.premiumSampleRate) !== null && _a !== void 0 ? _a : initConfiguration.replaySampleRate;\n if (premiumSampleRate !== undefined && initConfiguration.sessionReplaySampleRate !== undefined) {\n display.warn('Ignoring Premium Sample Rate because Session Replay Sample Rate is set');\n premiumSampleRate = undefined;\n }\n if (premiumSampleRate !== undefined && !isPercentage(premiumSampleRate)) {\n display.error('Premium Sample Rate should be a number between 0 and 100');\n return;\n }\n var traceSampleRate = (_b = initConfiguration.traceSampleRate) !== null && _b !== void 0 ? _b : initConfiguration.tracingSampleRate;\n if (traceSampleRate !== undefined && !isPercentage(traceSampleRate)) {\n display.error('Trace Sample Rate should be a number between 0 and 100');\n return;\n }\n if (initConfiguration.excludedActivityUrls !== undefined && !Array.isArray(initConfiguration.excludedActivityUrls)) {\n display.error('Excluded Activity Urls should be an array');\n return;\n }\n var allowedTracingUrls = validateAndBuildTracingOptions(initConfiguration);\n if (!allowedTracingUrls) {\n return;\n }\n var baseConfiguration = validateAndBuildConfiguration(initConfiguration);\n if (!baseConfiguration) {\n return;\n }\n var trackUserInteractions = !!((_c = initConfiguration.trackUserInteractions) !== null && _c !== void 0 ? _c : initConfiguration.trackInteractions);\n var trackFrustrations = !!initConfiguration.trackFrustrations;\n return assign({\n applicationId: initConfiguration.applicationId,\n version: initConfiguration.version,\n actionNameAttribute: initConfiguration.actionNameAttribute,\n sessionReplaySampleRate: (_e = (_d = initConfiguration.sessionReplaySampleRate) !== null && _d !== void 0 ? _d : premiumSampleRate) !== null && _e !== void 0 ? _e : 100,\n oldPlansBehavior: initConfiguration.sessionReplaySampleRate === undefined,\n traceSampleRate: traceSampleRate,\n allowedTracingUrls: allowedTracingUrls,\n excludedActivityUrls: (_f = initConfiguration.excludedActivityUrls) !== null && _f !== void 0 ? _f : [],\n trackUserInteractions: trackUserInteractions || trackFrustrations,\n trackFrustrations: trackFrustrations,\n trackViewsManually: !!initConfiguration.trackViewsManually,\n trackResources: initConfiguration.trackResources,\n trackLongTasks: initConfiguration.trackLongTasks,\n subdomain: initConfiguration.subdomain,\n defaultPrivacyLevel: objectHasValue(DefaultPrivacyLevel, initConfiguration.defaultPrivacyLevel) ? initConfiguration.defaultPrivacyLevel : DefaultPrivacyLevel.MASK_USER_INPUT,\n customerDataTelemetrySampleRate: 1\n }, baseConfiguration);\n}\n/**\n * Handles allowedTracingUrls and processes legacy allowedTracingOrigins\n */\nfunction validateAndBuildTracingOptions(initConfiguration) {\n // Advise about parameters precedence.\n if (initConfiguration.allowedTracingUrls !== undefined && initConfiguration.allowedTracingOrigins !== undefined) {\n display.warn('Both allowedTracingUrls and allowedTracingOrigins (deprecated) have been defined. The parameter allowedTracingUrls will override allowedTracingOrigins.');\n }\n // Handle allowedTracingUrls first\n if (initConfiguration.allowedTracingUrls !== undefined) {\n if (!Array.isArray(initConfiguration.allowedTracingUrls)) {\n display.error('Allowed Tracing URLs should be an array');\n return;\n }\n if (initConfiguration.allowedTracingUrls.length !== 0 && initConfiguration.service === undefined) {\n display.error('Service needs to be configured when tracing is enabled');\n return;\n }\n // Convert from (MatchOption | TracingOption) to TracingOption, remove unknown properties\n var tracingOptions_1 = [];\n initConfiguration.allowedTracingUrls.forEach(function (option) {\n if (isMatchOption(option)) {\n tracingOptions_1.push({\n match: option,\n propagatorTypes: ['datadog']\n });\n } else if (isTracingOption(option)) {\n tracingOptions_1.push(option);\n } else {\n display.warn('Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter', option);\n }\n });\n return tracingOptions_1;\n }\n // Handle conversion of allowedTracingOrigins to allowedTracingUrls\n if (initConfiguration.allowedTracingOrigins !== undefined) {\n if (!Array.isArray(initConfiguration.allowedTracingOrigins)) {\n display.error('Allowed Tracing Origins should be an array');\n return;\n }\n if (initConfiguration.allowedTracingOrigins.length !== 0 && initConfiguration.service === undefined) {\n display.error('Service needs to be configured when tracing is enabled');\n return;\n }\n var tracingOptions_2 = [];\n initConfiguration.allowedTracingOrigins.forEach(function (legacyMatchOption) {\n var tracingOption = convertLegacyMatchOptionToTracingOption(legacyMatchOption);\n if (tracingOption) {\n tracingOptions_2.push(tracingOption);\n }\n });\n return tracingOptions_2;\n }\n return [];\n}\n/**\n * Converts parameters from the deprecated allowedTracingOrigins\n * to allowedTracingUrls. Handles the change from origin to full URLs.\n */\nfunction convertLegacyMatchOptionToTracingOption(item) {\n var match;\n if (typeof item === 'string') {\n match = item;\n } else if (item instanceof RegExp) {\n match = function (url) {\n return item.test(getOrigin(url));\n };\n } else if (typeof item === 'function') {\n match = function (url) {\n return item(getOrigin(url));\n };\n }\n if (match === undefined) {\n display.warn('Allowed Tracing Origins parameters should be a string, RegExp or function. Ignoring parameter', item);\n return undefined;\n }\n return {\n match: match,\n propagatorTypes: ['datadog']\n };\n}\n/**\n * Combines the selected tracing propagators from the different options in allowedTracingUrls,\n * and assumes 'datadog' has been selected when using allowedTracingOrigins\n */\nfunction getSelectedTracingPropagators(configuration) {\n var usedTracingPropagators = new Set();\n if (Array.isArray(configuration.allowedTracingUrls) && configuration.allowedTracingUrls.length > 0) {\n configuration.allowedTracingUrls.forEach(function (option) {\n if (isMatchOption(option)) {\n usedTracingPropagators.add('datadog');\n } else if (getType(option) === 'object' && Array.isArray(option.propagatorTypes)) {\n // Ensure we have an array, as we cannot rely on types yet (configuration is provided by users)\n option.propagatorTypes.forEach(function (propagatorType) {\n return usedTracingPropagators.add(propagatorType);\n });\n }\n });\n }\n if (Array.isArray(configuration.allowedTracingOrigins) && configuration.allowedTracingOrigins.length > 0) {\n usedTracingPropagators.add('datadog');\n }\n return arrayFrom(usedTracingPropagators);\n}\nexport function serializeRumConfiguration(configuration) {\n var _a, _b;\n var baseSerializedConfiguration = serializeConfiguration(configuration);\n return assign({\n premium_sample_rate: configuration.premiumSampleRate,\n replay_sample_rate: configuration.replaySampleRate,\n session_replay_sample_rate: configuration.sessionReplaySampleRate,\n trace_sample_rate: (_a = configuration.traceSampleRate) !== null && _a !== void 0 ? _a : configuration.tracingSampleRate,\n action_name_attribute: configuration.actionNameAttribute,\n use_allowed_tracing_origins: Array.isArray(configuration.allowedTracingOrigins) && configuration.allowedTracingOrigins.length > 0,\n use_allowed_tracing_urls: Array.isArray(configuration.allowedTracingUrls) && configuration.allowedTracingUrls.length > 0,\n selected_tracing_propagators: getSelectedTracingPropagators(configuration),\n default_privacy_level: configuration.defaultPrivacyLevel,\n use_excluded_activity_urls: Array.isArray(configuration.excludedActivityUrls) && configuration.excludedActivityUrls.length > 0,\n track_frustrations: configuration.trackFrustrations,\n track_views_manually: configuration.trackViewsManually,\n track_user_interactions: (_b = configuration.trackUserInteractions) !== null && _b !== void 0 ? _b : configuration.trackInteractions\n }, baseSerializedConfiguration);\n}\n","export function buildCommonContext(globalContextManager, userContextManager, recorderApi) {\n return {\n context: globalContextManager.getContext(),\n user: userContextManager.getContext(),\n hasReplay: recorderApi.isRecording() ? true : undefined\n };\n}\n","import { noop, willSyntheticsInjectRum, assign, BoundedBuffer, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, checkUser, sanitizeUser, sanitize } from '@datadog/browser-core';\nimport { validateAndBuildRumConfiguration } from '../domain/configuration';\nimport { buildCommonContext } from '../domain/contexts/commonContext';\nexport function makeRumPublicApi(startRumImpl, recorderApi, _a) {\n var _b = _a === void 0 ? {} : _a,\n _c = _b.ignoreInitIfSyntheticsWillInjectRum,\n ignoreInitIfSyntheticsWillInjectRum = _c === void 0 ? true : _c;\n var isAlreadyInitialized = false;\n var globalContextManager = createContextManager(\"global context\" /* CustomerDataType.GlobalContext */);\n var userContextManager = createContextManager(\"user\" /* CustomerDataType.User */);\n var getInternalContextStrategy = function () {\n return undefined;\n };\n var getInitConfigurationStrategy = function () {\n return undefined;\n };\n var stopSessionStrategy = noop;\n var getSessionReplayLinkStrategy = function () {\n return undefined;\n };\n var bufferApiCalls = new BoundedBuffer();\n var addTimingStrategy = function (name, time) {\n if (time === void 0) {\n time = timeStampNow();\n }\n bufferApiCalls.add(function () {\n return addTimingStrategy(name, time);\n });\n };\n var startViewStrategy = function (options, startClocks) {\n if (startClocks === void 0) {\n startClocks = clocksNow();\n }\n bufferApiCalls.add(function () {\n return startViewStrategy(options, startClocks);\n });\n };\n var addActionStrategy = function (action, commonContext) {\n if (commonContext === void 0) {\n commonContext = buildCommonContext(globalContextManager, userContextManager, recorderApi);\n }\n bufferApiCalls.add(function () {\n return addActionStrategy(action, commonContext);\n });\n };\n var addErrorStrategy = function (providedError, commonContext) {\n if (commonContext === void 0) {\n commonContext = buildCommonContext(globalContextManager, userContextManager, recorderApi);\n }\n bufferApiCalls.add(function () {\n return addErrorStrategy(providedError, commonContext);\n });\n };\n var addFeatureFlagEvaluationStrategy = function (key, value) {\n bufferApiCalls.add(function () {\n return addFeatureFlagEvaluationStrategy(key, value);\n });\n };\n function initRum(initConfiguration) {\n // This function should be available, regardless of initialization success.\n getInitConfigurationStrategy = function () {\n return deepClone(initConfiguration);\n };\n // If we are in a Synthetics test configured to automatically inject a RUM instance, we want to\n // completely discard the customer application RUM instance by ignoring their init() call. But,\n // we should not ignore the init() call from the Synthetics-injected RUM instance, so the\n // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.\n if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {\n return;\n }\n var eventBridgeAvailable = canUseEventBridge();\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration);\n }\n if (!canInitRum(initConfiguration)) {\n return;\n }\n var configuration = validateAndBuildRumConfiguration(initConfiguration);\n if (!configuration) {\n return;\n }\n if (!eventBridgeAvailable && !configuration.sessionStoreStrategyType) {\n display.warn('No storage available for session. We will not send any data.');\n return;\n }\n if (!configuration.trackViewsManually) {\n doStartRum(initConfiguration, configuration);\n } else {\n // drain beforeInitCalls by buffering them until we start RUM\n // if we get a startView, drain re-buffered calls before continuing to drain beforeInitCalls\n // in order to ensure that calls are processed in order\n var beforeInitCalls = bufferApiCalls;\n bufferApiCalls = new BoundedBuffer();\n startViewStrategy = function (options) {\n doStartRum(initConfiguration, configuration, options);\n };\n beforeInitCalls.drain();\n }\n isAlreadyInitialized = true;\n }\n function doStartRum(initConfiguration, configuration, initialViewOptions) {\n var startRumResults = startRumImpl(initConfiguration, configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions);\n getSessionReplayLinkStrategy = function () {\n return recorderApi.getSessionReplayLink(configuration, startRumResults.session, startRumResults.viewContexts);\n };\n startViewStrategy = startRumResults.startView, addActionStrategy = startRumResults.addAction, addErrorStrategy = startRumResults.addError, addTimingStrategy = startRumResults.addTiming, addFeatureFlagEvaluationStrategy = startRumResults.addFeatureFlagEvaluation, getInternalContextStrategy = startRumResults.getInternalContext, stopSessionStrategy = startRumResults.stopSession;\n bufferApiCalls.drain();\n recorderApi.onRumStart(startRumResults.lifeCycle, configuration, startRumResults.session, startRumResults.viewContexts);\n }\n var startView = monitor(function (options) {\n var sanitizedOptions = typeof options === 'object' ? options : {\n name: options\n };\n startViewStrategy(sanitizedOptions);\n });\n var rumPublicApi = makePublicApi({\n init: monitor(initRum),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(globalContextManager.add),\n setGlobalContextProperty: monitor(globalContextManager.setContextProperty),\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(globalContextManager.remove),\n removeGlobalContextProperty: monitor(globalContextManager.removeContextProperty),\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(globalContextManager.get),\n getGlobalContext: monitor(globalContextManager.getContext),\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(globalContextManager.set),\n setGlobalContext: monitor(globalContextManager.setContext),\n clearGlobalContext: monitor(globalContextManager.clearContext),\n getInternalContext: monitor(function (startTime) {\n return getInternalContextStrategy(startTime);\n }),\n getInitConfiguration: monitor(function () {\n return getInitConfigurationStrategy();\n }),\n addAction: monitor(function (name, context) {\n addActionStrategy({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: \"custom\" /* ActionType.CUSTOM */\n });\n }),\n addError: function (error, context) {\n var handlingStack = createHandlingStack();\n callMonitored(function () {\n addErrorStrategy({\n error: error,\n handlingStack: handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n });\n });\n },\n addTiming: monitor(function (name, time) {\n addTimingStrategy(sanitize(name), time);\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser));\n }\n }),\n getUser: monitor(userContextManager.getContext),\n setUserProperty: monitor(function (key, property) {\n var _a;\n var sanitizedProperty = sanitizeUser((_a = {}, _a[key] = property, _a))[key];\n userContextManager.setContextProperty(key, sanitizedProperty);\n }),\n removeUserProperty: monitor(userContextManager.removeContextProperty),\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(userContextManager.clearContext),\n clearUser: monitor(userContextManager.clearContext),\n startView: startView,\n stopSession: monitor(function () {\n stopSessionStrategy();\n }),\n startSessionReplayRecording: monitor(recorderApi.start),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n /**\n * This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).\n */\n addFeatureFlagEvaluation: monitor(function (key, value) {\n addFeatureFlagEvaluationStrategy(sanitize(key), sanitize(value));\n }),\n getSessionReplayLink: monitor(function () {\n return getSessionReplayLinkStrategy();\n })\n });\n return rumPublicApi;\n function canInitRum(initConfiguration) {\n if (isAlreadyInitialized) {\n if (!initConfiguration.silentMultipleInit) {\n display.error('DD_RUM is already initialized.');\n }\n return false;\n }\n return true;\n }\n function overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n clientToken: 'empty',\n sessionSampleRate: 100\n });\n }\n}\n","import { monitor, noop, Observable, getZoneJsOriginalValue } from '@datadog/browser-core';\nexport function createDOMMutationObservable() {\n var MutationObserver = getMutationObserverConstructor();\n var observable = new Observable(function () {\n if (!MutationObserver) {\n return;\n }\n var observer = new MutationObserver(monitor(function () {\n return observable.notify();\n }));\n observer.observe(document, {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true\n });\n return function () {\n return observer.disconnect();\n };\n });\n return observable;\n}\nexport function getMutationObserverConstructor() {\n var constructor;\n var browserWindow = window;\n // Angular uses Zone.js to provide a context persisting across async tasks. Zone.js replaces the\n // global MutationObserver constructor with a patched version to support the context propagation.\n // There is an ongoing issue[1][2] with this setup when using a MutationObserver within a Angular\n // component: on some occasions, the callback is being called in an infinite loop, causing the\n // page to freeze (even if the callback is completely empty).\n //\n // To work around this issue, we try to get the original MutationObserver constructor stored by\n // Zone.js.\n //\n // [1] https://github.com/angular/angular/issues/26948\n // [2] https://github.com/angular/angular/issues/31712\n if (browserWindow.Zone) {\n // Zone.js 0.8.6+ is storing original class constructors into the browser 'window' object[3].\n //\n // [3] https://github.com/angular/angular/blob/6375fa79875c0fe7b815efc45940a6e6f5c9c9eb/packages/zone.js/lib/common/utils.ts#L288\n constructor = getZoneJsOriginalValue(browserWindow, 'MutationObserver');\n if (browserWindow.MutationObserver && constructor === browserWindow.MutationObserver) {\n // Anterior Zone.js versions (used in Angular 2) does not expose the original MutationObserver\n // in the 'window' object. Luckily, the patched MutationObserver class is storing an original\n // instance in its properties[4]. Let's get the original MutationObserver constructor from\n // there.\n //\n // [4] https://github.com/angular/zone.js/blob/v0.8.5/lib/common/utils.ts#L412\n var patchedInstance = new browserWindow.MutationObserver(noop);\n var originalInstance = getZoneJsOriginalValue(patchedInstance, 'originalInstance');\n constructor = originalInstance && originalInstance.constructor;\n }\n }\n if (!constructor) {\n constructor = browserWindow.MutationObserver;\n }\n return constructor;\n}\n","import { assign, addTelemetryDebug, elapsed, getPathName, includes, isValidUrl, toServerDuration } from '@datadog/browser-core';\nexport var FAKE_INITIAL_DOCUMENT = 'initial_document';\nvar RESOURCE_TYPES = [[\"document\" /* ResourceType.DOCUMENT */, function (initiatorType) {\n return FAKE_INITIAL_DOCUMENT === initiatorType;\n}], [\"xhr\" /* ResourceType.XHR */, function (initiatorType) {\n return 'xmlhttprequest' === initiatorType;\n}], [\"fetch\" /* ResourceType.FETCH */, function (initiatorType) {\n return 'fetch' === initiatorType;\n}], [\"beacon\" /* ResourceType.BEACON */, function (initiatorType) {\n return 'beacon' === initiatorType;\n}], [\"css\" /* ResourceType.CSS */, function (_, path) {\n return /\\.css$/i.test(path);\n}], [\"js\" /* ResourceType.JS */, function (_, path) {\n return /\\.js$/i.test(path);\n}], [\"image\" /* ResourceType.IMAGE */, function (initiatorType, path) {\n return includes(['image', 'img', 'icon'], initiatorType) || /\\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(path) !== null;\n}], [\"font\" /* ResourceType.FONT */, function (_, path) {\n return /\\.(woff|eot|woff2|ttf)$/i.exec(path) !== null;\n}], [\"media\" /* ResourceType.MEDIA */, function (initiatorType, path) {\n return includes(['audio', 'video'], initiatorType) || /\\.(mp3|mp4)$/i.exec(path) !== null;\n}]];\nexport function computeResourceKind(timing) {\n var url = timing.name;\n if (!isValidUrl(url)) {\n addTelemetryDebug(\"Failed to construct URL for \\\"\".concat(timing.name, \"\\\"\"));\n return \"other\" /* ResourceType.OTHER */;\n }\n var path = getPathName(url);\n for (var _i = 0, RESOURCE_TYPES_1 = RESOURCE_TYPES; _i < RESOURCE_TYPES_1.length; _i++) {\n var _a = RESOURCE_TYPES_1[_i],\n type = _a[0],\n isType = _a[1];\n if (isType(timing.initiatorType, path)) {\n return type;\n }\n }\n return \"other\" /* ResourceType.OTHER */;\n}\nfunction areInOrder() {\n var numbers = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n numbers[_i] = arguments[_i];\n }\n for (var i = 1; i < numbers.length; i += 1) {\n if (numbers[i - 1] > numbers[i]) {\n return false;\n }\n }\n return true;\n}\nexport function isRequestKind(timing) {\n return timing.initiatorType === 'xmlhttprequest' || timing.initiatorType === 'fetch';\n}\nexport function computePerformanceResourceDuration(entry) {\n var duration = entry.duration,\n startTime = entry.startTime,\n responseEnd = entry.responseEnd;\n // Safari duration is always 0 on timings blocked by cross origin policies.\n if (duration === 0 && startTime < responseEnd) {\n return toServerDuration(elapsed(startTime, responseEnd));\n }\n return toServerDuration(duration);\n}\nexport function computePerformanceResourceDetails(entry) {\n var validEntry = toValidEntry(entry);\n if (!validEntry) {\n return undefined;\n }\n var startTime = validEntry.startTime,\n fetchStart = validEntry.fetchStart,\n redirectStart = validEntry.redirectStart,\n redirectEnd = validEntry.redirectEnd,\n domainLookupStart = validEntry.domainLookupStart,\n domainLookupEnd = validEntry.domainLookupEnd,\n connectStart = validEntry.connectStart,\n secureConnectionStart = validEntry.secureConnectionStart,\n connectEnd = validEntry.connectEnd,\n requestStart = validEntry.requestStart,\n responseStart = validEntry.responseStart,\n responseEnd = validEntry.responseEnd;\n var details = {\n download: formatTiming(startTime, responseStart, responseEnd),\n first_byte: formatTiming(startTime, requestStart, responseStart)\n };\n // Make sure a connection occurred\n if (connectEnd !== fetchStart) {\n details.connect = formatTiming(startTime, connectStart, connectEnd);\n // Make sure a secure connection occurred\n if (areInOrder(connectStart, secureConnectionStart, connectEnd)) {\n details.ssl = formatTiming(startTime, secureConnectionStart, connectEnd);\n }\n }\n // Make sure a domain lookup occurred\n if (domainLookupEnd !== fetchStart) {\n details.dns = formatTiming(startTime, domainLookupStart, domainLookupEnd);\n }\n if (hasRedirection(entry)) {\n details.redirect = formatTiming(startTime, redirectStart, redirectEnd);\n }\n return details;\n}\nexport function toValidEntry(entry) {\n // Ensure timings are in the right order. On top of filtering out potential invalid\n // RumPerformanceResourceTiming, it will ignore entries from requests where timings cannot be\n // collected, for example cross origin requests without a \"Timing-Allow-Origin\" header allowing\n // it.\n if (!areInOrder(entry.startTime, entry.fetchStart, entry.domainLookupStart, entry.domainLookupEnd, entry.connectStart, entry.connectEnd, entry.requestStart, entry.responseStart, entry.responseEnd)) {\n return undefined;\n }\n if (!hasRedirection(entry)) {\n return entry;\n }\n var redirectStart = entry.redirectStart,\n redirectEnd = entry.redirectEnd;\n // Firefox doesn't provide redirect timings on cross origin requests.\n // Provide a default for those.\n if (redirectStart < entry.startTime) {\n redirectStart = entry.startTime;\n }\n if (redirectEnd < entry.startTime) {\n redirectEnd = entry.fetchStart;\n }\n // Make sure redirect timings are in order\n if (!areInOrder(entry.startTime, redirectStart, redirectEnd, entry.fetchStart)) {\n return undefined;\n }\n return assign({}, entry, {\n redirectEnd: redirectEnd,\n redirectStart: redirectStart\n });\n}\nfunction hasRedirection(entry) {\n // The only time fetchStart is different than startTime is if a redirection occurred.\n return entry.fetchStart !== entry.startTime;\n}\nfunction formatTiming(origin, start, end) {\n return {\n duration: toServerDuration(elapsed(start, end)),\n start: toServerDuration(elapsed(origin, start))\n };\n}\nexport function computeSize(entry) {\n // Make sure a request actually occurred\n if (entry.startTime < entry.responseStart) {\n return entry.decodedBodySize;\n }\n return undefined;\n}\nexport function isAllowedRequestUrl(configuration, url) {\n return url && !configuration.isIntakeUrl(url);\n}\n","export function isTextNode(node) {\n return node.nodeType === Node.TEXT_NODE;\n}\nexport function isCommentNode(node) {\n return node.nodeType === Node.COMMENT_NODE;\n}\nexport function isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\nexport function isNodeShadowHost(node) {\n return isElementNode(node) && Boolean(node.shadowRoot);\n}\nexport function isNodeShadowRoot(node) {\n var shadowRoot = node;\n return !!shadowRoot.host && shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE && isElementNode(shadowRoot.host);\n}\nexport function getChildNodes(node) {\n return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes;\n}\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node) {\n return isNodeShadowRoot(node) ? node.host : node.parentNode;\n}\n","import { dateNow, findCommaSeparatedValue, ONE_MINUTE } from '@datadog/browser-core';\nimport { isCommentNode, isTextNode } from '../../browser/htmlDomUtils';\nexport var INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD = 2 * ONE_MINUTE;\nexport function getDocumentTraceId(document) {\n var data = getDocumentTraceDataFromMeta(document) || getDocumentTraceDataFromComment(document);\n if (!data || data.traceTime <= dateNow() - INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD) {\n return undefined;\n }\n return data.traceId;\n}\nexport function getDocumentTraceDataFromMeta(document) {\n var traceIdMeta = document.querySelector('meta[name=dd-trace-id]');\n var traceTimeMeta = document.querySelector('meta[name=dd-trace-time]');\n return createDocumentTraceData(traceIdMeta && traceIdMeta.content, traceTimeMeta && traceTimeMeta.content);\n}\nexport function getDocumentTraceDataFromComment(document) {\n var comment = findTraceComment(document);\n if (!comment) {\n return undefined;\n }\n return createDocumentTraceData(findCommaSeparatedValue(comment, 'trace-id'), findCommaSeparatedValue(comment, 'trace-time'));\n}\nexport function createDocumentTraceData(traceId, rawTraceTime) {\n var traceTime = rawTraceTime && Number(rawTraceTime);\n if (!traceId || !traceTime) {\n return undefined;\n }\n return {\n traceId: traceId,\n traceTime: traceTime\n };\n}\nexport function findTraceComment(document) {\n // 1. Try to find the comment as a direct child of the document\n // Note: TSLint advises to use a 'for of', but TS doesn't allow to use 'for of' if the iterated\n // value is not an array or string (here, a NodeList).\n for (var i = 0; i < document.childNodes.length; i += 1) {\n var comment = getTraceCommentFromNode(document.childNodes[i]);\n if (comment) {\n return comment;\n }\n }\n // 2. If the comment is placed after the tag, but have some space or new lines before or\n // after, the DOM parser will lift it (and the surrounding text) at the end of the tag.\n // Try to look for the comment at the end of the by by iterating over its child nodes in\n // reverse order, stopping if we come across a non-text node.\n if (document.body) {\n for (var i = document.body.childNodes.length - 1; i >= 0; i -= 1) {\n var node = document.body.childNodes[i];\n var comment = getTraceCommentFromNode(node);\n if (comment) {\n return comment;\n }\n if (!isTextNode(node)) {\n break;\n }\n }\n }\n}\nfunction getTraceCommentFromNode(node) {\n if (node && isCommentNode(node)) {\n var match = /^\\s*DATADOG;(.*?)\\s*$/.exec(node.data);\n if (match) {\n return match[1];\n }\n }\n}\n","import { dateNow, assign, addEventListeners, getRelativeTime, isNumber, monitor, setTimeout, relativeNow, runOnReadyState, addEventListener } from '@datadog/browser-core';\nimport { FAKE_INITIAL_DOCUMENT, isAllowedRequestUrl } from '../domain/rumEventsCollection/resource/resourceUtils';\nimport { getDocumentTraceId } from '../domain/tracing/getDocumentTraceId';\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance;\n}\nexport function supportPerformanceTimingEvent(entryType) {\n return window.PerformanceObserver && PerformanceObserver.supportedEntryTypes !== undefined && PerformanceObserver.supportedEntryTypes.includes(entryType);\n}\nexport function startPerformanceCollection(lifeCycle, configuration) {\n retrieveInitialDocumentResourceTiming(function (timing) {\n handleRumPerformanceEntries(lifeCycle, configuration, [timing]);\n });\n if (supportPerformanceObject()) {\n var performanceEntries_1 = performance.getEntries();\n // Because the performance entry list can be quite large\n // delay the computation to prevent the SDK from blocking the main thread on init\n setTimeout(function () {\n return handleRumPerformanceEntries(lifeCycle, configuration, performanceEntries_1);\n });\n }\n if (window.PerformanceObserver) {\n var handlePerformanceEntryList_1 = monitor(function (entries) {\n return handleRumPerformanceEntries(lifeCycle, configuration, entries.getEntries());\n });\n var mainEntries = ['resource', 'navigation', 'longtask', 'paint'];\n var experimentalEntries = ['largest-contentful-paint', 'first-input', 'layout-shift'];\n try {\n // Experimental entries are not retrieved by performance.getEntries()\n // use a single PerformanceObserver with buffered flag by type\n // to get values that could happen before SDK init\n experimentalEntries.forEach(function (type) {\n var observer = new PerformanceObserver(handlePerformanceEntryList_1);\n observer.observe({\n type: type,\n buffered: true\n });\n });\n } catch (e) {\n // Some old browser versions (ex: chrome 67) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to PerformanceObserver with entryTypes\n mainEntries.push.apply(mainEntries, experimentalEntries);\n }\n var mainObserver = new PerformanceObserver(handlePerformanceEntryList_1);\n mainObserver.observe({\n entryTypes: mainEntries\n });\n if (supportPerformanceObject() && 'addEventListener' in performance) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n addEventListener(performance, 'resourcetimingbufferfull', function () {\n performance.clearResourceTimings();\n });\n }\n }\n if (!supportPerformanceTimingEvent('navigation')) {\n retrieveNavigationTiming(function (timing) {\n handleRumPerformanceEntries(lifeCycle, configuration, [timing]);\n });\n }\n if (!supportPerformanceTimingEvent('first-input')) {\n retrieveFirstInputTiming(function (timing) {\n handleRumPerformanceEntries(lifeCycle, configuration, [timing]);\n });\n }\n}\nexport function retrieveInitialDocumentResourceTiming(callback) {\n runOnReadyState('interactive', function () {\n var timing;\n var forcedAttributes = {\n entryType: 'resource',\n initiatorType: FAKE_INITIAL_DOCUMENT,\n traceId: getDocumentTraceId(document)\n };\n if (supportPerformanceTimingEvent('navigation') && performance.getEntriesByType('navigation').length > 0) {\n var navigationEntry = performance.getEntriesByType('navigation')[0];\n timing = assign(navigationEntry.toJSON(), forcedAttributes);\n } else {\n var relativePerformanceTiming = computeRelativePerformanceTiming();\n timing = assign(relativePerformanceTiming, {\n decodedBodySize: 0,\n duration: relativePerformanceTiming.responseEnd,\n name: window.location.href,\n startTime: 0\n }, forcedAttributes);\n }\n callback(timing);\n });\n}\nfunction retrieveNavigationTiming(callback) {\n function sendFakeTiming() {\n callback(assign(computeRelativePerformanceTiming(), {\n entryType: 'navigation'\n }));\n }\n runOnReadyState('complete', function () {\n // Send it a bit after the actual load event, so the \"loadEventEnd\" timing is accurate\n setTimeout(sendFakeTiming);\n });\n}\n/**\n * first-input timing entry polyfill based on\n * https://github.com/GoogleChrome/web-vitals/blob/master/src/lib/polyfills/firstInputPolyfill.ts\n */\nfunction retrieveFirstInputTiming(callback) {\n var startTimeStamp = dateNow();\n var timingSent = false;\n var removeEventListeners = addEventListeners(window, [\"click\" /* DOM_EVENT.CLICK */, \"mousedown\" /* DOM_EVENT.MOUSE_DOWN */, \"keydown\" /* DOM_EVENT.KEY_DOWN */, \"touchstart\" /* DOM_EVENT.TOUCH_START */, \"pointerdown\" /* DOM_EVENT.POINTER_DOWN */], function (evt) {\n // Only count cancelable events, which should trigger behavior important to the user.\n if (!evt.cancelable) {\n return;\n }\n // This timing will be used to compute the \"first Input delay\", which is the delta between\n // when the system received the event (e.g. evt.timeStamp) and when it could run the callback\n // (e.g. performance.now()).\n var timing = {\n entryType: 'first-input',\n processingStart: relativeNow(),\n startTime: evt.timeStamp\n };\n if (evt.type === \"pointerdown\" /* DOM_EVENT.POINTER_DOWN */) {\n sendTimingIfPointerIsNotCancelled(timing);\n } else {\n sendTiming(timing);\n }\n }, {\n passive: true,\n capture: true\n }).stop;\n /**\n * Pointer events are a special case, because they can trigger main or compositor thread behavior.\n * We differentiate these cases based on whether or not we see a pointercancel event, which are\n * fired when we scroll. If we're scrolling we don't need to report input delay since FID excludes\n * scrolling and pinch/zooming.\n */\n function sendTimingIfPointerIsNotCancelled(timing) {\n addEventListeners(window, [\"pointerup\" /* DOM_EVENT.POINTER_UP */, \"pointercancel\" /* DOM_EVENT.POINTER_CANCEL */], function (event) {\n if (event.type === \"pointerup\" /* DOM_EVENT.POINTER_UP */) {\n sendTiming(timing);\n }\n }, {\n once: true\n });\n }\n function sendTiming(timing) {\n if (!timingSent) {\n timingSent = true;\n removeEventListeners();\n // In some cases the recorded delay is clearly wrong, e.g. it's negative or it's larger than\n // the time between now and when the page was loaded.\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/4\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/6\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/7\n var delay = timing.processingStart - timing.startTime;\n if (delay >= 0 && delay < dateNow() - startTimeStamp) {\n callback(timing);\n }\n }\n }\n}\nfunction computeRelativePerformanceTiming() {\n var result = {};\n var timing = performance.timing;\n for (var key in timing) {\n if (isNumber(timing[key])) {\n var numberKey = key;\n var timingElement = timing[numberKey];\n result[numberKey] = timingElement === 0 ? 0 : getRelativeTime(timingElement);\n }\n }\n return result;\n}\nfunction handleRumPerformanceEntries(lifeCycle, configuration, entries) {\n var rumPerformanceEntries = entries.filter(function (entry) {\n return entry.entryType === 'resource' || entry.entryType === 'navigation' || entry.entryType === 'paint' || entry.entryType === 'longtask' || entry.entryType === 'largest-contentful-paint' || entry.entryType === 'first-input' || entry.entryType === 'layout-shift';\n });\n var rumAllowedPerformanceEntries = rumPerformanceEntries.filter(function (entry) {\n return !isIncompleteNavigation(entry) && !isForbiddenResource(configuration, entry);\n });\n if (rumAllowedPerformanceEntries.length) {\n lifeCycle.notify(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, rumAllowedPerformanceEntries);\n }\n}\nfunction isIncompleteNavigation(entry) {\n return entry.entryType === 'navigation' && entry.loadEventEnd <= 0;\n}\nfunction isForbiddenResource(configuration, entry) {\n return entry.entryType === 'resource' && !isAllowedRequestUrl(configuration, entry.name);\n}\n","import { getSyntheticsResultId, getSyntheticsTestId, willSyntheticsInjectRum } from '@datadog/browser-core';\nexport function getSyntheticsContext() {\n var testId = getSyntheticsTestId();\n var resultId = getSyntheticsResultId();\n if (testId && resultId) {\n return {\n test_id: testId,\n result_id: resultId,\n injected: willSyntheticsInjectRum()\n };\n }\n}\n","export function getCiTestContext() {\n var _a;\n var testExecutionId = (_a = window.Cypress) === null || _a === void 0 ? void 0 : _a.env('traceId');\n if (typeof testExecutionId === 'string') {\n return {\n test_execution_id: testExecutionId\n };\n }\n}\n","import { Observable, throttle, addEventListener } from '@datadog/browser-core';\nvar viewportObservable;\nexport function initViewportObservable() {\n if (!viewportObservable) {\n viewportObservable = createViewportObservable();\n }\n return viewportObservable;\n}\nexport function createViewportObservable() {\n var observable = new Observable(function () {\n var updateDimension = throttle(function () {\n observable.notify(getViewportDimension());\n }, 200).throttled;\n return addEventListener(window, \"resize\" /* DOM_EVENT.RESIZE */, updateDimension, {\n capture: true,\n passive: true\n }).stop;\n });\n return observable;\n}\n// excludes the width and height of any rendered classic scrollbar that is fixed to the visual viewport\nexport function getViewportDimension() {\n var visual = window.visualViewport;\n if (visual) {\n return {\n width: Number(visual.width * visual.scale),\n height: Number(visual.height * visual.scale)\n };\n }\n return {\n width: Number(window.innerWidth || 0),\n height: Number(window.innerHeight || 0)\n };\n}\n","import { getViewportDimension, initViewportObservable } from '../../browser/viewportObservable';\nvar viewport;\nvar stopListeners;\nexport function getDisplayContext() {\n if (!viewport) {\n viewport = getViewportDimension();\n stopListeners = initViewportObservable().subscribe(function (viewportDimension) {\n viewport = viewportDimension;\n }).unsubscribe;\n }\n return {\n viewport: viewport\n };\n}\nexport function resetDisplayContext() {\n if (stopListeners) {\n stopListeners();\n }\n viewport = undefined;\n}\n","import { sanitize, deepClone, getType, objectEntries } from '@datadog/browser-core';\n/**\n * Current limitation:\n * - field path do not support array, 'a.b.c' only\n */\nexport function limitModification(object, modifiableFieldPaths, modifier) {\n var clone = deepClone(object);\n var result = modifier(clone);\n objectEntries(modifiableFieldPaths).forEach(function (_a) {\n var fieldPath = _a[0],\n fieldType = _a[1];\n var newValue = get(clone, fieldPath);\n var newType = getType(newValue);\n if (newType === fieldType) {\n set(object, fieldPath, sanitize(newValue));\n } else if (fieldType === 'object' && (newType === 'undefined' || newType === 'null')) {\n set(object, fieldPath, {});\n }\n });\n return result;\n}\nfunction get(object, path) {\n var current = object;\n for (var _i = 0, _a = path.split('.'); _i < _a.length; _i++) {\n var field = _a[_i];\n if (!isValidObjectContaining(current, field)) {\n return;\n }\n current = current[field];\n }\n return current;\n}\nfunction set(object, path, value) {\n var current = object;\n var fields = path.split('.');\n for (var i = 0; i < fields.length; i += 1) {\n var field = fields[i];\n if (!isValidObject(current)) {\n return;\n }\n if (i !== fields.length - 1) {\n current = current[field];\n } else {\n current[field] = value;\n }\n }\n}\nfunction isValidObject(object) {\n return getType(object) === 'object';\n}\nfunction isValidObjectContaining(object, field) {\n return isValidObject(object) && Object.prototype.hasOwnProperty.call(object, field);\n}\n","import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign } from '@datadog/browser-core';\nimport { getSyntheticsContext } from './contexts/syntheticsContext';\nimport { getCiTestContext } from './contexts/ciTestContext';\nimport { getDisplayContext } from './contexts/displayContext';\nimport { limitModification } from './limitModification';\nvar VIEW_MODIFIABLE_FIELD_PATHS = {\n 'view.url': 'string',\n 'view.referrer': 'string'\n};\nvar USER_CUSTOMIZABLE_FIELD_PATHS = {\n context: 'object'\n};\nvar modifiableFieldPathsByEvent;\nexport function startRumAssembly(configuration, lifeCycle, sessionManager, viewContexts, urlContexts, actionContexts, buildCommonContext, reportError) {\n var _a, _b;\n modifiableFieldPathsByEvent = (_a = {}, _a[\"view\" /* RumEventType.VIEW */] = VIEW_MODIFIABLE_FIELD_PATHS, _a[\"error\" /* RumEventType.ERROR */] = assign({\n 'error.message': 'string',\n 'error.stack': 'string',\n 'error.resource.url': 'string',\n 'error.fingerprint': 'string'\n }, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS), _a[\"resource\" /* RumEventType.RESOURCE */] = assign({\n 'resource.url': 'string'\n }, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS), _a[\"action\" /* RumEventType.ACTION */] = assign({\n 'action.target.name': 'string'\n }, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS), _a[\"long_task\" /* RumEventType.LONG_TASK */] = assign({}, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS), _a);\n var eventRateLimiters = (_b = {}, _b[\"error\" /* RumEventType.ERROR */] = createEventRateLimiter(\"error\" /* RumEventType.ERROR */, configuration.eventRateLimiterThreshold, reportError), _b[\"action\" /* RumEventType.ACTION */] = createEventRateLimiter(\"action\" /* RumEventType.ACTION */, configuration.eventRateLimiterThreshold, reportError), _b);\n var syntheticsContext = getSyntheticsContext();\n var ciTestContext = getCiTestContext();\n lifeCycle.subscribe(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, function (_a) {\n var startTime = _a.startTime,\n rawRumEvent = _a.rawRumEvent,\n domainContext = _a.domainContext,\n savedCommonContext = _a.savedCommonContext,\n customerContext = _a.customerContext;\n var viewContext = viewContexts.findView(startTime);\n var urlContext = urlContexts.findUrl(startTime);\n var session = sessionManager.findTrackedSession(startTime);\n if (session && viewContext && urlContext) {\n var commonContext = savedCommonContext || buildCommonContext();\n var actionId = actionContexts.findActionId(startTime);\n var rumContext = {\n _dd: {\n format_version: 2,\n drift: currentDrift(),\n session: {\n plan: session.plan\n },\n browser_sdk_version: canUseEventBridge() ? \"4.43.0\" : undefined\n },\n application: {\n id: configuration.applicationId\n },\n date: timeStampNow(),\n service: viewContext.service || configuration.service,\n version: viewContext.version || configuration.version,\n source: 'browser',\n session: {\n id: session.id,\n type: syntheticsContext ? \"synthetics\" /* SessionType.SYNTHETICS */ : ciTestContext ? \"ci_test\" /* SessionType.CI_TEST */ : \"user\" /* SessionType.USER */\n },\n view: {\n id: viewContext.id,\n name: viewContext.name,\n url: urlContext.url,\n referrer: urlContext.referrer\n },\n action: needToAssembleWithAction(rawRumEvent) && actionId ? {\n id: actionId\n } : undefined,\n synthetics: syntheticsContext,\n ci_test: ciTestContext,\n display: getDisplayContext()\n };\n var serverRumEvent = combine(rumContext, rawRumEvent);\n serverRumEvent.context = combine(commonContext.context, customerContext);\n if (!('has_replay' in serverRumEvent.session)) {\n ;\n serverRumEvent.session.has_replay = commonContext.hasReplay;\n }\n if (!isEmptyObject(commonContext.user)) {\n ;\n serverRumEvent.usr = commonContext.user;\n }\n if (shouldSend(serverRumEvent, configuration.beforeSend, domainContext, eventRateLimiters)) {\n if (isEmptyObject(serverRumEvent.context)) {\n delete serverRumEvent.context;\n }\n lifeCycle.notify(11 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, serverRumEvent);\n }\n }\n });\n}\nfunction shouldSend(event, beforeSend, domainContext, eventRateLimiters) {\n var _a;\n if (beforeSend) {\n var result = limitModification(event, modifiableFieldPathsByEvent[event.type], function (event) {\n return beforeSend(event, domainContext);\n });\n if (result === false && event.type !== \"view\" /* RumEventType.VIEW */) {\n return false;\n }\n if (result === false) {\n display.warn(\"Can't dismiss view events using beforeSend!\");\n }\n }\n var rateLimitReached = (_a = eventRateLimiters[event.type]) === null || _a === void 0 ? void 0 : _a.isLimitReached();\n return !rateLimitReached;\n}\nfunction needToAssembleWithAction(event) {\n return [\"error\" /* RumEventType.ERROR */, \"resource\" /* RumEventType.RESOURCE */, \"long_task\" /* RumEventType.LONG_TASK */].indexOf(event.type) !== -1;\n}\n","import { addDuration, addEventListener, elapsed, relativeNow, toServerDuration } from '@datadog/browser-core';\n// Arbitrary value to cap number of element mostly for backend & to save bandwidth\nexport var MAX_NUMBER_OF_SELECTABLE_FOREGROUND_PERIODS = 500;\n// Arbitrary value to cap number of element mostly for memory consumption in the browser\nexport var MAX_NUMBER_OF_STORED_FOREGROUND_PERIODS = 2500;\nvar foregroundPeriods = [];\nexport function startForegroundContexts() {\n if (document.hasFocus()) {\n addNewForegroundPeriod();\n }\n var stopForegroundTracking = trackFocus(addNewForegroundPeriod).stop;\n var stopBlurTracking = trackBlur(closeForegroundPeriod).stop;\n return {\n isInForegroundAt: isInForegroundAt,\n selectInForegroundPeriodsFor: selectInForegroundPeriodsFor,\n stop: function () {\n foregroundPeriods = [];\n stopForegroundTracking();\n stopBlurTracking();\n }\n };\n}\nexport function addNewForegroundPeriod() {\n if (foregroundPeriods.length > MAX_NUMBER_OF_STORED_FOREGROUND_PERIODS) {\n return;\n }\n var currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1];\n var now = relativeNow();\n if (currentForegroundPeriod !== undefined && currentForegroundPeriod.end === undefined) {\n return;\n }\n foregroundPeriods.push({\n start: now\n });\n}\nexport function closeForegroundPeriod() {\n if (foregroundPeriods.length === 0) {\n return;\n }\n var currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1];\n var now = relativeNow();\n if (currentForegroundPeriod.end !== undefined) {\n return;\n }\n currentForegroundPeriod.end = now;\n}\nfunction trackFocus(onFocusChange) {\n return addEventListener(window, \"focus\" /* DOM_EVENT.FOCUS */, function (event) {\n if (!event.isTrusted) {\n return;\n }\n onFocusChange();\n });\n}\nfunction trackBlur(onBlurChange) {\n return addEventListener(window, \"blur\" /* DOM_EVENT.BLUR */, function (event) {\n if (!event.isTrusted) {\n return;\n }\n onBlurChange();\n });\n}\nfunction isInForegroundAt(startTime) {\n for (var i = foregroundPeriods.length - 1; i >= 0; i--) {\n var foregroundPeriod = foregroundPeriods[i];\n if (foregroundPeriod.end !== undefined && startTime > foregroundPeriod.end) {\n break;\n }\n if (startTime > foregroundPeriod.start && (foregroundPeriod.end === undefined || startTime < foregroundPeriod.end)) {\n return true;\n }\n }\n return false;\n}\nfunction selectInForegroundPeriodsFor(eventStartTime, duration) {\n var eventEndTime = addDuration(eventStartTime, duration);\n var filteredForegroundPeriods = [];\n var earliestIndex = Math.max(0, foregroundPeriods.length - MAX_NUMBER_OF_SELECTABLE_FOREGROUND_PERIODS);\n for (var i = foregroundPeriods.length - 1; i >= earliestIndex; i--) {\n var foregroundPeriod = foregroundPeriods[i];\n if (foregroundPeriod.end !== undefined && eventStartTime > foregroundPeriod.end) {\n // event starts after the end of the current focus period\n // since the array is sorted, we can stop looking for foreground periods\n break;\n }\n if (eventEndTime < foregroundPeriod.start) {\n // event ends before the start of the current focus period\n // continue to previous one\n continue;\n }\n var startTime = eventStartTime > foregroundPeriod.start ? eventStartTime : foregroundPeriod.start;\n var startDuration = elapsed(eventStartTime, startTime);\n var endTime = foregroundPeriod.end === undefined || eventEndTime < foregroundPeriod.end ? eventEndTime : foregroundPeriod.end;\n var endDuration = elapsed(startTime, endTime);\n filteredForegroundPeriods.unshift({\n start: toServerDuration(startDuration),\n duration: toServerDuration(endDuration)\n });\n }\n return filteredForegroundPeriods;\n}\n","/**\n * Internal context keep returning v1 format\n * to not break compatibility with logs data format\n */\nexport function startInternalContext(applicationId, sessionManager, viewContexts, actionContexts, urlContexts) {\n return {\n get: function (startTime) {\n var viewContext = viewContexts.findView(startTime);\n var urlContext = urlContexts.findUrl(startTime);\n var session = sessionManager.findTrackedSession(startTime);\n if (session && viewContext && urlContext) {\n var actionId = actionContexts.findActionId(startTime);\n return {\n application_id: applicationId,\n session_id: session.id,\n user_action: actionId ? {\n id: actionId\n } : undefined,\n view: {\n id: viewContext.id,\n name: viewContext.name,\n referrer: urlContext.referrer,\n url: urlContext.url\n }\n };\n }\n }\n };\n}\n","import { AbstractLifeCycle } from '@datadog/browser-core';\nexport var LifeCycle = AbstractLifeCycle;\n","import { SESSION_TIME_OUT_DELAY, ValueHistory } from '@datadog/browser-core';\nexport var VIEW_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;\nexport function startViewContexts(lifeCycle) {\n var viewContextHistory = new ValueHistory(VIEW_CONTEXT_TIME_OUT_DELAY);\n lifeCycle.subscribe(2 /* LifeCycleEventType.VIEW_CREATED */, function (view) {\n viewContextHistory.add(buildViewContext(view), view.startClocks.relative);\n });\n lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, function (_a) {\n var endClocks = _a.endClocks;\n viewContextHistory.closeActive(endClocks.relative);\n });\n lifeCycle.subscribe(8 /* LifeCycleEventType.SESSION_RENEWED */, function () {\n viewContextHistory.reset();\n });\n function buildViewContext(view) {\n return {\n service: view.service,\n version: view.version,\n id: view.id,\n name: view.name,\n startClocks: view.startClocks\n };\n }\n return {\n findView: function (startTime) {\n return viewContextHistory.find(startTime);\n },\n stop: function () {\n viewContextHistory.stop();\n }\n };\n}\n","import { initFetchObservable, initXhrObservable, readBytesFromStream, elapsed, timeStampNow, tryToClone } from '@datadog/browser-core';\nimport { isAllowedRequestUrl } from './rumEventsCollection/resource/resourceUtils';\nimport { startTracer } from './tracing/tracer';\nvar nextRequestIndex = 1;\nexport function startRequestCollection(lifeCycle, configuration, sessionManager) {\n var tracer = startTracer(configuration, sessionManager);\n trackXhr(lifeCycle, configuration, tracer);\n trackFetch(lifeCycle, configuration, tracer);\n}\nexport function trackXhr(lifeCycle, configuration, tracer) {\n var subscription = initXhrObservable().subscribe(function (rawContext) {\n var context = rawContext;\n if (!isAllowedRequestUrl(configuration, context.url)) {\n return;\n }\n switch (context.state) {\n case 'start':\n tracer.traceXhr(context, context.xhr);\n context.requestIndex = getNextRequestIndex();\n lifeCycle.notify(5 /* LifeCycleEventType.REQUEST_STARTED */, {\n requestIndex: context.requestIndex,\n url: context.url\n });\n break;\n case 'complete':\n tracer.clearTracingIfNeeded(context);\n lifeCycle.notify(6 /* LifeCycleEventType.REQUEST_COMPLETED */, {\n duration: context.duration,\n method: context.method,\n requestIndex: context.requestIndex,\n spanId: context.spanId,\n startClocks: context.startClocks,\n status: context.status,\n traceId: context.traceId,\n traceSampled: context.traceSampled,\n type: \"xhr\" /* RequestType.XHR */,\n url: context.url,\n xhr: context.xhr\n });\n break;\n }\n });\n return {\n stop: function () {\n return subscription.unsubscribe();\n }\n };\n}\nexport function trackFetch(lifeCycle, configuration, tracer) {\n var subscription = initFetchObservable().subscribe(function (rawContext) {\n var context = rawContext;\n if (!isAllowedRequestUrl(configuration, context.url)) {\n return;\n }\n switch (context.state) {\n case 'start':\n tracer.traceFetch(context);\n context.requestIndex = getNextRequestIndex();\n lifeCycle.notify(5 /* LifeCycleEventType.REQUEST_STARTED */, {\n requestIndex: context.requestIndex,\n url: context.url\n });\n break;\n case 'resolve':\n waitForResponseToComplete(context, function (duration) {\n tracer.clearTracingIfNeeded(context);\n lifeCycle.notify(6 /* LifeCycleEventType.REQUEST_COMPLETED */, {\n duration: duration,\n method: context.method,\n requestIndex: context.requestIndex,\n responseType: context.responseType,\n spanId: context.spanId,\n startClocks: context.startClocks,\n status: context.status,\n traceId: context.traceId,\n traceSampled: context.traceSampled,\n type: \"fetch\" /* RequestType.FETCH */,\n url: context.url,\n response: context.response,\n init: context.init,\n input: context.input\n });\n });\n break;\n }\n });\n return {\n stop: function () {\n return subscription.unsubscribe();\n }\n };\n}\nfunction getNextRequestIndex() {\n var result = nextRequestIndex;\n nextRequestIndex += 1;\n return result;\n}\nfunction waitForResponseToComplete(context, callback) {\n var clonedResponse = context.response && tryToClone(context.response);\n if (!clonedResponse || !clonedResponse.body) {\n // do not try to wait for the response if the clone failed, fetch error or null body\n callback(elapsed(context.startClocks.timeStamp, timeStampNow()));\n } else {\n readBytesFromStream(clonedResponse.body, function () {\n callback(elapsed(context.startClocks.timeStamp, timeStampNow()));\n }, {\n bytesLimit: Number.POSITIVE_INFINITY,\n collectStreamBody: false\n });\n }\n}\n","import { noop } from '@datadog/browser-core';\nexport function trackEventCounts(_a) {\n var lifeCycle = _a.lifeCycle,\n isChildEvent = _a.isChildEvent,\n _b = _a.onChange,\n callback = _b === void 0 ? noop : _b;\n var eventCounts = {\n errorCount: 0,\n longTaskCount: 0,\n resourceCount: 0,\n actionCount: 0,\n frustrationCount: 0\n };\n var subscription = lifeCycle.subscribe(11 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, function (event) {\n if (event.type === 'view' || !isChildEvent(event)) {\n return;\n }\n switch (event.type) {\n case \"error\" /* RumEventType.ERROR */:\n eventCounts.errorCount += 1;\n callback();\n break;\n case \"action\" /* RumEventType.ACTION */:\n eventCounts.actionCount += 1;\n if (event.action.frustration) {\n eventCounts.frustrationCount += event.action.frustration.type.length;\n }\n callback();\n break;\n case \"long_task\" /* RumEventType.LONG_TASK */:\n eventCounts.longTaskCount += 1;\n callback();\n break;\n case \"resource\" /* RumEventType.RESOURCE */:\n eventCounts.resourceCount += 1;\n callback();\n break;\n }\n });\n return {\n stop: function () {\n subscription.unsubscribe();\n },\n eventCounts: eventCounts\n };\n}\n","import { instrumentMethodAndCallOriginal, matchList, monitor, Observable, timeStampNow, setTimeout, clearTimeout } from '@datadog/browser-core';\n// Delay to wait for a page activity to validate the tracking process\nexport var PAGE_ACTIVITY_VALIDATION_DELAY = 100;\n// Delay to wait after a page activity to end the tracking process\nexport var PAGE_ACTIVITY_END_DELAY = 100;\n/**\n * Wait for the page activity end\n *\n * Detection lifecycle:\n * ```\n * Wait page activity end\n * .-------------------'--------------------.\n * v v\n * [Wait for a page activity ] [Wait for a maximum duration]\n * [timeout: VALIDATION_DELAY] [ timeout: maxDuration ]\n * / \\ |\n * v v |\n * [No page activity] [Page activity] |\n * | |,----------------------. |\n * v v | |\n * (Discard) [Wait for a page activity] | |\n * [ timeout: END_DELAY ] | |\n * / \\ | |\n * v v | |\n * [No page activity] [Page activity] | |\n * | | | |\n * | '------------' |\n * '-----------. ,--------------------'\n * v\n * (End)\n * ```\n *\n * Note: by assuming that maxDuration is greater than VALIDATION_DELAY, we are sure that if the\n * process is still alive after maxDuration, it has been validated.\n */\nexport function waitPageActivityEnd(lifeCycle, domMutationObservable, configuration, pageActivityEndCallback, maxDuration) {\n var pageActivityObservable = createPageActivityObservable(lifeCycle, domMutationObservable, configuration);\n return doWaitPageActivityEnd(pageActivityObservable, pageActivityEndCallback, maxDuration);\n}\nexport function doWaitPageActivityEnd(pageActivityObservable, pageActivityEndCallback, maxDuration) {\n var pageActivityEndTimeoutId;\n var hasCompleted = false;\n var validationTimeoutId = setTimeout(monitor(function () {\n return complete({\n hadActivity: false\n });\n }), PAGE_ACTIVITY_VALIDATION_DELAY);\n var maxDurationTimeoutId = maxDuration !== undefined ? setTimeout(monitor(function () {\n return complete({\n hadActivity: true,\n end: timeStampNow()\n });\n }), maxDuration) : undefined;\n var pageActivitySubscription = pageActivityObservable.subscribe(function (_a) {\n var isBusy = _a.isBusy;\n clearTimeout(validationTimeoutId);\n clearTimeout(pageActivityEndTimeoutId);\n var lastChangeTime = timeStampNow();\n if (!isBusy) {\n pageActivityEndTimeoutId = setTimeout(monitor(function () {\n return complete({\n hadActivity: true,\n end: lastChangeTime\n });\n }), PAGE_ACTIVITY_END_DELAY);\n }\n });\n var stop = function () {\n hasCompleted = true;\n clearTimeout(validationTimeoutId);\n clearTimeout(pageActivityEndTimeoutId);\n clearTimeout(maxDurationTimeoutId);\n pageActivitySubscription.unsubscribe();\n };\n function complete(event) {\n if (hasCompleted) {\n return;\n }\n stop();\n pageActivityEndCallback(event);\n }\n return {\n stop: stop\n };\n}\nexport function createPageActivityObservable(lifeCycle, domMutationObservable, configuration) {\n var observable = new Observable(function () {\n var subscriptions = [];\n var firstRequestIndex;\n var pendingRequestsCount = 0;\n subscriptions.push(domMutationObservable.subscribe(notifyPageActivity), lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n if (entries.some(function (entry) {\n return entry.entryType === 'resource' && !isExcludedUrl(configuration, entry.name);\n })) {\n notifyPageActivity();\n }\n }), lifeCycle.subscribe(5 /* LifeCycleEventType.REQUEST_STARTED */, function (startEvent) {\n if (isExcludedUrl(configuration, startEvent.url)) {\n return;\n }\n if (firstRequestIndex === undefined) {\n firstRequestIndex = startEvent.requestIndex;\n }\n pendingRequestsCount += 1;\n notifyPageActivity();\n }), lifeCycle.subscribe(6 /* LifeCycleEventType.REQUEST_COMPLETED */, function (request) {\n if (isExcludedUrl(configuration, request.url) || firstRequestIndex === undefined ||\n // If the request started before the tracking start, ignore it\n request.requestIndex < firstRequestIndex) {\n return;\n }\n pendingRequestsCount -= 1;\n notifyPageActivity();\n }));\n var stopTrackingWindowOpen = trackWindowOpen(notifyPageActivity).stop;\n return function () {\n stopTrackingWindowOpen();\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n };\n function notifyPageActivity() {\n observable.notify({\n isBusy: pendingRequestsCount > 0\n });\n }\n });\n return observable;\n}\nfunction isExcludedUrl(configuration, requestUrl) {\n return matchList(configuration.excludedActivityUrls, requestUrl);\n}\nfunction trackWindowOpen(callback) {\n return instrumentMethodAndCallOriginal(window, 'open', {\n before: callback\n });\n}\n","import { ONE_SECOND, clearTimeout, setTimeout } from '@datadog/browser-core';\nexport var MAX_DURATION_BETWEEN_CLICKS = ONE_SECOND;\nexport var MAX_DISTANCE_BETWEEN_CLICKS = 100;\nexport function createClickChain(firstClick, onFinalize) {\n var bufferedClicks = [];\n var status = 0 /* ClickChainStatus.WaitingForMoreClicks */;\n var maxDurationBetweenClicksTimeoutId;\n appendClick(firstClick);\n function appendClick(click) {\n click.stopObservable.subscribe(tryFinalize);\n bufferedClicks.push(click);\n clearTimeout(maxDurationBetweenClicksTimeoutId);\n maxDurationBetweenClicksTimeoutId = setTimeout(dontAcceptMoreClick, MAX_DURATION_BETWEEN_CLICKS);\n }\n function tryFinalize() {\n if (status === 1 /* ClickChainStatus.WaitingForClicksToStop */ && bufferedClicks.every(function (click) {\n return click.isStopped();\n })) {\n status = 2 /* ClickChainStatus.Finalized */;\n onFinalize(bufferedClicks);\n }\n }\n function dontAcceptMoreClick() {\n clearTimeout(maxDurationBetweenClicksTimeoutId);\n if (status === 0 /* ClickChainStatus.WaitingForMoreClicks */) {\n status = 1 /* ClickChainStatus.WaitingForClicksToStop */;\n tryFinalize();\n }\n }\n return {\n tryAppend: function (click) {\n if (status !== 0 /* ClickChainStatus.WaitingForMoreClicks */) {\n return false;\n }\n if (bufferedClicks.length > 0 && !areEventsSimilar(bufferedClicks[bufferedClicks.length - 1].event, click.event)) {\n dontAcceptMoreClick();\n return false;\n }\n appendClick(click);\n return true;\n },\n stop: function () {\n dontAcceptMoreClick();\n }\n };\n}\n/**\n * Checks whether two events are similar by comparing their target, position and timestamp\n */\nfunction areEventsSimilar(first, second) {\n return first.target === second.target && mouseEventDistance(first, second) <= MAX_DISTANCE_BETWEEN_CLICKS && first.timeStamp - second.timeStamp <= MAX_DURATION_BETWEEN_CLICKS;\n}\nfunction mouseEventDistance(origin, other) {\n return Math.sqrt(Math.pow(origin.clientX - other.clientX, 2) + Math.pow(origin.clientY - other.clientY, 2));\n}\n","import { safeTruncate, isIE, find } from '@datadog/browser-core';\n/**\n * Get the action name from the attribute 'data-dd-action-name' on the element or any of its parent.\n * It can also be retrieved from a user defined attribute.\n */\nexport var DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE = 'data-dd-action-name';\nexport function getActionNameFromElement(element, userProgrammaticAttribute) {\n // Proceed to get the action name in two steps:\n // * first, get the name programmatically, explicitly defined by the user.\n // * then, use strategies that are known to return good results. Those strategies will be used on\n // the element and a few parents, but it's likely that they won't succeed at all.\n // * if no name is found this way, use strategies returning less accurate names as a fallback.\n // Those are much likely to succeed.\n return getActionNameFromElementProgrammatically(element, DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE) || userProgrammaticAttribute && getActionNameFromElementProgrammatically(element, userProgrammaticAttribute) || getActionNameFromElementForStrategies(element, userProgrammaticAttribute, priorityStrategies) || getActionNameFromElementForStrategies(element, userProgrammaticAttribute, fallbackStrategies) || '';\n}\nfunction getActionNameFromElementProgrammatically(targetElement, programmaticAttribute) {\n var elementWithAttribute;\n // We don't use getActionNameFromElementForStrategies here, because we want to consider all parents,\n // without limit. It is up to the user to declare a relevant naming strategy.\n // If available, use element.closest() to match get the attribute from the element or any of its\n // parent. Else fallback to a more traditional implementation.\n if (supportsElementClosest()) {\n elementWithAttribute = targetElement.closest(\"[\".concat(programmaticAttribute, \"]\"));\n } else {\n var element = targetElement;\n while (element) {\n if (element.hasAttribute(programmaticAttribute)) {\n elementWithAttribute = element;\n break;\n }\n element = element.parentElement;\n }\n }\n if (!elementWithAttribute) {\n return;\n }\n var name = elementWithAttribute.getAttribute(programmaticAttribute);\n return truncate(normalizeWhitespace(name.trim()));\n}\nvar priorityStrategies = [\n// associated LABEL text\nfunction (element, userProgrammaticAttribute) {\n // IE does not support element.labels, so we fallback to a CSS selector based on the element id\n // instead\n if (supportsLabelProperty()) {\n if ('labels' in element && element.labels && element.labels.length > 0) {\n return getTextualContent(element.labels[0], userProgrammaticAttribute);\n }\n } else if (element.id) {\n var label = element.ownerDocument && find(element.ownerDocument.querySelectorAll('label'), function (label) {\n return label.htmlFor === element.id;\n });\n return label && getTextualContent(label, userProgrammaticAttribute);\n }\n},\n// INPUT button (and associated) value\nfunction (element) {\n if (element.nodeName === 'INPUT') {\n var input = element;\n var type = input.getAttribute('type');\n if (type === 'button' || type === 'submit' || type === 'reset') {\n return input.value;\n }\n }\n},\n// BUTTON, LABEL or button-like element text\nfunction (element, userProgrammaticAttribute) {\n if (element.nodeName === 'BUTTON' || element.nodeName === 'LABEL' || element.getAttribute('role') === 'button') {\n return getTextualContent(element, userProgrammaticAttribute);\n }\n}, function (element) {\n return element.getAttribute('aria-label');\n},\n// associated element text designated by the aria-labelledby attribute\nfunction (element, userProgrammaticAttribute) {\n var labelledByAttribute = element.getAttribute('aria-labelledby');\n if (labelledByAttribute) {\n return labelledByAttribute.split(/\\s+/).map(function (id) {\n return getElementById(element, id);\n }).filter(function (label) {\n return Boolean(label);\n }).map(function (element) {\n return getTextualContent(element, userProgrammaticAttribute);\n }).join(' ');\n }\n}, function (element) {\n return element.getAttribute('alt');\n}, function (element) {\n return element.getAttribute('name');\n}, function (element) {\n return element.getAttribute('title');\n}, function (element) {\n return element.getAttribute('placeholder');\n},\n// SELECT first OPTION text\nfunction (element, userProgrammaticAttribute) {\n if ('options' in element && element.options.length > 0) {\n return getTextualContent(element.options[0], userProgrammaticAttribute);\n }\n}];\nvar fallbackStrategies = [function (element, userProgrammaticAttribute) {\n return getTextualContent(element, userProgrammaticAttribute);\n}];\n/**\n * Iterates over the target element and its parent, using the strategies list to get an action name.\n * Each strategies are applied on each element, stopping as soon as a non-empty value is returned.\n */\nvar MAX_PARENTS_TO_CONSIDER = 10;\nfunction getActionNameFromElementForStrategies(targetElement, userProgrammaticAttribute, strategies) {\n var element = targetElement;\n var recursionCounter = 0;\n while (recursionCounter <= MAX_PARENTS_TO_CONSIDER && element && element.nodeName !== 'BODY' && element.nodeName !== 'HTML' && element.nodeName !== 'HEAD') {\n for (var _i = 0, strategies_1 = strategies; _i < strategies_1.length; _i++) {\n var strategy = strategies_1[_i];\n var name_1 = strategy(element, userProgrammaticAttribute);\n if (typeof name_1 === 'string') {\n var trimmedName = name_1.trim();\n if (trimmedName) {\n return truncate(normalizeWhitespace(trimmedName));\n }\n }\n }\n // Consider a FORM as a contextual limit to get the action name. This is experimental and may\n // be reconsidered in the future.\n if (element.nodeName === 'FORM') {\n break;\n }\n element = element.parentElement;\n recursionCounter += 1;\n }\n}\nfunction normalizeWhitespace(s) {\n return s.replace(/\\s+/g, ' ');\n}\nfunction truncate(s) {\n return s.length > 100 ? \"\".concat(safeTruncate(s, 100), \" [...]\") : s;\n}\nfunction getElementById(refElement, id) {\n // Use the element ownerDocument here, because tests are executed in an iframe, so\n // document.getElementById won't work.\n return refElement.ownerDocument ? refElement.ownerDocument.getElementById(id) : null;\n}\nfunction getTextualContent(element, userProgrammaticAttribute) {\n if (element.isContentEditable) {\n return;\n }\n if ('innerText' in element) {\n var text_1 = element.innerText;\n var removeTextFromElements = function (query) {\n var list = element.querySelectorAll(query);\n for (var index = 0; index < list.length; index += 1) {\n var element_1 = list[index];\n if ('innerText' in element_1) {\n var textToReplace = element_1.innerText;\n if (textToReplace && textToReplace.trim().length > 0) {\n text_1 = text_1.replace(textToReplace, '');\n }\n }\n }\n };\n if (!supportsInnerTextScriptAndStyleRemoval()) {\n // remove the inner text of SCRIPT and STYLES from the result. This is a bit dirty, but should\n // be relatively fast and work in most cases.\n removeTextFromElements('script, style');\n }\n // remove the text of elements with programmatic attribute value\n removeTextFromElements(\"[\".concat(DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE, \"]\"));\n if (userProgrammaticAttribute) {\n removeTextFromElements(\"[\".concat(userProgrammaticAttribute, \"]\"));\n }\n return text_1;\n }\n return element.textContent;\n}\n/**\n * Returns true if element.innerText excludes the text from inline SCRIPT and STYLE element. This\n * should be the case everywhere except on Internet Explorer 10 and 11 (see [1])\n *\n * The innerText property relies on what is actually rendered to compute its output, so to check if\n * it actually excludes SCRIPT and STYLE content, a solution would be to create a style element, set\n * its content to '*', inject it in the document body, and check if the style element innerText\n * property returns '*'. Using a new `document` instance won't work as it is not rendered.\n *\n * This solution requires specific CSP rules (see [2]) to be set by the customer. We want to avoid\n * this, so instead we rely on browser detection. In case of false negative, the impact should be\n * low, since we rely on this result to remove the SCRIPT and STYLE innerText (which will be empty)\n * from a parent element innerText.\n *\n * [1]: https://web.archive.org/web/20210602165716/http://perfectionkills.com/the-poor-misunderstood-innerText/#diff-with-textContent\n * [2]: https://github.com/DataDog/browser-sdk/issues/1084\n */\nfunction supportsInnerTextScriptAndStyleRemoval() {\n return !isIE();\n}\n/**\n * Returns true if the browser supports the element.labels property. This should be the case\n * everywhere except on Internet Explorer.\n * Note: The result is computed lazily, because we don't want any DOM access when the SDK is\n * evaluated.\n */\nvar supportsLabelPropertyResult;\nfunction supportsLabelProperty() {\n if (supportsLabelPropertyResult === undefined) {\n supportsLabelPropertyResult = 'labels' in HTMLInputElement.prototype;\n }\n return supportsLabelPropertyResult;\n}\n/**\n * Returns true if the browser supports the element.closest method. This should be the case\n * everywhere except on Internet Explorer.\n * Note: The result is computed lazily, because we don't want any DOM access when the SDK is\n * evaluated.\n */\nvar supportsElementClosestResult;\nfunction supportsElementClosest() {\n if (supportsElementClosestResult === undefined) {\n supportsElementClosestResult = 'closest' in HTMLElement.prototype;\n }\n return supportsElementClosestResult;\n}\n","import { cssEscape } from '@datadog/browser-core';\nimport { DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE } from './getActionNameFromElement';\n/**\n * Stable attributes are attributes that are commonly used to identify parts of a UI (ex:\n * component). Those attribute values should not be generated randomly (hardcoded most of the time)\n * and stay the same across deploys. They are not necessarily unique across the document.\n */\nexport var STABLE_ATTRIBUTES = [DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE,\n// Common test attributes (list provided by google recorder)\n'data-testid', 'data-test', 'data-qa', 'data-cy', 'data-test-id', 'data-qa-id', 'data-testing',\n// FullStory decorator attributes:\n'data-component', 'data-element', 'data-source-file'];\n// Selectors to use if they target a single element on the whole document. Those selectors are\n// considered as \"stable\" and uniquely identify an element regardless of the page state. If we find\n// one, we should consider the selector \"complete\" and stop iterating over ancestors.\nvar GLOBALLY_UNIQUE_SELECTOR_GETTERS = [getStableAttributeSelector, getIDSelector];\n// Selectors to use if they target a single element among an element descendants. Those selectors\n// are more brittle than \"globally unique\" selectors and should be combined with ancestor selectors\n// to improve specificity.\nvar UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS = [getStableAttributeSelector, getClassSelector, getTagNameSelector];\nexport function getSelectorFromElement(targetElement, actionNameAttribute) {\n var targetElementSelector = '';\n var element = targetElement;\n while (element && element.nodeName !== 'HTML') {\n var globallyUniqueSelector = findSelector(element, GLOBALLY_UNIQUE_SELECTOR_GETTERS, isSelectorUniqueGlobally, actionNameAttribute, targetElementSelector);\n if (globallyUniqueSelector) {\n return globallyUniqueSelector;\n }\n var uniqueSelectorAmongChildren = findSelector(element, UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS, isSelectorUniqueAmongSiblings, actionNameAttribute, targetElementSelector);\n targetElementSelector = uniqueSelectorAmongChildren || combineSelector(getPositionSelector(element), targetElementSelector);\n element = element.parentElement;\n }\n return targetElementSelector;\n}\nfunction isGeneratedValue(value) {\n // To compute the \"URL path group\", the backend replaces every URL path parts as a question mark\n // if it thinks the part is an identifier. The condition it uses is to checks whether a digit is\n // present.\n //\n // Here, we use the same strategy: if a the value contains a digit, we consider it generated. This\n // strategy might be a bit naive and fail in some cases, but there are many fallbacks to generate\n // CSS selectors so it should be fine most of the time. We might want to allow customers to\n // provide their own `isGeneratedValue` at some point.\n return /[0-9]/.test(value);\n}\nfunction getIDSelector(element) {\n if (element.id && !isGeneratedValue(element.id)) {\n return \"#\".concat(cssEscape(element.id));\n }\n}\nfunction getClassSelector(element) {\n if (element.tagName === 'BODY') {\n return;\n }\n if (element.classList.length > 0) {\n for (var i = 0; i < element.classList.length; i += 1) {\n var className = element.classList[i];\n if (isGeneratedValue(className)) {\n continue;\n }\n return \"\".concat(element.tagName, \".\").concat(cssEscape(className));\n }\n }\n}\nfunction getTagNameSelector(element) {\n return element.tagName;\n}\nfunction getStableAttributeSelector(element, actionNameAttribute) {\n if (actionNameAttribute) {\n var selector = getAttributeSelector(actionNameAttribute);\n if (selector) {\n return selector;\n }\n }\n for (var _i = 0, STABLE_ATTRIBUTES_1 = STABLE_ATTRIBUTES; _i < STABLE_ATTRIBUTES_1.length; _i++) {\n var attributeName = STABLE_ATTRIBUTES_1[_i];\n var selector = getAttributeSelector(attributeName);\n if (selector) {\n return selector;\n }\n }\n function getAttributeSelector(attributeName) {\n if (element.hasAttribute(attributeName)) {\n return \"\".concat(element.tagName, \"[\").concat(attributeName, \"=\\\"\").concat(cssEscape(element.getAttribute(attributeName)), \"\\\"]\");\n }\n }\n}\nfunction getPositionSelector(element) {\n var sibling = element.parentElement.firstElementChild;\n var elementIndex = 1;\n while (sibling && sibling !== element) {\n if (sibling.tagName === element.tagName) {\n elementIndex += 1;\n }\n sibling = sibling.nextElementSibling;\n }\n return \"\".concat(element.tagName, \":nth-of-type(\").concat(elementIndex, \")\");\n}\nfunction findSelector(element, selectorGetters, predicate, actionNameAttribute, childSelector) {\n for (var _i = 0, selectorGetters_1 = selectorGetters; _i < selectorGetters_1.length; _i++) {\n var selectorGetter = selectorGetters_1[_i];\n var elementSelector = selectorGetter(element, actionNameAttribute);\n if (!elementSelector) {\n continue;\n }\n var fullSelector = combineSelector(elementSelector, childSelector);\n if (predicate(element, fullSelector)) {\n return fullSelector;\n }\n }\n}\n/**\n * Check whether the selector is unique among the whole document.\n */\nfunction isSelectorUniqueGlobally(element, selector) {\n return element.ownerDocument.querySelectorAll(selector).length === 1;\n}\n/**\n * Check whether the selector is unique among the element siblings. In other words, it returns true\n * if \"ELEMENT_PARENT > SELECTOR\" returns a single element.\n *\n * The result will be less accurate on browsers that don't support :scope (i. e. IE): it will check\n * for any element matching the selector contained in the parent (in other words,\n * \"ELEMENT_PARENT SELECTOR\" returns a single element), regardless of whether the selector is a\n * direct descendent of the element parent. This should not impact results too much: if it\n * inaccurately returns false, we'll just fall back to another strategy.\n */\nfunction isSelectorUniqueAmongSiblings(element, selector) {\n return element.parentElement.querySelectorAll(supportScopeSelector() ? combineSelector(':scope', selector) : selector).length === 1;\n}\nfunction combineSelector(parent, child) {\n return child ? \"\".concat(parent, \">\").concat(child) : parent;\n}\nvar supportScopeSelectorCache;\nexport function supportScopeSelector() {\n if (supportScopeSelectorCache === undefined) {\n try {\n document.querySelector(':scope');\n supportScopeSelectorCache = true;\n } catch (_a) {\n supportScopeSelectorCache = false;\n }\n }\n return supportScopeSelectorCache;\n}\n","import { addEventListener } from '@datadog/browser-core';\nexport function listenActionEvents(_a) {\n var onPointerDown = _a.onPointerDown,\n onPointerUp = _a.onPointerUp;\n var selectionEmptyAtPointerDown;\n var userActivity = {\n selection: false,\n input: false\n };\n var clickContext;\n var listeners = [addEventListener(window, \"pointerdown\" /* DOM_EVENT.POINTER_DOWN */, function (event) {\n if (isValidPointerEvent(event)) {\n selectionEmptyAtPointerDown = isSelectionEmpty();\n userActivity = {\n selection: false,\n input: false\n };\n clickContext = onPointerDown(event);\n }\n }, {\n capture: true\n }), addEventListener(window, \"selectionchange\" /* DOM_EVENT.SELECTION_CHANGE */, function () {\n if (!selectionEmptyAtPointerDown || !isSelectionEmpty()) {\n userActivity.selection = true;\n }\n }, {\n capture: true\n }), addEventListener(window, \"pointerup\" /* DOM_EVENT.POINTER_UP */, function (event) {\n if (isValidPointerEvent(event) && clickContext) {\n // Use a scoped variable to make sure the value is not changed by other clicks\n var localUserActivity_1 = userActivity;\n onPointerUp(clickContext, event, function () {\n return localUserActivity_1;\n });\n clickContext = undefined;\n }\n }, {\n capture: true\n }), addEventListener(window, \"input\" /* DOM_EVENT.INPUT */, function () {\n userActivity.input = true;\n }, {\n capture: true\n })];\n return {\n stop: function () {\n listeners.forEach(function (listener) {\n return listener.stop();\n });\n }\n };\n}\nfunction isSelectionEmpty() {\n var selection = window.getSelection();\n return !selection || selection.isCollapsed;\n}\nfunction isValidPointerEvent(event) {\n return event.target instanceof Element &&\n // Only consider 'primary' pointer events for now. Multi-touch support could be implemented in\n // the future.\n event.isPrimary !== false;\n}\n","import { elementMatches, ONE_SECOND } from '@datadog/browser-core';\nvar MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE = 3;\nexport function computeFrustration(clicks, rageClick) {\n if (isRage(clicks)) {\n rageClick.addFrustration(\"rage_click\" /* FrustrationType.RAGE_CLICK */);\n if (clicks.some(isDead)) {\n rageClick.addFrustration(\"dead_click\" /* FrustrationType.DEAD_CLICK */);\n }\n if (rageClick.hasError) {\n rageClick.addFrustration(\"error_click\" /* FrustrationType.ERROR_CLICK */);\n }\n return {\n isRage: true\n };\n }\n var hasSelectionChanged = clicks.some(function (click) {\n return click.getUserActivity().selection;\n });\n clicks.forEach(function (click) {\n if (click.hasError) {\n click.addFrustration(\"error_click\" /* FrustrationType.ERROR_CLICK */);\n }\n if (isDead(click) &&\n // Avoid considering clicks part of a double-click or triple-click selections as dead clicks\n !hasSelectionChanged) {\n click.addFrustration(\"dead_click\" /* FrustrationType.DEAD_CLICK */);\n }\n });\n return {\n isRage: false\n };\n}\nexport function isRage(clicks) {\n if (clicks.some(function (click) {\n return click.getUserActivity().selection;\n })) {\n return false;\n }\n for (var i = 0; i < clicks.length - (MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE - 1); i += 1) {\n if (clicks[i + MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE - 1].event.timeStamp - clicks[i].event.timeStamp <= ONE_SECOND) {\n return true;\n }\n }\n return false;\n}\nvar DEAD_CLICK_EXCLUDE_SELECTOR =\n// inputs that don't trigger a meaningful event like \"input\" when clicked, including textual\n// inputs (using a negative selector is shorter here)\n'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"range\"]),' + 'textarea,' + 'select,' +\n// contenteditable and their descendants don't always trigger meaningful changes when manipulated\n'[contenteditable],' + '[contenteditable] *,' +\n// canvas, as there is no good way to detect activity occurring on them\n'canvas,' +\n// links that are interactive (have an href attribute) or any of their descendants, as they can\n// open a new tab or navigate to a hash without triggering a meaningful event\n'a[href],' + 'a[href] *';\nexport function isDead(click) {\n if (click.hasPageActivity || click.getUserActivity().input) {\n return false;\n }\n return !elementMatches(click.event.target, DEAD_CLICK_EXCLUDE_SELECTOR);\n}\n","import { includes, timeStampNow, Observable, assign, getRelativeTime, ONE_MINUTE, ValueHistory, generateUUID, clocksNow, ONE_SECOND, elapsed } from '@datadog/browser-core';\nimport { trackEventCounts } from '../../trackEventCounts';\nimport { PAGE_ACTIVITY_VALIDATION_DELAY, waitPageActivityEnd } from '../../waitPageActivityEnd';\nimport { createClickChain } from './clickChain';\nimport { getActionNameFromElement } from './getActionNameFromElement';\nimport { getSelectorFromElement } from './getSelectorFromElement';\nimport { listenActionEvents } from './listenActionEvents';\nimport { computeFrustration } from './computeFrustration';\n// Maximum duration for click actions\nexport var CLICK_ACTION_MAX_DURATION = 10 * ONE_SECOND;\nexport var ACTION_CONTEXT_TIME_OUT_DELAY = 5 * ONE_MINUTE; // arbitrary\nexport function trackClickActions(lifeCycle, domMutationObservable, configuration) {\n var history = new ValueHistory(ACTION_CONTEXT_TIME_OUT_DELAY);\n var stopObservable = new Observable();\n var currentClickChain;\n lifeCycle.subscribe(8 /* LifeCycleEventType.SESSION_RENEWED */, function () {\n history.reset();\n });\n lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, stopClickChain);\n var stopActionEventsListener = listenActionEvents({\n onPointerDown: function (pointerDownEvent) {\n return processPointerDown(configuration, lifeCycle, domMutationObservable, history, pointerDownEvent);\n },\n onPointerUp: function (_a, startEvent, getUserActivity) {\n var clickActionBase = _a.clickActionBase,\n hadActivityOnPointerDown = _a.hadActivityOnPointerDown;\n return startClickAction(configuration, lifeCycle, domMutationObservable, history, stopObservable, appendClickToClickChain, clickActionBase, startEvent, getUserActivity, hadActivityOnPointerDown);\n }\n }).stop;\n var actionContexts = {\n findActionId: function (startTime) {\n return configuration.trackFrustrations ? history.findAll(startTime) : history.find(startTime);\n }\n };\n return {\n stop: function () {\n stopClickChain();\n stopObservable.notify();\n stopActionEventsListener();\n },\n actionContexts: actionContexts\n };\n function appendClickToClickChain(click) {\n if (!currentClickChain || !currentClickChain.tryAppend(click)) {\n var rageClick_1 = click.clone();\n currentClickChain = createClickChain(click, function (clicks) {\n finalizeClicks(clicks, rageClick_1);\n });\n }\n }\n function stopClickChain() {\n if (currentClickChain) {\n currentClickChain.stop();\n }\n }\n}\nfunction processPointerDown(configuration, lifeCycle, domMutationObservable, history, pointerDownEvent) {\n if (!configuration.trackFrustrations && history.find()) {\n // TODO: remove this in a future major version. To keep retrocompatibility, ignore any new\n // action if another one is already occurring.\n return;\n }\n var clickActionBase = computeClickActionBase(pointerDownEvent, configuration.actionNameAttribute);\n if (!configuration.trackFrustrations && !clickActionBase.name) {\n // TODO: remove this in a future major version. To keep retrocompatibility, ignore any action\n // with a blank name\n return;\n }\n var hadActivityOnPointerDown = false;\n waitPageActivityEnd(lifeCycle, domMutationObservable, configuration, function (pageActivityEndEvent) {\n hadActivityOnPointerDown = pageActivityEndEvent.hadActivity;\n },\n // We don't care about the activity duration, we just want to know whether an activity did happen\n // within the \"validation delay\" or not. Limit the duration so the callback is called sooner.\n PAGE_ACTIVITY_VALIDATION_DELAY);\n return {\n clickActionBase: clickActionBase,\n hadActivityOnPointerDown: function () {\n return hadActivityOnPointerDown;\n }\n };\n}\nfunction startClickAction(configuration, lifeCycle, domMutationObservable, history, stopObservable, appendClickToClickChain, clickActionBase, startEvent, getUserActivity, hadActivityOnPointerDown) {\n var click = newClick(lifeCycle, history, getUserActivity, clickActionBase, startEvent);\n if (configuration.trackFrustrations) {\n appendClickToClickChain(click);\n }\n var stopWaitPageActivityEnd = waitPageActivityEnd(lifeCycle, domMutationObservable, configuration, function (pageActivityEndEvent) {\n if (pageActivityEndEvent.hadActivity && pageActivityEndEvent.end < click.startClocks.timeStamp) {\n // If the clock is looking weird, just discard the click\n click.discard();\n } else {\n if (pageActivityEndEvent.hadActivity) {\n click.stop(pageActivityEndEvent.end);\n } else if (hadActivityOnPointerDown()) {\n click.stop(\n // using the click start as activity end, so the click will have some activity but its\n // duration will be 0 (as the activity started before the click start)\n click.startClocks.timeStamp);\n } else {\n click.stop();\n }\n // Validate or discard the click only if we don't track frustrations. It'll be done when\n // the click chain is finalized.\n if (!configuration.trackFrustrations) {\n if (!pageActivityEndEvent.hadActivity) {\n // If we are not tracking frustrations, we should discard the click to keep backward\n // compatibility.\n click.discard();\n } else {\n click.validate();\n }\n }\n }\n }, CLICK_ACTION_MAX_DURATION).stop;\n var viewEndedSubscription = lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, function (_a) {\n var endClocks = _a.endClocks;\n click.stop(endClocks.timeStamp);\n });\n var stopSubscription = stopObservable.subscribe(function () {\n click.stop();\n });\n click.stopObservable.subscribe(function () {\n viewEndedSubscription.unsubscribe();\n stopWaitPageActivityEnd();\n stopSubscription.unsubscribe();\n });\n}\nfunction computeClickActionBase(event, actionNameAttribute) {\n var rect = event.target.getBoundingClientRect();\n return {\n type: \"click\" /* ActionType.CLICK */,\n target: {\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n selector: getSelectorFromElement(event.target, actionNameAttribute)\n },\n position: {\n // Use clientX and Y because for SVG element offsetX and Y are relatives to the element\n x: Math.round(event.clientX - rect.left),\n y: Math.round(event.clientY - rect.top)\n },\n name: getActionNameFromElement(event.target, actionNameAttribute)\n };\n}\nfunction newClick(lifeCycle, history, getUserActivity, clickActionBase, startEvent) {\n var id = generateUUID();\n var startClocks = clocksNow();\n var historyEntry = history.add(id, startClocks.relative);\n var eventCountsSubscription = trackEventCounts({\n lifeCycle: lifeCycle,\n isChildEvent: function (event) {\n return event.action !== undefined && (Array.isArray(event.action.id) ? includes(event.action.id, id) : event.action.id === id);\n }\n });\n var status = 0 /* ClickStatus.ONGOING */;\n var activityEndTime;\n var frustrationTypes = [];\n var stopObservable = new Observable();\n function stop(newActivityEndTime) {\n if (status !== 0 /* ClickStatus.ONGOING */) {\n return;\n }\n activityEndTime = newActivityEndTime;\n status = 1 /* ClickStatus.STOPPED */;\n if (activityEndTime) {\n historyEntry.close(getRelativeTime(activityEndTime));\n } else {\n historyEntry.remove();\n }\n eventCountsSubscription.stop();\n stopObservable.notify();\n }\n return {\n event: startEvent,\n stop: stop,\n stopObservable: stopObservable,\n get hasError() {\n return eventCountsSubscription.eventCounts.errorCount > 0;\n },\n get hasPageActivity() {\n return activityEndTime !== undefined;\n },\n getUserActivity: getUserActivity,\n addFrustration: function (frustrationType) {\n frustrationTypes.push(frustrationType);\n },\n startClocks: startClocks,\n isStopped: function () {\n return status === 1 /* ClickStatus.STOPPED */ || status === 2 /* ClickStatus.FINALIZED */;\n },\n clone: function () {\n return newClick(lifeCycle, history, getUserActivity, clickActionBase, startEvent);\n },\n validate: function (domEvents) {\n stop();\n if (status !== 1 /* ClickStatus.STOPPED */) {\n return;\n }\n var _a = eventCountsSubscription.eventCounts,\n resourceCount = _a.resourceCount,\n errorCount = _a.errorCount,\n longTaskCount = _a.longTaskCount;\n var clickAction = assign({\n type: \"click\" /* ActionType.CLICK */,\n duration: activityEndTime && elapsed(startClocks.timeStamp, activityEndTime),\n startClocks: startClocks,\n id: id,\n frustrationTypes: frustrationTypes,\n counts: {\n resourceCount: resourceCount,\n errorCount: errorCount,\n longTaskCount: longTaskCount\n },\n events: domEvents !== null && domEvents !== void 0 ? domEvents : [startEvent],\n event: startEvent\n }, clickActionBase);\n lifeCycle.notify(1 /* LifeCycleEventType.AUTO_ACTION_COMPLETED */, clickAction);\n status = 2 /* ClickStatus.FINALIZED */;\n },\n discard: function () {\n stop();\n status = 2 /* ClickStatus.FINALIZED */;\n }\n };\n}\nexport function finalizeClicks(clicks, rageClick) {\n var isRage = computeFrustration(clicks, rageClick).isRage;\n if (isRage) {\n clicks.forEach(function (click) {\n return click.discard();\n });\n rageClick.stop(timeStampNow());\n rageClick.validate(clicks.map(function (click) {\n return click.event;\n }));\n } else {\n rageClick.discard();\n clicks.forEach(function (click) {\n return click.validate();\n });\n }\n}\n","import { noop, assign, combine, toServerDuration, generateUUID } from '@datadog/browser-core';\nimport { trackClickActions } from './trackClickActions';\nexport function startActionCollection(lifeCycle, domMutationObservable, configuration, foregroundContexts) {\n lifeCycle.subscribe(1 /* LifeCycleEventType.AUTO_ACTION_COMPLETED */, function (action) {\n return lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processAction(action, foregroundContexts));\n });\n var actionContexts = {\n findActionId: noop\n };\n if (configuration.trackUserInteractions) {\n actionContexts = trackClickActions(lifeCycle, domMutationObservable, configuration).actionContexts;\n }\n return {\n addAction: function (action, savedCommonContext) {\n lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, assign({\n savedCommonContext: savedCommonContext\n }, processAction(action, foregroundContexts)));\n },\n actionContexts: actionContexts\n };\n}\nfunction processAction(action, foregroundContexts) {\n var autoActionProperties = isAutoAction(action) ? {\n action: {\n id: action.id,\n loading_time: toServerDuration(action.duration),\n frustration: {\n type: action.frustrationTypes\n },\n error: {\n count: action.counts.errorCount\n },\n long_task: {\n count: action.counts.longTaskCount\n },\n resource: {\n count: action.counts.resourceCount\n }\n },\n _dd: {\n action: {\n target: action.target,\n position: action.position\n }\n }\n } : undefined;\n var customerContext = !isAutoAction(action) ? action.context : undefined;\n var actionEvent = combine({\n action: {\n id: generateUUID(),\n target: {\n name: action.name\n },\n type: action.type\n },\n date: action.startClocks.timeStamp,\n type: \"action\" /* RumEventType.ACTION */\n }, autoActionProperties);\n var inForeground = foregroundContexts.isInForegroundAt(action.startClocks.relative);\n if (inForeground !== undefined) {\n actionEvent.view = {\n in_foreground: inForeground\n };\n }\n return {\n customerContext: customerContext,\n rawRumEvent: actionEvent,\n startTime: action.startClocks.relative,\n domainContext: isAutoAction(action) ? {\n event: action.event,\n events: action.events\n } : {}\n };\n}\nfunction isAutoAction(action) {\n return action.type !== \"custom\" /* ActionType.CUSTOM */;\n}\n","import { clocksNow, initConsoleObservable, ErrorSource, ConsoleApiName } from '@datadog/browser-core';\nexport function trackConsoleError(errorObservable) {\n var subscription = initConsoleObservable([ConsoleApiName.error]).subscribe(function (consoleError) {\n return errorObservable.notify({\n startClocks: clocksNow(),\n message: consoleError.message,\n stack: consoleError.stack,\n fingerprint: consoleError.fingerprint,\n source: ErrorSource.CONSOLE,\n handling: \"handled\" /* ErrorHandling.HANDLED */,\n handlingStack: consoleError.handlingStack\n });\n });\n return {\n stop: function () {\n subscription.unsubscribe();\n }\n };\n}\n","import { clocksNow, ErrorSource, initReportObservable, RawReportType } from '@datadog/browser-core';\nexport function trackReportError(errorObservable) {\n var subscription = initReportObservable([RawReportType.cspViolation, RawReportType.intervention]).subscribe(function (reportError) {\n return errorObservable.notify({\n startClocks: clocksNow(),\n message: reportError.message,\n stack: reportError.stack,\n type: reportError.subtype,\n source: ErrorSource.REPORT,\n handling: \"unhandled\" /* ErrorHandling.UNHANDLED */\n });\n });\n return {\n stop: function () {\n subscription.unsubscribe();\n }\n };\n}\n","import { isEmptyObject, assign, ErrorSource, generateUUID, computeRawError, computeStackTrace, Observable, trackRuntimeError } from '@datadog/browser-core';\nimport { trackConsoleError } from './trackConsoleError';\nimport { trackReportError } from './trackReportError';\nexport function startErrorCollection(lifeCycle, foregroundContexts, featureFlagContexts) {\n var errorObservable = new Observable();\n trackConsoleError(errorObservable);\n trackRuntimeError(errorObservable);\n trackReportError(errorObservable);\n errorObservable.subscribe(function (error) {\n return lifeCycle.notify(12 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, {\n error: error\n });\n });\n return doStartErrorCollection(lifeCycle, foregroundContexts, featureFlagContexts);\n}\nexport function doStartErrorCollection(lifeCycle, foregroundContexts, featureFlagContexts) {\n lifeCycle.subscribe(12 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, function (_a) {\n var error = _a.error,\n customerContext = _a.customerContext,\n savedCommonContext = _a.savedCommonContext;\n lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, assign({\n customerContext: customerContext,\n savedCommonContext: savedCommonContext\n }, processError(error, foregroundContexts, featureFlagContexts)));\n });\n return {\n addError: function (_a, savedCommonContext) {\n var error = _a.error,\n handlingStack = _a.handlingStack,\n startClocks = _a.startClocks,\n customerContext = _a.context;\n var stackTrace = error instanceof Error ? computeStackTrace(error) : undefined;\n var rawError = computeRawError({\n stackTrace: stackTrace,\n originalError: error,\n handlingStack: handlingStack,\n startClocks: startClocks,\n nonErrorPrefix: \"Provided\" /* NonErrorPrefix.PROVIDED */,\n source: ErrorSource.CUSTOM,\n handling: \"handled\" /* ErrorHandling.HANDLED */\n });\n lifeCycle.notify(12 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, {\n customerContext: customerContext,\n savedCommonContext: savedCommonContext,\n error: rawError\n });\n }\n };\n}\nfunction processError(error, foregroundContexts, featureFlagContexts) {\n var rawRumEvent = {\n date: error.startClocks.timeStamp,\n error: {\n id: generateUUID(),\n message: error.message,\n source: error.source,\n stack: error.stack,\n handling_stack: error.handlingStack,\n type: error.type,\n handling: error.handling,\n causes: error.causes,\n source_type: 'browser',\n fingerprint: error.fingerprint\n },\n type: \"error\" /* RumEventType.ERROR */\n };\n var inForeground = foregroundContexts.isInForegroundAt(error.startClocks.relative);\n if (inForeground) {\n rawRumEvent.view = {\n in_foreground: inForeground\n };\n }\n var featureFlagContext = featureFlagContexts.findFeatureFlagEvaluations(error.startClocks.relative);\n if (featureFlagContext && !isEmptyObject(featureFlagContext)) {\n rawRumEvent.feature_flags = featureFlagContext;\n }\n return {\n rawRumEvent: rawRumEvent,\n startTime: error.startClocks.relative,\n domainContext: {\n error: error.originalError\n }\n };\n}\n","import { toServerDuration, relativeToClocks, generateUUID } from '@datadog/browser-core';\nexport function startLongTaskCollection(lifeCycle, sessionManager) {\n lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n if (entry.entryType !== 'longtask') {\n break;\n }\n var session = sessionManager.findTrackedSession(entry.startTime);\n if (!session || !session.longTaskAllowed) {\n break;\n }\n var startClocks = relativeToClocks(entry.startTime);\n var rawRumEvent = {\n date: startClocks.timeStamp,\n long_task: {\n id: generateUUID(),\n duration: toServerDuration(entry.duration)\n },\n type: \"long_task\" /* RumEventType.LONG_TASK */,\n _dd: {\n discarded: false\n }\n };\n lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, {\n rawRumEvent: rawRumEvent,\n startTime: startClocks.relative,\n domainContext: {\n performanceEntry: entry.toJSON()\n }\n });\n }\n });\n}\n","import { addDuration } from '@datadog/browser-core';\nimport { toValidEntry } from './resourceUtils';\n/**\n * Look for corresponding timing in resource timing buffer\n *\n * Observations:\n * - Timing (start, end) are nested inside the request (start, end)\n * - Some timing can be not exactly nested, being off by < 1 ms\n *\n * Strategy:\n * - from valid nested entries (with 1 ms error margin)\n * - if a single timing match, return the timing\n * - otherwise we can't decide, return undefined\n */\nexport function matchRequestTiming(request) {\n if (!performance || !('getEntriesByName' in performance)) {\n return;\n }\n var sameNameEntries = performance.getEntriesByName(request.url, 'resource');\n if (!sameNameEntries.length || !('toJSON' in sameNameEntries[0])) {\n return;\n }\n var candidates = sameNameEntries.map(function (entry) {\n return entry.toJSON();\n }).filter(toValidEntry).filter(function (entry) {\n return isBetween(entry, request.startClocks.relative, endTime({\n startTime: request.startClocks.relative,\n duration: request.duration\n }));\n });\n if (candidates.length === 1) {\n return candidates[0];\n }\n return;\n}\nfunction endTime(timing) {\n return addDuration(timing.startTime, timing.duration);\n}\nfunction isBetween(timing, start, end) {\n var errorMargin = 1;\n return timing.startTime >= start - errorMargin && endTime(timing) <= addDuration(end, errorMargin);\n}\n","import { combine, generateUUID, toServerDuration, relativeToClocks, assign, isNumber, isExperimentalFeatureEnabled, ExperimentalFeature } from '@datadog/browser-core';\nimport { matchRequestTiming } from './matchRequestTiming';\nimport { computePerformanceResourceDetails, computePerformanceResourceDuration, computeResourceKind, computeSize, isRequestKind } from './resourceUtils';\nexport function startResourceCollection(lifeCycle, configuration, sessionManager, pageStateHistory) {\n lifeCycle.subscribe(6 /* LifeCycleEventType.REQUEST_COMPLETED */, function (request) {\n lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processRequest(request, configuration, sessionManager, pageStateHistory));\n });\n lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n if (entry.entryType === 'resource' && !isRequestKind(entry)) {\n lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processResourceEntry(entry, configuration, sessionManager, pageStateHistory));\n }\n }\n });\n}\nfunction processRequest(request, configuration, sessionManager, pageStateHistory) {\n var _a;\n var type = request.type === \"xhr\" /* RequestType.XHR */ ? \"xhr\" /* ResourceType.XHR */ : \"fetch\" /* ResourceType.FETCH */;\n var matchingTiming = matchRequestTiming(request);\n var startClocks = matchingTiming ? relativeToClocks(matchingTiming.startTime) : request.startClocks;\n var correspondingTimingOverrides = matchingTiming ? computePerformanceEntryMetrics(matchingTiming) : undefined;\n var tracingInfo = computeRequestTracingInfo(request, configuration);\n var indexingInfo = computeIndexingInfo(sessionManager, startClocks);\n var duration = computeRequestDuration(pageStateHistory, startClocks, request.duration);\n var pageStateInfo = computePageStateInfo(pageStateHistory, startClocks, (_a = matchingTiming === null || matchingTiming === void 0 ? void 0 : matchingTiming.duration) !== null && _a !== void 0 ? _a : request.duration);\n var resourceEvent = combine({\n date: startClocks.timeStamp,\n resource: {\n id: generateUUID(),\n type: type,\n duration: duration,\n method: request.method,\n status_code: request.status,\n url: request.url\n },\n type: \"resource\" /* RumEventType.RESOURCE */\n }, tracingInfo, correspondingTimingOverrides, indexingInfo, pageStateInfo);\n return {\n startTime: startClocks.relative,\n rawRumEvent: resourceEvent,\n domainContext: {\n performanceEntry: matchingTiming && toPerformanceEntryRepresentation(matchingTiming),\n xhr: request.xhr,\n response: request.response,\n requestInput: request.input,\n requestInit: request.init,\n error: request.error\n }\n };\n}\nfunction processResourceEntry(entry, configuration, sessionManager, pageStateHistory) {\n var type = computeResourceKind(entry);\n var entryMetrics = computePerformanceEntryMetrics(entry);\n var startClocks = relativeToClocks(entry.startTime);\n var tracingInfo = computeEntryTracingInfo(entry, configuration);\n var indexingInfo = computeIndexingInfo(sessionManager, startClocks);\n var pageStateInfo = computePageStateInfo(pageStateHistory, startClocks, entry.duration);\n var resourceEvent = combine({\n date: startClocks.timeStamp,\n resource: {\n id: generateUUID(),\n type: type,\n url: entry.name\n },\n type: \"resource\" /* RumEventType.RESOURCE */\n }, tracingInfo, entryMetrics, indexingInfo, pageStateInfo);\n return {\n startTime: startClocks.relative,\n rawRumEvent: resourceEvent,\n domainContext: {\n performanceEntry: toPerformanceEntryRepresentation(entry)\n }\n };\n}\nfunction computePerformanceEntryMetrics(timing) {\n return {\n resource: assign({\n duration: computePerformanceResourceDuration(timing),\n size: computeSize(timing)\n }, computePerformanceResourceDetails(timing))\n };\n}\nfunction computeRequestTracingInfo(request, configuration) {\n var hasBeenTraced = request.traceSampled && request.traceId && request.spanId;\n if (!hasBeenTraced) {\n return undefined;\n }\n return {\n _dd: {\n span_id: request.spanId.toDecimalString(),\n trace_id: request.traceId.toDecimalString(),\n rule_psr: getRulePsr(configuration)\n }\n };\n}\nfunction computeEntryTracingInfo(entry, configuration) {\n var hasBeenTraced = entry.traceId;\n if (!hasBeenTraced) {\n return undefined;\n }\n return {\n _dd: {\n trace_id: entry.traceId,\n rule_psr: getRulePsr(configuration)\n }\n };\n}\n// TODO next major: use directly PerformanceEntry type in domain context\nfunction toPerformanceEntryRepresentation(entry) {\n return entry;\n}\n/**\n * @returns number between 0 and 1 which represents trace sample rate\n */\nfunction getRulePsr(configuration) {\n return isNumber(configuration.traceSampleRate) ? configuration.traceSampleRate / 100 : undefined;\n}\nfunction computeIndexingInfo(sessionManager, resourceStart) {\n var session = sessionManager.findTrackedSession(resourceStart.relative);\n return {\n _dd: {\n discarded: !session || !session.resourceAllowed\n }\n };\n}\nfunction computePageStateInfo(pageStateHistory, startClocks, duration) {\n if (!isExperimentalFeatureEnabled(ExperimentalFeature.RESOURCE_PAGE_STATES)) {\n return;\n }\n return {\n _dd: {\n page_states: pageStateHistory.findAll(startClocks.relative, duration),\n page_was_discarded: String(document.wasDiscarded)\n }\n };\n}\nfunction computeRequestDuration(pageStateHistory, startClocks, duration) {\n var _a;\n // TODO remove FF in next major\n if (!isExperimentalFeatureEnabled(ExperimentalFeature.NO_RESOURCE_DURATION_FROZEN_STATE)) {\n return toServerDuration(duration);\n }\n var requestCrossedFrozenState = (_a = pageStateHistory.findAll(startClocks.relative, duration)) === null || _a === void 0 ? void 0 : _a.some(function (pageState) {\n return pageState.state === \"frozen\" /* PageState.FROZEN */;\n });\n return !requestCrossedFrozenState ? toServerDuration(duration) : undefined;\n}\n","import { addEventListeners } from '@datadog/browser-core';\nvar trackFirstHiddenSingleton;\nvar stopListeners;\nexport function trackFirstHidden(eventTarget) {\n if (eventTarget === void 0) {\n eventTarget = window;\n }\n if (!trackFirstHiddenSingleton) {\n if (document.visibilityState === 'hidden') {\n trackFirstHiddenSingleton = {\n timeStamp: 0\n };\n } else {\n trackFirstHiddenSingleton = {\n timeStamp: Infinity\n };\n stopListeners = addEventListeners(eventTarget, [\"pagehide\" /* DOM_EVENT.PAGE_HIDE */, \"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */], function (event) {\n if (event.type === 'pagehide' || document.visibilityState === 'hidden') {\n trackFirstHiddenSingleton.timeStamp = event.timeStamp;\n stopListeners();\n }\n }, {\n capture: true\n }).stop;\n }\n }\n return trackFirstHiddenSingleton;\n}\nexport function resetFirstHidden() {\n if (stopListeners) {\n stopListeners();\n }\n trackFirstHiddenSingleton = undefined;\n}\n","import { setTimeout, assign, addEventListeners, elapsed, ONE_MINUTE, find, findLast, relativeNow } from '@datadog/browser-core';\nimport { trackFirstHidden } from './trackFirstHidden';\n// Discard LCP and FCP timings above a certain delay to avoid incorrect data\n// It happens in some cases like sleep mode or some browser implementations\nexport var TIMING_MAXIMUM_DELAY = 10 * ONE_MINUTE;\n/**\n * The initial view can finish quickly, before some metrics can be produced (ex: before the page load\n * event, or the first input). Also, we don't want to trigger a view update indefinitely, to avoid\n * updates on views that ended a long time ago. Keep watching for metrics after the view ends for a\n * limited amount of time.\n */\nexport var KEEP_TRACKING_TIMINGS_AFTER_VIEW_DELAY = 5 * ONE_MINUTE;\nexport function trackInitialViewTimings(lifeCycle, setLoadEvent, scheduleViewUpdate) {\n var timings = {};\n function setTimings(newTimings) {\n assign(timings, newTimings);\n scheduleViewUpdate();\n }\n var stopNavigationTracking = trackNavigationTimings(lifeCycle, function (newTimings) {\n setLoadEvent(newTimings.loadEvent);\n setTimings(newTimings);\n }).stop;\n var stopFCPTracking = trackFirstContentfulPaintTiming(lifeCycle, function (firstContentfulPaint) {\n return setTimings({\n firstContentfulPaint: firstContentfulPaint\n });\n }).stop;\n var stopLCPTracking = trackLargestContentfulPaintTiming(lifeCycle, window, function (largestContentfulPaint) {\n setTimings({\n largestContentfulPaint: largestContentfulPaint\n });\n }).stop;\n var stopFIDTracking = trackFirstInputTimings(lifeCycle, function (_a) {\n var firstInputDelay = _a.firstInputDelay,\n firstInputTime = _a.firstInputTime;\n setTimings({\n firstInputDelay: firstInputDelay,\n firstInputTime: firstInputTime\n });\n }).stop;\n function stop() {\n stopNavigationTracking();\n stopFCPTracking();\n stopLCPTracking();\n stopFIDTracking();\n }\n return {\n stop: stop,\n timings: timings,\n scheduleStop: function () {\n setTimeout(stop, KEEP_TRACKING_TIMINGS_AFTER_VIEW_DELAY);\n }\n };\n}\nexport function trackNavigationTimings(lifeCycle, callback) {\n var stop = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n if (entry.entryType === 'navigation') {\n callback({\n domComplete: entry.domComplete,\n domContentLoaded: entry.domContentLoadedEventEnd,\n domInteractive: entry.domInteractive,\n loadEvent: entry.loadEventEnd,\n // In some cases the value reported is negative or is larger\n // than the current page time. Ignore these cases:\n // https://github.com/GoogleChrome/web-vitals/issues/137\n // https://github.com/GoogleChrome/web-vitals/issues/162\n firstByte: entry.responseStart >= 0 && entry.responseStart <= relativeNow() ? entry.responseStart : undefined\n });\n }\n }\n }).unsubscribe;\n return {\n stop: stop\n };\n}\nexport function trackFirstContentfulPaintTiming(lifeCycle, callback) {\n var firstHidden = trackFirstHidden();\n var stop = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n var fcpEntry = find(entries, function (entry) {\n return entry.entryType === 'paint' && entry.name === 'first-contentful-paint' && entry.startTime < firstHidden.timeStamp && entry.startTime < TIMING_MAXIMUM_DELAY;\n });\n if (fcpEntry) {\n callback(fcpEntry.startTime);\n }\n }).unsubscribe;\n return {\n stop: stop\n };\n}\n/**\n * Track the largest contentful paint (LCP) occurring during the initial View. This can yield\n * multiple values, only the most recent one should be used.\n * Documentation: https://web.dev/lcp/\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getLCP.ts\n */\nexport function trackLargestContentfulPaintTiming(lifeCycle, eventTarget, callback) {\n var firstHidden = trackFirstHidden();\n // Ignore entries that come after the first user interaction. According to the documentation, the\n // browser should not send largest-contentful-paint entries after a user interact with the page,\n // but the web-vitals reference implementation uses this as a safeguard.\n var firstInteractionTimestamp = Infinity;\n var stopEventListener = addEventListeners(eventTarget, [\"pointerdown\" /* DOM_EVENT.POINTER_DOWN */, \"keydown\" /* DOM_EVENT.KEY_DOWN */], function (event) {\n firstInteractionTimestamp = event.timeStamp;\n }, {\n capture: true,\n once: true\n }).stop;\n var unsubscribeLifeCycle = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n var lcpEntry = findLast(entries, function (entry) {\n return entry.entryType === 'largest-contentful-paint' && entry.startTime < firstInteractionTimestamp && entry.startTime < firstHidden.timeStamp && entry.startTime < TIMING_MAXIMUM_DELAY;\n });\n if (lcpEntry) {\n callback(lcpEntry.startTime);\n }\n }).unsubscribe;\n return {\n stop: function () {\n stopEventListener();\n unsubscribeLifeCycle();\n }\n };\n}\n/**\n * Track the first input occurring during the initial View to return:\n * - First Input Delay\n * - First Input Time\n * Callback is called at most one time.\n * Documentation: https://web.dev/fid/\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getFID.ts\n */\nexport function trackFirstInputTimings(lifeCycle, callback) {\n var firstHidden = trackFirstHidden();\n var stop = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n var firstInputEntry = find(entries, function (entry) {\n return entry.entryType === 'first-input' && entry.startTime < firstHidden.timeStamp;\n });\n if (firstInputEntry) {\n var firstInputDelay = elapsed(firstInputEntry.startTime, firstInputEntry.processingStart);\n callback({\n // Ensure firstInputDelay to be positive, see\n // https://bugs.chromium.org/p/chromium/issues/detail?id=1185815\n firstInputDelay: firstInputDelay >= 0 ? firstInputDelay : 0,\n firstInputTime: firstInputEntry.startTime\n });\n }\n }).unsubscribe;\n return {\n stop: stop\n };\n}\n","import { noop, round, ONE_SECOND, elapsed } from '@datadog/browser-core';\nimport { supportPerformanceTimingEvent } from '../../../browser/performanceCollection';\nimport { waitPageActivityEnd } from '../../waitPageActivityEnd';\nexport function trackViewMetrics(lifeCycle, domMutationObservable, configuration, scheduleViewUpdate, loadingType, viewStart) {\n var viewMetrics = {};\n var _a = trackLoadingTime(lifeCycle, domMutationObservable, configuration, loadingType, viewStart, function (newLoadingTime) {\n viewMetrics.loadingTime = newLoadingTime;\n scheduleViewUpdate();\n }),\n stopLoadingTimeTracking = _a.stop,\n setLoadEvent = _a.setLoadEvent;\n var stopCLSTracking;\n if (isLayoutShiftSupported()) {\n viewMetrics.cumulativeLayoutShift = 0;\n stopCLSTracking = trackCumulativeLayoutShift(lifeCycle, function (cumulativeLayoutShift) {\n viewMetrics.cumulativeLayoutShift = cumulativeLayoutShift;\n scheduleViewUpdate();\n }).stop;\n } else {\n stopCLSTracking = noop;\n }\n return {\n stop: function () {\n stopLoadingTimeTracking();\n stopCLSTracking();\n },\n setLoadEvent: setLoadEvent,\n viewMetrics: viewMetrics\n };\n}\nfunction trackLoadingTime(lifeCycle, domMutationObservable, configuration, loadType, viewStart, callback) {\n var isWaitingForLoadEvent = loadType === \"initial_load\" /* ViewLoadingType.INITIAL_LOAD */;\n var isWaitingForActivityLoadingTime = true;\n var loadingTimeCandidates = [];\n function invokeCallbackIfAllCandidatesAreReceived() {\n if (!isWaitingForActivityLoadingTime && !isWaitingForLoadEvent && loadingTimeCandidates.length > 0) {\n callback(Math.max.apply(Math, loadingTimeCandidates));\n }\n }\n var stop = waitPageActivityEnd(lifeCycle, domMutationObservable, configuration, function (event) {\n if (isWaitingForActivityLoadingTime) {\n isWaitingForActivityLoadingTime = false;\n if (event.hadActivity) {\n loadingTimeCandidates.push(elapsed(viewStart.timeStamp, event.end));\n }\n invokeCallbackIfAllCandidatesAreReceived();\n }\n }).stop;\n return {\n stop: stop,\n setLoadEvent: function (loadEvent) {\n if (isWaitingForLoadEvent) {\n isWaitingForLoadEvent = false;\n loadingTimeCandidates.push(loadEvent);\n invokeCallbackIfAllCandidatesAreReceived();\n }\n }\n };\n}\n/**\n * Track the cumulative layout shifts (CLS).\n * Layout shifts are grouped into session windows.\n * The minimum gap between session windows is 1 second.\n * The maximum duration of a session window is 5 second.\n * The session window layout shift value is the sum of layout shifts inside it.\n * The CLS value is the max of session windows values.\n *\n * This yields a new value whenever the CLS value is updated (a higher session window value is computed).\n *\n * See isLayoutShiftSupported to check for browser support.\n *\n * Documentation:\n * https://web.dev/cls/\n * https://web.dev/evolving-cls/\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getCLS.ts\n */\nfunction trackCumulativeLayoutShift(lifeCycle, callback) {\n var maxClsValue = 0;\n var window = slidingSessionWindow();\n var stop = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n if (entry.entryType === 'layout-shift' && !entry.hadRecentInput) {\n window.update(entry);\n if (window.value() > maxClsValue) {\n maxClsValue = window.value();\n callback(round(maxClsValue, 4));\n }\n }\n }\n }).unsubscribe;\n return {\n stop: stop\n };\n}\nfunction slidingSessionWindow() {\n var value = 0;\n var startTime;\n var endTime;\n return {\n update: function (entry) {\n var shouldCreateNewWindow = startTime === undefined || entry.startTime - endTime >= ONE_SECOND || entry.startTime - startTime >= 5 * ONE_SECOND;\n if (shouldCreateNewWindow) {\n startTime = endTime = entry.startTime;\n value = entry.value;\n } else {\n value += entry.value;\n endTime = entry.startTime;\n }\n },\n value: function () {\n return value;\n }\n };\n}\n/**\n * Check whether `layout-shift` is supported by the browser.\n */\nfunction isLayoutShiftSupported() {\n return supportPerformanceTimingEvent('layout-shift');\n}\n","import { ONE_MINUTE, setTimeout } from '@datadog/browser-core';\nimport { trackEventCounts } from '../../trackEventCounts';\n// Some events are not being counted as they transcend views. To reduce the occurrence;\n// an arbitrary delay is added for stopping event counting after the view ends.\n//\n// Ideally, we would not stop and keep counting events until the end of the session.\n// But this might have a small performance impact if there are many many views:\n// we would need to go through each event to see if the related view matches.\n// So let's have a fairly short delay to avoid impacting performances too much.\n//\n// In the future, we could have views stored in a data structure similar to ContextHistory. Whenever\n// a child event is collected, we could look into this history to find the matching view and\n// increase the associated and increase its counter. Having a centralized data structure for it\n// would allow us to look for views more efficiently.\n//\n// For now, having a small cleanup delay will already improve the situation in most cases.\nexport var KEEP_TRACKING_EVENT_COUNTS_AFTER_VIEW_DELAY = 5 * ONE_MINUTE;\nexport function trackViewEventCounts(lifeCycle, viewId, onChange) {\n var _a = trackEventCounts({\n lifeCycle: lifeCycle,\n isChildEvent: function (event) {\n return event.view.id === viewId;\n },\n onChange: onChange\n }),\n stop = _a.stop,\n eventCounts = _a.eventCounts;\n return {\n scheduleStop: function () {\n setTimeout(stop, KEEP_TRACKING_EVENT_COUNTS_AFTER_VIEW_DELAY);\n },\n eventCounts: eventCounts\n };\n}\n","import { noop, PageExitReason, shallowClone, assign, elapsed, generateUUID, ONE_MINUTE, throttle, clocksNow, clocksOrigin, timeStampNow, display, looksLikeRelativeTime, setInterval, clearInterval } from '@datadog/browser-core';\nimport { trackInitialViewTimings } from './trackInitialViewTimings';\nimport { trackViewMetrics } from './trackViewMetrics';\nimport { trackViewEventCounts } from './trackViewEventCounts';\nexport var THROTTLE_VIEW_UPDATE_PERIOD = 3000;\nexport var SESSION_KEEP_ALIVE_INTERVAL = 5 * ONE_MINUTE;\nexport function trackViews(location, lifeCycle, domMutationObservable, configuration, locationChangeObservable, areViewsTrackedAutomatically, initialViewOptions) {\n var currentView = startNewView(\"initial_load\" /* ViewLoadingType.INITIAL_LOAD */, clocksOrigin(), initialViewOptions);\n startViewLifeCycle();\n var locationChangeSubscription;\n if (areViewsTrackedAutomatically) {\n locationChangeSubscription = renewViewOnLocationChange(locationChangeObservable);\n }\n function startNewView(loadingType, startClocks, viewOptions) {\n return newView(lifeCycle, domMutationObservable, configuration, location, loadingType, startClocks, viewOptions);\n }\n function startViewLifeCycle() {\n lifeCycle.subscribe(8 /* LifeCycleEventType.SESSION_RENEWED */, function () {\n // Renew view on session renewal\n currentView = startNewView(\"route_change\" /* ViewLoadingType.ROUTE_CHANGE */, undefined, {\n name: currentView.name,\n service: currentView.service,\n version: currentView.version\n });\n });\n lifeCycle.subscribe(7 /* LifeCycleEventType.SESSION_EXPIRED */, function () {\n currentView.end({\n sessionIsActive: false\n });\n });\n // End the current view on page unload\n lifeCycle.subscribe(9 /* LifeCycleEventType.PAGE_EXITED */, function (pageExitEvent) {\n if (pageExitEvent.reason === PageExitReason.UNLOADING || pageExitEvent.reason === PageExitReason.PAGEHIDE) {\n currentView.end();\n }\n });\n }\n function renewViewOnLocationChange(locationChangeObservable) {\n return locationChangeObservable.subscribe(function (_a) {\n var oldLocation = _a.oldLocation,\n newLocation = _a.newLocation;\n if (areDifferentLocation(oldLocation, newLocation)) {\n currentView.end();\n currentView = startNewView(\"route_change\" /* ViewLoadingType.ROUTE_CHANGE */);\n }\n });\n }\n return {\n addTiming: function (name, time) {\n if (time === void 0) {\n time = timeStampNow();\n }\n currentView.addTiming(name, time);\n },\n startView: function (options, startClocks) {\n currentView.end({\n endClocks: startClocks\n });\n currentView = startNewView(\"route_change\" /* ViewLoadingType.ROUTE_CHANGE */, startClocks, options);\n },\n stop: function () {\n locationChangeSubscription === null || locationChangeSubscription === void 0 ? void 0 : locationChangeSubscription.unsubscribe();\n currentView.end();\n }\n };\n}\nfunction newView(lifeCycle, domMutationObservable, configuration, initialLocation, loadingType, startClocks, viewOptions) {\n if (startClocks === void 0) {\n startClocks = clocksNow();\n }\n // Setup initial values\n var id = generateUUID();\n var customTimings = {};\n var documentVersion = 0;\n var endClocks;\n var location = shallowClone(initialLocation);\n var sessionIsActive = true;\n var name;\n var service;\n var version;\n if (viewOptions) {\n name = viewOptions.name;\n service = viewOptions.service;\n version = viewOptions.version;\n }\n lifeCycle.notify(2 /* LifeCycleEventType.VIEW_CREATED */, {\n id: id,\n name: name,\n startClocks: startClocks,\n service: service,\n version: version\n });\n // Update the view every time the measures are changing\n var _a = throttle(triggerViewUpdate, THROTTLE_VIEW_UPDATE_PERIOD, {\n leading: false\n }),\n scheduleViewUpdate = _a.throttled,\n cancelScheduleViewUpdate = _a.cancel;\n var _b = trackViewMetrics(lifeCycle, domMutationObservable, configuration, scheduleViewUpdate, loadingType, startClocks),\n setLoadEvent = _b.setLoadEvent,\n stopViewMetricsTracking = _b.stop,\n viewMetrics = _b.viewMetrics;\n var _c = loadingType === \"initial_load\" /* ViewLoadingType.INITIAL_LOAD */ ? trackInitialViewTimings(lifeCycle, setLoadEvent, scheduleViewUpdate) : {\n scheduleStop: noop,\n timings: {}\n },\n scheduleStopInitialViewTimingsTracking = _c.scheduleStop,\n timings = _c.timings;\n var _d = trackViewEventCounts(lifeCycle, id, scheduleViewUpdate),\n scheduleStopEventCountsTracking = _d.scheduleStop,\n eventCounts = _d.eventCounts;\n // Session keep alive\n var keepAliveIntervalId = setInterval(triggerViewUpdate, SESSION_KEEP_ALIVE_INTERVAL);\n // Initial view update\n triggerViewUpdate();\n function triggerViewUpdate() {\n cancelScheduleViewUpdate();\n documentVersion += 1;\n var currentEnd = endClocks === undefined ? timeStampNow() : endClocks.timeStamp;\n lifeCycle.notify(3 /* LifeCycleEventType.VIEW_UPDATED */, assign({\n customTimings: customTimings,\n documentVersion: documentVersion,\n id: id,\n name: name,\n service: service,\n version: version,\n loadingType: loadingType,\n location: location,\n startClocks: startClocks,\n timings: timings,\n duration: elapsed(startClocks.timeStamp, currentEnd),\n isActive: endClocks === undefined,\n sessionIsActive: sessionIsActive,\n eventCounts: eventCounts\n }, viewMetrics));\n }\n return {\n name: name,\n service: service,\n version: version,\n end: function (options) {\n var _a, _b;\n if (options === void 0) {\n options = {};\n }\n if (endClocks) {\n // view already ended\n return;\n }\n endClocks = (_a = options.endClocks) !== null && _a !== void 0 ? _a : clocksNow();\n sessionIsActive = (_b = options.sessionIsActive) !== null && _b !== void 0 ? _b : true;\n lifeCycle.notify(4 /* LifeCycleEventType.VIEW_ENDED */, {\n endClocks: endClocks\n });\n clearInterval(keepAliveIntervalId);\n stopViewMetricsTracking();\n scheduleStopInitialViewTimingsTracking();\n scheduleStopEventCountsTracking();\n triggerViewUpdate();\n },\n addTiming: function (name, time) {\n if (endClocks) {\n return;\n }\n var relativeTime = looksLikeRelativeTime(time) ? time : elapsed(startClocks.timeStamp, time);\n customTimings[sanitizeTiming(name)] = relativeTime;\n scheduleViewUpdate();\n }\n };\n}\n/**\n * Timing name is used as facet path that must contain only letters, digits, or the characters - _ . @ $\n */\nfunction sanitizeTiming(name) {\n var sanitized = name.replace(/[^a-zA-Z0-9-_.@$]/g, '_');\n if (sanitized !== name) {\n display.warn(\"Invalid timing name: \".concat(name, \", sanitized to: \").concat(sanitized));\n }\n return sanitized;\n}\nfunction areDifferentLocation(currentLocation, otherLocation) {\n return currentLocation.pathname !== otherLocation.pathname || !isHashAnAnchor(otherLocation.hash) && getPathFromHash(otherLocation.hash) !== getPathFromHash(currentLocation.hash);\n}\nfunction isHashAnAnchor(hash) {\n var correspondingId = hash.substr(1);\n return !!document.getElementById(correspondingId);\n}\nfunction getPathFromHash(hash) {\n var index = hash.indexOf('?');\n return index < 0 ? hash : hash.slice(0, index);\n}\n","import { isExperimentalFeatureEnabled, ExperimentalFeature, isEmptyObject, mapValues, toServerDuration, isNumber } from '@datadog/browser-core';\nimport { trackViews } from './trackViews';\nexport function startViewCollection(lifeCycle, configuration, location, domMutationObservable, locationChangeObservable, foregroundContexts, featureFlagContexts, pageStateHistory, recorderApi, initialViewOptions) {\n lifeCycle.subscribe(3 /* LifeCycleEventType.VIEW_UPDATED */, function (view) {\n return lifeCycle.notify(10 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processViewUpdate(view, foregroundContexts, featureFlagContexts, recorderApi, pageStateHistory));\n });\n var trackViewResult = trackViews(location, lifeCycle, domMutationObservable, configuration, locationChangeObservable, !configuration.trackViewsManually, initialViewOptions);\n return trackViewResult;\n}\nfunction processViewUpdate(view, foregroundContexts, featureFlagContexts, recorderApi, pageStateHistory) {\n var replayStats = recorderApi.getReplayStats(view.id);\n var featureFlagContext = featureFlagContexts.findFeatureFlagEvaluations(view.startClocks.relative);\n var pageStatesEnabled = isExperimentalFeatureEnabled(ExperimentalFeature.PAGE_STATES);\n var viewEvent = {\n _dd: {\n document_version: view.documentVersion,\n replay_stats: replayStats,\n page_states: pageStatesEnabled ? pageStateHistory.findAll(view.startClocks.relative, view.duration) : undefined\n },\n date: view.startClocks.timeStamp,\n type: \"view\" /* RumEventType.VIEW */,\n view: {\n action: {\n count: view.eventCounts.actionCount\n },\n frustration: {\n count: view.eventCounts.frustrationCount\n },\n cumulative_layout_shift: view.cumulativeLayoutShift,\n first_byte: toServerDuration(view.timings.firstByte),\n dom_complete: toServerDuration(view.timings.domComplete),\n dom_content_loaded: toServerDuration(view.timings.domContentLoaded),\n dom_interactive: toServerDuration(view.timings.domInteractive),\n error: {\n count: view.eventCounts.errorCount\n },\n first_contentful_paint: toServerDuration(view.timings.firstContentfulPaint),\n first_input_delay: toServerDuration(view.timings.firstInputDelay),\n first_input_time: toServerDuration(view.timings.firstInputTime),\n is_active: view.isActive,\n name: view.name,\n largest_contentful_paint: toServerDuration(view.timings.largestContentfulPaint),\n load_event: toServerDuration(view.timings.loadEvent),\n loading_time: discardNegativeDuration(toServerDuration(view.loadingTime)),\n loading_type: view.loadingType,\n long_task: {\n count: view.eventCounts.longTaskCount\n },\n resource: {\n count: view.eventCounts.resourceCount\n },\n time_spent: toServerDuration(view.duration),\n in_foreground_periods: !pageStatesEnabled ? foregroundContexts.selectInForegroundPeriodsFor(view.startClocks.relative, view.duration) : undefined\n },\n feature_flags: featureFlagContext && !isEmptyObject(featureFlagContext) ? featureFlagContext : undefined,\n session: {\n has_replay: replayStats ? true : undefined,\n is_active: view.sessionIsActive ? undefined : false\n }\n };\n if (!isEmptyObject(view.customTimings)) {\n viewEvent.view.custom_timings = mapValues(view.customTimings, toServerDuration);\n }\n return {\n rawRumEvent: viewEvent,\n startTime: view.startClocks.relative,\n domainContext: {\n location: view.location\n }\n };\n}\nfunction discardNegativeDuration(duration) {\n return isNumber(duration) && duration < 0 ? undefined : duration;\n}\n","import { Observable, noop, performDraw, startSessionManager } from '@datadog/browser-core';\nexport var RUM_SESSION_KEY = 'rum';\nexport function startRumSessionManager(configuration, lifeCycle) {\n var sessionManager = startSessionManager(\n // TODO - Improve configuration type and remove assertion\n configuration.sessionStoreStrategyType, RUM_SESSION_KEY, function (rawTrackingType) {\n return computeSessionState(configuration, rawTrackingType);\n });\n sessionManager.expireObservable.subscribe(function () {\n lifeCycle.notify(7 /* LifeCycleEventType.SESSION_EXPIRED */);\n });\n sessionManager.renewObservable.subscribe(function () {\n lifeCycle.notify(8 /* LifeCycleEventType.SESSION_RENEWED */);\n });\n return {\n findTrackedSession: function (startTime) {\n var session = sessionManager.findActiveSession(startTime);\n if (!session || !isTypeTracked(session.trackingType)) {\n return;\n }\n var plan = session.trackingType === \"1\" /* RumTrackingType.TRACKED_WITH_SESSION_REPLAY */ ? 2 /* RumSessionPlan.WITH_SESSION_REPLAY */ : 1 /* RumSessionPlan.WITHOUT_SESSION_REPLAY */;\n return {\n id: session.id,\n plan: plan,\n sessionReplayAllowed: plan === 2 /* RumSessionPlan.WITH_SESSION_REPLAY */,\n longTaskAllowed: configuration.trackLongTasks !== undefined ? configuration.trackLongTasks : configuration.oldPlansBehavior && plan === 2 /* RumSessionPlan.WITH_SESSION_REPLAY */,\n resourceAllowed: configuration.trackResources !== undefined ? configuration.trackResources : configuration.oldPlansBehavior && plan === 2 /* RumSessionPlan.WITH_SESSION_REPLAY */\n };\n },\n expire: sessionManager.expire,\n expireObservable: sessionManager.expireObservable\n };\n}\n/**\n * Start a tracked replay session stub\n */\nexport function startRumSessionManagerStub() {\n var session = {\n id: '00000000-aaaa-0000-aaaa-000000000000',\n plan: 1 /* RumSessionPlan.WITHOUT_SESSION_REPLAY */,\n sessionReplayAllowed: false,\n longTaskAllowed: true,\n resourceAllowed: true\n };\n return {\n findTrackedSession: function () {\n return session;\n },\n expire: noop,\n expireObservable: new Observable()\n };\n}\nfunction computeSessionState(configuration, rawTrackingType) {\n var trackingType;\n if (hasValidRumSession(rawTrackingType)) {\n trackingType = rawTrackingType;\n } else if (!performDraw(configuration.sessionSampleRate)) {\n trackingType = \"0\" /* RumTrackingType.NOT_TRACKED */;\n } else if (!performDraw(configuration.sessionReplaySampleRate)) {\n trackingType = \"2\" /* RumTrackingType.TRACKED_WITHOUT_SESSION_REPLAY */;\n } else {\n trackingType = \"1\" /* RumTrackingType.TRACKED_WITH_SESSION_REPLAY */;\n }\n return {\n trackingType: trackingType,\n isTracked: isTypeTracked(trackingType)\n };\n}\nfunction hasValidRumSession(trackingType) {\n return trackingType === \"0\" /* RumTrackingType.NOT_TRACKED */ || trackingType === \"1\" /* RumTrackingType.TRACKED_WITH_SESSION_REPLAY */ || trackingType === \"2\" /* RumTrackingType.TRACKED_WITHOUT_SESSION_REPLAY */;\n}\nfunction isTypeTracked(rumSessionType) {\n return rumSessionType === \"2\" /* RumTrackingType.TRACKED_WITHOUT_SESSION_REPLAY */ || rumSessionType === \"1\" /* RumTrackingType.TRACKED_WITH_SESSION_REPLAY */;\n}\n","import { createFlushController, Batch, combine, createHttpRequest, isTelemetryReplicationAllowed } from '@datadog/browser-core';\nexport function startRumBatch(configuration, lifeCycle, telemetryEventObservable, reportError, pageExitObservable, sessionExpireObservable) {\n var batch = makeRumBatch(configuration, reportError, pageExitObservable, sessionExpireObservable);\n lifeCycle.subscribe(11 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, function (serverRumEvent) {\n if (serverRumEvent.type === \"view\" /* RumEventType.VIEW */) {\n batch.upsert(serverRumEvent, serverRumEvent.view.id);\n } else {\n batch.add(serverRumEvent);\n }\n });\n telemetryEventObservable.subscribe(function (event) {\n return batch.add(event, isTelemetryReplicationAllowed(configuration));\n });\n return batch;\n}\nfunction makeRumBatch(configuration, reportError, pageExitObservable, sessionExpireObservable) {\n var _a = createRumBatch(configuration.rumEndpointBuilder),\n primaryBatch = _a.batch,\n primaryFlushController = _a.flushController;\n var replicaBatch;\n var replica = configuration.replica;\n if (replica !== undefined) {\n replicaBatch = createRumBatch(replica.rumEndpointBuilder).batch;\n }\n function createRumBatch(endpointBuilder) {\n var flushController = createFlushController({\n messagesLimit: configuration.batchMessagesLimit,\n bytesLimit: configuration.batchBytesLimit,\n durationLimit: configuration.flushTimeout,\n pageExitObservable: pageExitObservable,\n sessionExpireObservable: sessionExpireObservable\n });\n var batch = new Batch(createHttpRequest(endpointBuilder, configuration.batchBytesLimit, reportError), flushController, configuration.messageBytesLimit);\n return {\n batch: batch,\n flushController: flushController\n };\n }\n function withReplicaApplicationId(message) {\n return combine(message, {\n application: {\n id: replica.applicationId\n }\n });\n }\n return {\n flushObservable: primaryFlushController.flushObservable,\n add: function (message, replicated) {\n if (replicated === void 0) {\n replicated = true;\n }\n primaryBatch.add(message);\n if (replicaBatch && replicated) {\n replicaBatch.add(withReplicaApplicationId(message));\n }\n },\n upsert: function (message, key) {\n primaryBatch.upsert(message, key);\n if (replicaBatch) {\n replicaBatch.upsert(withReplicaApplicationId(message), key);\n }\n }\n };\n}\n","import { getEventBridge } from '@datadog/browser-core';\nexport function startRumEventBridge(lifeCycle) {\n var bridge = getEventBridge();\n lifeCycle.subscribe(11 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, function (serverRumEvent) {\n bridge.send('rum', serverRumEvent);\n });\n}\n","import { SESSION_TIME_OUT_DELAY, relativeNow, ValueHistory } from '@datadog/browser-core';\n/**\n * We want to attach to an event:\n * - the url corresponding to its start\n * - the referrer corresponding to the previous view url (or document referrer for initial view)\n */\nexport var URL_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;\nexport function startUrlContexts(lifeCycle, locationChangeObservable, location) {\n var urlContextHistory = new ValueHistory(URL_CONTEXT_TIME_OUT_DELAY);\n var previousViewUrl;\n lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, function (_a) {\n var endClocks = _a.endClocks;\n urlContextHistory.closeActive(endClocks.relative);\n });\n lifeCycle.subscribe(2 /* LifeCycleEventType.VIEW_CREATED */, function (_a) {\n var startClocks = _a.startClocks;\n var viewUrl = location.href;\n urlContextHistory.add(buildUrlContext({\n url: viewUrl,\n referrer: !previousViewUrl ? document.referrer : previousViewUrl\n }), startClocks.relative);\n previousViewUrl = viewUrl;\n });\n var locationChangeSubscription = locationChangeObservable.subscribe(function (_a) {\n var newLocation = _a.newLocation;\n var current = urlContextHistory.find();\n if (current) {\n var changeTime = relativeNow();\n urlContextHistory.closeActive(changeTime);\n urlContextHistory.add(buildUrlContext({\n url: newLocation.href,\n referrer: current.referrer\n }), changeTime);\n }\n });\n function buildUrlContext(_a) {\n var url = _a.url,\n referrer = _a.referrer;\n return {\n url: url,\n referrer: referrer\n };\n }\n return {\n findUrl: function (startTime) {\n return urlContextHistory.find(startTime);\n },\n stop: function () {\n locationChangeSubscription.unsubscribe();\n urlContextHistory.stop();\n }\n };\n}\n","import { addEventListener, instrumentMethodAndCallOriginal, Observable, shallowClone } from '@datadog/browser-core';\nexport function createLocationChangeObservable(location) {\n var currentLocation = shallowClone(location);\n var observable = new Observable(function () {\n var stopHistoryTracking = trackHistory(onLocationChange).stop;\n var stopHashTracking = trackHash(onLocationChange).stop;\n return function () {\n stopHistoryTracking();\n stopHashTracking();\n };\n });\n function onLocationChange() {\n if (currentLocation.href === location.href) {\n return;\n }\n var newLocation = shallowClone(location);\n observable.notify({\n newLocation: newLocation,\n oldLocation: currentLocation\n });\n currentLocation = newLocation;\n }\n return observable;\n}\nfunction trackHistory(onHistoryChange) {\n var stopInstrumentingPushState = instrumentMethodAndCallOriginal(history, 'pushState', {\n after: onHistoryChange\n }).stop;\n var stopInstrumentingReplaceState = instrumentMethodAndCallOriginal(history, 'replaceState', {\n after: onHistoryChange\n }).stop;\n var removeListener = addEventListener(window, \"popstate\" /* DOM_EVENT.POP_STATE */, onHistoryChange).stop;\n return {\n stop: function () {\n stopInstrumentingPushState();\n stopInstrumentingReplaceState();\n removeListener();\n }\n };\n}\nfunction trackHash(onHashChange) {\n return addEventListener(window, \"hashchange\" /* DOM_EVENT.HASH_CHANGE */, onHashChange);\n}\n","import { warnIfCustomerDataLimitReached, throttle, jsonStringify, computeBytesCount, noop, isExperimentalFeatureEnabled, SESSION_TIME_OUT_DELAY, ValueHistory, ExperimentalFeature } from '@datadog/browser-core';\nexport var FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;\nexport var BYTES_COMPUTATION_THROTTLING_DELAY = 200;\n/**\n * Start feature flag contexts\n *\n * Feature flag contexts follow the life of views.\n * A new context is added when a view is created and ended when the view is ended\n *\n * Note: we choose not to add a new context at each evaluation to save memory\n */\nexport function startFeatureFlagContexts(lifeCycle, computeBytesCountImpl) {\n if (computeBytesCountImpl === void 0) {\n computeBytesCountImpl = computeBytesCount;\n }\n if (!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_FLAGS)) {\n return {\n findFeatureFlagEvaluations: function () {\n return undefined;\n },\n getFeatureFlagBytesCount: function () {\n return 0;\n },\n addFeatureFlagEvaluation: noop,\n stop: noop\n };\n }\n var featureFlagContexts = new ValueHistory(FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY);\n var bytesCountCache = 0;\n var alreadyWarned = false;\n lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, function (_a) {\n var endClocks = _a.endClocks;\n featureFlagContexts.closeActive(endClocks.relative);\n });\n lifeCycle.subscribe(2 /* LifeCycleEventType.VIEW_CREATED */, function (_a) {\n var startClocks = _a.startClocks;\n featureFlagContexts.add({}, startClocks.relative);\n bytesCountCache = 0;\n });\n // Throttle the bytes computation to minimize the impact on performance.\n // Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row\n var _a = throttle(function (context) {\n bytesCountCache = computeBytesCountImpl(jsonStringify(context));\n if (!alreadyWarned) {\n alreadyWarned = warnIfCustomerDataLimitReached(bytesCountCache, \"feature flag evaluation\" /* CustomerDataType.FeatureFlag */);\n }\n }, BYTES_COMPUTATION_THROTTLING_DELAY),\n computeBytesCountThrottled = _a.throttled,\n cancelPendingComputation = _a.cancel;\n return {\n findFeatureFlagEvaluations: function (startTime) {\n return featureFlagContexts.find(startTime);\n },\n getFeatureFlagBytesCount: function () {\n var currentContext = featureFlagContexts.find();\n if (!currentContext) {\n return 0;\n }\n return bytesCountCache;\n },\n addFeatureFlagEvaluation: function (key, value) {\n var currentContext = featureFlagContexts.find();\n if (currentContext) {\n currentContext[key] = value;\n computeBytesCountThrottled(currentContext);\n }\n },\n stop: cancelPendingComputation\n };\n}\n","import { isEmptyObject, includes, performDraw, ONE_SECOND, addTelemetryDebug, setInterval } from '@datadog/browser-core';\nexport var MEASURES_PERIOD_DURATION = 10 * ONE_SECOND;\nvar currentPeriodMeasures;\nvar currentBatchMeasures;\nvar batchHasRumEvent;\nexport function startCustomerDataTelemetry(configuration, telemetry, lifeCycle, globalContextManager, userContextManager, featureFlagContexts, batchFlushObservable) {\n var customerDataTelemetryEnabled = telemetry.enabled && performDraw(configuration.customerDataTelemetrySampleRate);\n if (!customerDataTelemetryEnabled) {\n return;\n }\n initCurrentPeriodMeasures();\n initCurrentBatchMeasures();\n // We measure the data of every view updates even if there could only be one per batch due to the upsert\n // It means that contexts bytes count sums can be higher than it really is\n lifeCycle.subscribe(11 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, function (event) {\n batchHasRumEvent = true;\n updateMeasure(currentBatchMeasures.globalContextBytes, !isEmptyObject(globalContextManager.get()) ? globalContextManager.getBytesCount() : 0);\n updateMeasure(currentBatchMeasures.userContextBytes, !isEmptyObject(userContextManager.get()) ? userContextManager.getBytesCount() : 0);\n var featureFlagContext = featureFlagContexts.findFeatureFlagEvaluations();\n var hasFeatureFlagContext = includes([\"view\" /* RumEventType.VIEW */, \"error\" /* RumEventType.ERROR */], event.type) && featureFlagContext && !isEmptyObject(featureFlagContext);\n updateMeasure(currentBatchMeasures.featureFlagBytes, hasFeatureFlagContext ? featureFlagContexts.getFeatureFlagBytesCount() : 0);\n });\n batchFlushObservable.subscribe(function (_a) {\n var bytesCount = _a.bytesCount,\n messagesCount = _a.messagesCount;\n // Don't measure batch that only contains telemetry events to avoid batch sending loop\n // It could happen because after each batch we are adding a customer data measures telemetry event to the next one\n if (!batchHasRumEvent) {\n return;\n }\n currentPeriodMeasures.batchCount += 1;\n updateMeasure(currentPeriodMeasures.batchBytesCount, bytesCount);\n updateMeasure(currentPeriodMeasures.batchMessagesCount, messagesCount);\n mergeMeasure(currentPeriodMeasures.globalContextBytes, currentBatchMeasures.globalContextBytes);\n mergeMeasure(currentPeriodMeasures.userContextBytes, currentBatchMeasures.userContextBytes);\n mergeMeasure(currentPeriodMeasures.featureFlagBytes, currentBatchMeasures.featureFlagBytes);\n initCurrentBatchMeasures();\n });\n setInterval(sendCurrentPeriodMeasures, MEASURES_PERIOD_DURATION);\n}\nfunction sendCurrentPeriodMeasures() {\n if (currentPeriodMeasures.batchCount === 0) {\n return;\n }\n addTelemetryDebug('Customer data measures', currentPeriodMeasures);\n initCurrentPeriodMeasures();\n}\nfunction createMeasure() {\n return {\n min: Infinity,\n max: 0,\n sum: 0\n };\n}\nfunction updateMeasure(measure, value) {\n measure.sum += value;\n measure.min = Math.min(measure.min, value);\n measure.max = Math.max(measure.max, value);\n}\nfunction mergeMeasure(target, source) {\n target.sum += source.sum;\n target.min = Math.min(target.min, source.min);\n target.max = Math.max(target.max, source.max);\n}\nfunction initCurrentPeriodMeasures() {\n currentPeriodMeasures = {\n batchCount: 0,\n batchBytesCount: createMeasure(),\n batchMessagesCount: createMeasure(),\n globalContextBytes: createMeasure(),\n userContextBytes: createMeasure(),\n featureFlagBytes: createMeasure()\n };\n}\nfunction initCurrentBatchMeasures() {\n batchHasRumEvent = false;\n currentBatchMeasures = {\n globalContextBytes: createMeasure(),\n userContextBytes: createMeasure(),\n featureFlagBytes: createMeasure()\n };\n}\n","import { elapsed, ValueHistory, SESSION_TIME_OUT_DELAY, toServerDuration, addEventListeners, relativeNow } from '@datadog/browser-core';\n// Arbitrary value to cap number of element for memory consumption in the browser\nexport var MAX_PAGE_STATE_ENTRIES = 4000;\n// Arbitrary value to cap number of element for backend & to save bandwidth\nexport var MAX_PAGE_STATE_ENTRIES_SELECTABLE = 500;\nexport var PAGE_STATE_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;\nexport function startPageStateHistory(maxPageStateEntriesSelectable) {\n if (maxPageStateEntriesSelectable === void 0) {\n maxPageStateEntriesSelectable = MAX_PAGE_STATE_ENTRIES_SELECTABLE;\n }\n var pageStateHistory = new ValueHistory(PAGE_STATE_CONTEXT_TIME_OUT_DELAY, MAX_PAGE_STATE_ENTRIES);\n var currentPageState;\n addPageState(getPageState(), relativeNow());\n var stopEventListeners = addEventListeners(window, [\"pageshow\" /* DOM_EVENT.PAGE_SHOW */, \"focus\" /* DOM_EVENT.FOCUS */, \"blur\" /* DOM_EVENT.BLUR */, \"visibilitychange\" /* DOM_EVENT.VISIBILITY_CHANGE */, \"resume\" /* DOM_EVENT.RESUME */, \"freeze\" /* DOM_EVENT.FREEZE */, \"pagehide\" /* DOM_EVENT.PAGE_HIDE */], function (event) {\n // Only get events fired by the browser to avoid false currentPageState changes done with custom events\n // cf: developer extension auto flush: https://github.com/DataDog/browser-sdk/blob/2f72bf05a672794c9e33965351964382a94c72ba/developer-extension/src/panel/flushEvents.ts#L11-L12\n if (event.isTrusted) {\n addPageState(computePageState(event), event.timeStamp);\n }\n }, {\n capture: true\n }).stop;\n function addPageState(nextPageState, startTime) {\n if (startTime === void 0) {\n startTime = relativeNow();\n }\n if (nextPageState === currentPageState) {\n return;\n }\n currentPageState = nextPageState;\n pageStateHistory.closeActive(startTime);\n pageStateHistory.add({\n state: currentPageState,\n startTime: startTime\n }, startTime);\n }\n return {\n findAll: function (eventStartTime, duration) {\n var pageStateEntries = pageStateHistory.findAll(eventStartTime, duration);\n if (pageStateEntries.length === 0) {\n return;\n }\n var pageStateServerEntries = [];\n // limit the number of entries to return\n var limit = Math.max(0, pageStateEntries.length - maxPageStateEntriesSelectable);\n // loop page state entries backward to return the selected ones in desc order\n for (var index = pageStateEntries.length - 1; index >= limit; index--) {\n var pageState = pageStateEntries[index];\n // compute the start time relative to the event start time (ex: to be relative to the view start time)\n var relativeStartTime = elapsed(eventStartTime, pageState.startTime);\n pageStateServerEntries.push({\n state: pageState.state,\n start: toServerDuration(relativeStartTime)\n });\n }\n return pageStateServerEntries;\n },\n addPageState: addPageState,\n stop: function () {\n stopEventListeners();\n pageStateHistory.stop();\n }\n };\n}\nfunction computePageState(event) {\n if (event.type === \"freeze\" /* DOM_EVENT.FREEZE */) {\n return \"frozen\" /* PageState.FROZEN */;\n } else if (event.type === \"pagehide\" /* DOM_EVENT.PAGE_HIDE */) {\n return event.persisted ? \"frozen\" /* PageState.FROZEN */ : \"terminated\" /* PageState.TERMINATED */;\n }\n return getPageState();\n}\nfunction getPageState() {\n if (document.visibilityState === 'hidden') {\n return \"hidden\" /* PageState.HIDDEN */;\n }\n if (document.hasFocus()) {\n return \"active\" /* PageState.ACTIVE */;\n }\n return \"passive\" /* PageState.PASSIVE */;\n}\n","import { sendToExtension, createPageExitObservable, addTelemetryConfiguration, startTelemetry, canUseEventBridge, getEventBridge } from '@datadog/browser-core';\nimport { createDOMMutationObservable } from '../browser/domMutationObservable';\nimport { startPerformanceCollection } from '../browser/performanceCollection';\nimport { startRumAssembly } from '../domain/assembly';\nimport { startForegroundContexts } from '../domain/contexts/foregroundContexts';\nimport { startInternalContext } from '../domain/contexts/internalContext';\nimport { LifeCycle } from '../domain/lifeCycle';\nimport { startViewContexts } from '../domain/contexts/viewContexts';\nimport { startRequestCollection } from '../domain/requestCollection';\nimport { startActionCollection } from '../domain/rumEventsCollection/action/actionCollection';\nimport { startErrorCollection } from '../domain/rumEventsCollection/error/errorCollection';\nimport { startLongTaskCollection } from '../domain/rumEventsCollection/longTask/longTaskCollection';\nimport { startResourceCollection } from '../domain/rumEventsCollection/resource/resourceCollection';\nimport { startViewCollection } from '../domain/rumEventsCollection/view/viewCollection';\nimport { startRumSessionManager, startRumSessionManagerStub } from '../domain/rumSessionManager';\nimport { startRumBatch } from '../transport/startRumBatch';\nimport { startRumEventBridge } from '../transport/startRumEventBridge';\nimport { startUrlContexts } from '../domain/contexts/urlContexts';\nimport { createLocationChangeObservable } from '../browser/locationChangeObservable';\nimport { serializeRumConfiguration } from '../domain/configuration';\nimport { startFeatureFlagContexts } from '../domain/contexts/featureFlagContext';\nimport { startCustomerDataTelemetry } from '../domain/startCustomerDataTelemetry';\nimport { startPageStateHistory } from '../domain/contexts/pageStateHistory';\nimport { buildCommonContext } from '../domain/contexts/commonContext';\nexport function startRum(initConfiguration, configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions) {\n var lifeCycle = new LifeCycle();\n lifeCycle.subscribe(11 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, function (event) {\n return sendToExtension('rum', event);\n });\n var telemetry = startRumTelemetry(configuration);\n telemetry.setContextProvider(function () {\n var _a, _b;\n return {\n application: {\n id: configuration.applicationId\n },\n session: {\n id: (_a = session.findTrackedSession()) === null || _a === void 0 ? void 0 : _a.id\n },\n view: {\n id: (_b = viewContexts.findView()) === null || _b === void 0 ? void 0 : _b.id\n },\n action: {\n id: actionContexts.findActionId()\n }\n };\n });\n var reportError = function (error) {\n lifeCycle.notify(12 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, {\n error: error\n });\n };\n var featureFlagContexts = startFeatureFlagContexts(lifeCycle);\n var pageExitObservable = createPageExitObservable();\n pageExitObservable.subscribe(function (event) {\n lifeCycle.notify(9 /* LifeCycleEventType.PAGE_EXITED */, event);\n });\n var session = !canUseEventBridge() ? startRumSessionManager(configuration, lifeCycle) : startRumSessionManagerStub();\n if (!canUseEventBridge()) {\n var batch = startRumBatch(configuration, lifeCycle, telemetry.observable, reportError, pageExitObservable, session.expireObservable);\n startCustomerDataTelemetry(configuration, telemetry, lifeCycle, globalContextManager, userContextManager, featureFlagContexts, batch.flushObservable);\n } else {\n startRumEventBridge(lifeCycle);\n }\n var domMutationObservable = createDOMMutationObservable();\n var locationChangeObservable = createLocationChangeObservable(location);\n var _a = startRumEventCollection(lifeCycle, configuration, location, session, locationChangeObservable, domMutationObservable, function () {\n return buildCommonContext(globalContextManager, userContextManager, recorderApi);\n }, reportError),\n viewContexts = _a.viewContexts,\n foregroundContexts = _a.foregroundContexts,\n pageStateHistory = _a.pageStateHistory,\n urlContexts = _a.urlContexts,\n actionContexts = _a.actionContexts,\n addAction = _a.addAction;\n addTelemetryConfiguration(serializeRumConfiguration(initConfiguration));\n startLongTaskCollection(lifeCycle, session);\n startResourceCollection(lifeCycle, configuration, session, pageStateHistory);\n var _b = startViewCollection(lifeCycle, configuration, location, domMutationObservable, locationChangeObservable, foregroundContexts, featureFlagContexts, pageStateHistory, recorderApi, initialViewOptions),\n addTiming = _b.addTiming,\n startView = _b.startView;\n var addError = startErrorCollection(lifeCycle, foregroundContexts, featureFlagContexts).addError;\n startRequestCollection(lifeCycle, configuration, session);\n startPerformanceCollection(lifeCycle, configuration);\n var internalContext = startInternalContext(configuration.applicationId, session, viewContexts, actionContexts, urlContexts);\n return {\n addAction: addAction,\n addError: addError,\n addTiming: addTiming,\n addFeatureFlagEvaluation: featureFlagContexts.addFeatureFlagEvaluation,\n startView: startView,\n lifeCycle: lifeCycle,\n viewContexts: viewContexts,\n session: session,\n stopSession: function () {\n return session.expire();\n },\n getInternalContext: internalContext.get\n };\n}\nfunction startRumTelemetry(configuration) {\n var telemetry = startTelemetry(\"browser-rum-sdk\" /* TelemetryService.RUM */, configuration);\n if (canUseEventBridge()) {\n var bridge_1 = getEventBridge();\n telemetry.observable.subscribe(function (event) {\n return bridge_1.send('internal_telemetry', event);\n });\n }\n return telemetry;\n}\nexport function startRumEventCollection(lifeCycle, configuration, location, sessionManager, locationChangeObservable, domMutationObservable, buildCommonContext, reportError) {\n var viewContexts = startViewContexts(lifeCycle);\n var urlContexts = startUrlContexts(lifeCycle, locationChangeObservable, location);\n var foregroundContexts = startForegroundContexts();\n var pageStateHistory = startPageStateHistory();\n var _a = startActionCollection(lifeCycle, domMutationObservable, configuration, foregroundContexts),\n addAction = _a.addAction,\n actionContexts = _a.actionContexts;\n startRumAssembly(configuration, lifeCycle, sessionManager, viewContexts, urlContexts, actionContexts, buildCommonContext, reportError);\n return {\n viewContexts: viewContexts,\n foregroundContexts: foregroundContexts,\n pageStateHistory: pageStateHistory,\n urlContexts: urlContexts,\n addAction: addAction,\n actionContexts: actionContexts,\n stop: function () {\n viewContexts.stop();\n foregroundContexts.stop();\n }\n };\n}\n","import { INTAKE_SITE_STAGING, INTAKE_SITE_US1, INTAKE_SITE_EU1 } from '@datadog/browser-core';\nexport function getSessionReplayUrl(configuration, _a) {\n var session = _a.session,\n viewContext = _a.viewContext,\n errorType = _a.errorType;\n var sessionId = session ? session.id : 'no-session-id';\n var parameters = [];\n if (errorType !== undefined) {\n parameters.push(\"error-type=\".concat(errorType));\n }\n if (viewContext) {\n parameters.push(\"seed=\".concat(viewContext.id));\n parameters.push(\"from=\".concat(viewContext.startClocks.timeStamp));\n }\n var origin = getDatadogSiteUrl(configuration);\n var path = \"/rum/replay/sessions/\".concat(sessionId);\n return \"\".concat(origin).concat(path, \"?\").concat(parameters.join('&'));\n}\nexport function getDatadogSiteUrl(rumConfiguration) {\n var site = rumConfiguration.site;\n var subdomain = rumConfiguration.subdomain || getSiteDefaultSubdomain(rumConfiguration);\n return \"https://\".concat(subdomain ? \"\".concat(subdomain, \".\") : '').concat(site);\n}\nfunction getSiteDefaultSubdomain(configuration) {\n switch (configuration.site) {\n case INTAKE_SITE_US1:\n case INTAKE_SITE_EU1:\n return 'app';\n case INTAKE_SITE_STAGING:\n return 'dd';\n default:\n return undefined;\n }\n}\n","export var RecordType = {\n FullSnapshot: 2,\n IncrementalSnapshot: 3,\n Meta: 4,\n Focus: 6,\n ViewEnd: 7,\n VisualViewport: 8,\n FrustrationRecord: 9\n};\nexport var NodeType = {\n Document: 0,\n DocumentType: 1,\n Element: 2,\n Text: 3,\n CDATA: 4,\n DocumentFragment: 11\n};\nexport var IncrementalSource = {\n Mutation: 0,\n MouseMove: 1,\n MouseInteraction: 2,\n Scroll: 3,\n ViewportResize: 4,\n Input: 5,\n TouchMove: 6,\n MediaInteraction: 7,\n StyleSheetRule: 8\n // CanvasMutation : 9,\n // Font : 10,\n};\nexport var MouseInteractionType = {\n MouseUp: 0,\n MouseDown: 1,\n Click: 2,\n ContextMenu: 3,\n DblClick: 4,\n Focus: 5,\n Blur: 6,\n TouchStart: 7,\n TouchEnd: 9\n};\nexport var MediaInteractionType = {\n Play: 0,\n Pause: 1\n};\n","import { assign, timeStampNow } from '@datadog/browser-core';\nimport { RecordType } from '../../types';\nexport function assembleIncrementalSnapshot(source, data) {\n return {\n data: assign({\n source: source\n }, data),\n type: RecordType.IncrementalSnapshot,\n timestamp: timeStampNow()\n };\n}\n","import { DefaultPrivacyLevel } from '@datadog/browser-core';\nexport var NodePrivacyLevel = {\n IGNORE: 'ignore',\n HIDDEN: 'hidden',\n ALLOW: DefaultPrivacyLevel.ALLOW,\n MASK: DefaultPrivacyLevel.MASK,\n MASK_USER_INPUT: DefaultPrivacyLevel.MASK_USER_INPUT\n};\nexport var PRIVACY_ATTR_NAME = 'data-dd-privacy';\n// Privacy Attrs\nexport var PRIVACY_ATTR_VALUE_ALLOW = 'allow';\nexport var PRIVACY_ATTR_VALUE_MASK = 'mask';\nexport var PRIVACY_ATTR_VALUE_MASK_USER_INPUT = 'mask-user-input';\nexport var PRIVACY_ATTR_VALUE_HIDDEN = 'hidden';\n// Privacy Classes - not all customers can set plain HTML attributes, so support classes too\nexport var PRIVACY_CLASS_ALLOW = 'dd-privacy-allow';\nexport var PRIVACY_CLASS_MASK = 'dd-privacy-mask';\nexport var PRIVACY_CLASS_MASK_USER_INPUT = 'dd-privacy-mask-user-input';\nexport var PRIVACY_CLASS_HIDDEN = 'dd-privacy-hidden';\n// Private Replacement Templates\nexport var CENSORED_STRING_MARK = '***';\nexport var CENSORED_IMG_MARK = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';\nexport var FORM_PRIVATE_TAG_NAMES = {\n INPUT: true,\n OUTPUT: true,\n TEXTAREA: true,\n SELECT: true,\n OPTION: true,\n DATALIST: true,\n OPTGROUP: true\n};\n","import { isElementNode, getParentNode, isTextNode } from '@datadog/browser-rum-core';\nimport { NodePrivacyLevel, PRIVACY_ATTR_NAME, PRIVACY_ATTR_VALUE_ALLOW, PRIVACY_ATTR_VALUE_MASK, PRIVACY_ATTR_VALUE_MASK_USER_INPUT, PRIVACY_ATTR_VALUE_HIDDEN, PRIVACY_CLASS_ALLOW, PRIVACY_CLASS_MASK, PRIVACY_CLASS_MASK_USER_INPUT, PRIVACY_CLASS_HIDDEN, FORM_PRIVATE_TAG_NAMES, CENSORED_STRING_MARK } from '../../constants';\nexport var MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 100000;\nvar TEXT_MASKING_CHAR = 'x';\n/**\n * Get node privacy level by iterating over its ancestors. When the direct parent privacy level is\n * know, it is best to use something like:\n *\n * derivePrivacyLevelGivenParent(getNodeSelfPrivacyLevel(node), parentNodePrivacyLevel)\n */\nexport function getNodePrivacyLevel(node, defaultPrivacyLevel) {\n var parentNode = getParentNode(node);\n var parentNodePrivacyLevel = parentNode ? getNodePrivacyLevel(parentNode, defaultPrivacyLevel) : defaultPrivacyLevel;\n var selfNodePrivacyLevel = getNodeSelfPrivacyLevel(node);\n return reducePrivacyLevel(selfNodePrivacyLevel, parentNodePrivacyLevel);\n}\n/**\n * Reduces the next privacy level based on self + parent privacy levels\n */\nexport function reducePrivacyLevel(childPrivacyLevel, parentNodePrivacyLevel) {\n switch (parentNodePrivacyLevel) {\n // These values cannot be overridden\n case NodePrivacyLevel.HIDDEN:\n case NodePrivacyLevel.IGNORE:\n return parentNodePrivacyLevel;\n }\n switch (childPrivacyLevel) {\n case NodePrivacyLevel.ALLOW:\n case NodePrivacyLevel.MASK:\n case NodePrivacyLevel.MASK_USER_INPUT:\n case NodePrivacyLevel.HIDDEN:\n case NodePrivacyLevel.IGNORE:\n return childPrivacyLevel;\n default:\n return parentNodePrivacyLevel;\n }\n}\n/**\n * Determines the node's own privacy level without checking for ancestors.\n */\nexport function getNodeSelfPrivacyLevel(node) {\n // Only Element types can have a privacy level set\n if (!isElementNode(node)) {\n return;\n }\n var privAttr = node.getAttribute(PRIVACY_ATTR_NAME);\n // Overrules for replay purpose\n if (node.tagName === 'BASE') {\n return NodePrivacyLevel.ALLOW;\n }\n // Overrules to enforce end-user protection\n if (node.tagName === 'INPUT') {\n var inputElement = node;\n if (inputElement.type === 'password' || inputElement.type === 'email' || inputElement.type === 'tel') {\n return NodePrivacyLevel.MASK;\n }\n if (inputElement.type === 'hidden') {\n return NodePrivacyLevel.MASK;\n }\n var autocomplete = inputElement.getAttribute('autocomplete');\n // Handle input[autocomplete=cc-number/cc-csc/cc-exp/cc-exp-month/cc-exp-year]\n if (autocomplete && autocomplete.indexOf('cc-') === 0) {\n return NodePrivacyLevel.MASK;\n }\n }\n // Check HTML privacy attributes and classes\n if (privAttr === PRIVACY_ATTR_VALUE_HIDDEN || node.classList.contains(PRIVACY_CLASS_HIDDEN)) {\n return NodePrivacyLevel.HIDDEN;\n }\n if (privAttr === PRIVACY_ATTR_VALUE_MASK || node.classList.contains(PRIVACY_CLASS_MASK)) {\n return NodePrivacyLevel.MASK;\n }\n if (privAttr === PRIVACY_ATTR_VALUE_MASK_USER_INPUT || node.classList.contains(PRIVACY_CLASS_MASK_USER_INPUT)) {\n return NodePrivacyLevel.MASK_USER_INPUT;\n }\n if (privAttr === PRIVACY_ATTR_VALUE_ALLOW || node.classList.contains(PRIVACY_CLASS_ALLOW)) {\n return NodePrivacyLevel.ALLOW;\n }\n if (shouldIgnoreElement(node)) {\n return NodePrivacyLevel.IGNORE;\n }\n}\n/**\n * Helper aiming to unify `mask` and `mask-user-input` privacy levels:\n *\n * In the `mask` case, it is trivial: we should mask the element.\n *\n * In the `mask-user-input` case, we should mask the element only if it is a \"form\" element or the\n * direct parent is a form element for text nodes).\n *\n * Other `shouldMaskNode` cases are edge cases that should not matter too much (ex: should we mask a\n * node if it is ignored or hidden? it doesn't matter since it won't be serialized).\n */\nexport function shouldMaskNode(node, privacyLevel) {\n switch (privacyLevel) {\n case NodePrivacyLevel.MASK:\n case NodePrivacyLevel.HIDDEN:\n case NodePrivacyLevel.IGNORE:\n return true;\n case NodePrivacyLevel.MASK_USER_INPUT:\n return isTextNode(node) ? isFormElement(node.parentNode) : isFormElement(node);\n default:\n return false;\n }\n}\nfunction isFormElement(node) {\n if (!node || node.nodeType !== node.ELEMENT_NODE) {\n return false;\n }\n var element = node;\n if (element.tagName === 'INPUT') {\n switch (element.type) {\n case 'button':\n case 'color':\n case 'reset':\n case 'submit':\n return false;\n }\n }\n return !!FORM_PRIVATE_TAG_NAMES[element.tagName];\n}\n/**\n * Text censoring non-destructively maintains whitespace characters in order to preserve text shape\n * during replay.\n */\nexport var censorText = function (text) {\n return text.replace(/\\S/g, TEXT_MASKING_CHAR);\n};\nexport function getTextContent(textNode, ignoreWhiteSpace, parentNodePrivacyLevel) {\n var _a;\n // The parent node may not be a html element which has a tagName attribute.\n // So just let it be undefined which is ok in this use case.\n var parentTagName = (_a = textNode.parentElement) === null || _a === void 0 ? void 0 : _a.tagName;\n var textContent = textNode.textContent || '';\n if (ignoreWhiteSpace && !textContent.trim()) {\n return;\n }\n var nodePrivacyLevel = parentNodePrivacyLevel;\n var isStyle = parentTagName === 'STYLE' ? true : undefined;\n var isScript = parentTagName === 'SCRIPT';\n if (isScript) {\n // For perf reasons, we don't record script (heuristic)\n textContent = CENSORED_STRING_MARK;\n } else if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n // Should never occur, but just in case, we set to CENSORED_MARK.\n textContent = CENSORED_STRING_MARK;\n } else if (shouldMaskNode(textNode, nodePrivacyLevel) &&\n // Style tags are `overruled` (Use `hide` to enforce privacy)\n !isStyle) {\n if (\n // Scrambling the child list breaks text nodes for DATALIST/SELECT/OPTGROUP\n parentTagName === 'DATALIST' || parentTagName === 'SELECT' || parentTagName === 'OPTGROUP') {\n if (!textContent.trim()) {\n return;\n }\n } else if (parentTagName === 'OPTION') {\n //
\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t@if (additionalCommentLabel) {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\n\n","import { Directive, ViewContainerRef } from '@angular/core';\n\n@Directive({\n\tselector: '[appDynamicMenuComponent]',\n\tstandalone: true\n})\nexport class DynamicMenuDirective {\n\n constructor(public viewContainerRef: ViewContainerRef) { }\n\n}\n","import { trigger, transition, style, animate } from '@angular/animations';\nimport * as i2 from '@angular/common';\nimport { isPlatformBrowser, CommonModule } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { Injectable, PLATFORM_ID, Pipe, Inject, EventEmitter, forwardRef, Component, ViewEncapsulation, Input, Output, computed, signal, inject, booleanAttribute, numberAttribute, ChangeDetectionStrategy, ViewChild, ContentChild, ContentChildren, NgModule } from '@angular/core';\nimport * as i3 from '@angular/router';\nimport { RouterModule } from '@angular/router';\nimport { uuid, focus, relativePosition, absolutePosition, appendChild, isTouchDevice, find, findSingle } from '@primeuix/utils';\nimport * as i5 from 'primeng/api';\nimport { SharedModule, PrimeTemplate } from 'primeng/api';\nimport * as i4 from 'primeng/badge';\nimport { BadgeModule } from 'primeng/badge';\nimport { BaseComponent } from 'primeng/basecomponent';\nimport { ConnectedOverlayScrollHandler } from 'primeng/dom';\nimport { Ripple } from 'primeng/ripple';\nimport * as i6 from 'primeng/tooltip';\nimport { TooltipModule } from 'primeng/tooltip';\nimport { ZIndexUtils } from 'primeng/utils';\nimport { BaseStyle } from 'primeng/base';\nimport * as i1 from '@angular/platform-browser';\nconst theme = ({\n dt\n}) => `\n.p-menu {\n background: ${dt('menu.background')};\n color: ${dt('menu.color')};\n border: 1px solid ${dt('menu.border.color')};\n border-radius: ${dt('menu.border.radius')};\n min-width: 12.5rem;\n}\n\n.p-menu-list {\n margin: 0;\n padding: ${dt('menu.list.padding')};\n outline: 0 none;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: ${dt('menu.list.gap')};\n}\n\n.p-menu-item-content {\n transition: background ${dt('menu.transition.duration')}, color ${dt('menu.transition.duration')};\n border-radius: ${dt('menu.item.border.radius')};\n color: ${dt('menu.item.color')};\n}\n\n.p-menu-item-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n color: inherit;\n padding: ${dt('menu.item.padding')};\n gap: ${dt('menu.item.gap')};\n user-select: none;\n outline: 0 none;\n}\n\n.p-menu-item-label {\n line-height: 1;\n}\n\n.p-menu-item-icon {\n color: ${dt('menu.item.icon.color')};\n}\n\n.p-menu-item.p-focus .p-menu-item-content {\n color: ${dt('menu.item.focus.color')};\n background: ${dt('menu.item.focus.background')};\n}\n\n.p-menu-item.p-focus .p-menu-item-icon {\n color: ${dt('menu.item.icon.focus.color')};\n}\n\n.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {\n color: ${dt('menu.item.focus.color')};\n background: ${dt('menu.item.focus.background')};\n}\n\n.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {\n color: ${dt('menu.item.icon.focus.color')};\n}\n\n.p-menu-overlay {\n box-shadow: ${dt('menu.shadow')};\n}\n\n.p-menu-submenu-label {\n background: ${dt('menu.submenu.label.background')};\n padding: ${dt('menu.submenu.label.padding')};\n color: ${dt('menu.submenu.label.color')};\n font-weight: ${dt('menu.submenu.label.font.weight')};\n}\n\n.p-menu-separator {\n border-top: 1px solid ${dt('menu.separator.border.color')};\n}\n\n/* For PrimeNG */\n.p-menu-overlay {\n position: absolute;\n}\n`;\nconst classes = {\n root: ({\n props\n }) => ['p-menu p-component', {\n 'p-menu-overlay': props.popup\n }],\n start: 'p-menu-start',\n list: 'p-menu-list',\n submenuLabel: 'p-menu-submenu-label',\n separator: 'p-menu-separator',\n end: 'p-menu-end',\n item: ({\n instance\n }) => ['p-menu-item', {\n 'p-focus': instance.id === instance.focusedOptionId,\n 'p-disabled': instance.disabled()\n }],\n itemContent: 'p-menu-item-content',\n itemLink: 'p-menu-item-link',\n itemIcon: 'p-menu-item-icon',\n itemLabel: 'p-menu-item-label'\n};\nlet MenuStyle = /*#__PURE__*/(() => {\n class MenuStyle extends BaseStyle {\n name = 'menu';\n theme = theme;\n classes = classes;\n static ɵfac = /*@__PURE__*/(() => {\n let ɵMenuStyle_BaseFactory;\n return function MenuStyle_Factory(__ngFactoryType__) {\n return (ɵMenuStyle_BaseFactory || (ɵMenuStyle_BaseFactory = i0.ɵɵgetInheritedFactory(MenuStyle)))(__ngFactoryType__ || MenuStyle);\n };\n })();\n static ɵprov = /*@__PURE__*/i0.ɵɵdefineInjectable({\n token: MenuStyle,\n factory: MenuStyle.ɵfac\n });\n }\n return MenuStyle;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n *\n * Menu is a navigation / command component that supports dynamic and static positioning.\n *\n * [Live Demo](https://www.primeng.org/menu/)\n *\n * @module menustyle\n *\n */\nvar MenuClasses = /*#__PURE__*/function (MenuClasses) {\n /**\n * Class name of the root element\n */\n MenuClasses[\"root\"] = \"p-menu\";\n /**\n * Class name of the start element\n */\n MenuClasses[\"start\"] = \"p-menu-start\";\n /**\n * Class name of the list element\n */\n MenuClasses[\"list\"] = \"p-menu-list\";\n /**\n * Class name of the submenu item element\n */\n MenuClasses[\"submenuItem\"] = \"p-menu-submenu-item\";\n /**\n * Class name of the separator element\n */\n MenuClasses[\"separator\"] = \"p-menu-separator\";\n /**\n * Class name of the end element\n */\n MenuClasses[\"end\"] = \"p-menu-end\";\n /**\n * Class name of the item element\n */\n MenuClasses[\"item\"] = \"p-menu-item\";\n /**\n * Class name of the item content element\n */\n MenuClasses[\"itemContent\"] = \"p-menu-item-content\";\n /**\n * Class name of the item link element\n */\n MenuClasses[\"itemLink\"] = \"p-menu-item-link\";\n /**\n * Class name of the item icon element\n */\n MenuClasses[\"itemIcon\"] = \"p-menu-item-icon\";\n /**\n * Class name of the item label element\n */\n MenuClasses[\"itemLabel\"] = \"p-menu-item-label\";\n return MenuClasses;\n}(MenuClasses || {});\nconst _c0 = [\"pMenuItemContent\", \"\"];\nconst _c1 = a0 => ({\n \"p-disabled\": a0\n});\nconst _c2 = a0 => ({\n $implicit: a0\n});\nconst _c3 = () => ({\n exact: false\n});\nfunction MenuItemContent_ng_container_1_a_1_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction MenuItemContent_ng_container_1_a_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"a\", 6);\n i0.ɵɵtemplate(1, MenuItemContent_ng_container_1_a_1_ng_container_1_Template, 1, 0, \"ng-container\", 7);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n const itemContent_r3 = i0.ɵɵreference(4);\n i0.ɵɵproperty(\"target\", ctx_r1.item.target)(\"ngClass\", i0.ɵɵpureFunction1(9, _c1, ctx_r1.item.disabled));\n i0.ɵɵattribute(\"title\", ctx_r1.item.title)(\"href\", ctx_r1.item.url || null, i0.ɵɵsanitizeUrl)(\"data-automationid\", ctx_r1.item.automationId)(\"tabindex\", -1)(\"data-pc-section\", \"action\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", itemContent_r3)(\"ngTemplateOutletContext\", i0.ɵɵpureFunction1(11, _c2, ctx_r1.item));\n }\n}\nfunction MenuItemContent_ng_container_1_a_2_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction MenuItemContent_ng_container_1_a_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"a\", 8);\n i0.ɵɵtemplate(1, MenuItemContent_ng_container_1_a_2_ng_container_1_Template, 1, 0, \"ng-container\", 7);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n const itemContent_r3 = i0.ɵɵreference(4);\n i0.ɵɵproperty(\"routerLink\", ctx_r1.item.routerLink)(\"queryParams\", ctx_r1.item.queryParams)(\"routerLinkActiveOptions\", ctx_r1.item.routerLinkActiveOptions || i0.ɵɵpureFunction0(17, _c3))(\"target\", ctx_r1.item.target)(\"ngClass\", i0.ɵɵpureFunction1(18, _c1, ctx_r1.item.disabled))(\"fragment\", ctx_r1.item.fragment)(\"queryParamsHandling\", ctx_r1.item.queryParamsHandling)(\"preserveFragment\", ctx_r1.item.preserveFragment)(\"skipLocationChange\", ctx_r1.item.skipLocationChange)(\"replaceUrl\", ctx_r1.item.replaceUrl)(\"state\", ctx_r1.item.state);\n i0.ɵɵattribute(\"data-automationid\", ctx_r1.item.automationId)(\"tabindex\", -1)(\"data-pc-section\", \"action\")(\"title\", ctx_r1.item.title);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", itemContent_r3)(\"ngTemplateOutletContext\", i0.ɵɵpureFunction1(20, _c2, ctx_r1.item));\n }\n}\nfunction MenuItemContent_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, MenuItemContent_ng_container_1_a_1_Template, 2, 13, \"a\", 4)(2, MenuItemContent_ng_container_1_a_2_Template, 2, 22, \"a\", 5);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !(ctx_r1.item == null ? null : ctx_r1.item.routerLink));\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx_r1.item == null ? null : ctx_r1.item.routerLink);\n }\n}\nfunction MenuItemContent_ng_container_2_1_ng_template_0_Template(rf, ctx) {}\nfunction MenuItemContent_ng_container_2_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, MenuItemContent_ng_container_2_1_ng_template_0_Template, 0, 0, \"ng-template\");\n }\n}\nfunction MenuItemContent_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, MenuItemContent_ng_container_2_1_Template, 1, 0, null, 7);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r1.itemTemplate)(\"ngTemplateOutletContext\", i0.ɵɵpureFunction1(2, _c2, ctx_r1.item));\n }\n}\nfunction MenuItemContent_ng_template_3_span_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 12);\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵclassMap(ctx_r1.item.iconClass);\n i0.ɵɵproperty(\"ngClass\", ctx_r1.item.icon)(\"ngStyle\", ctx_r1.item.iconStyle);\n }\n}\nfunction MenuItemContent_ng_template_3_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 13);\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance();\n i0.ɵɵtextInterpolate(ctx_r1.item.label);\n }\n}\nfunction MenuItemContent_ng_template_3_ng_template_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 14);\n i0.ɵɵpipe(1, \"safeHtml\");\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"innerHTML\", i0.ɵɵpipeBind1(1, 1, ctx_r1.item.label), i0.ɵɵsanitizeHtml);\n }\n}\nfunction MenuItemContent_ng_template_3_p_badge_4_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"p-badge\", 15);\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"styleClass\", ctx_r1.item.badgeStyleClass)(\"value\", ctx_r1.item.badge);\n }\n}\nfunction MenuItemContent_ng_template_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, MenuItemContent_ng_template_3_span_0_Template, 1, 4, \"span\", 9)(1, MenuItemContent_ng_template_3_span_1_Template, 2, 1, \"span\", 10)(2, MenuItemContent_ng_template_3_ng_template_2_Template, 2, 3, \"ng-template\", null, 1, i0.ɵɵtemplateRefExtractor)(4, MenuItemContent_ng_template_3_p_badge_4_Template, 1, 2, \"p-badge\", 11);\n }\n if (rf & 2) {\n const htmlLabel_r4 = i0.ɵɵreference(3);\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵproperty(\"ngIf\", ctx_r1.item.icon);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx_r1.item.escape !== false)(\"ngIfElse\", htmlLabel_r4);\n i0.ɵɵadvance(3);\n i0.ɵɵproperty(\"ngIf\", ctx_r1.item.badge);\n }\n}\nconst _c4 = [\"start\"];\nconst _c5 = [\"end\"];\nconst _c6 = [\"header\"];\nconst _c7 = [\"item\"];\nconst _c8 = [\"submenuheader\"];\nconst _c9 = [\"list\"];\nconst _c10 = [\"container\"];\nconst _c11 = a0 => ({\n \"p-menu p-component\": true,\n \"p-menu-overlay\": a0\n});\nconst _c12 = (a0, a1) => ({\n showTransitionParams: a0,\n hideTransitionParams: a1\n});\nconst _c13 = a0 => ({\n value: \"visible\",\n params: a0\n});\nconst _c14 = (a0, a1) => ({\n \"p-hidden\": a0,\n flex: a1\n});\nconst _c15 = (a0, a1) => ({\n \"p-focus\": a0,\n \"p-disabled\": a1\n});\nfunction Menu_div_0_div_2_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Menu_div_0_div_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 9);\n i0.ɵɵtemplate(1, Menu_div_0_div_2_ng_container_1_Template, 1, 0, \"ng-container\", 10);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n let tmp_5_0;\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵattribute(\"data-pc-section\", \"start\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", (tmp_5_0 = ctx_r1.startTemplate) !== null && tmp_5_0 !== undefined ? tmp_5_0 : ctx_r1._startTemplate);\n }\n}\nfunction Menu_div_0_5_ng_template_0_li_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"li\", 14);\n }\n}\nfunction Menu_div_0_5_ng_template_0_li_1_ng_container_1_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\");\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const submenu_r3 = i0.ɵɵnextContext(3).$implicit;\n i0.ɵɵadvance();\n i0.ɵɵtextInterpolate(submenu_r3.label);\n }\n}\nfunction Menu_div_0_5_ng_template_0_li_1_ng_container_1_ng_template_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 18);\n i0.ɵɵpipe(1, \"safeHtml\");\n }\n if (rf & 2) {\n const submenu_r3 = i0.ɵɵnextContext(3).$implicit;\n i0.ɵɵproperty(\"innerHTML\", i0.ɵɵpipeBind1(1, 1, submenu_r3.label), i0.ɵɵsanitizeHtml);\n }\n}\nfunction Menu_div_0_5_ng_template_0_li_1_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Menu_div_0_5_ng_template_0_li_1_ng_container_1_span_1_Template, 2, 1, \"span\", 17)(2, Menu_div_0_5_ng_template_0_li_1_ng_container_1_ng_template_2_Template, 2, 3, \"ng-template\", null, 2, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const htmlSubmenuLabel_r4 = i0.ɵɵreference(3);\n const submenu_r3 = i0.ɵɵnextContext(2).$implicit;\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", submenu_r3.escape !== false)(\"ngIfElse\", htmlSubmenuLabel_r4);\n }\n}\nfunction Menu_div_0_5_ng_template_0_li_1_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Menu_div_0_5_ng_template_0_li_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"li\", 15);\n i0.ɵɵtemplate(1, Menu_div_0_5_ng_template_0_li_1_ng_container_1_Template, 4, 2, \"ng-container\", 7)(2, Menu_div_0_5_ng_template_0_li_1_ng_container_2_Template, 1, 0, \"ng-container\", 16);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n let tmp_13_0;\n const ctx_r4 = i0.ɵɵnextContext();\n const submenu_r3 = ctx_r4.$implicit;\n const i_r6 = ctx_r4.index;\n const ctx_r1 = i0.ɵɵnextContext(3);\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction2(7, _c14, submenu_r3.visible === false, submenu_r3.visible))(\"tooltipOptions\", submenu_r3.tooltipOptions);\n i0.ɵɵattribute(\"data-automationid\", submenu_r3.automationId)(\"id\", ctx_r1.menuitemId(submenu_r3, ctx_r1.id, i_r6));\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx_r1.submenuHeaderTemplate && !ctx_r1._submenuHeaderTemplate);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", (tmp_13_0 = ctx_r1.submenuHeaderTemplate) !== null && tmp_13_0 !== undefined ? tmp_13_0 : ctx_r1._submenuHeaderTemplate)(\"ngTemplateOutletContext\", i0.ɵɵpureFunction1(10, _c2, submenu_r3));\n }\n}\nfunction Menu_div_0_5_ng_template_0_ng_template_2_li_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"li\", 14);\n }\n}\nfunction Menu_div_0_5_ng_template_0_ng_template_2_li_1_Template(rf, ctx) {\n if (rf & 1) {\n const _r7 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"li\", 20);\n i0.ɵɵlistener(\"onMenuItemClick\", function Menu_div_0_5_ng_template_0_ng_template_2_li_1_Template_li_onMenuItemClick_0_listener($event) {\n i0.ɵɵrestoreView(_r7);\n const ctx_r7 = i0.ɵɵnextContext();\n const item_r9 = ctx_r7.$implicit;\n const j_r10 = ctx_r7.index;\n const i_r6 = i0.ɵɵnextContext().index;\n const ctx_r1 = i0.ɵɵnextContext(3);\n return i0.ɵɵresetView(ctx_r1.itemClick($event, ctx_r1.menuitemId(item_r9, ctx_r1.id, i_r6, j_r10)));\n });\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n let tmp_13_0;\n const ctx_r7 = i0.ɵɵnextContext();\n const item_r9 = ctx_r7.$implicit;\n const j_r10 = ctx_r7.index;\n const i_r6 = i0.ɵɵnextContext().index;\n const ctx_r1 = i0.ɵɵnextContext(3);\n i0.ɵɵclassMap(item_r9.styleClass);\n i0.ɵɵproperty(\"pMenuItemContent\", item_r9)(\"itemTemplate\", (tmp_13_0 = ctx_r1.itemTemplate) !== null && tmp_13_0 !== undefined ? tmp_13_0 : ctx_r1._itemTemplate)(\"ngClass\", i0.ɵɵpureFunction2(13, _c15, ctx_r1.focusedOptionId() && ctx_r1.menuitemId(item_r9, ctx_r1.id, i_r6, j_r10) === ctx_r1.focusedOptionId(), ctx_r1.disabled(item_r9.disabled)))(\"ngStyle\", item_r9.style)(\"tooltipOptions\", item_r9.tooltipOptions);\n i0.ɵɵattribute(\"data-pc-section\", \"menuitem\")(\"aria-label\", ctx_r1.label(item_r9.label))(\"data-p-focused\", ctx_r1.isItemFocused(ctx_r1.menuitemId(item_r9, ctx_r1.id, i_r6, j_r10)))(\"data-p-disabled\", ctx_r1.disabled(item_r9.disabled))(\"aria-disabled\", ctx_r1.disabled(item_r9.disabled))(\"id\", ctx_r1.menuitemId(item_r9, ctx_r1.id, i_r6, j_r10));\n }\n}\nfunction Menu_div_0_5_ng_template_0_ng_template_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Menu_div_0_5_ng_template_0_ng_template_2_li_0_Template, 1, 0, \"li\", 12)(1, Menu_div_0_5_ng_template_0_ng_template_2_li_1_Template, 1, 16, \"li\", 19);\n }\n if (rf & 2) {\n const item_r9 = ctx.$implicit;\n const submenu_r3 = i0.ɵɵnextContext().$implicit;\n i0.ɵɵproperty(\"ngIf\", item_r9.separator && (item_r9.visible !== false || submenu_r3.visible !== false));\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !item_r9.separator && item_r9.visible !== false && (item_r9.visible !== undefined || submenu_r3.visible !== false));\n }\n}\nfunction Menu_div_0_5_ng_template_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Menu_div_0_5_ng_template_0_li_0_Template, 1, 0, \"li\", 12)(1, Menu_div_0_5_ng_template_0_li_1_Template, 3, 12, \"li\", 13)(2, Menu_div_0_5_ng_template_0_ng_template_2_Template, 2, 2, \"ng-template\", 11);\n }\n if (rf & 2) {\n const submenu_r3 = ctx.$implicit;\n i0.ɵɵproperty(\"ngIf\", submenu_r3.separator && submenu_r3.visible !== false);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !submenu_r3.separator);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngForOf\", submenu_r3.items);\n }\n}\nfunction Menu_div_0_5_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Menu_div_0_5_ng_template_0_Template, 3, 3, \"ng-template\", 11);\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngForOf\", ctx_r1.model);\n }\n}\nfunction Menu_div_0_6_ng_template_0_li_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"li\", 14);\n }\n}\nfunction Menu_div_0_6_ng_template_0_li_1_Template(rf, ctx) {\n if (rf & 1) {\n const _r11 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"li\", 20);\n i0.ɵɵlistener(\"onMenuItemClick\", function Menu_div_0_6_ng_template_0_li_1_Template_li_onMenuItemClick_0_listener($event) {\n i0.ɵɵrestoreView(_r11);\n const ctx_r11 = i0.ɵɵnextContext();\n const item_r13 = ctx_r11.$implicit;\n const i_r14 = ctx_r11.index;\n const ctx_r1 = i0.ɵɵnextContext(3);\n return i0.ɵɵresetView(ctx_r1.itemClick($event, ctx_r1.menuitemId(item_r13, ctx_r1.id, i_r14)));\n });\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n let tmp_10_0;\n const ctx_r11 = i0.ɵɵnextContext();\n const item_r13 = ctx_r11.$implicit;\n const i_r14 = ctx_r11.index;\n const ctx_r1 = i0.ɵɵnextContext(3);\n i0.ɵɵclassMap(item_r13.styleClass);\n i0.ɵɵproperty(\"pMenuItemContent\", item_r13)(\"itemTemplate\", (tmp_10_0 = ctx_r1.itemTemplate) !== null && tmp_10_0 !== undefined ? tmp_10_0 : ctx_r1._itemTemplate)(\"ngClass\", i0.ɵɵpureFunction2(13, _c15, ctx_r1.focusedOptionId() && ctx_r1.menuitemId(item_r13, ctx_r1.id, i_r14) === ctx_r1.focusedOptionId(), ctx_r1.disabled(item_r13.disabled)))(\"ngStyle\", item_r13.style)(\"tooltipOptions\", item_r13.tooltipOptions);\n i0.ɵɵattribute(\"data-pc-section\", \"menuitem\")(\"aria-label\", ctx_r1.label(item_r13.label))(\"data-p-focused\", ctx_r1.isItemFocused(ctx_r1.menuitemId(item_r13, ctx_r1.id, i_r14)))(\"data-p-disabled\", ctx_r1.disabled(item_r13.disabled))(\"aria-disabled\", ctx_r1.disabled(item_r13.disabled))(\"id\", ctx_r1.menuitemId(item_r13, ctx_r1.id, i_r14));\n }\n}\nfunction Menu_div_0_6_ng_template_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Menu_div_0_6_ng_template_0_li_0_Template, 1, 0, \"li\", 12)(1, Menu_div_0_6_ng_template_0_li_1_Template, 1, 16, \"li\", 19);\n }\n if (rf & 2) {\n const item_r13 = ctx.$implicit;\n i0.ɵɵproperty(\"ngIf\", item_r13.separator && item_r13.visible !== false);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !item_r13.separator && item_r13.visible !== false);\n }\n}\nfunction Menu_div_0_6_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Menu_div_0_6_ng_template_0_Template, 2, 2, \"ng-template\", 11);\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngForOf\", ctx_r1.model);\n }\n}\nfunction Menu_div_0_div_7_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Menu_div_0_div_7_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 21);\n i0.ɵɵtemplate(1, Menu_div_0_div_7_ng_container_1_Template, 1, 0, \"ng-container\", 10);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n let tmp_5_0;\n const ctx_r1 = i0.ɵɵnextContext(2);\n i0.ɵɵattribute(\"data-pc-section\", \"end\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", (tmp_5_0 = ctx_r1.endTemplate) !== null && tmp_5_0 !== undefined ? tmp_5_0 : ctx_r1._endTemplate);\n }\n}\nfunction Menu_div_0_Template(rf, ctx) {\n if (rf & 1) {\n const _r1 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"div\", 4, 0);\n i0.ɵɵlistener(\"click\", function Menu_div_0_Template_div_click_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n const ctx_r1 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r1.onOverlayClick($event));\n })(\"@overlayAnimation.start\", function Menu_div_0_Template_div_animation_overlayAnimation_start_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n const ctx_r1 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r1.onOverlayAnimationStart($event));\n })(\"@overlayAnimation.done\", function Menu_div_0_Template_div_animation_overlayAnimation_done_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n const ctx_r1 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r1.onOverlayAnimationEnd($event));\n });\n i0.ɵɵtemplate(2, Menu_div_0_div_2_Template, 2, 2, \"div\", 5);\n i0.ɵɵelementStart(3, \"ul\", 6, 1);\n i0.ɵɵlistener(\"focus\", function Menu_div_0_Template_ul_focus_3_listener($event) {\n i0.ɵɵrestoreView(_r1);\n const ctx_r1 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r1.onListFocus($event));\n })(\"blur\", function Menu_div_0_Template_ul_blur_3_listener($event) {\n i0.ɵɵrestoreView(_r1);\n const ctx_r1 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r1.onListBlur($event));\n })(\"keydown\", function Menu_div_0_Template_ul_keydown_3_listener($event) {\n i0.ɵɵrestoreView(_r1);\n const ctx_r1 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r1.onListKeyDown($event));\n });\n i0.ɵɵtemplate(5, Menu_div_0_5_Template, 1, 1, null, 7)(6, Menu_div_0_6_Template, 1, 1, null, 7);\n i0.ɵɵelementEnd();\n i0.ɵɵtemplate(7, Menu_div_0_div_7_Template, 2, 2, \"div\", 8);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n let tmp_10_0;\n let tmp_19_0;\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵclassMap(ctx_r1.styleClass);\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction1(18, _c11, ctx_r1.popup))(\"ngStyle\", ctx_r1.style)(\"@overlayAnimation\", i0.ɵɵpureFunction1(23, _c13, i0.ɵɵpureFunction2(20, _c12, ctx_r1.showTransitionOptions, ctx_r1.hideTransitionOptions)))(\"@.disabled\", ctx_r1.popup !== true);\n i0.ɵɵattribute(\"data-pc-name\", \"menu\")(\"id\", ctx_r1.id);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", (tmp_10_0 = ctx_r1.startTemplate) !== null && tmp_10_0 !== undefined ? tmp_10_0 : ctx_r1._startTemplate);\n i0.ɵɵadvance();\n i0.ɵɵattribute(\"id\", ctx_r1.id + \"_list\")(\"tabindex\", ctx_r1.getTabIndexValue())(\"data-pc-section\", \"menu\")(\"aria-activedescendant\", ctx_r1.activedescendant())(\"aria-label\", ctx_r1.ariaLabel)(\"aria-labelledBy\", ctx_r1.ariaLabelledBy);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", ctx_r1.hasSubMenu());\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx_r1.hasSubMenu());\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", (tmp_19_0 = ctx_r1.endTemplate) !== null && tmp_19_0 !== undefined ? tmp_19_0 : ctx_r1._endTemplate);\n }\n}\nlet SafeHtmlPipe = /*#__PURE__*/(() => {\n class SafeHtmlPipe {\n platformId;\n sanitizer;\n constructor(platformId, sanitizer) {\n this.platformId = platformId;\n this.sanitizer = sanitizer;\n }\n transform(value) {\n if (!value || !isPlatformBrowser(this.platformId)) {\n return value;\n }\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n static ɵfac = function SafeHtmlPipe_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || SafeHtmlPipe)(i0.ɵɵdirectiveInject(PLATFORM_ID, 16), i0.ɵɵdirectiveInject(i1.DomSanitizer, 16));\n };\n static ɵpipe = /*@__PURE__*/i0.ɵɵdefinePipe({\n name: \"safeHtml\",\n type: SafeHtmlPipe,\n pure: true\n });\n }\n return SafeHtmlPipe;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet MenuItemContent = /*#__PURE__*/(() => {\n class MenuItemContent {\n item;\n itemTemplate;\n onMenuItemClick = new EventEmitter();\n menu;\n constructor(menu) {\n this.menu = menu;\n }\n onItemClick(event, item) {\n this.onMenuItemClick.emit({\n originalEvent: event,\n item\n });\n }\n static ɵfac = function MenuItemContent_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || MenuItemContent)(i0.ɵɵdirectiveInject(forwardRef(() => Menu)));\n };\n static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: MenuItemContent,\n selectors: [[\"\", \"pMenuItemContent\", \"\"]],\n inputs: {\n item: [0, \"pMenuItemContent\", \"item\"],\n itemTemplate: \"itemTemplate\"\n },\n outputs: {\n onMenuItemClick: \"onMenuItemClick\"\n },\n attrs: _c0,\n decls: 5,\n vars: 3,\n consts: [[\"itemContent\", \"\"], [\"htmlLabel\", \"\"], [1, \"p-menu-item-content\", 3, \"click\"], [4, \"ngIf\"], [\"class\", \"p-menu-item-link\", \"pRipple\", \"\", 3, \"target\", \"ngClass\", 4, \"ngIf\"], [\"routerLinkActive\", \"p-menu-item-link-active\", \"class\", \"p-menu-item-link\", \"pRipple\", \"\", 3, \"routerLink\", \"queryParams\", \"routerLinkActiveOptions\", \"target\", \"ngClass\", \"fragment\", \"queryParamsHandling\", \"preserveFragment\", \"skipLocationChange\", \"replaceUrl\", \"state\", 4, \"ngIf\"], [\"pRipple\", \"\", 1, \"p-menu-item-link\", 3, \"target\", \"ngClass\"], [4, \"ngTemplateOutlet\", \"ngTemplateOutletContext\"], [\"routerLinkActive\", \"p-menu-item-link-active\", \"pRipple\", \"\", 1, \"p-menu-item-link\", 3, \"routerLink\", \"queryParams\", \"routerLinkActiveOptions\", \"target\", \"ngClass\", \"fragment\", \"queryParamsHandling\", \"preserveFragment\", \"skipLocationChange\", \"replaceUrl\", \"state\"], [\"class\", \"p-menu-item-icon\", 3, \"ngClass\", \"class\", \"ngStyle\", 4, \"ngIf\"], [\"class\", \"p-menu-item-label\", 4, \"ngIf\", \"ngIfElse\"], [3, \"styleClass\", \"value\", 4, \"ngIf\"], [1, \"p-menu-item-icon\", 3, \"ngClass\", \"ngStyle\"], [1, \"p-menu-item-label\"], [1, \"p-menu-item-label\", 3, \"innerHTML\"], [3, \"styleClass\", \"value\"]],\n template: function MenuItemContent_Template(rf, ctx) {\n if (rf & 1) {\n const _r1 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"div\", 2);\n i0.ɵɵlistener(\"click\", function MenuItemContent_Template_div_click_0_listener($event) {\n i0.ɵɵrestoreView(_r1);\n return i0.ɵɵresetView(ctx.onItemClick($event, ctx.item));\n });\n i0.ɵɵtemplate(1, MenuItemContent_ng_container_1_Template, 3, 2, \"ng-container\", 3)(2, MenuItemContent_ng_container_2_Template, 2, 4, \"ng-container\", 3)(3, MenuItemContent_ng_template_3_Template, 5, 4, \"ng-template\", null, 0, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n i0.ɵɵattribute(\"data-pc-section\", \"content\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx.itemTemplate);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx.itemTemplate);\n }\n },\n dependencies: [CommonModule, i2.NgClass, i2.NgIf, i2.NgTemplateOutlet, i2.NgStyle, RouterModule, i3.RouterLink, i3.RouterLinkActive, Ripple, TooltipModule, BadgeModule, i4.Badge, SharedModule, SafeHtmlPipe],\n encapsulation: 2\n });\n }\n return MenuItemContent;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Menu is a navigation / command component that supports dynamic and static positioning.\n * @group Components\n */\nlet Menu = /*#__PURE__*/(() => {\n class Menu extends BaseComponent {\n overlayService;\n /**\n * An array of menuitems.\n * @group Props\n */\n model;\n /**\n * Defines if menu would displayed as a popup.\n * @group Props\n */\n popup;\n /**\n * Inline style of the component.\n * @group Props\n */\n style;\n /**\n * Style class of the component.\n * @group Props\n */\n styleClass;\n /**\n * Target element to attach the overlay, valid values are \"body\" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]=\"mydiv\" for a div element having #mydiv as variable name).\n * @group Props\n */\n appendTo;\n /**\n * Whether to automatically manage layering.\n * @group Props\n */\n autoZIndex = true;\n /**\n * Base zIndex value to use in layering.\n * @group Props\n */\n baseZIndex = 0;\n /**\n * Transition options of the show animation.\n * @group Props\n */\n showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';\n /**\n * Transition options of the hide animation.\n * @group Props\n */\n hideTransitionOptions = '.1s linear';\n /**\n * Defines a string value that labels an interactive element.\n * @group Props\n */\n ariaLabel;\n /**\n * Identifier of the underlying input element.\n * @group Props\n */\n ariaLabelledBy;\n /**\n * Current id state as a string.\n * @group Props\n */\n id;\n /**\n * Index of the element in tabbing order.\n * @group Props\n */\n tabindex = 0;\n /**\n * Callback to invoke when overlay menu is shown.\n * @group Emits\n */\n onShow = new EventEmitter();\n /**\n * Callback to invoke when overlay menu is hidden.\n * @group Emits\n */\n onHide = new EventEmitter();\n /**\n * Callback to invoke when the list loses focus.\n * @param {Event} event - blur event.\n * @group Emits\n */\n onBlur = new EventEmitter();\n /**\n * Callback to invoke when the list receives focus.\n * @param {Event} event - focus event.\n * @group Emits\n */\n onFocus = new EventEmitter();\n listViewChild;\n containerViewChild;\n container;\n scrollHandler;\n documentClickListener;\n documentResizeListener;\n preventDocumentDefault;\n target;\n visible;\n focusedOptionId = computed(() => {\n return this.focusedOptionIndex() !== -1 ? this.focusedOptionIndex() : null;\n });\n focusedOptionIndex = signal(-1);\n selectedOptionIndex = signal(-1);\n focused = false;\n overlayVisible = false;\n relativeAlign;\n _componentStyle = inject(MenuStyle);\n constructor(overlayService) {\n super();\n this.overlayService = overlayService;\n this.id = this.id || uuid('pn_id_');\n }\n /**\n * Toggles the visibility of the popup menu.\n * @param {Event} event - Browser event.\n * @group Method\n */\n toggle(event) {\n if (this.visible) this.hide();else this.show(event);\n this.preventDocumentDefault = true;\n }\n /**\n * Displays the popup menu.\n * @param {Event} event - Browser event.\n * @group Method\n */\n show(event) {\n this.target = event.currentTarget;\n this.relativeAlign = event.relativeAlign;\n this.visible = true;\n this.preventDocumentDefault = true;\n this.overlayVisible = true;\n this.cd.markForCheck();\n }\n ngOnInit() {\n super.ngOnInit();\n if (!this.popup) {\n this.bindDocumentClickListener();\n }\n }\n /**\n * Defines template option for start.\n * @group Templates\n */\n startTemplate;\n _startTemplate;\n /**\n * Defines template option for end.\n * @group Templates\n */\n endTemplate;\n _endTemplate;\n /**\n * Defines template option for header.\n * @group Templates\n */\n headerTemplate;\n _headerTemplate;\n /**\n * Defines template option for item.\n * @group Templates\n */\n itemTemplate;\n _itemTemplate;\n /**\n * Defines template option for item.\n * @group Templates\n */\n submenuHeaderTemplate;\n _submenuHeaderTemplate;\n templates;\n ngAfterContentInit() {\n this.templates?.forEach(item => {\n switch (item.getType()) {\n case 'start':\n this._startTemplate = item.template;\n break;\n case 'end':\n this._endTemplate = item.template;\n break;\n case 'item':\n this._itemTemplate = item.template;\n break;\n case 'submenuheader':\n this._submenuHeaderTemplate = item.template;\n break;\n default:\n this._itemTemplate = item.template;\n break;\n }\n });\n }\n getTabIndexValue() {\n return this.tabindex !== undefined ? this.tabindex.toString() : null;\n }\n onOverlayAnimationStart(event) {\n switch (event.toState) {\n case 'visible':\n if (this.popup) {\n this.container = event.element;\n this.moveOnTop();\n this.onShow.emit({});\n this.appendOverlay();\n this.alignOverlay();\n this.bindDocumentClickListener();\n this.bindDocumentResizeListener();\n this.bindScrollListener();\n focus(this.listViewChild.nativeElement);\n }\n break;\n case 'void':\n this.onOverlayHide();\n this.onHide.emit({});\n break;\n }\n }\n onOverlayAnimationEnd(event) {\n switch (event.toState) {\n case 'void':\n if (this.autoZIndex) {\n ZIndexUtils.clear(event.element);\n }\n break;\n }\n }\n alignOverlay() {\n if (this.relativeAlign) relativePosition(this.container, this.target);else absolutePosition(this.container, this.target);\n }\n appendOverlay() {\n if (this.appendTo) {\n if (this.appendTo === 'body') this.renderer.appendChild(this.document.body, this.container);else appendChild(this.appendTo, this.container);\n }\n }\n restoreOverlayAppend() {\n if (this.container && this.appendTo) {\n this.renderer.appendChild(this.el.nativeElement, this.container);\n }\n }\n moveOnTop() {\n if (this.autoZIndex) {\n ZIndexUtils.set('menu', this.container, this.baseZIndex + this.config.zIndex.menu);\n }\n }\n /**\n * Hides the popup menu.\n * @group Method\n */\n hide() {\n this.visible = false;\n this.relativeAlign = false;\n this.cd.markForCheck();\n }\n onWindowResize() {\n if (this.visible && !isTouchDevice()) {\n this.hide();\n }\n }\n menuitemId(item, id, index, childIndex) {\n return item?.id ?? `${id}_${index}${childIndex !== undefined ? '_' + childIndex : ''}`;\n }\n isItemFocused(id) {\n return this.focusedOptionId() === id;\n }\n label(label) {\n return typeof label === 'function' ? label() : label;\n }\n disabled(disabled) {\n return typeof disabled === 'function' ? disabled() : typeof disabled === 'undefined' ? false : disabled;\n }\n activedescendant() {\n return this.focused ? this.focusedOptionId() : undefined;\n }\n onListFocus(event) {\n if (!this.focused) {\n this.focused = true;\n this.onFocus.emit(event);\n }\n }\n onListBlur(event) {\n if (this.focused) {\n this.focused = false;\n this.changeFocusedOptionIndex(-1);\n this.selectedOptionIndex.set(-1);\n this.focusedOptionIndex.set(-1);\n this.onBlur.emit(event);\n }\n }\n onListKeyDown(event) {\n switch (event.code) {\n case 'ArrowDown':\n this.onArrowDownKey(event);\n break;\n case 'ArrowUp':\n this.onArrowUpKey(event);\n break;\n case 'Home':\n this.onHomeKey(event);\n break;\n case 'End':\n this.onEndKey(event);\n break;\n case 'Enter':\n this.onEnterKey(event);\n break;\n case 'NumpadEnter':\n this.onEnterKey(event);\n break;\n case 'Space':\n this.onSpaceKey(event);\n break;\n case 'Escape':\n case 'Tab':\n if (this.popup) {\n focus(this.target);\n this.hide();\n }\n this.overlayVisible && this.hide();\n break;\n default:\n break;\n }\n }\n onArrowDownKey(event) {\n const optionIndex = this.findNextOptionIndex(this.focusedOptionIndex());\n this.changeFocusedOptionIndex(optionIndex);\n event.preventDefault();\n }\n onArrowUpKey(event) {\n if (event.altKey && this.popup) {\n focus(this.target);\n this.hide();\n event.preventDefault();\n } else {\n const optionIndex = this.findPrevOptionIndex(this.focusedOptionIndex());\n this.changeFocusedOptionIndex(optionIndex);\n event.preventDefault();\n }\n }\n onHomeKey(event) {\n this.changeFocusedOptionIndex(0);\n event.preventDefault();\n }\n onEndKey(event) {\n this.changeFocusedOptionIndex(find(this.containerViewChild.nativeElement, 'li[data-pc-section=\"menuitem\"][data-p-disabled=\"false\"]').length - 1);\n event.preventDefault();\n }\n onEnterKey(event) {\n const element = findSingle(this.containerViewChild.nativeElement, `li[id=\"${`${this.focusedOptionIndex()}`}\"]`);\n const anchorElement = element && findSingle(element, 'a[data-pc-section=\"action\"]');\n this.popup && focus(this.target);\n anchorElement ? anchorElement.click() : element && element.click();\n event.preventDefault();\n }\n onSpaceKey(event) {\n this.onEnterKey(event);\n }\n findNextOptionIndex(index) {\n const links = find(this.containerViewChild.nativeElement, 'li[data-pc-section=\"menuitem\"][data-p-disabled=\"false\"]');\n const matchedOptionIndex = [...links].findIndex(link => link.id === index);\n return matchedOptionIndex > -1 ? matchedOptionIndex + 1 : 0;\n }\n findPrevOptionIndex(index) {\n const links = find(this.containerViewChild.nativeElement, 'li[data-pc-section=\"menuitem\"][data-p-disabled=\"false\"]');\n const matchedOptionIndex = [...links].findIndex(link => link.id === index);\n return matchedOptionIndex > -1 ? matchedOptionIndex - 1 : 0;\n }\n changeFocusedOptionIndex(index) {\n const links = find(this.containerViewChild.nativeElement, 'li[data-pc-section=\"menuitem\"][data-p-disabled=\"false\"]');\n if (links.length > 0) {\n let order = index >= links.length ? links.length - 1 : index < 0 ? 0 : index;\n order > -1 && this.focusedOptionIndex.set(links[order].getAttribute('id'));\n }\n }\n itemClick(event, id) {\n const {\n originalEvent,\n item\n } = event;\n if (!this.focused) {\n this.focused = true;\n this.onFocus.emit();\n }\n if (item.disabled) {\n originalEvent.preventDefault();\n return;\n }\n if (!item.url && !item.routerLink) {\n originalEvent.preventDefault();\n }\n if (item.command) {\n item.command({\n originalEvent: originalEvent,\n item: item\n });\n }\n if (this.popup) {\n this.hide();\n }\n if (!this.popup && this.focusedOptionIndex() !== id) {\n this.focusedOptionIndex.set(id);\n }\n }\n onOverlayClick(event) {\n if (this.popup) {\n this.overlayService.add({\n originalEvent: event,\n target: this.el.nativeElement\n });\n }\n this.preventDocumentDefault = true;\n }\n bindDocumentClickListener() {\n if (!this.documentClickListener && isPlatformBrowser(this.platformId)) {\n const documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';\n this.documentClickListener = this.renderer.listen(documentTarget, 'click', event => {\n const isOutsideContainer = this.containerViewChild?.nativeElement && !this.containerViewChild?.nativeElement.contains(event.target);\n const isOutsideTarget = !(this.target && (this.target === event.target || this.target.contains(event.target)));\n if (!this.popup && isOutsideContainer && isOutsideTarget) {\n this.onListBlur(event);\n }\n if (this.preventDocumentDefault && this.overlayVisible && isOutsideContainer && isOutsideTarget) {\n this.hide();\n this.preventDocumentDefault = false;\n }\n });\n }\n }\n unbindDocumentClickListener() {\n if (this.documentClickListener) {\n this.documentClickListener();\n this.documentClickListener = null;\n }\n }\n bindDocumentResizeListener() {\n if (!this.documentResizeListener && isPlatformBrowser(this.platformId)) {\n const window = this.document.defaultView;\n this.documentResizeListener = this.renderer.listen(window, 'resize', this.onWindowResize.bind(this));\n }\n }\n unbindDocumentResizeListener() {\n if (this.documentResizeListener) {\n this.documentResizeListener();\n this.documentResizeListener = null;\n }\n }\n bindScrollListener() {\n if (!this.scrollHandler && isPlatformBrowser(this.platformId)) {\n this.scrollHandler = new ConnectedOverlayScrollHandler(this.target, () => {\n if (this.visible) {\n this.hide();\n }\n });\n }\n this.scrollHandler?.bindScrollListener();\n }\n unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n }\n onOverlayHide() {\n this.unbindDocumentClickListener();\n this.unbindDocumentResizeListener();\n this.unbindScrollListener();\n this.preventDocumentDefault = false;\n if (!this.cd.destroyed) {\n this.target = null;\n }\n }\n ngOnDestroy() {\n if (this.popup) {\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n if (this.container && this.autoZIndex) {\n ZIndexUtils.clear(this.container);\n }\n this.restoreOverlayAppend();\n this.onOverlayHide();\n }\n if (!this.popup) {\n this.unbindDocumentClickListener();\n }\n super.ngOnDestroy();\n }\n hasSubMenu() {\n return this.model?.some(item => item.items) ?? false;\n }\n isItemHidden(item) {\n if (item.separator) {\n return item.visible === false || item.items && item.items.some(subitem => subitem.visible !== false);\n }\n return item.visible === false;\n }\n static ɵfac = function Menu_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Menu)(i0.ɵɵdirectiveInject(i5.OverlayService));\n };\n static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: Menu,\n selectors: [[\"p-menu\"]],\n contentQueries: function Menu_ContentQueries(rf, ctx, dirIndex) {\n if (rf & 1) {\n i0.ɵɵcontentQuery(dirIndex, _c4, 4);\n i0.ɵɵcontentQuery(dirIndex, _c5, 4);\n i0.ɵɵcontentQuery(dirIndex, _c6, 4);\n i0.ɵɵcontentQuery(dirIndex, _c7, 4);\n i0.ɵɵcontentQuery(dirIndex, _c8, 4);\n i0.ɵɵcontentQuery(dirIndex, PrimeTemplate, 4);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.startTemplate = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.endTemplate = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerTemplate = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.itemTemplate = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.submenuHeaderTemplate = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templates = _t);\n }\n },\n viewQuery: function Menu_Query(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵviewQuery(_c9, 5);\n i0.ɵɵviewQuery(_c10, 5);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.listViewChild = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.containerViewChild = _t.first);\n }\n },\n inputs: {\n model: \"model\",\n popup: [2, \"popup\", \"popup\", booleanAttribute],\n style: \"style\",\n styleClass: \"styleClass\",\n appendTo: \"appendTo\",\n autoZIndex: [2, \"autoZIndex\", \"autoZIndex\", booleanAttribute],\n baseZIndex: [2, \"baseZIndex\", \"baseZIndex\", numberAttribute],\n showTransitionOptions: \"showTransitionOptions\",\n hideTransitionOptions: \"hideTransitionOptions\",\n ariaLabel: \"ariaLabel\",\n ariaLabelledBy: \"ariaLabelledBy\",\n id: \"id\",\n tabindex: [2, \"tabindex\", \"tabindex\", numberAttribute]\n },\n outputs: {\n onShow: \"onShow\",\n onHide: \"onHide\",\n onBlur: \"onBlur\",\n onFocus: \"onFocus\"\n },\n features: [i0.ɵɵProvidersFeature([MenuStyle]), i0.ɵɵInputTransformsFeature, i0.ɵɵInheritDefinitionFeature],\n decls: 1,\n vars: 1,\n consts: [[\"container\", \"\"], [\"list\", \"\"], [\"htmlSubmenuLabel\", \"\"], [3, \"ngClass\", \"class\", \"ngStyle\", \"click\", 4, \"ngIf\"], [3, \"click\", \"ngClass\", \"ngStyle\"], [\"class\", \"p-menu-start\", 4, \"ngIf\"], [\"role\", \"menu\", 1, \"p-menu-list\", \"p-reset\", 3, \"focus\", \"blur\", \"keydown\"], [4, \"ngIf\"], [\"class\", \"p-menu-end\", 4, \"ngIf\"], [1, \"p-menu-start\"], [4, \"ngTemplateOutlet\"], [\"ngFor\", \"\", 3, \"ngForOf\"], [\"class\", \"p-menu-separator\", \"role\", \"separator\", 4, \"ngIf\"], [\"class\", \"p-menu-submenu-label\", \"pTooltip\", \"\", \"role\", \"none\", 3, \"ngClass\", \"tooltipOptions\", 4, \"ngIf\"], [\"role\", \"separator\", 1, \"p-menu-separator\"], [\"pTooltip\", \"\", \"role\", \"none\", 1, \"p-menu-submenu-label\", 3, \"ngClass\", \"tooltipOptions\"], [4, \"ngTemplateOutlet\", \"ngTemplateOutletContext\"], [4, \"ngIf\", \"ngIfElse\"], [3, \"innerHTML\"], [\"class\", \"p-menu-item\", \"pTooltip\", \"\", \"role\", \"menuitem\", 3, \"pMenuItemContent\", \"itemTemplate\", \"ngClass\", \"ngStyle\", \"class\", \"tooltipOptions\", \"onMenuItemClick\", 4, \"ngIf\"], [\"pTooltip\", \"\", \"role\", \"menuitem\", 1, \"p-menu-item\", 3, \"onMenuItemClick\", \"pMenuItemContent\", \"itemTemplate\", \"ngClass\", \"ngStyle\", \"tooltipOptions\"], [1, \"p-menu-end\"]],\n template: function Menu_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Menu_div_0_Template, 8, 25, \"div\", 3);\n }\n if (rf & 2) {\n i0.ɵɵproperty(\"ngIf\", !ctx.popup || ctx.visible);\n }\n },\n dependencies: [CommonModule, i2.NgClass, i2.NgForOf, i2.NgIf, i2.NgTemplateOutlet, i2.NgStyle, RouterModule, MenuItemContent, TooltipModule, i6.Tooltip, BadgeModule, SharedModule, SafeHtmlPipe],\n encapsulation: 2,\n data: {\n animation: [trigger('overlayAnimation', [transition(':enter', [style({\n opacity: 0,\n transform: 'scaleY(0.8)'\n }), animate('{{showTransitionParams}}')]), transition(':leave', [animate('{{hideTransitionParams}}', style({\n opacity: 0\n }))])])]\n },\n changeDetection: 0\n });\n }\n return Menu;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\nlet MenuModule = /*#__PURE__*/(() => {\n class MenuModule {\n static ɵfac = function MenuModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || MenuModule)();\n };\n static ɵmod = /*@__PURE__*/i0.ɵɵdefineNgModule({\n type: MenuModule\n });\n static ɵinj = /*@__PURE__*/i0.ɵɵdefineInjector({\n imports: [Menu, SharedModule, SharedModule]\n });\n }\n return MenuModule;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n(function () {\n (typeof ngJitMode === \"undefined\" || ngJitMode) && i0.ɵɵsetNgModuleScope(MenuModule, {\n imports: [Menu, SharedModule, SafeHtmlPipe],\n exports: [Menu, SharedModule, SafeHtmlPipe]\n });\n})();\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Menu, MenuClasses, MenuItemContent, MenuModule, MenuStyle, SafeHtmlPipe };\n","import { ChangeDetectionStrategy, Component, ComponentFactoryResolver, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { filter } from 'rxjs/operators';\n\nimport { DynamicMenuDirective } from '../../directives/dynamic-menu.directive';\nimport { DynamicMenuComponentModel } from '../../models/dynamic-menu-component-model';\nimport { DynamicMenuItem } from '../../models/dynamic-menu-item';\nimport { DynamicMenuItemService } from '../../services/dynamic-menu-item.service';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { NgClass, AsyncPipe, NgIf } from '@angular/common';\nimport { Menu } from 'primeng/menu';\nimport { EzMobileOverlayComponent } from '@ezuiaws/ez.ui.packages/ez-layout';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-dynamic-menu',\n\ttemplateUrl: './dynamic-menu.component.html',\n\tstyleUrls: ['./dynamic-menu.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [\n\t\tNgClass,\n\t\tAsyncPipe,\n\t\tMenu,\n\t\tNgIf,\n\t\tEzMobileOverlayComponent,\n\t\tDynamicMenuDirective\n\t],\n})\nexport class DynamicMenuComponent implements OnInit {\n\n @ViewChild(DynamicMenuDirective, { static: true }) appDynamicMenuComponent: DynamicMenuDirective;\n @Output() dynamicMenuOpened: EventEmitter = new EventEmitter;\n @Input() isMobileView: boolean = false;\n\n dynamicItems$: Observable;\n isOpen$: BehaviorSubject = new BehaviorSubject(false);\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private dynamicMenuItemService: DynamicMenuItemService\n ) { }\n\n ngOnInit(): void {\n this.dynamicMenuItemService.selectedDynamicItem$.pipe(\n untilDestroyed(this),\n filter(item => !!item)\n ).subscribe(\n item => this.loadComponent(item)\n );\n\n this.dynamicItems$ = this.dynamicMenuItemService.dynamicItems$;\n }\n\n loadComponent(item: DynamicMenuItem) {\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(item.component);\n\n const viewContainerRef = this.appDynamicMenuComponent.viewContainerRef;\n viewContainerRef.clear();\n\n const componentRef = viewContainerRef.createComponent(componentFactory);\n\n componentRef.instance.data = item.data;\n }\n\n showStatusChanged(show: boolean) {\n this.isOpen$.next(show);\n this.onDynamicMenuOpened(show);\n }\n\n private onDynamicMenuOpened(isOpen: boolean) {\n if (isOpen) {\n this.dynamicMenuOpened.emit();\n };\n }\n\n}\n","\n \n \n\n\n\n\n\n\n\n\n \n \n\n","import { DOCUMENT } from \"@angular/common\";\nimport { AfterViewInit, Directive, ElementRef, EventEmitter, Inject, OnDestroy, Output } from \"@angular/core\";\nimport { UntilDestroy, untilDestroyed } from \"@ngneat/until-destroy\";\nimport { filter, fromEvent, Subscription } from \"rxjs\";\n\n@UntilDestroy()\n@Directive({\n\tselector: '[clickOutside]'\n})\nexport class ClickOutsideDirective implements AfterViewInit, OnDestroy {\n\n\t@Output() clickedOutside = new EventEmitter();\n\n\tdocumentClickSubscription: Subscription | undefined;\n\n\tconstructor(\n\t\tprivate elementRef: ElementRef,\n\t\t@Inject(DOCUMENT) private document: Document\n\t) { }\n\n\tngAfterViewInit(): void {\n\t\tthis.documentClickSubscription = fromEvent(this.document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn !this.isInside(event.target as HTMLElement);\n\t\t\t\t}),\n\t\t\t\tuntilDestroyed(this)\n\t\t\t).subscribe(() => {\n\t\t\t\tthis.clickedOutside.emit();\n\t\t\t});\n\t}\n\n\tisInside(elementToCheck: HTMLElement): boolean {\n\t\treturn elementToCheck === this.elementRef.nativeElement || this.elementRef.nativeElement.contains(elementToCheck);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.documentClickSubscription?.unsubscribe();\n\t}\n\n}\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { AuthService } from '@app-core/auth/auth.service';\nimport { LocationSettingsService } from '@app-core/auth/location-settings.service';\nimport { UserSettingsService } from '@app-core/auth/user-settings.service';\nimport { SessionFacade } from '@app-root/state/session-state/session.facade';\nimport { Observable } from 'rxjs';\nimport { EzLocalizationModule } from '@ezuiaws/ez.ui.packages/ez-localization';\nimport { ClickOutsideDirective } from '@app-shared/directives/click-outside.directive';\nimport { EzMobileOverlayComponent } from '@ezuiaws/ez.ui.packages/ez-layout';\n\n@Component({\n\tselector: 'app-profile-popup',\n\ttemplateUrl: './profile-popup.component.html',\n\tstyleUrls: ['./profile-popup.component.scss'],\n\timports: [CommonModule, EzLocalizationModule, ClickOutsideDirective, EzMobileOverlayComponent],\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ProfilePopupComponent implements OnInit {\n\n @Input() isMobileView: boolean = false;\n @Output() profilePopupOpened: EventEmitter = new EventEmitter;\n\n userName$: Observable = this.sessionFacade.userName$;\n showProfilePopup: boolean = false;\n showOldPlatform: boolean = this.locationSettingsService.getLocationPreferenceBooleanValue('EnableTMSPlatform') && this.locationSettingsService.getLocationPreferenceBooleanValue('EnableHybridPlatform');\n showSystemAdmin: boolean = this.userSettingsService.userSession.adminLevel >= 100;\n\n constructor( private sessionFacade: SessionFacade,\n private authService: AuthService,\n private locationSettingsService: LocationSettingsService,\n private userSettingsService: UserSettingsService,) { }\n\n ngOnInit(): void {\n\n }\n\n toggleProfilePopup() {\n this.showProfilePopup = !this.showProfilePopup;\n this.onProfilePopupOpened();\n }\n\n clickedOutside() {\n this.showProfilePopup = false;\n }\n\n logout() {\n this.sessionFacade.fetchUserLogout();\n }\n\n redirectToOldPlatform(page: string = null) {\n this.authService.openTmsInSameWindow(null, page, true);\n }\n\n private onProfilePopupOpened() {\n if (this.showProfilePopup) {\n this.profilePopupOpened.emit();\n }\n }\n\n}\n","\n\n\n \n \n\n\n","import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject, distinctUntilChanged } from 'rxjs';\nimport { AuthService } from '@app-core/auth/auth.service';\nimport { ServerMiddlewareHelperService } from '@app-core/server-middleware-helper/server-middleware-helper.service';\nimport { EZLayoutService } from '@ezuiaws/ez.ui.packages/ez-layout';\nimport { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';\nimport { NgIf, UpperCasePipe, AsyncPipe, DatePipe, NgStyle } from '@angular/common';\nimport { EzLocalizationModule } from '@ezuiaws/ez.ui.packages/ez-localization';\nimport { EzButtonsModule } from '@ezuiaws/ez.ui.packages/ez-buttons';\nimport { FeedbackFormComponent } from '@app-shared/layout/feedback-form/feedback-form.component';\nimport { DynamicMenuComponent } from '@app-shared/layout/header/components/dynamic-menu/dynamic-menu.component';\nimport { ProfilePopupComponent } from '@app-shared/layout/profile-popup/profile-popup.component';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-footer',\n\ttemplateUrl: './footer.component.html',\n\tstyleUrls: ['./footer.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [\n\t\tNgIf,\n\t\tEzLocalizationModule,\n\t\tUpperCasePipe,\n\t\tAsyncPipe,\n\t\tDatePipe,\n\t\tEzButtonsModule,\n\t\tFeedbackFormComponent,\n\t\tDynamicMenuComponent,\n\t\tProfilePopupComponent,\n\t\tNgStyle\n\t],\n})\nexport class FooterComponent implements OnInit {\n\n @Input() isMobileDevice: boolean = false;\n @Input() sideBarIsOpen: boolean = false;\n\n tokenExpDate: Date;\n showPopupEvent: Subject = new Subject();\n\n serviceCode$: BehaviorSubject = new BehaviorSubject(null);\n footerIsActive$: Observable = this.layoutService.footerIsActive$;\n showMobileSwitchToGridFooterButton$: Observable = this.layoutService.showMobileSwitchToGridFooterButton$;\n\n constructor(\n private authService: AuthService,\n private serverMiddlewareHelperService: ServerMiddlewareHelperService,\n private layoutService: EZLayoutService,\n ) { }\n\n ngOnInit() {\n this.tokenExpDate = this.authService.getTokenExpirationDate();\n this.configureServiceCode();\n }\n\n showFeedBackPopup() {\n this.showPopupEvent.next();\n }\n\n private configureServiceCode() {\n this.serverMiddlewareHelperService.getHubTaskIdFromServer().pipe(\n distinctUntilChanged(),\n untilDestroyed(this)\n ).subscribe((hubTaskId: string) => {\n const serviceCode: string = hubTaskId + '-00' + this.authService.getUserLocationIdFromLocalStorage().toString();\n this.serviceCode$.next(serviceCode);\n });\n }\n\n openHelpPage() {\n window.open('https://ezfacility.zendesk.com/hc/en-us', '_blank');\n }\n\n closeSidebar() {\n if (this.isMobileDevice && this.sideBarIsOpen) {\n this.layoutService.toggleSidebar();\n }\n }\n\n switchToGridFooter() {\n this.layoutService.changeFooterStatus(false);\n }\n\n}\n","
\n \n
\n\t\t\t\n {{ \"ServiceCode\" | ezLocale | uppercase }}: \n \n {{ serviceCode$ | async }}\n \n
\n
\n {{ \"SessionExpirationMessage\" | ezLocale }}\n {{ tokenExpDate | date : \"medium\" }}\n \n \n \n \n {{ \"PrivacyPolicy\" | ezLocale }}\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n","import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { Observable, filter, map, take, tap } from 'rxjs';\nimport { AuthService } from '@app-core/auth/auth.service';\nimport { UserSettingsService } from '@app-core/auth/user-settings.service';\nimport { LocationSettingsService } from '@app-core/auth/location-settings.service';\nimport { LocationResponse } from '@app-autogen/ez.common/contracts/response/location-response';\n\nimport { EzFormControl } from '@ezuiaws/ez.ui.packages/ez-form-controls';\nimport { EzLocaleHelper } from '@ezuiaws/ez.ui.packages/ez-localization';\nimport { EzNotificationService } from '@ezuiaws/ez.ui.packages/ez-notification';\nimport { EZLayoutService } from '@ezuiaws/ez.ui.packages/ez-layout';\nimport { ToastContainers } from '../models/toast-containers.enum';\nimport { BannerNotificationModel, NotificationModel, NotificationScope } from '@ezuiaws/ez.ui.models';\nimport { BannerContentAlignment, EzBannerComponent } from '@ezuiaws/ez.ui.packages/ez-banner';\nimport { Router } from '@angular/router';\nimport { EzStoreService } from '@ezuiaws/ez.ui.packages/ez-store';\nimport * as appRouter from '@src/app/state/router-state';\nimport { SharedStateFacade } from '@app-root/state/shared-state/shared-state.facade';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { EzFormControlTemplateComponent } from '@ezuiaws/ez.ui.packages/ez-form-control-template';\nimport { NgIf, AsyncPipe, NgForOf, LowerCasePipe, NgClass } from '@angular/common';\nimport { DynamicMenuComponent } from '@app-shared/layout/header/components/dynamic-menu/dynamic-menu.component';\nimport { EzButtonsModule } from '@ezuiaws/ez.ui.packages/ez-buttons';\nimport { ProfilePopupComponent } from '@app-shared/layout/profile-popup/profile-popup.component';\nimport { LocationSelectComponent } from '@app-shared/components/selectors/location-select/location-select.component';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-header',\n\ttemplateUrl: './header.component.html',\n\tstyleUrls: ['./header.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [\n\t\tEzFormControlTemplateComponent,\n\t\tReactiveFormsModule,\n\t\tNgIf,\n\t\tDynamicMenuComponent,\n\t\tEzButtonsModule,\n\t\tProfilePopupComponent,\n\t\tAsyncPipe,\n\t\tEzBannerComponent,\n\t\tNgForOf,\n\t\tLowerCasePipe,\n\t\tNgClass,\n\t\tLocationSelectComponent\n\t]\n})\nexport class HeaderComponent implements OnInit {\n\n @Input() isMobileDevice: boolean = false;\n\n pageTitle$: Observable = this.layoutService.pageTitle$;\n\n headerForm: UntypedFormGroup;\n\n userLocationId: number = this.userSettingsService.userSession.currentLocationId;\n enableChatSupport: boolean = this.locationSettingsService.getLocationPreferenceBooleanValue('EnableChatSupport');\n\n toastContainerId: ToastContainers = ToastContainers.LayoutBottomHeader;\n\n banners$: Observable = this.notificationService.banners$;\n banners: NotificationModel[] = [];\n\n conditionalBanners$: Observable = this.notificationService.conditionalBanners$;\n\n userHasPendingActivityItem$: Observable = this.sharedStateFacade.userHasPendingActivityItem$;\n\n showConfirmationOnLocationChange$: Observable = this.layoutService.showConfirmationOnLocationChange$;\n\n BannerContentAlignment = BannerContentAlignment;\n NotificationScope = NotificationScope;\n BannerNotificationModel = BannerNotificationModel;\n\n sessionUserId: number = this.userSettingsService.userSession.userId;\n\n constructor(\n private authService: AuthService,\n private locationSettingsService: LocationSettingsService,\n private userSettingsService: UserSettingsService,\n private fb: UntypedFormBuilder,\n private notificationService: EzNotificationService,\n private layoutService: EZLayoutService,\n private router: Router,\n private storeHelper: EzStoreService,\n private sharedStateFacade: SharedStateFacade\n ) { }\n\n ngOnInit() {\n this.headerForm = this.fb.group({\n locationId: new EzFormControl({ value: this.userLocationId, disabled: true }, null, null, 'locationId')\n });\n\n this.notificationService.defaultNotificationContainerId = this.toastContainerId;\n this.notificationService.setInlineNotificationContainer(this.toastContainerId);\n this.subscribeOnGlobalBanners();\n this.subscribeOnUserPendingActivityItem();\n\n }\n\n subscribeOnGlobalBanners() {\n this.banners$.pipe(\n filter((banners: NotificationModel[]) => !!banners.length),\n map((banners: NotificationModel[]) => {\n return banners.filter(banner => banner.Enabled && !!banner.NotificationText.trim());\n }),\n take(1)\n ).subscribe((data) => {\n this.banners = this.userSettingsService.getUserPreferenceBooleanValue('ShowGlobalNotification') ?\n data :\n data.filter(banner => banner.NotificationType !== BannerNotificationModel.Survey);\n });\n }\n\n subscribeOnUserPendingActivityItem() {\n this.storeHelper.stateStreamSelector(appRouter.getRouterFeatureState)\n .pipe(\n untilDestroyed(this),\n map(route => route.state.url),\n tap(() => {\n this.sharedStateFacade.userHasPendingActivityItem(this.sessionUserId);\n }))\n .subscribe();\n }\n\n toggleMenu() {\n this.layoutService.toggleSidebar();\n }\n\n openHelpPage() {\n window.open('https://ezfacility.zendesk.com/hc/en-us', '_blank');\n }\n\n selectedLocationChanged(location: LocationResponse) {\n EzLocaleHelper.setCurrentLanguageLocale(location.cultureCode);\n void this.authService.changeUserLocation(location.locationId);\n }\n\n openZenDeskWidget() {\n if (typeof window['zE'] !== 'undefined') {\n window['zE']('messenger', 'open');\n }\n }\n\n canSwitchLocation(canSwitchLocation: boolean) {\n if (canSwitchLocation) {\n this.headerForm.controls['locationId'].enable();\n } else {\n this.headerForm.controls['locationId'].disable();\n }\n }\n\n onSurveyClicked() {\n this.userSettingsService.updateUserPreferenceBooleanValue('ShowGlobalNotification', false);\n this.banners = this.banners.filter(banner => banner.NotificationType !== BannerNotificationModel.Survey);\n this.notificationService.removeSurveyBanner();\n }\n\n onNotificationIconClick() {\n this.router.navigateByUrl(`/reports/membership-reports/client-activity-items-report/${this.sessionUserId}`)\n }\n\n\n}\n","
\n
\n \n
\n \n
\n

{{ pageTitle$ | async }}

\n
\n \"diamond-layout\"\n\n
\n \n \n \n \n
\n
\n\n \n
\n
    \n
  • \n \n \n \n
  • \n
  • \n\t\t\t\t\t\n
  • \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n\t\t\t\t\t\n
  • \n
\n
\n
\n
\n\n 0\">\n
\n \n \n
\n
\n\n 0\">\n
\n \n \n
\n
\n
\n","import { Component, OnInit } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { SessionResponse } from '@app-autogen/ez.authentication/contracts/response/session-response';\nimport { UserSettingsService } from '@app-core/auth/user-settings.service';\nimport { ConfirmationModalSettings, EZLayoutService, EzLayoutModule } from '@ezuiaws/ez.ui.packages/ez-layout';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { environment } from '@src/environments/environment.defaults';\nimport { NgIf } from '@angular/common';\nimport { EzLocalizationModule } from '@ezuiaws/ez.ui.packages/ez-localization';\nimport { EzEscapeHtmlPipe } from '@ezuiaws/ez.ui.packages/ez-pipes';\nimport { EzButtonsModule } from '@ezuiaws/ez.ui.packages/ez-buttons';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-important-message',\n\ttemplateUrl: './important-message.component.html',\n\tstyleUrls: ['./important-message.component.scss'],\n\timports: [\n\t\tEzLayoutModule,\n\t\tNgIf,\n\t\tEzLocalizationModule,\n\t\tEzEscapeHtmlPipe,\n\t\tEzButtonsModule\n\t]\n})\nexport class ImportantMessageComponent implements OnInit {\n\n showImportantMessage: boolean = false;\n\n importantMessageConfirmationSettings: ConfirmationModalSettings = {\n confirmationId: 'important-message-confirmation',\n title: '',\n message: '',\n showCancel: true\n };\n\n constructor(\n private router: Router,\n private layoutService: EZLayoutService,\n private userSettingsService: UserSettingsService\n ) { }\n\n ngOnInit(): void {\n\n this.userSettingsService.userSession$.pipe(\n untilDestroyed(this)\n ).subscribe((userSession: SessionResponse) => {\n if (userSession \n && !this.router.url.includes('/admin/approval-new-administrator')\n && this.userSettingsService.getUserPreferenceBooleanValue('ShowSurveyModal')\n && this.router.url.includes('/schedule')) {\n // sometimes an important message may be dismissible which will use a user preference \n // to save that is has been dismissed - This will check it\n // && this.userSettingsService.getUserPreferenceBooleanValue('ShowAWSMaintenanceAlert')\n this.layoutService.confirmationConfirmed();\n this.showImportantMessageDialog();\n }\n });\n }\n\n confirmationClosed(): void {\n this.showImportantMessage = false;\n }\n\n closeModalDialog(): void {\n // sometimes an important message may be dismissible which will use a user preference \n // to save that is has been dismissed - This update that is has been dismissed and not show again\n // if (this.showImportantMessage) {\n // this.userSettingsService.updateUserPreferenceBooleanValue('ShowAWSMaintenanceAlert', false);\n // }\n\n this.userSettingsService.updateUserPreferenceBooleanValue('ShowSurveyModal', false);\n this.layoutService.confirmationConfirmed();\n this.showImportantMessage = false;\n }\n\n onTakeClick(): void {\n this.userSettingsService.updateUserPreferenceBooleanValue('ShowSurveyModal', false);\n this.layoutService.confirmationConfirmed();\n window.open(environment.survey_link, '_blank');\n }\n\n showImportantMessageDialog(): void {\n this.showImportantMessage = true;\n this.layoutService.showConfirmationWithSettings(this.importantMessageConfirmationSettings);\n }\n}\n","\n\n
\n
\n

{{ 'ImportantMessageModalTitle' | ezLocale }}

\n\t\t\t
\n
\n
\n \n \n
\n
\n
\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, ViewChild } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, map } from 'rxjs/operators';\nimport { MenuItem } from 'primeng/api';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\n\nimport { appversion } from '@src/environments/appversion';\n\nimport { TmsMessageService } from '@app-shared/services/tms-message.service';\n\nimport { ConnectionState } from '@ssv/signalr-client';\nimport { AuthService } from '@app-core/auth/auth.service';\nimport { LocalizationService } from '@app-core/localization/localization.service';\nimport { ReportsAuthService } from '@app-core/auth/reports-auth.service';\nimport { UserSettingsService } from '@app-core/auth/user-settings.service';\nimport { LocationSettingsService } from '@app-core/auth/location-settings.service';\nimport { LocationModulesEnum } from '@app-core/auth/location-modules-enum';\nimport { AdministrationService } from '@app-shared/services/administration.service';\nimport { SharedStateFacade } from '@app-root/state/shared-state/shared-state.facade';\n\nimport { TmsIframeComponent } from '../tms-iframe/tms-iframe.component';\n\nimport * as appRouter from '@app-root/state/router-state';\nimport * as fromTheme from 'src/app/shared/state/theme-state';\nimport * as themeActions from '@app-shared/state/theme-state/theme.actions';\n\nimport { EzSocketService } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { EZLayoutService, EzSidemenuComponent } from '@ezuiaws/ez.ui.packages/ez-layout';\nimport { EzStoreService } from '@ezuiaws/ez.ui.packages/ez-store';\n\nimport { EZLeaguesUserResponse } from '@app-autogen/ez.ezleagues/contracts/response/ez-leagues-user-response';\nimport { TmsMessage } from '@app-autogen/ez.common/contracts/reference-objects/tms-message';\nimport { TmsMessageType } from '@app-autogen/ez.common/contracts/reference-objects/tms-message-type';\nimport { SessionResponse } from '@app-autogen/ez.authentication/contracts/response/session-response';\nimport { AsyncPipe, NgIf, NgClass } from '@angular/common';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-sidebar',\n\ttemplateUrl: './sidebar.component.html',\n\tstyleUrls: ['./sidebar.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [\n\t\tEzSidemenuComponent,\n\t\tAsyncPipe,\n\t\tNgIf,\n\t\tNgClass,\n\t\tTmsIframeComponent\n\t]\n})\nexport class SidebarComponent implements OnInit {\n\n @ViewChild('tmsIframeSelfCheckin') tmsIframeSelfCheckin: TmsIframeComponent;\n\n @Input() isDesktopDevice: boolean = false;\n @Input() isTabletDevice: boolean = false;\n @Input() isMobileDevice: boolean = false;\n\n showSideBar$: Observable = this.layoutService.showSidebar$;\n\n environment: string = this.authService.getEnvironment();\n\n build: string = '';\n connectionState: string = 'red';\n\n navigationMenu$: BehaviorSubject = new BehaviorSubject([]);\n\n sessionUser: SessionResponse = this.userSettingsService.userSession;\n\n routerUrl: string = '';\n viewDatebook = false;\n hasDirectDebitMerchantStreaming: boolean = undefined;\n ezlUser: EZLeaguesUserResponse = null;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private authService: AuthService,\n private tmsMessageService: TmsMessageService,\n private router: Router,\n private layoutService: EZLayoutService,\n private storeHelper: EzStoreService,\n private ezSocketService: EzSocketService,\n private reportsAuthService: ReportsAuthService,\n private userSettingsService: UserSettingsService,\n private locationSettingsService: LocationSettingsService,\n private themeStoreHelper: EzStoreService,\n private administrationService: AdministrationService,\n private sharedStateFacade: SharedStateFacade\n ) { }\n\n ngOnInit() {\n this.administrationService.showCloverAuthentication();\n this.setupNavigationItems();\n this.showDirectDebitBatches();\n this.getEZLeaguesCredentials();\n\n this.ezSocketService.getConnectionState().pipe(\n untilDestroyed(this),\n map((connectionState: ConnectionState) => {\n\n if (connectionState.status !== 'connected') {\n this.connectionState = 'red-dot';\n } else {\n this.connectionState = 'green-dot';\n }\n\n // Force the dot to change if any state change is detected.\n this.cdr.detectChanges();\n })\n ).subscribe();\n\n this.tmsMessageService.tmsMessages$.pipe(\n untilDestroyed(this),\n ).subscribe((msg: TmsMessage) => {\n\n let rebuildNavigationItems: boolean = false;\n\n if (msg.MessageType === TmsMessageType.ScheduleDatebook\n || msg.MessageType === TmsMessageType.ScheduleEzView) {\n this.viewDatebook = msg.MessageType === TmsMessageType.ScheduleDatebook;\n rebuildNavigationItems = true;\n }\n\n if (msg.MessageType === TmsMessageType.StaffCheckInNavigateToClientProfile || msg.MessageType === TmsMessageType.GotoClientDetails) {\n void this.router.navigateByUrl(`/clients/client/profile/${msg.Message}`);\n rebuildNavigationItems = true;\n }\n\n if (rebuildNavigationItems) {\n this.setupNavigationItems();\n }\n });\n\n this.storeHelper.stateStreamSelector(appRouter.getRouterFeatureState).pipe(\n map(route => route.state.url),\n distinctUntilChanged(),\n untilDestroyed(this)\n ).subscribe((url: string) => {\n this.routerUrl = url;\n this.setupNavigationItems();\n });\n\n this.administrationService.hasCloverMerchantSetUp$.pipe(\n untilDestroyed(this),\n ).subscribe((result: boolean) => {\n this.setupNavigationItems();\n });\n }\n\n toggleMenu() {\n this.layoutService.toggleSidebar();\n }\n\n getEZLeaguesCredentials() {\n\n this.sharedStateFacade.ezleaguesUser$.pipe(\n untilDestroyed(this)\n ).subscribe((result: EZLeaguesUserResponse) => {\n this.ezlUser = result;\n this.setupNavigationItems();\n });\n\n }\n\n showDirectDebitBatches() {\n this.themeStoreHelper.dispatchAction(themeActions.getDirectDebitMerchantIsStreaming());\n this.themeStoreHelper.stateStreamSelector(fromTheme.getDirectDebitMerchantIsStreaming)\n .pipe(\n filter(result => result != undefined),\n untilDestroyed(this)\n )\n .subscribe((result: boolean) => {\n this.hasDirectDebitMerchantStreaming = result;\n this.getBillingHasDirectMerchant();\n });\n }\n\n private setupNavigationItems() {\n const navigationMenu: MenuItem[] = [\n // { label: 'Dashboard', icon: 'pi pi-chart-bar', routerLink: ['/dashboard'] }\n ];\n\n // Administration\n const administrationItems = this.administrationService.getAdministrationItems();\n if (administrationItems.length) {\n const expanded: boolean = this.routerUrl.indexOf('/admin') >= 0;\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.Administration,\n icon: 'pi pi-cog',\n routerLink: ['/admin'],\n styleClass: `has-submenu ${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n items: administrationItems\n }\n ]);\n }\n\n // Attendance\n if (this.userSettingsService.userHasPermission('MarkMyAttendance')\n || this.userSettingsService.userHasPermission('MarkNoShow')\n || this.userSettingsService.userHasPermission('MarkEarlyCancel')\n || this.userSettingsService.userHasPermission('MarkLateCancel')\n || this.userSettingsService.userHasPermission('MarkLateCancelPayTrainer')\n || this.userSettingsService.userHasPermission('MarkReserved')\n || this.userSettingsService.userHasPermission('MarkWaitlist')) {\n const expanded: boolean = this.routerUrl.indexOf('/attendance') >= 0;\n\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.Attendance,\n icon: 'pi pi-check',\n routerLink: ['/attendance'],\n styleClass: `${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n }\n ]);\n }\n\n // CheckinMode\n if (this.locationSettingsService.locationHasModule(LocationModulesEnum.HasCheckIn)\n && this.userSettingsService.userHasPermission('CheckinMode')) {\n\n const includeCheckInDashboard: boolean = this.locationSettingsService.getLocationPreferenceBooleanValue('EnableCheckout');\n const checkInNavigationItem = this.getCheckInNavigationItems(includeCheckInDashboard, this.sessionUser.selfCheckinAuthorizationToken);\n navigationMenu.push(...checkInNavigationItem);\n }\n\n // Clients\n if (this.userSettingsService.userHasPermission('ViewClientList')) {\n navigationMenu.push(...this.getClientsSubItems());\n }\n\n // Email Campaigns\n const canSeeNewEmailCampaign: boolean = this.locationSettingsService.locationHasModule(LocationModulesEnum.HasNewEmailCampaign) &&\n (this.userSettingsService.userHasPermission('LimitedAccessEmailCampaign') || this.userSettingsService.userHasPermission('FullAccessEmailCampaign') || this.userSettingsService.userHasPermission('ViewOnlyAccessEmailCampaign'));\n if (canSeeNewEmailCampaign) {\n navigationMenu.push(...this.getEmailCampaignsItems());\n }\n\n // Equipment\n if (this.locationSettingsService.locationHasModule(LocationModulesEnum.HasEquipment)\n && this.userSettingsService.userHasPermission('OperateEquipment')) {\n\n const expanded: boolean = this.routerUrl.indexOf('/equipment') >= 0;\n\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.Equipment,\n icon: 'pi pi-tags',\n routerLink: ['/equipment'],\n styleClass: `${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n }\n ]);\n }\n\n // EZleagues\n if (this.locationSettingsService.locationHasModule(LocationModulesEnum.HasEZleagues)) {\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.EZLeaguesNoSpacing,\n icon: 'pi pi-circle-off',\n routerLink: null,\n command: () => {\n this.authService.openEZLInNewWindow('/admin/administration.aspx', this.ezlUser);\n }\n }\n ]);\n }\n\n // EZSignUp\n if (this.locationSettingsService.locationHasModule(LocationModulesEnum.HasSmuRegistrations)) {\n const expanded: boolean = this.routerUrl.indexOf('/ezsignup') >= 0;\n\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.EZSignUp,\n icon: 'pi pi-book',\n routerLink: ['/ezsignup'],\n styleClass: `${expanded ? 'is-expanded' : ''}`,\n expanded: expanded\n }\n ]);\n }\n\n // Groups\n if (this.userSettingsService.userHasPermission('ViewGroups')) {\n navigationMenu.push(...this.getGroupsItems());\n }\n\n // Lockers\n if (this.locationSettingsService.locationHasModule(LocationModulesEnum.HasLockers)\n && this.userSettingsService.userHasPermission('OperateLockerRooms')\n && (this.environment === 'Development' || this.environment === 'QA')) {\n const expanded: boolean = this.routerUrl.indexOf('/locker-rooms') >= 0;\n\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.Lockers,\n icon: 'pi pi-lock',\n routerLink: ['/locker-rooms'],\n styleClass: `${expanded ? 'is-expanded' : ''}`,\n }\n ]);\n }\n\n // POS\n if ((this.locationSettingsService.locationHasModule(LocationModulesEnum.HasPOS) || this.locationSettingsService.locationHasModule(LocationModulesEnum.HasPOSv2))\n && this.userSettingsService.userHasPermission('OperatePOS')) {\n navigationMenu.push(...[\n { label: LocalizationService.rks.POS, icon: 'pi pi-money-bill', url: this.authService.uiWebOptions.PointOfSaleURL + '/login', target: '_blank' },\n ]);\n }\n\n // Reports\n const reportItems = this.getReportItems();\n if (reportItems.length) {\n const expanded: boolean = this.routerUrl.indexOf('/reports') >= 0;\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.Reports,\n icon: 'pi pi-table',\n styleClass: `has-submenu ${expanded ? 'is-expanded' : ''}`,\n routerLink: ['/reports'],\n items: reportItems,\n expanded: expanded,\n }\n ]);\n }\n\n // Schedule\n if (this.userSettingsService.userHasPermission('ViewSchedule')) {\n const noPaddingQueryParams: boolean = !(this.environment === 'Development' || this.environment === 'QA');\n const expanded: boolean = this.routerUrl.indexOf('/schedule') >= 0\n && this.routerUrl.indexOf('clients/client/schedule') === -1\n && this.routerUrl.indexOf('email-campaigns/campaigns/scheduled') === -1;\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.Schedule,\n icon: 'pi pi-calendar-times',\n styleClass: `has-submenu ${expanded ? 'is-expanded' : ''}`,\n routerLink: ['/schedule'],\n queryParams: noPaddingQueryParams ? { 'noPadding': true } : null,\n expanded: expanded,\n items: this.getScheduleSubItems()\n }\n ]);\n }\n\n // TimeClock\n if (this.locationSettingsService.locationHasModule(LocationModulesEnum.HasTimeClock)\n && this.userSettingsService.userHasPermission('AccessTimeClock')) {\n const expanded: boolean = this.routerUrl.indexOf('/timeclock') >= 0;\n navigationMenu.push(...[\n {\n label: LocalizationService.rks.TimeClock,\n icon: 'pi pi-clock',\n routerLink: ['/timeclock'],\n styleClass: `${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n }\n ]);\n }\n\n // Temporary removed RegEngine link from sidebar due to task #29586\n if (this.environment === 'Development') {\n navigationMenu.push(...[\n { label: LocalizationService.rks.RegEngine, icon: 'pi pi-bolt', routerLink: ['/reg-engine'] }\n ]);\n }\n\n if (this.sessionUser.adminLevel >= 100 || this.environment === 'Development') {\n navigationMenu.push(...[\n { label: LocalizationService.rks.Support, icon: 'pi pi-info-circle', routerLink: ['/support'] }\n ]);\n }\n\n if (this.environment === 'Development') {\n navigationMenu.push(...[\n { label: LocalizationService.rks.Chat, icon: 'pi pi-comments', routerLink: ['/chat'] },\n ]);\n }\n\n this.navigationMenu$.next(navigationMenu);\n this.build = appversion.build;\n }\n\n private getScheduleSubItems(): MenuItem[] {\n const view = this.viewDatebook ? 'datebook' : 'ez-view';\n const expanded: boolean = this.routerUrl.indexOf('/schedule') >= 0;\n const items: MenuItem[] = [\n { label: LocalizationService.rks.Day, styleClass: 'is-subitem', routerLink: ['/schedule'], queryParams: { 'view': view, 'mode': 'day', 'noPadding': true }, visible: expanded },\n { label: LocalizationService.rks.Week, styleClass: 'is-subitem', routerLink: ['/schedule'], queryParams: { 'view': view, 'mode': 'week', 'noPadding': true }, visible: expanded },\n { label: LocalizationService.rks.Month, styleClass: 'is-subitem', routerLink: ['/schedule'], queryParams: { 'view': view, 'mode': 'month', 'noPadding': true }, visible: expanded },\n { label: this.viewDatebook ? LocalizationService.rks.EZView : LocalizationService.rks.Datebook, styleClass: 'is-subitem', routerLink: ['/schedule'], queryParams: { 'view': this.viewDatebook ? 'ez-view' : 'datebook', 'noPadding': true }, visible: expanded },\n\n ];\n if (this.userSettingsService.userHasPermission('ViewClients')) {\n items.push({ label: LocalizationService.rks.Search, styleClass: 'is-subitem', routerLink: ['/schedule/search'], queryParams: { 'adjustHeight': true } });\n }\n\n return items;\n }\n\n private getClientsSubItems(): MenuItem[] {\n\n const subitems: MenuItem[] = [];\n\n if (this.userSettingsService.userHasPermission('ViewClients')\n && this.userSettingsService.userHasPermission('ViewClientList')\n && this.userSettingsService.userHasPermission('EditClients')) {\n subitems.push({ label: LocalizationService.rks.AuditClients, styleClass: 'is-subitem', routerLink: ['/clients/audit-clients'] });\n }\n\n if (this.userSettingsService.userHasPermission('BillingStatements')) {\n subitems.push({ label: LocalizationService.rks.BillingStatements, styleClass: 'is-subitem', routerLink: ['/clients/billing-statements'] });\n }\n\n const expanded: boolean = this.routerUrl.indexOf('/clients') >= 0;\n\n return [\n {\n label: LocalizationService.rks.Clients,\n icon: 'pi pi-users',\n routerLink: ['/clients'],\n styleClass: `has-submenu ${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n items: subitems\n }\n ];\n }\n\n private getEmailCampaignsItems(): MenuItem[] {\n const emailCampaignSubItems: MenuItem[] = [];\n emailCampaignSubItems.push(\n { label: LocalizationService.rks.Drafts, styleClass: 'is-subitem', routerLink: ['/email-campaigns/campaigns/drafts'] }\n );\n if (this.userSettingsService.userHasPermission('FullAccessEmailCampaign')) {\n emailCampaignSubItems.push(\n { label: LocalizationService.rks.NewCampaign, styleClass: 'is-subitem', routerLink: ['/email-campaigns/campaigns/new-campaign'] }\n );\n }\n emailCampaignSubItems.push(\n { label: LocalizationService.rks.Scheduled, styleClass: 'is-subitem', routerLink: ['/email-campaigns/campaigns/scheduled'] }\n );\n emailCampaignSubItems.push(\n { label: LocalizationService.rks.Sent, styleClass: 'is-subitem', routerLink: ['/email-campaigns/campaigns/sent'] }\n );\n\n const subitems: MenuItem[] = [\n {\n label: LocalizationService.rks.Campaigns, styleClass: 'is-subitem has-submenu',\n expanded: this.routerUrl.indexOf('/email-campaigns/campaigns') >= 0,\n items: emailCampaignSubItems\n },\n {\n label: LocalizationService.rks.FailedEmails,\n expanded: this.routerUrl.indexOf('/email-campaigns/failed-emails') >= 0,\n styleClass: 'is-subitem',\n routerLink: ['/email-campaigns/failed-emails']\n }\n ];\n\n const expanded: boolean = this.routerUrl.indexOf('/email-campaigns') >= 0;\n\n return [\n {\n label: LocalizationService.rks.EmailCampaigns,\n icon: 'pi pi-envelope',\n styleClass: `has-submenu ${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n items: subitems\n }\n ];\n }\n\n private getGroupsItems(): MenuItem[] {\n const expanded: boolean = this.routerUrl.indexOf('/groups') >= 0;\n return [{\n label: LocalizationService.rks.Groups,\n icon: 'pi pi-sitemap',\n styleClass: `${expanded ? 'is-expanded' : ''}`,\n routerLink: ['/groups'],\n }];\n }\n\n private getCheckInNavigationItems(includeCheckInDashboard: boolean, selfCheckinToken: string) {\n const checkInItems: MenuItem[] = [\n {\n label: LocalizationService.rks.StaffCheckIn, styleClass: 'is-subitem', routerLink: null,\n command: () => {\n this.authService.openTmsInNewWindow('checkinlite.aspx', 'scrollbars=yes,width=805,height=800');\n }\n },\n {\n label: LocalizationService.rks.SelfCheckIn, styleClass: 'is-subitem', routerLink: null,\n command: () => {\n this.tmsIframeSelfCheckin.addPostValue('SelfCheckinToken', selfCheckinToken);\n this.tmsIframeSelfCheckin.submitForm(false);\n }\n }\n ];\n\n if (includeCheckInDashboard) {\n checkInItems.push(\n {\n label: LocalizationService.rks.CheckInDashboard,\n styleClass: 'is-subitem',\n routerLink: ['/checkin/checkin-dashboard'],\n queryParams: { 'adjustHeight': true }\n }\n );\n }\n\n const expanded: boolean = this.routerUrl.indexOf('/checkin') >= 0;\n\n return [\n {\n label: LocalizationService.rks.CheckIn,\n icon: 'pi pi-id-card',\n styleClass: `has-submenu ${expanded ? 'is-expanded' : ''}`,\n expanded: expanded,\n items: checkInItems\n }\n ];\n }\n\n private getBillingHasDirectMerchant() {\n const tempMenu = this.navigationMenu$.value;\n const adminLevel = this.getMenuItem(tempMenu, 'Administration');\n const billingLevel = this.getMenuItem(adminLevel.items, 'Billing');\n\n if (this.hasDirectDebitMerchantStreaming && this.userSettingsService.userHasPermission('AccountAdministration')) {\n billingLevel.items.push(...[\n { label: LocalizationService.rks.DirectDebitBatches, styleClass: 'is-subitem', routerLink: ['/admin/billing/direct-debit-batches'], queryParams: { 'adjustHeight': true } }\n ]);\n }\n\n this.navigationMenu$.next(tempMenu);\n }\n\n private getReportItems() {\n const reportItems = [];\n\n if (this.reportsAuthService.showFinancialReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.Financial, styleClass: 'is-subitem', routerLink: ['/reports/financial-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showTrainingReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.Training, styleClass: 'is-subitem', routerLink: ['/reports/training-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showVenueBookingReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.VenueBooking, styleClass: 'is-subitem', routerLink: ['/reports/venue-booking-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showEquipmentReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.Equipment, styleClass: 'is-subitem', routerLink: ['/reports/equipment-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showTimeClockReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.TimeClock, styleClass: 'is-subitem', routerLink: ['/reports/timeclock-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showMembershipReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.Membership, styleClass: 'is-subitem', routerLink: ['/reports/membership-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showPointOfSalesReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.PointOfSales, styleClass: 'is-subitem', routerLink: ['/reports/point-of-sales-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showMarketingReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.Marketing, styleClass: 'is-subitem', routerLink: ['/reports/marketing-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showSystemUsageReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.SystemUsage, styleClass: 'is-subitem', routerLink: ['/reports/system-usage-reports'] }\n ]);\n }\n\n if (this.reportsAuthService.showLockerReports()) {\n reportItems.push(...[\n { label: LocalizationService.rks.Locker, styleClass: 'is-subitem', routerLink: ['/reports/locker-reports'] }\n ]);\n }\n\n return reportItems;\n }\n\n private getMenuItem(array: any, label: string): any {\n return array.find(item => item.label === label);\n }\n}\n\n","\n \n \n
\n \"logo-image\"\n\n
\n
\n \n
\n \"logo-image\"\n\n
\n
\n \"collapse-menu-arrow-icon\"\n\n
\n
{{ build }}
\n \n
\n
\n \n \n \n \n
\n","import { Component, OnInit, Renderer2, ViewEncapsulation } from '@angular/core';\nimport { BehaviorSubject, Observable, combineLatest, defaultIfEmpty, filter, map } from 'rxjs';\nimport * as appRouter from '@app-root/state/router-state';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { distinctUntilChanged } from 'rxjs/operators';\n\nimport { EzStoreService } from '@ezuiaws/ez.ui.packages/ez-store';\nimport { EZLayoutService, EzLayoutModule } from '@ezuiaws/ez.ui.packages/ez-layout';\nimport { EzNotificationService } from '@ezuiaws/ez.ui.packages/ez-notification';\nimport { NotificationModel, BannerNotificationModel } from '@ezuiaws/ez.ui.models';\nimport { EzStatisticsService } from '@ezuiaws/ez.ui.packages/ez-statistics';\nimport { UserSettingsService } from '@app-core/auth/user-settings.service';\nimport { NgClass, AsyncPipe } from '@angular/common';\nimport { RouterOutlet } from '@angular/router';\nimport { FooterComponent } from '@app-shared/layout/footer/footer.component';\nimport { HeaderComponent } from '@app-shared/layout/header/header.component';\nimport { ImportantMessageComponent } from '@app-shared/layout/important-message/important-message.component';\nimport { SidebarComponent } from '@app-shared/layout/sidebar/sidebar.component';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-full-layout',\n\ttemplateUrl: './full-layout.component.html',\n\tstyleUrls: ['./full-layout.component.scss'],\n\t// View Encapsulation is set to none so that the html in coming from the innerHtml can be styled.\n\tencapsulation: ViewEncapsulation.None,\n\timports: [\n\t\tNgClass,\n\t\tAsyncPipe,\n\t\tRouterOutlet,\n\t\tFooterComponent,\n\t\tEzLayoutModule,\n\t\tHeaderComponent,\n\t\tImportantMessageComponent,\n\t\tSidebarComponent\n\t]\n})\nexport class FullLayoutComponent implements OnInit {\n\n showSideModal$: Observable = this.layoutService.showSideModal$;\n showSideBar$: Observable = this.layoutService.showSidebar$;\n isDesktopDevice$: Observable = this.ezStatisticsService.isDesktopDevice$;\n isTabletDevice$: Observable = this.ezStatisticsService.isTabletDevice$;\n isMobileDevice$: Observable = this.ezStatisticsService.isMobileDevice$;\n isIphone$: Observable = this.ezStatisticsService.isIphone$;\n isSafariBrowser$: Observable = this.ezStatisticsService.isSafariBrowser$;\n\n noRouterOutletPadding: boolean = false;\n adjustHeight: boolean = false;\n\n banners$: Observable = this.ezNotificationService.banners$.pipe(\n filter((banners: NotificationModel[]) => !!banners.length),\n map((banners: NotificationModel[]) => {\n const isSurveyIncluded = !!banners.find(banner => banner.NotificationType === BannerNotificationModel.Survey)\n && this.userSettingsService.getUserPreferenceBooleanValue('ShowGlobalNotification');\n\n if (!this.userSettingsService.getUserPreferenceBooleanValue('ShowGlobalNotification')\n && !!banners.find(banner => banner.NotificationType === BannerNotificationModel.Survey)) {\n this.ezNotificationService.removeSurveyBanner();\n }\n this.isSurveyBannerIncluded$.next(isSurveyIncluded);\n return banners.filter(banner => banner.Enabled && !!banner.NotificationText.trim());\n }));\n\n isSurveyBannerIncluded$: BehaviorSubject = new BehaviorSubject(false);\n conditionalBanner$: Observable = this.ezNotificationService.conditionalBanners$;\n\n\n constructor(\n private layoutService: EZLayoutService,\n private storeHelper: EzStoreService,\n private renderer: Renderer2,\n private ezNotificationService: EzNotificationService,\n private ezStatisticsService: EzStatisticsService,\n private userSettingsService: UserSettingsService\n ) { }\n\n ngOnInit() {\n this.configureSidebar();\n this.watchSideBarValueChanges();\n this.configureHeightAndPadding();\n this.subscribeOnBannerLength();\n }\n\n //Set default view of sidebar to be collapsed if device is not desktop\n private configureSidebar() {\n combineLatest([this.isDesktopDevice$, this.isTabletDevice$, this.isMobileDevice$, this.isIphone$, this.isSafariBrowser$]).pipe(\n untilDestroyed(this),\n ).subscribe(([isDesktopDevice, isTabletDevice, isMobileDevice, isIphone, isSafariBrowser]) => {\n\n this.renderer.removeClass(document.body, 'tablet-view');\n this.renderer.removeClass(document.body, 'mobile-view');\n\n if (!isDesktopDevice) {\n this.layoutService.toggleSidebar();\n }\n if (isTabletDevice) {\n this.renderer.addClass(document.body, 'tablet-view');\n }\n if (isMobileDevice) {\n this.renderer.addClass(document.body, 'mobile-view');\n }\n if (isMobileDevice && isIphone) {\n this.renderer.addClass(document.body, 'iphone');\n }\n if (isSafariBrowser) {\n this.renderer.addClass(document.body, 'safari');\n }\n });\n }\n\n private watchSideBarValueChanges() {\n this.showSideBar$\n .pipe(\n distinctUntilChanged(),\n untilDestroyed(this)\n ).subscribe((showSideBar: boolean) => {\n if (showSideBar) {\n this.renderer.removeClass(document.body, 'mini-navbar');\n } else {\n this.renderer.addClass(document.body, 'mini-navbar');\n }\n });\n }\n\n private configureHeightAndPadding() {\n this.storeHelper.stateStreamSelector(appRouter.getRouterFeatureState)\n .pipe(untilDestroyed(this))\n .subscribe((route) => {\n this.noRouterOutletPadding = !!route.state.queryParams?.noPadding;\n this.adjustHeight = !!route.state.queryParams?.adjustHeight;\n });\n }\n\n private subscribeOnBannerLength() {\n combineLatest([\n this.banners$.pipe(defaultIfEmpty([])),\n this.conditionalBanner$.pipe(defaultIfEmpty([]))\n ]).pipe(untilDestroyed(this))\n .subscribe(([banners, conditionalBanner]) => {\n const count = (banners?.length || 0) + (conditionalBanner?.length || 0);\n document.documentElement.style.setProperty(\"--banner-count\", count.toString());\n });\n }\n}\n","\n
\n \n\n \n \n \n
\n \n \n
\n \n \n \n \n\n
\n\n\n\n","import { Component, OnInit } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n\tselector: 'app-no-sidebar-layout',\n\ttemplateUrl: './no-sidebar-layout.component.html',\n\tstyleUrls: ['./no-sidebar-layout.component.scss'],\n\timports: [\n\t\tRouterOutlet\n\t]\n})\nexport class NoSidebarLayoutComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","\n
\n\n\n \n
\n\n\n \n \n\n\n \n \n\n
\n \n\n
\n\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';\nimport { AuthService } from './auth.service';\nimport { Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoginGuardService {\n\n constructor(\n public authService: AuthService,\n public router: Router\n ) {\n }\n\n canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree {\n return of(route.queryParams?.jwt).pipe(\n mergeMap(jwt => {\n if (jwt) {\n this.authService.clearLocalStorage();\n const claims = this.authService.decodeJwt(jwt);\n\n if (claims && claims.UserId && claims.LocationId) {\n this.authService.loginSingleSignOn(claims.UserId, claims.LocationId, jwt);\n\n //set a timeout to reload the page in case it gets stuck from the redirect and is still on the login page\n setTimeout(() => {\n if (this.router.url.indexOf('login') > 0) {\n window.location.reload();\n }\n }, 10000);\n }\n return of(false);\n }\n\n return of(this.authService.getIsUserAuthorized());\n }),\n\n map((isUserAuth) => {\n if (isUserAuth) {\n\n this.router.navigate(['/']);\n return false;\n }\n this.authService.setApplicationIsInitialized(true);\n return true;\n })\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\nimport { SharedStateFacade } from '@src/app/state/shared-state/shared-state.facade';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthResolver {\n\n constructor(private sharedStateFacade: SharedStateFacade) {\n }\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {\n this.sharedStateFacade.fetchLocations();\n return true;\n }\n}\n","import { EzStoreService } from '@ezuiaws/ez.ui.packages/ez-store';\nimport { Component, OnInit } from '@angular/core';\nimport * as appRouter from '@app-root/state/router-state';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { TmsIframeComponent } from '@app-shared/layout/tms-iframe/tms-iframe.component';\n\n@UntilDestroy()\n@Component({\n\tselector: 'app-access-denied-iframe',\n\ttemplateUrl: './access-denied-iframe.component.html',\n\timports: [\n\t\tTmsIframeComponent\n\t],\n\tstyleUrls: ['./access-denied-iframe.component.scss']\n})\nexport class AccessDeniedIframeComponent implements OnInit {\n route = '';\n constructor(private storeHelper: EzStoreService) { }\n\n ngOnInit() {\n this.storeHelper.stateStreamSelector(appRouter.getRouterFeatureState).pipe(\n untilDestroyed(this)\n ).subscribe(route => {\n if (route.state.queryParams?.permissionCode) {\n const permissionCode = route.state.queryParams?.permissionCode;\n this.route = 'access_denied.aspx?PermissionCode=' + permissionCode;\n } else {\n this.route = 'access_denied.aspx';\n }\n });\n }\n}\n","\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { ClientAccessibleToUserState, CLIENT_ACCESS_FEATURE_KEY, State } from './client-accessible-to-user.reducer';\n\nconst getState = createFeatureSelector(CLIENT_ACCESS_FEATURE_KEY);\n\nexport const getClientIsAccessibleForUser = createSelector(\n getState,\n state => state.clientIsAccessibleForUser\n);\n","import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { EzStoreService } from '@ezuiaws/ez.ui.packages/ez-store';\nimport { Observable, of } from 'rxjs';\n\nimport * as ClientAccessibleToUserSelector from '@app-shared/state/client-accessible-to-user-state/client-accessible-to-user.selector';\nimport * as ClientAccessibleToUserActions from '@app-shared/state/client-accessible-to-user-state/client-accessible-to-user.actions';\nimport * as fromClientAccessibleToUser from '@app-shared/state/client-accessible-to-user-state/client-accessible-to-user.reducer';\n\nimport { filter, map } from 'rxjs/operators';\nimport { GetClientIsAccessibleForUserRequest } from '@app-autogen/ez.client/contracts/request/get-client-is-accessible-for-user-request';\nimport { GetClientIsAccessibleForUserResponse } from '@app-autogen/ez.client/contracts/response/get-client-is-accessible-for-user-response';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ClientAccessibleToUserGuardService {\n\n constructor(\n private router: Router,\n private clientAccessibleToUserStoreHelper: EzStoreService) {\n }\n\n canActivateChild(route: ActivatedRouteSnapshot): Observable {\n let activate: Observable = of(true);\n if (route.params.id) {\n activate = this.canActivateValidation(route);\n }\n return activate;\n }\n\n canActivateValidation(route: ActivatedRouteSnapshot): Observable {\n const request: GetClientIsAccessibleForUserRequest = {\n clientId: route.params.id,\n };\n\n this.clientAccessibleToUserStoreHelper.dispatchAction(ClientAccessibleToUserActions.getClientIsAccessibleForUser(request));\n\n return this.clientAccessibleToUserStoreHelper.stateStreamSelector(ClientAccessibleToUserSelector.getClientIsAccessibleForUser)\n .pipe(\n filter((getClientIsAccessibleForUserResponse: GetClientIsAccessibleForUserResponse) => !!getClientIsAccessibleForUserResponse),\n map((getClientIsAccessibleForUserResponse) => {\n const activate: boolean = getClientIsAccessibleForUserResponse.clientIsAccessibleForUser;\n if (!activate) {\n this.router.navigate(['access-denied']);\n }\n this.clientAccessibleToUserStoreHelper.dispatchAction(ClientAccessibleToUserActions.clearClientIsAccessibleForUser());\n return activate;\n })\n );\n }\n}\n","import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\nimport { AuthGuardService } from '@app-core/auth/auth-guard.service';\nimport { FullLayoutComponent } from '@app-shared/layout/full-layout/full-layout.component';\nimport { NoSidebarLayoutComponent } from '@app-shared/layout/no-sidebar-layout/no-sidebar-layout.component';\nimport { LoginGuardService } from '@app-core/auth/login-guard.service';\nimport { AuthResolver } from '@app-core/auth/auth.resolver';\nimport { AccessDeniedIframeComponent } from '@app-shared/components/access-denied-iframe/access-denied-iframe.component';\nimport { ClientAccessibleToUserGuardService } from '@app-core/auth/client-accessible-to-user-guard.service';\n\nconst routes: Routes = [\n { path: '', redirectTo: 'schedule', pathMatch: 'full' },\n {\n path: '', component: FullLayoutComponent, canActivateChild: [AuthGuardService], resolve: { resolver: AuthResolver }, children: [\n { path: 'dashboard', loadChildren: () => import('@app-root/dashboard-module/dashboard.module').then(m => m.DashboardModule) },\n {\n path: 'schedule',\n loadChildren: () => import('@app-root/schedule-module/schedule.module').then(m => m.ScheduleModule)\n },\n {\n path: 'clients',\n canActivateChild: [ClientAccessibleToUserGuardService],\n loadChildren: () => import('@app-root/clients-module/clients.module').then(m => m.ClientsModule)\n },\n {\n path: 'email-campaigns',\n loadChildren: () => import('@app-root/email-campaigns-module/email-campaigns.module').then(m => m.EmailCampaignsModule)\n },\n { path: 'groups', loadChildren: () => import('@app-root/groups-module/groups.module').then(m => m.GroupsModule) },\n { path: 'attendance', loadChildren: () => import('@app-root/attendance-module/attendance.module').then(m => m.AttendanceModule) },\n { path: 'equipment', loadChildren: () => import('@app-root/equipment-module/equipment.module').then(m => m.EquipmentModule) },\n { path: 'timeclock', loadChildren: () => import('@app-root/timeclock-module/timeclock.module').then(m => m.TimeClockModule) },\n { path: 'locker-rooms', loadChildren: () => import('@app-root/lockers-module/lockers.module').then(m => m.LockersModule) },\n { path: 'checkin', loadChildren: () => import('@app-root/checkin-module/checkin.module').then(m => m.CheckInModule) },\n { path: 'reports', loadChildren: () => import('@app-root/reports-module/reports.module').then(m => m.ReportsModule) },\n { path: 'support', loadChildren: () => import('@app-root/support-module/support.module').then(m => m.SupportModule) },\n { path: 'ezsignup', loadChildren: () => import('@app-root/registration-module/registration.module').then(m => m.RegistrationModule) },\n { path: 'reg-engine', loadChildren: () => import('@app-root/reg-engine-module/reg-engine.module').then(m => m.RegEngineModule) },\n { path: 'admin', loadChildren: () => import('@app-root/admin-module/admin.module').then(m => m.AdminModule) },\n { path: 'access-denied', component: AccessDeniedIframeComponent }\n ]\n },\n {\n path: '', component: NoSidebarLayoutComponent, children: [\n { path: 'login', canActivateChild: [LoginGuardService], loadChildren: () => import('@app-root/auth-module/auth.module').then(m => m.AuthModule) },\n { path: 'chat', resolve: { resolver: AuthResolver }, canActivateChild: [AuthGuardService], loadChildren: () => import('@src/app/chat-module/chat.module').then(m => m.ChatModule) },\n ]\n },\n { path: '**', redirectTo: 'schedule' }\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'top', onSameUrlNavigation: 'reload', bindToComponentInputs: true })],\n exports: [RouterModule]\n})\nexport class AppRoutingModule { }\n","import { NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\nimport { themeReducer, THEME_FEATURE_KEY } from '@app-shared/state/theme-state/theme.reducer';\n\n@NgModule({\n\tdeclarations: [],\n\timports: [\n\t\tStoreModule.forFeature(THEME_FEATURE_KEY, themeReducer)\n\t],\n\tproviders: []\n})\n\nexport class ThemeStateModule {\n}\n","/**\r\n * This is a TypeGen auto-generated file.\r\n * Any changes made to this file can be lost when this file is regenerated.\r\n */\r\n\r\nexport enum LoginResultStatuses {\r\n Success = 0,\r\n NoSuchUser = 1,\r\n LockedOut = 2,\r\n Disabled = 3,\r\n WrongPassword = 4,\r\n LocationCanceled = 5,\r\n LocationSuspended = 6,\r\n IpAddressNotAllowed = 7,\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { AuthService } from '@app-core/auth/auth.service';\nimport { tap } from 'rxjs/operators';\nimport { NotificationType } from '@app-autogen/ez.common/enums/notification-type';\nimport { LocalizationService } from '@app-core/localization/localization.service';\nimport { LoginResultStatuses } from '@app-autogen/ez.authentication/contracts/response/login-result-statuses';\nimport { EzNotificationService } from '@ezuiaws/ez.ui.packages/ez-notification';\nimport * as fromSessionActions from './session.actions';\nimport { SharedStateFacade } from '../shared-state/shared-state.facade';\n\n\n@Injectable()\nexport class SessionEffects {\n constructor(\n private actions$: Actions,\n private authService: AuthService,\n private notificationService: EzNotificationService,\n private sharedStateFacade: SharedStateFacade\n ) { }\n\n onGetUserSessionSuccess = createEffect(() =>\n this.actions$.pipe(\n ofType(fromSessionActions.getUserSessionSuccess),\n tap(({ payload }) => {\n this.authService.configureAppSettingsWithUserSessionData(payload);\n this.sharedStateFacade.fetchEZLeaguesUser(payload.userId);\n })\n ), { dispatch: false }\n );\n\n onUserLoginSuccess = createEffect(() =>\n this.actions$.pipe(\n ofType(fromSessionActions.userLoginSuccess, fromSessionActions.userSingleSignOnSuccess),\n tap(({ payload }) => {\n this.authService.setJwt(payload);\n void this.authService.signOnSignUpSuccess();\n })\n ), { dispatch: false }\n );\n\n onUserLoginFail = createEffect(() =>\n this.actions$.pipe(\n ofType(fromSessionActions.userLoginFail),\n tap(() => this.authService.setIsLogging(false)),\n tap(({ payload }) => {\n\n if (payload == LoginResultStatuses.IpAddressNotAllowed) {\n this.notificationService.sendFailNotification({\n type: NotificationType.error,\n title: LocalizationService.rks.Failed,\n message: LocalizationService.rks.LoginNotPermitted,\n });\n } else {\n\n this.notificationService.sendFailNotification({\n type: NotificationType.error,\n title: LocalizationService.rks.Failed,\n message: LocalizationService.rks.UserLoginFail,\n });\n }\n }),\n ), { dispatch: false }\n );\n\n onUserLogout = createEffect(() =>\n this.actions$.pipe(\n ofType(fromSessionActions.userLogout),\n tap(() => this.authService.logout())\n ), { dispatch: false }\n );\n\n onUserSessionOut = createEffect(() =>\n this.actions$.pipe(\n ofType(fromSessionActions.userSessionOut),\n tap(() => this.authService.logout()),\n tap(() => {\n this.notificationService.sendFailNotification({\n type: NotificationType.warning,\n title: LocalizationService.rks.Failed,\n message: LocalizationService.rks.UserSessionOut,\n });\n }),\n ), { dispatch: false }\n );\n}\n\n","import { FailResponseState } from '@src/app/state/fail-state/fail-state';\nimport * as FailsActions from '@src/app/state/fail-state/fails.actions';\nimport { ClientActionFailResponse } from '@app-autogen-socketmodels/client-action-fail-response';\nimport { ActionWithPayload } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { createReducer, on } from '@ngrx/store';\n\nconst initialState: FailResponseState = {\n failResponses: []\n};\n\nconst reducer = createReducer(\n initialState,\n on(FailsActions.addFailResponse, (state, { payload }) => {\n return {\n ...state,\n failResponses: [\n ...state.failResponses,\n payload\n ]\n };\n }),\n on(FailsActions.removeFailResponse, (state) => {\n return {\n ...state,\n failResponses: []\n };\n })\n);\n\n\nexport function FailResponseReducer(state: FailResponseState | undefined, action: ActionWithPayload) {\n return reducer(state, action);\n}\n","import * as SessionActions from './session.actions';\nimport { ActionWithPayload } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { createReducer, on } from '@ngrx/store';\nimport { SessionResponse } from '@app-autogen/ez.authentication/contracts/response/session-response';\nimport { SessionLoggingLevel } from '@app-autogen/ez.core/models/enums/session-logging-level';\nimport { SessionSupportStatus } from '@app-autogen/ez.core/models/enums/session-support-status';\n\nconst initialState: SessionResponse = {\n jwtToken: '',\n userGuid: '',\n currentLocationId: 0,\n currentCompanyId: 0,\n currentLocationTimeZone: '',\n currentLocationCurrencyCode: '',\n currentLocationCulture: '',\n currentLocationCountryCode: '',\n currentLocationPublicName: '',\n currentLocationName: '',\n currentLocationEmail: '',\n userId: 0,\n error: null,\n loggingLevel: SessionLoggingLevel.debug,\n supportStatus: SessionSupportStatus.nosupport,\n userName: '',\n firstName: '',\n lastName: '',\n userCalendarId: 0,\n userResourceId: 0,\n userResourceCalendarId: 0,\n userLocationId: 0,\n userIdentifier: '',\n isActive: true,\n emailAddress: '',\n adminLevel: 4,\n userPermissions: [],\n userPreferences: null,\n locationModules: null,\n locationPreferences: null,\n shareClientsAcrossLocations: false,\n selfCheckinAuthorizationToken: ''\n};\n\nconst reducer = createReducer(\n initialState,\n\n on(SessionActions.getUserSessionSuccess, (state, { payload }) => {\n return payload;\n }),\n\n on(SessionActions.clearUserSession, (state) => {\n return initialState;\n }),\n\n on(SessionActions.setCurrentLocationId, (state, { payload }) => {\n return {\n ...state,\n currentLocationId: payload\n };\n }),\n\n on(SessionActions.setCurrentCompanyId, (state, { payload }) => {\n return {\n ...state,\n currentCompanyId: payload\n };\n }),\n\n on(SessionActions.setCurrentLocationTimeZone, (state, { payload }) => {\n return {\n ...state,\n currentLocationTimeZone: payload\n };\n }),\n\n on(SessionActions.setCurrentUserId, (state, { payload }) => {\n return {\n ...state,\n userId: payload\n };\n }),\n\n\n on(SessionActions.setUserCalendarId, (state, { payload }) => {\n return {\n ...state,\n userCalendarId: payload\n };\n }),\n\n\n on(SessionActions.addGlobalError, (state, { payload }) => {\n return {\n ...state,\n error: payload\n };\n }),\n\n on(SessionActions.setUserName, (state, { payload }) => {\n return {\n ...state,\n userName: payload\n };\n }),\n\n on(SessionActions.setFirstName, (state, { payload }) => {\n return {\n ...state,\n firstName: payload\n };\n }),\n\n on(SessionActions.setLastName, (state, { payload }) => {\n return {\n ...state,\n lastName: payload\n };\n }),\n\n on(SessionActions.setLoggingLevel, (state, { payload }) => {\n return {\n ...state,\n loggingLevel: payload\n };\n }),\n\n on(SessionActions.setSupportStatus, (state, { payload }) => {\n return {\n ...state,\n supportStatus: payload\n };\n }),\n\n on(SessionActions.setClientConnectionGuid, (state, { payload }) => {\n return {\n ...state,\n userIdentifier: payload\n };\n })\n);\n\nexport function SessionReducer(state: SessionResponse | undefined, action: ActionWithPayload) {\n return reducer(state, action);\n}\n","import { AppDetailsState } from './app-details-state';\nimport { HubConnectionActivityResponse } from '@app-autogen/ez.core/contracts/support/response/hub-connection-activity-response';\nimport { HubActivity } from '@app-autogen/ez.core/contracts/support/response/hub-activity';\nimport * as AppDetailsActions from './app-details-actions';\nimport { ActionWithPayload } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { createReducer, on } from '@ngrx/store';\n\nconst initialState: AppDetailsState = {\n hubConnected: false,\n applicationInitialized: false,\n hubConnectionActivity: { hubActivity: [] },\n browserDetails: null,\n browserLocationDetails: null\n};\n\nconst reducer = createReducer(\n initialState,\n on(AppDetailsActions.setHubConnected, (state, { payload }) => {\n return {\n ...state,\n hubConnected: payload\n };\n }),\n\n on(AppDetailsActions.setAppInitiated, (state, { payload }) => {\n return {\n ...state,\n applicationInitialized: payload\n };\n }),\n\n on(AppDetailsActions.logConnectionActivity, (state, { payload }) => {\n const currentActivity = [...state.hubConnectionActivity.hubActivity, payload];\n const newHubConnectionActivity: HubConnectionActivityResponse = { hubActivity: currentActivity };\n\n return {\n ...state,\n hubConnectionActivity: newHubConnectionActivity\n };\n }),\n\n on(AppDetailsActions.setBrowserDetails, (state, { payload }): AppDetailsState => {\n return {\n ...state,\n browserDetails: payload\n };\n }),\n\n on(AppDetailsActions.setBrowserLocation, (state, { payload }): AppDetailsState => {\n return {\n ...state,\n browserLocationDetails: payload\n };\n })\n);\n\nexport function AppDetailsReducer(state: AppDetailsState | undefined, action: ActionWithPayload) {\n return reducer(state, action);\n}\n","/**\r\n * This is a TypeGen auto-generated file.\r\n * Any changes made to this file can be lost when this file is regenerated.\r\n */\r\n\r\nimport { MonitorPerformance } from './monitor-performance';\r\n\r\nexport class MonitorPerformanceInfoResponse {\r\n public monitorPerformance: MonitorPerformance[];\r\n}\r\n","/**\r\n * This is a TypeGen auto-generated file.\r\n * Any changes made to this file can be lost when this file is regenerated.\r\n */\r\n\r\nimport { EventLog } from './event-log';\r\n\r\nexport class EventLogResponse {\r\n public eventLog: EventLog[];\r\n}\r\n","import { SharedState } from './shared-state';\nimport { ActionWithPayload } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { createReducer, on } from '@ngrx/store';\nimport { MonitorPerformanceInfoResponse } from '@app-autogen/ez.core/contracts/monitor/response/monitor-performance-info-response';\nimport { EventLogResponse } from '@app-autogen/ez.errorlogging/contracts/response/event-log-response';\n\nimport * as SharedStateActions from './shared-state.actions';\n\nconst initialState: SharedState = {\n trainers: [],\n salesPeople: [],\n locations: null,\n smsProviders: [],\n locationInfo: null,\n locationContactPreferences: null,\n checkInStations: [],\n programFees: [],\n taxes: [],\n resources: null,\n reservationTypes: null,\n tShirtSizes: null,\n membershipTypes: [],\n documentTemplates: [],\n membershipPlans: null,\n loadingMembershipPlans: true,\n locationJobTypes: [],\n lockerRooms: [],\n dashboard: new MonitorPerformanceInfoResponse(),\n eventLogs: new EventLogResponse(),\n uiWebOptions: null,\n customFields: null,\n cashRegisters: null,\n ezleaguesUser: null,\n userHasPendingActivityItem: null\n};\nconst reducer = createReducer(\n initialState,\n on(SharedStateActions.getTrainersOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n trainers: payload\n };\n }),\n\n on(SharedStateActions.getTrainersOnLoadFail, (state) => {\n return {\n ...state,\n trainers: []\n };\n }),\n\n on(SharedStateActions.getSalesPeopleOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n salesPeople: payload\n };\n }),\n\n on(SharedStateActions.getSalesPeopleOnLoadFail, (state) => {\n return {\n ...state,\n salesPeople: []\n };\n }),\n\n on(SharedStateActions.getLocationsOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n locations: payload\n };\n }),\n\n on(SharedStateActions.getLocationsOnLoadFail, (state) => {\n return {\n ...state,\n locations: []\n };\n }),\n\n on(SharedStateActions.getSMSProvidersOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n smsProviders: payload\n };\n }),\n\n on(SharedStateActions.getSMSProvidersOnLoadFail, (state) => {\n return {\n ...state,\n smsProviders: []\n };\n }),\n\n on(SharedStateActions.getLocationInfoOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n locationInfo: payload\n };\n }),\n\n on(SharedStateActions.getLocationInfoOnLoadFail, (state) => {\n return {\n ...state,\n locationInfo: null\n };\n }),\n\n on(SharedStateActions.getCheckInStationsOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n checkInStations: payload\n };\n }),\n\n on(SharedStateActions.getCheckInStationsOnLoadFail, (state) => {\n return {\n ...state,\n checkInStations: null\n };\n }),\n\n on(SharedStateActions.getProgramFeesSuccess, (state, { payload }) => {\n return {\n ...state,\n programFees: payload\n };\n }),\n\n on(SharedStateActions.getProgramFeesFail, (state) => {\n return {\n ...state,\n programFees: null\n };\n }),\n\n on(SharedStateActions.getTaxesSuccess, (state, { payload }) => {\n return {\n ...state,\n taxes: payload\n };\n }),\n\n on(SharedStateActions.getTaxesFail, (state) => {\n return {\n ...state,\n taxes: null\n };\n }),\n\n on(SharedStateActions.getLocationContactPreferencesOnLoadSuccess,\n (state, { payload }) => {\n return {\n ...state,\n locationContactPreferences: payload\n };\n }),\n\n on(SharedStateActions.getResourcesAndScheduleGroupsSuccess, (state, { payload }) => {\n return {\n ...state,\n resources: payload\n };\n }),\n\n on(SharedStateActions.getResourcesAndScheduleGroupsFail, (state) => {\n return {\n ...state,\n resources: []\n };\n }),\n\n on(SharedStateActions.getReservationTypesOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n reservationTypes: payload\n };\n }),\n\n on(SharedStateActions.getReservationTypesOnLoadFail, (state) => {\n return {\n ...state,\n reservationTypes: []\n };\n }),\n\n on(SharedStateActions.getTShirtSizesOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n tShirtSizes: payload\n };\n }),\n\n on(SharedStateActions.getTShirtSizesOnLoadFail, (state) => {\n return {\n ...state,\n tShirtSizes: []\n };\n }),\n\n on(SharedStateActions.getMembershipPlansOnLoad, (state) => {\n return {\n ...state,\n loadingMembershipPlans: true\n };\n }),\n\n on(SharedStateActions.getMembershipPlansOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n membershipPlans: payload,\n loadingMembershipPlans: false\n };\n }),\n\n on(SharedStateActions.getMembershipPlansOnLoadFail, (state) => {\n return {\n ...state,\n membershipPlans: initialState.membershipPlans,\n loadingMembershipPlans: false\n };\n }),\n\n on(SharedStateActions.getMembershipTypesOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n membershipTypes: payload\n };\n }),\n\n on(SharedStateActions.getMembershipTypesOnLoadFail, (state) => {\n return {\n ...state,\n membershipTypes: []\n };\n }),\n on(SharedStateActions.getDocumentTemplateOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n documentTemplates: payload\n };\n }),\n\n on(SharedStateActions.getDocumentTemplateOnLoadFail, (state) => {\n return {\n ...state,\n documentTemplates: []\n };\n }),\n\n on(SharedStateActions.getLocationJobTypesOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n locationJobTypes: payload\n };\n }),\n\n on(SharedStateActions.getLocationJobTypesOnLoadFail, (state) => {\n return {\n ...state,\n locationJobTypes: []\n };\n }),\n\n on(SharedStateActions.getLockerRoomsSuccess, (state, { payload }) => {\n return {\n ...state,\n lockerRooms: payload\n };\n }),\n\n on(SharedStateActions.getLockerRoomsFail, (state) => {\n return {\n ...state,\n lockerRooms: []\n };\n }),\n\n on(SharedStateActions.getDashboardOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n dashboard: payload\n };\n }),\n\n on(SharedStateActions.getDashboardOnLoadFail, (state) => {\n return {\n ...state,\n dashboard: null\n };\n }),\n\n on(SharedStateActions.getDashboardWithTimeSuccess, (state, { payload }) => {\n return {\n ...state,\n dashboard: payload\n };\n }),\n\n on(SharedStateActions.getDashboardWithTimeFail, (state) => {\n return {\n ...state,\n dashboard: null\n };\n }),\n\n on(SharedStateActions.getEventLogOnLoadSuccess, (state, { payload }) => {\n return {\n ...state,\n eventLogs: payload\n };\n }),\n\n on(SharedStateActions.getEventLogOnLoadFail, (state) => {\n return {\n ...state,\n eventLogs: null\n };\n }),\n\n on(SharedStateActions.getEventLogTimeByRangeSuccess, (state, { payload }) => {\n return {\n ...state,\n eventLogs: payload\n };\n }),\n\n on(SharedStateActions.getEventLogTimeByRangeFail, (state) => {\n return {\n ...state,\n eventLogs: null\n };\n }),\n\n on(SharedStateActions.getEventLogTimeByRangeSuccess, (state, { payload }) => {\n return {\n ...state,\n eventLogs: payload\n };\n }),\n\n on(SharedStateActions.getUiWebOptionsSuccess, (state, { payload }) => {\n return {\n ...state,\n uiWebOptions: payload\n };\n }),\n\n on(SharedStateActions.getUiWebOptionsFail, (state) => {\n return {\n ...state,\n uiWebOptions: null\n };\n }),\n\n on(SharedStateActions.getCustomFieldsSuccess, (state, { payload }) => {\n return {\n ...state,\n customFields: payload.customFields\n };\n }),\n\n on(SharedStateActions.getCustomFieldsFail, (state) => {\n return {\n ...state,\n customFields: null\n };\n }),\n\n on(SharedStateActions.getCashRegistersSuccess, (state, { payload }) => {\n return {\n ...state,\n cashRegisters: payload.cashRegisters\n };\n }),\n\n on(SharedStateActions.getCashRegistersFail, (state) => {\n return {\n ...state,\n cashRegisters: null\n };\n }),\n\n on(SharedStateActions.getEZLUserSuccess, (state, { payload }) => {\n return {\n ...state,\n ezleaguesUser: payload\n };\n }),\n\n on(SharedStateActions.hasUserPendingActivityItemSuccess, (state, { payload }) => {\n return {\n ...state,\n userHasPendingActivityItem: payload.hasPendingActivity\n };\n }),\n\n on(SharedStateActions.hasUserPendingActivityItemFail, (state) => {\n return {\n ...state,\n userHasPendingActivityItem: null\n };\n }),\n\n on(SharedStateActions.clearMembershipPlansState, (state) => {\n return {\n ...state,\n membershipPlans: null\n };\n }),\n \n\n);\n\nexport function SharedStateReducer(state: SharedState | undefined, action: ActionWithPayload) {\n return reducer(state, action);\n}\n","import { Injectable } from '@angular/core';\nimport { tap } from 'rxjs/operators';\n\n// Module Imports\nimport { SocketHelperService } from '@app-core/socket/socket-helper.service';\nimport * as socketActions from './socket.actions';\n\n// NgRx/Redux - State\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { ActionWithPayload } from '@ezuiaws/ez.ui.packages/ez-socket';\n\n@Injectable()\nexport class SocketEffects {\n\n // constructor(private actions$: Actions, private socketHelperService: SocketHelperService) {}\n //\n // sendToHub$ = createEffect(() =>\n // this.actions$.pipe(\n // ofType(socketActions.relayToServer),\n // tap((action: ActionWithPayload) => this.socketHelperService.relayActionAddToQueue(action.payload))\n // ), { dispatch: false }\n // );\n}\n\n\n","import {\n RouteReuseStrategy,\n ActivatedRouteSnapshot,\n DetachedRouteHandle,\n RouterModule,\n Routes,\n UrlSegment\n} from '@angular/router';\n\n\nexport class CustomRouteReuseStrategy implements RouteReuseStrategy {\n\n private handlers: { [key: string]: DetachedRouteHandle } = {};\n\n /**\n * Determines if this route (and its subtree) should be detached to be reused later\n * @param route\n */\n shouldDetach(route: ActivatedRouteSnapshot): boolean {\n\n if (!route.routeConfig || route.routeConfig.loadChildren) {\n return false;\n }\n /** Whether this route should be re used or not */\n let shouldReuse = false;\n // console.log('[router-reuse] checking if this route should be re used or not', route);\n if (route.routeConfig.data) {\n route.routeConfig.data.shouldReuse ? shouldReuse = true : shouldReuse = false;\n }\n\n return shouldReuse;\n }\n\n /**\n * Stores the detached route.\n */\n store(route: ActivatedRouteSnapshot, handler: DetachedRouteHandle): void {\n // console.log('[router-reuse] storing handler');\n if (handler) {\n this.handlers[this.getUrl(route)] = handler;\n }\n }\n\n /**\n * Determines if this route (and its subtree) should be reattached\n * @param route Stores the detached route.\n */\n shouldAttach(route: ActivatedRouteSnapshot): boolean {\n // console.log('[router-reuse] checking if it should be re attached');\n return !!this.handlers[this.getUrl(route)];\n }\n\n /**\n * Retrieves the previously stored route\n */\n retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle {\n if (!route.routeConfig || route.routeConfig.loadChildren) {\n return null;\n };\n\n return this.handlers[this.getUrl(route)];\n }\n\n /**\n * Determines if a route should be reused\n * @param future\n * @param current\n */\n shouldReuseRoute(future: ActivatedRouteSnapshot, current: ActivatedRouteSnapshot): boolean {\n /**\n * Default reuse strategy by angular assers based on the following condition\n * @see https://github.com/angular/angular/blob/4.4.6/packages/router/src/route_reuse_strategy.ts#L67\n */\n let reUseUrl = (future.routeConfig === current.routeConfig);\n\n if (future.routeConfig) {\n if (future.routeConfig.data && typeof future.routeConfig.data.shouldReuse !== \"undefined\") {\n reUseUrl = future.routeConfig.data.shouldReuse;\n // console.log('%cshouldReuse', 'background-color:red;', future.routeConfig.data.shouldReuse);\n }\n }\n\n\n return reUseUrl;\n }\n\n /**\n * Returns a url for the current route\n * @param route\n */\n getUrl(route: ActivatedRouteSnapshot): string {\n /** The url we are going to return */\n if (route.routeConfig) {\n const url = route.routeConfig.path;\n // console.log('[router-reuse] returning url', url);\n\n return url;\n }\n }\n}\n","import { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { NgModule, LOCALE_ID, inject, provideAppInitializer } from '@angular/core';\nimport { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormsModule } from '@angular/forms';\nimport { RouteReuseStrategy } from '@angular/router';\n\n// External Imports\nimport { JwtModule } from '@auth0/angular-jwt';\nimport { ToastrModule } from 'ngx-toastr';\n\n// NgRx Imports\nimport { StoreModule } from '@ngrx/store';\nimport { StoreDevtoolsModule } from '@ngrx/store-devtools';\nimport { EffectsModule } from '@ngrx/effects';\nimport { routerReducer, StoreRouterConnectingModule, RouterStateSerializer } from '@ngrx/router-store';\n\n//EZUI AWS\nimport { EZ_APP_NAME, EZ_BUILD_VERSION, EZ_HUB_ENDPOINT, EZ_JWT_KEY, EZ_SOCKET_KEY } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { EZ_USER_FILES_ENDPOINT } from '@ezuiaws/ez.ui.packages/ez-fileupload';\nimport { EZ_CRYPTO_PASSWORD } from '@ezuiaws/ez.ui.packages/ez-crypto';\nimport { EzNotificationModule } from '@ezuiaws/ez.ui.packages/ez-notification';\nimport { EzLocalizationModule, EzLocaleHelper } from '@ezuiaws/ez.ui.packages/ez-localization';\nimport { EzStoreModule } from '@ezuiaws/ez.ui.packages/ez-store';\nimport { EzStatisticsModule } from '@ezuiaws/ez.ui.packages/ez-statistics';\nimport { EzSocketModule } from '@ezuiaws/ez.ui.packages/ez-socket';\nimport { EzSpinnerComponent } from '@ezuiaws/ez.ui.packages/ez-spinner';\n\n// Core\nimport { SocketProvider } from '@app-core/socket/socket.provider';\nimport { socketProviderFactory } from '@app-core/socket/socket-provider-factory';\nimport { LocalizationService } from '@app-core/localization/localization.service';\nimport { localizationResourcesFactory } from '@app-core/localization/localization-resources-provider-factory';\nimport { datadogRumFactory } from '@app-core/datadog/services/datadog-rum-factory';\nimport { DatadogService } from '@app-core/datadog/services/datadog.service';\n\n// App Imports\nimport { environment } from 'src/environments/environment';\nimport { appversion } from '@src/environments/appversion';\nimport { AppComponent } from './app.component';\nimport { AppRoutingModule } from './app-routing.module';\nimport { ThemeStateModule } from '@app-shared/state/theme-state/theme-state.module';\nimport { SessionEffects } from '@src/app/state/session-state/session-effects';\nimport { CustomSerializer, metaReducers } from './state/router-state';\nimport { FailResponseReducer } from '@src/app/state/fail-state/fails.reducer';\nimport { SessionReducer } from './state/session-state/session.reducer';\nimport { AppDetailsReducer } from './state/app-details-state/app-details.reducer';\nimport { SharedStateReducer } from '@src/app/state/shared-state/shared-state.reducer';\nimport { SocketEffects } from '@src/app/state/socket-state/socket.effects';\nimport { SharedStateFacade } from '@src/app/state/shared-state/shared-state.facade';\nimport { SessionFacade } from '@src/app/state/session-state/session.facade';\nimport { AppDetailsFacade } from '@src/app/state/app-details-state/app-details.facade';\nimport { CustomRouteReuseStrategy } from '@app-shared/route-reuse/custom-route-reuses-strategy';\n\n@NgModule({\n\tbootstrap: [AppComponent],\n\tdeclarations: [AppComponent],\n\timports: [\n\t\tBrowserModule,\n\t\tBrowserAnimationsModule,\n\t\tFormsModule,\n\t\tReactiveFormsModule,\n\t\tAppRoutingModule,\n\t\tThemeStateModule,\n\t\tEzStoreModule,\n\t\tEzNotificationModule,\n\t\tEzLocalizationModule,\n\t\tEzStatisticsModule,\n\t\tEzSocketModule,\n\t\tEzSpinnerComponent,\n\t\tStoreModule.forFeature('appSession', SessionReducer),\n\t\tStoreModule.forFeature('appDetails', AppDetailsReducer),\n\t\tStoreModule.forFeature('appShared', SharedStateReducer),\n\t\tStoreModule.forFeature('appFailResponses', FailResponseReducer),\n\t\tStoreModule.forFeature('appRouter', routerReducer, { metaReducers }),\n\t\tEffectsModule.forFeature([SessionEffects, SocketEffects]),\n\t\tEffectsModule.forRoot([]),\n\t\tStoreRouterConnectingModule.forRoot({\n\t\t\tstateKey: 'appRouter'\n\t\t}),\n\t\tStoreModule.forRoot({}, {\n\t\t\truntimeChecks: {\n\t\t\t\tstrictStateImmutability: false,\n\t\t\t\tstrictActionImmutability: false,\n\t\t\t},\n\t\t}),\n\t\tStoreDevtoolsModule.instrument({\n\t\t\tname: 'App DevTools',\n\t\t\tmaxAge: 25,\n\t\t\tlogOnly: true\n\t\t}),\n\t\tToastrModule.forRoot(),\n\t\tJwtModule.forRoot({\n\t\t\tconfig: {\n\t\t\t\ttokenGetter: () => localStorage.getItem(environment.jwt_key)\n\t\t\t}\n\t\t})\n\t],\n\tproviders: [\n\t\tLocalizationService,\n\t\tSharedStateFacade,\n\t\tSessionFacade,\n\t\tAppDetailsFacade,\n\t\t{ provide: RouterStateSerializer, useClass: CustomSerializer },\n\t\t{ provide: LOCALE_ID, useValue: `${EzLocaleHelper.locale}-${EzLocaleHelper.currencyCode}` },\n\t\tprovideAppInitializer(() => {\n\t\t\tconst initializerFn = (datadogRumFactory)(inject(DatadogService));\n\t\t\treturn initializerFn();\n\t\t}),\n\t\tprovideAppInitializer(() => {\n\t\t\tconst initializerFn = (socketProviderFactory)(inject(SocketProvider));\n\t\t\treturn initializerFn();\n\t\t}),\n\t\tprovideAppInitializer(() => {\n\t\t\tconst initializerFn = (localizationResourcesFactory)(inject(LocalizationService));\n\t\t\treturn initializerFn();\n\t\t}),\n\t\t{ provide: EZ_CRYPTO_PASSWORD, useValue: environment.encryption_key },\n\t\t{ provide: EZ_JWT_KEY, useValue: environment.jwt_key },\n\t\t{ provide: EZ_APP_NAME, useValue: environment.client_software },\n\t\t{ provide: EZ_BUILD_VERSION, useValue: appversion.build },\n\t\t{ provide: EZ_SOCKET_KEY, useValue: environment.tms_hub_key },\n\t\t{ provide: EZ_HUB_ENDPOINT, useValue: environment.tmshub },\n\t\t{ provide: EZ_USER_FILES_ENDPOINT, useValue: environment.file_upload_url },\n\t\t{ provide: RouteReuseStrategy, useClass: CustomRouteReuseStrategy },\n\t\tprovideHttpClient(withInterceptorsFromDi())\n\t]\n})\nexport class AppModule {\n}\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.error(err));\n"],"mappings":"g/HAUA,SAASA,GAAmBC,EAAK,CAC/B,OAAO,IAAIC,GAAc,IAAkD,EAA6D,CAC1I,CACA,SAASC,IAAoB,CAC3B,OAAO,IAAID,GAAc,KAAiD,EAA+E,CAC3J,CACA,SAASE,IAAqB,CAC5B,OAAO,IAAIF,GAAc,KAAkD,EAA4E,CACzJ,CACA,SAASG,GAAmBC,EAAS,CACnC,OAAO,IAAIJ,GAAc,KAAkD,EAAiG,CAC9K,CACA,SAASK,GAAkBD,EAAS,CAClC,OAAO,IAAIJ,GAAc,KAAiD,EAAwE,CACpJ,CACA,SAASM,GAAgBC,EAAU,CACjC,OAAO,IAAIP,GAAc,KAA+C,EAAqE,CAC/I,CACA,SAASQ,GAAoBC,EAAsBC,EAAO,CACxD,OAAO,IAAIV,GAAc,K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Value","invalidStyleParams","varName","invalidParamValue","invalidNodeType","nodeType","invalidCssUnitValue","userProvidedProperty","value","invalidTrigger","invalidDefinition","invalidState","metadataName","missingSubs","invalidStyleValue","invalidParallelAnimation","prop","firstStart","firstEnd","secondStart","secondEnd","RuntimeError","invalidKeyframes","invalidOffset","keyframeOffsetsOutOfOrder","keyframesMissingOffsets","invalidStagger","invalidQuery","selector","invalidExpression","expr","invalidTransitionAlias","alias","triggerBuildFailed","name","errors","RuntimeError","animationFailed","registerFailed","missingOrDestroyedAnimation","createAnimationFailed","missingPlayer","id","missingTrigger","phase","missingEvent","unsupportedTriggerEvent","unregisteredTrigger","triggerTransitionsFailed","transitionFailed","name","errors","RuntimeError","optimizeGroupPlayer","players","NoopAnimationPlayer","AnimationGroupPlayer","normalizeKeyframes$1","normalizer","keyframes","preStyles","postStyles","errors","normalizedKeyframes","previousOffset","previousKeyframe","kf","offset","isSameOffset","normalizedKeyframe","val","prop","normalizedProp","normalizedValue","ɵPRE_STYLE","AUTO_STYLE","animationFailed","listenOnPlayer","player","eventName","event","callback","copyAnimationEvent","phaseName","totalTime","disabled","makeAnimationEvent","data","element","triggerName","fromState","toState","getOrSetDefaultValue","map","key","defaultValue","value","parseTimelineCommand","command","separatorPos","id","action","documentElement","getParentElement","parent","containsVendorPrefix","_CACHED_BODY","_IS_WEBKIT","validateStyleProperty","getBodyNode","result","getBodyNode","containsElement","elm1","elm2","getParentElement","invokeQuery","element","selector","multi","elem","NoopAnimationDriver","prop","validateStyleProperty","elm1","elm2","containsElement","element","getParentElement","selector","multi","invokeQuery","defaultValue","keyframes","duration","delay","easing","previousPlayers","scrubberAccessRequested","NoopAnimationPlayer","__ngFactoryType__","ɵɵdefineInjectable","AnimationDriver","AnimationStyleNormalizer","ONE_SECOND","SUBSTITUTION_EXPR_START","SUBSTITUTION_EXPR_END","ENTER_CLASSNAME","LEAVE_CLASSNAME","NG_TRIGGER_CLASSNAME","NG_TRIGGER_SELECTOR","NG_ANIMATING_CLASSNAME","NG_ANIMATING_SELECTOR","resolveTimingValue","value","matches","_convertTimeValueToMS","unit","resolveTiming","timings","errors","allowNegativeValues","parseTimeExpression","exp","regex","duration","delay","easing","invalidTimingValue","delayMatch","easingVal","containsErrors","startIndex","negativeStepValue","negativeDelayValue","normalizeKeyframes","keyframes","kf","setStyles","element","styles","formerStyles","val","prop","camelProp","dashCaseToCamelCase","eraseStyles","_","normalizeAnimationEntry","steps","sequence","validateStyleParams","value","options","errors","params","matches","extractStyleParams","varName","invalidStyleParams","PARAM_REGEX","SUBSTITUTION_EXPR_START","SUBSTITUTION_EXPR_END","match","interpolateParams","original","str","localVal","invalidParamValue","DASH_CASE_REGEXP","input","m","allowPreviousPlayerStylesMerge","duration","delay","balancePreviousStylesIntoKeyframes","element","keyframes","previousStyles","startingKeyframe","missingStyleProps","val","prop","i","kf","computeStyle","visitDslNode","visitor","node","context","AnimationMetadataType","invalidNodeType","DIMENSIONAL_PROP_SET","WebAnimationsStyleNormalizer","AnimationStyleNormalizer","propertyName","errors","dashCaseToCamelCase","userProvidedProperty","normalizedProperty","value","unit","strVal","valAndSuffixMatch","invalidCssUnitValue","ANY_STATE","parseTransitionExpr","transitionValue","errors","expressions","str","parseInnerTransitionStr","eventStr","result","parseAnimationAlias","match","invalidExpression","fromState","separator","toState","makeLambdaFromStates","isFullAnyStateExpr","alias","invalidTransitionAlias","TRUE_BOOLEAN_VALUES","FALSE_BOOLEAN_VALUES","lhs","rhs","LHS_MATCH_BOOLEAN","RHS_MATCH_BOOLEAN","lhsMatch","rhsMatch","SELF_TOKEN","SELF_TOKEN_REGEX","buildAnimationAst","driver","metadata","warnings","AnimationAstBuilderVisitor","ROOT_SELECTOR","_driver","context","AnimationAstBuilderContext","visitDslNode","normalizeAnimationEntry","queryCount","depCount","states","transitions","invalidTrigger","def","AnimationMetadataType","stateDef","name","n","transition","invalidDefinition","styleAst","astParams","missingSubs","params","style","value","extractStyleParams","sub","invalidState","animation","matchers","normalizeAnimationOptions","s","currentTime","furthestTime","steps","step","innerAst","timingAst","constructTimingAst","styleMetadata","isEmpty","newStyleData","_styleAst","ast","styles","metadataStyles","styleTuple","AUTO_STYLE","invalidStyleValue","containsDynamicStyles","collectedEasing","styleData","SUBSTITUTION_EXPR_START","timings","endTime","startTime","tuple","prop","collectedStyles","collectedEntry","updateCollectedStyle","invalidParallelAnimation","validateStyleParams","invalidKeyframes","MAX_KEYFRAME_OFFSET","totalKeyframesWithOffsets","offsets","offsetsOutOfOrder","keyframesOutOfRange","previousOffset","keyframes","offsetVal","consumeOffset","offset","invalidOffset","keyframeOffsetsOutOfOrder","length","generatedOffset","keyframesMissingOffsets","limit","currentAnimateTimings","animateDuration","kf","i","durationUpToThisFrame","parentSelector","options","selector","includeSelf","normalizeSelector","getOrSetDefaultValue","invalidStagger","resolveTiming","hasAmpersand","token","NG_TRIGGER_SELECTOR","NG_ANIMATING_SELECTOR","normalizeParams","obj","__spreadValues","duration","makeTimingAst","strValue","v","delay","easing","createTimelineInstruction","element","preStyleProps","postStyleProps","subTimeline","ElementInstructionMap","instructions","existingInstructions","ONE_FRAME_IN_MILLISECONDS","ENTER_TOKEN","ENTER_TOKEN_REGEX","LEAVE_TOKEN","LEAVE_TOKEN_REGEX","buildAnimationTimelines","rootElement","enterClassName","leaveClassName","startingStyles","finalStyles","subInstructions","AnimationTimelineBuilderVisitor","AnimationTimelineContext","resolveTimingValue","timelines","timeline","lastRootTimeline","elementInstructions","innerContext","animationsRefsOptions","animationRefOptions","animationDelay","animationDelayValue","interpolateParams","instruction","instructionTimings","subContextCount","ctx","DEFAULT_NOOP_PREVIOUS_NODE","innerTimelines","timingValue","innerTimeline","elms","sameElementTimeline","parentContext","tl","maxTime","startingTime","_AnimationTimelineContext","_enterClassName","_leaveClassName","initialTimeline","TimelineBuilder","skipIfExists","newOptions","optionsToUpdate","newParams","paramsToUpdate","oldParams","newTime","target","updatedTimings","builder","SubTimelineBuilder","time","originalSelector","optional","results","multi","elements","invalidQuery","_TimelineBuilder","_elementTimelineStylesLookup","hasPreStyleStep","input","flattenStyles","val","properties","details1","details0","finalKeyframes","keyframe","finalKeyframe","ɵPRE_STYLE","preProps","postProps","kf0","kf1","_stretchStartingKeyframe","newKeyframes","totalTime","startingGap","newFirstKeyframe","oldFirstKeyframe","roundOffset","oldOffset","timeAtKeyframe","decimalPoints","mult","allStyles","allProperties","createTransitionInstruction","triggerName","isRemovalTransition","fromStyles","toStyles","queriedElements","EMPTY_OBJECT","AnimationTransitionFactory","_triggerName","_stateStyles","currentState","nextState","oneOrMoreTransitionsMatch","stateName","styler","currentOptions","nextOptions","skipAstBuild","transitionAnimationParams","currentAnimationParams","currentStateStyles","nextAnimationParams","nextStateStyles","preStyleMap","postStyleMap","isRemoval","animationOptions","applyParamDefaults","elm","oneOrMoreTransitionsMatch","matchFns","currentState","nextState","element","params","fn","applyParamDefaults","userParams","defaults","result","__spreadValues","key","value","AnimationStateStyles","styles","defaultParams","normalizer","errors","finalStyles","combinedParams","val","prop","interpolateParams","normalizedProp","buildTrigger","name","ast","AnimationTrigger","_normalizer","balanceProperties","AnimationTransitionFactory","createFallbackTransition","f","triggerName","states","matchers","fromState","toState","animation","AnimationMetadataType","transition","stateMap","key1","key2","EMPTY_INSTRUCTION_MAP","ElementInstructionMap","TimelineAnimationEngine","bodyNode","_driver","id","metadata","warnings","buildAnimationAst","registerFailed","i","preStyles","postStyles","keyframes","normalizeKeyframes$1","options","instructions","autoStylesMap","buildAnimationTimelines","ENTER_CLASSNAME","LEAVE_CLASSNAME","inst","getOrSetDefaultValue","missingOrDestroyedAnimation","createAnimationFailed","_","AUTO_STYLE","players","player","optimizeGroupPlayer","index","missingPlayer","eventName","callback","baseEvent","makeAnimationEvent","listenOnPlayer","command","args","QUEUED_CLASSNAME","QUEUED_SELECTOR","DISABLED_CLASSNAME","DISABLED_SELECTOR","STAR_CLASSNAME","STAR_SELECTOR","EMPTY_PLAYER_ARRAY","NULL_REMOVAL_STATE","NULL_REMOVED_QUERIED_STATE","REMOVAL_FLAG","StateValue","input","namespaceId","isObj","normalizeTriggerValue","_a","__objRest","newParams","oldParams","VOID_VALUE","DEFAULT_STATE_VALUE","AnimationTransitionNamespace","hostElement","_engine","addClass","phase","missingTrigger","missingEvent","isTriggerEventValid","unsupportedTriggerEvent","listeners","data","triggersWithStates","NG_TRIGGER_CLASSNAME","trigger","unregisteredTrigger","defaultToFallback","TransitionAnimationPlayer","objEquals","fromStyles","toStyles","eraseStyles","setStyles","playersOnElement","isFallbackTransition","removeClass","entry","elementPlayers","rootElement","context","elements","NG_TRIGGER_SELECTOR","elm","namespaces","ns","destroyAfterComplete","triggerStates","previousTriggersValues","state","elementStates","visitedTriggers","listener","engine","containsPotentialParentTransition","currentPlayers","parent","removalFlag","microtaskId","a","b","d0","d1","p","TransitionAnimationEngine","driver","namespaceList","namespacesByHostElement","found","ancestor","ancestorNs","stateValue","isElementNode","insertBefore","details","hostNS","hasAnimation","subTimelines","enterClassName","leaveClassName","skipBuildAst","containerElement","NG_ANIMATING_SELECTOR","resolve","node","cleanupFns","quietFns","triggerTransitionsFailed","skippedPlayers","skippedPlayersMap","queuedInstructions","queriedElements","allPreStyleElements","allPostStyleElements","disabledElementsSet","nodesThatAreDisabled","allTriggerElements","enterNodeMap","buildRootMap","enterNodeMapIds","nodes","root","className","allLeaveNodes","mergedLeaveNodes","leaveNodesWithoutAnimations","leaveNodeMapIds","leaveNodeMap","allPlayers","erroneousTransitions","previousValue","nodeIsOrphaned","instruction","timelines","tl","tuple","stringMap","setVal","transitionFailed","allPreviousPlayersMap","animationElementMap","prevPlayer","replaceNodes","replacePostStylesAsPre","postStylesMap","cloakAndComputeStyles","preStylesMap","ɵPRE_STYLE","post","pre","rootPlayers","subPlayers","NO_PARENT_ANIMATION_ELEMENT_DETECTED","parentWithAnimation","parentsToAdd","detectedParent","innerPlayer","parentPlayers","playersForElement","queriedPlayerResults","queriedInnerElements","j","queriedPlayers","activePlayers","removeNodesAfterAnimationDone","isQueriedElement","toStateValue","queriedElementPlayers","isRemovalAnimation","targetNameSpaceId","targetTriggerName","timelineInstruction","realPlayer","allQueriedPlayers","allConsumedElements","allSubElements","allNewPlayers","NoopAnimationPlayer","previousPlayers","flattenGroupPlayers","pp","wrappedPlayer","deleteOrUnsetInMap","NG_ANIMATING_CLASSNAME","callbacks","totalTime","phaseName","map","currentValues","cloakElement","oldValue","valuesMap","elementPropsMap","defaultStyle","cloakVals","failedElements","props","roots","rootMap","NULL_NODE","nodeSet","localRootMap","getRoot","finalPlayers","_flattenGroupPlayersRecur","AnimationGroupPlayer","k1","k2","postEntry","preEntry","AnimationEngine","doc","componentId","cacheKey","triggerBuildFailed","disable","property","action","parseTimelineCommand","eventPhase","cb","packageNonAnimatableStyles","startStyles","endStyles","filterNonAnimatableStyles","SpecialCasedStyles","_element","_startStyles","_endStyles","initialStyles","isNonAnimatableStyle","WebAnimationsPlayer","_specialStyles","onFinish","kfs","frame","computeStyle","methods","WebAnimationsDriver","elm1","elm2","containsElement","getParentElement","selector","multi","invokeQuery","defaultValue","duration","delay","easing","fill","playerOptions","previousStyles","previousWebAnimationPlayers","allowPreviousPlayerStylesMerge","_keyframes","normalizeKeyframes","balancePreviousStylesIntoKeyframes","specialStyles","ANIMATION_PREFIX","DISABLE_ANIMATIONS_FLAG","BaseAnimationRenderer","namespaceId","delegate","engine","_onDestroy","node","name","namespace","value","parent","newChild","refChild","isMove","oldChild","isHostElement","selectorOrNode","preserveContent","el","style","flags","target","eventName","callback","options","element","AnimationRenderer","factory","onDestroy","resolveElementFromTarget","phase","parseTriggerCallbackName","event","countId","triggerName","dotIndex","trigger","AnimationRendererFactory","_zone","hostElement","type","EMPTY_NAMESPACE_ID","cache","renderer","onRendererDestroy","componentId","registerTrigger","count","fn","data","animationCallbacksBuffer","tuple","InjectableAnimationEngine","AnimationEngine","doc","driver","normalizer","__ngFactoryType__","ɵɵinject","DOCUMENT","AnimationDriver","AnimationStyleNormalizer","ɵɵdefineInjectable","instantiateDefaultStyleNormalizer","WebAnimationsStyleNormalizer","instantiateRendererFactory","renderer","engine","zone","AnimationRendererFactory","SHARED_ANIMATION_PROVIDERS","RendererFactory2","DomRendererFactory2","NgZone","BROWSER_ANIMATIONS_PROVIDERS","WebAnimationsDriver","ANIMATION_MODULE_TYPE","BROWSER_NOOP_ANIMATIONS_PROVIDERS","NoopAnimationDriver","BrowserAnimationsModule","config","ɵɵdefineNgModule","ɵɵdefineInjector","BrowserModule","PERFORM_ACTION","REFRESH","RESET","ROLLBACK","COMMIT","SWEEP","TOGGLE_ACTION","SET_ACTIONS_ACTIVE","JUMP_TO_STATE","JUMP_TO_ACTION","IMPORT_STATE","LOCK_CHANGES","PAUSE_RECORDING","PerformAction","action","timestamp","Refresh","Reset","Rollback","Commit","Sweep","ToggleAction","id","JumpToState","index","JUMP_TO_STATE","JumpToAction","actionId","JUMP_TO_ACTION","ImportState","nextLiftedState","IMPORT_STATE","LockChanges","status","LOCK_CHANGES","PauseRecording","PAUSE_RECORDING","STORE_DEVTOOLS_CONFIG","InjectionToken","INITIAL_OPTIONS","noMonitor","DEFAULT_NAME","createConfig","optionsInput","DEFAULT_OPTIONS","options","logOnly","features","config","difference","first","second","item","unliftState","liftedState","computedStates","currentStateIndex","state","liftAction","action","PerformAction","sanitizeActions","actionSanitizer","actions","sanitizedActions","actionIdx","idx","sanitizeAction","__spreadProps","__spreadValues","sanitizeStates","stateSanitizer","states","computedState","sanitizeState","state","stateIdx","shouldFilterActions","config","filterLiftedState","liftedState","predicate","safelist","blocklist","filteredStagedActionIds","filteredActionsById","filteredComputedStates","id","liftedAction","isActionFiltered","blockedlist","predicateMatch","safelistMatch","s","escapeRegExp","blocklistMatch","injectZoneConfig","connectInZone","inject","NgZone","DevtoolsDispatcher","_DevtoolsDispatcher","ActionsSubject","ɵDevtoolsDispatcher_BaseFactory","__ngFactoryType__","ɵɵgetInheritedFactory","ɵɵdefineInjectable","ExtensionActionTypes","REDUX_DEVTOOLS_EXTENSION","InjectionToken","DevtoolsExtension","_DevtoolsExtension","devtoolsExtension","dispatcher","PERFORM_ACTION","currentState","unliftState","sanitizedState","sanitizedAction","sanitizedLiftedState","Observable","subscriber","connection","change","EMPTY","changes$","share","start$","filter","stop$","liftedActions$","map","concatMap","IMPORT_STATE","UPDATE","timeout","debounceTime","catchError","of","take","actionsUntilStop$","takeUntil","liftedUntilStop$","switchMap","extensionOptions","send","err","ɵɵinject","STORE_DEVTOOLS_CONFIG","INIT_ACTION","INIT","RECOMPUTE","RECOMPUTE_ACTION","computeNextEntry","reducer","error","errorHandler","nextState","nextError","recomputeStates","computedStates","minInvalidatedStateIndex","committedState","actionsById","stagedActionIds","skippedActionIds","isPaused","nextComputedStates","lastIncludedActionId","i","actionId","previousEntry","previousState","previousError","entry","liftInitialState","initialCommittedState","monitorReducer","liftReducerWith","initialLiftedState","options","monitorState","nextActionId","currentStateIndex","isLocked","commitExcessActions","n","excess","idsToDelete","commitChanges","LOCK_CHANGES","PAUSE_RECORDING","RESET","COMMIT","ROLLBACK","TOGGLE_ACTION","SET_ACTIONS_ACTIVE","start","end","active","actionIds","difference","JUMP_TO_STATE","JUMP_TO_ACTION","index","SWEEP","lastState","cmp","StoreDevtools","_StoreDevtools","actions$","reducers$","extension","scannedActions","initialState","liftedInitialState","liftReducer","liftedAction$","merge","skip","observeOn","queueScheduler","liftedReducer$","zoneConfig","liftedStateSubject","ReplaySubject","withLatestFrom","emitInZone","scan","reducedLiftedState","unliftedAction","liftedState$","state$","toSignal","Refresh","Reset","Rollback","Commit","Sweep","ToggleAction","JumpToAction","JumpToState","nextLiftedState","ImportState","status","LockChanges","PauseRecording","ReducerObservable","ScannedActionsSubject","ErrorHandler","INITIAL_STATE","ngZone","source","value","IS_EXTENSION_OR_MONITOR_PRESENT","createIsExtensionOrMonitorPresent","noMonitor","createReduxDevtoolsExtension","extensionKey","createStateObservable","devtools","provideStoreDevtools","makeEnvironmentProviders","INITIAL_OPTIONS","createConfig","StateObservable","ReducerManagerDispatcher","StoreDevtoolsModule","_StoreDevtoolsModule","ɵɵdefineNgModule","ɵɵdefineInjector","ROUTER_REQUEST","routerRequestAction","createAction","props","ROUTER_NAVIGATION","routerNavigationAction","ROUTER_CANCEL","routerCancelAction","ROUTER_ERROR","routerErrorAction","ROUTER_NAVIGATED","routerNavigatedAction","routerReducer","state","action","routerAction","MinimalRouterStateSerializer","routerState","route","children","c","NavigationActionTiming","DEFAULT_ROUTER_FEATURENAME","_ROUTER_CONFIG","InjectionToken","ROUTER_CONFIG","RouterState","_createRouterConfig","config","__spreadValues","FullRouterStateSerializer","RouterStateSerializer","RouterTrigger","StoreRouterConnectingService","_StoreRouterConnectingService","store","router","serializer","errorHandler","activeRuntimeChecks","isNgrxMockEnvironment","isDevMode","select","withLatestFrom","routerStoreState","storeState","NavigationStart","url","isSameUrl","error","dispatchNavLate","routesRecognized","event","RoutesRecognized","NavigationCancel","NavigationError","NavigationEnd","lastRoutesRecognized","nextRouterState","type","payload","__spreadProps","__ngFactoryType__","ɵɵinject","Store","Router","ErrorHandler","ACTIVE_RUNTIME_CHECKS","ɵɵdefineInjectable","first","second","stripTrailingSlash","text","provideRouterStore","makeEnvironmentProviders","ENVIRONMENT_INITIALIZER","inject","StoreRouterConnectingModule","_StoreRouterConnectingModule","ɵɵdefineNgModule","ɵɵdefineInjector","SocketProvider","constructor","socketHelperService","initHubConnection","initSocket","Promise","resolve","hubConnected$","pipe","filter","connected","take","subscribe","ɵɵinject","SocketHelperService","factory","ɵfac","providedIn","_SocketProvider","socketProviderFactory","provider","initHubConnection","localizationResourcesFactory","localizationService","init","datadogRumFactory","provider","startSessionReplayRecording","ConsoleApiName","display","api","args","_i","globalConsole","catchUserErrors","fn","errorMsg","args","_i","err","display","ExperimentalFeature","enabledExperimentalFeatures","addExperimentalFeatures","enabledFeatures","flag","isExperimentalFeatureEnabled","featureName","getExperimentalFeatures","enabledExperimentalFeatures","performDraw","threshold","round","num","decimals","isPercentage","value","isNumber","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","relativeToClocks","relative","getCorrectedTimeStamp","relativeTime","correctedOrigin","dateNow","getNavigationStart","addDuration","getTimeStamp","currentDrift","toServerDuration","duration","isNumber","round","timeStampNow","relativeNow","clocksNow","clocksOrigin","elapsed","start","end","a","b","getRelativeTime","timestamp","looksLikeRelativeTime","time","navigationStart","ONE_KIBI_BYTE","ONE_MEBI_BYTE","HAS_MULTI_BYTES_CHARACTERS","computeBytesCount","candidate","includes","candidate","search","arrayFrom","arrayLike","array","item","i","find","predicate","findLast","forEach","list","callback","objectValues","object","key","objectEntries","startsWith","endsWith","elementMatches","element","selector","cssEscape","str","ch","asCodePoint","assign","target","toAssign","_i","source","shallowClone","object","assign","objectHasValue","value","key","isEmptyObject","mapValues","fn","newObject","_i","_a","getGlobalObject","globalObject","getZoneJsOriginalValue","target","name","browserWindow","getGlobalObject","original","__spreadArray","to","from","pack","l","ar","onMonitorErrorCollected","debugMode","startMonitorErrorCollection","newOnMonitorErrorCollected","setDebugMode","newDebugMode","monitor","fn","callMonitored","context","args","e","displayIfDebugEnabled","ConsoleApiName","onMonitorErrorCollected","api","_i","debugMode","display","__spreadArray","setTimeout","callback","delay","getZoneJsOriginalValue","getGlobalObject","monitor","clearTimeout","timeoutId","setInterval","clearInterval","Observable","onFirstSubscribe","f","_this","other","data","observer","mergeObservables","observables","_i","globalObservable","Observable","subscriptions","observable","data","subscription","throttle","fn","wait","options","needLeadingExecution","needTrailingExecution","inWaitPeriod","pendingExecutionWithParameters","pendingTimeoutId","parameters","_i","setTimeout","clearTimeout","noop","generateUUID","placeholder","findCommaSeparatedValue","rawString","name","regex","matches","safeTruncate","candidate","length","suffix","lastChar","isLastCharSurrogatePair","correctedLength","SESSION_TIME_OUT_DELAY","ONE_HOUR","SESSION_EXPIRATION_DELAY","ONE_MINUTE","setCookie","name","value","expireDelay","options","date","expires","sameSite","domain","secure","getCookie","findCommaSeparatedValue","deleteCookie","areCookiesAuthorized","testCookieName","generateUUID","testCookieValue","ONE_MINUTE","isCookieCorrectlySet","error","display","getCurrentSiteCache","getCurrentSite","domainLevels","candidateDomain","ONE_SECOND","SESSION_STORE_KEY","SESSION_ENTRY_REGEXP","SESSION_ENTRY_SEPARATOR","isSessionInExpiredState","session","isEmptyObject","expandSessionState","dateNow","SESSION_EXPIRATION_DELAY","toSessionString","objectEntries","_a","key","value","toSessionState","sessionString","isValidSessionString","entry","matches","OLD_SESSION_COOKIE_NAME","OLD_RUM_COOKIE_NAME","OLD_LOGS_COOKIE_NAME","RUM_SESSION_KEY","LOGS_SESSION_KEY","tryOldCookiesMigration","cookieStoreStrategy","sessionString","getCookie","SESSION_STORE_KEY","oldSessionId","oldRumType","oldLogsType","session","isSessionInExpiredState","expandSessionState","selectCookieStrategy","initConfiguration","cookieOptions","buildCookieOptions","areCookiesAuthorized","initCookieStrategy","cookieStore","persistSessionCookie","retrieveSessionCookie","deleteSessionCookie","tryOldCookiesMigration","options","session","setCookie","SESSION_STORE_KEY","toSessionString","SESSION_EXPIRATION_DELAY","sessionString","getCookie","toSessionState","deleteCookie","getCurrentSite","LOCAL_STORAGE_TEST_KEY","selectLocalStorageStrategy","id","generateUUID","testKey","retrievedId","initLocalStorageStrategy","persistInLocalStorage","retrieveSessionFromLocalStorage","clearSessionFromLocalStorage","sessionState","SESSION_STORE_KEY","toSessionString","sessionString","toSessionState","isIE","isChromium","LOCK_RETRY_DELAY","LOCK_MAX_TRIES","bufferedOperations","ongoingOperations","processSessionStoreOperations","operations","sessionStoreStrategy","numberOfRetries","_a","retrieveSession","persistSession","clearSession","lockEnabled","isLockEnabled","next","currentLock","currentSession","retryLater","generateUUID","processedSession","isSessionInExpiredState","expandSessionState","isChromium","sessionStore","currentNumberOfRetries","setTimeout","nextOperations","STORAGE_POLL_DELAY","ONE_SECOND","selectSessionStoreStrategyType","initConfiguration","sessionStoreStrategyType","selectCookieStrategy","selectLocalStorageStrategy","startSessionStore","productKey","computeSessionState","renewObservable","Observable","expireObservable","sessionStoreStrategy","initCookieStrategy","initLocalStorageStrategy","clearSession","retrieveSession","watchSessionTimeoutId","setInterval","watchSession","sessionCache","retrieveActiveSession","expandOrRenewSession","isTracked","processSessionStoreOperations","sessionState","synchronizedSession","synchronizeSession","expandOrRenewSessionState","hasSessionInCache","renewSessionInCache","expandSession","isActiveSession","isSessionInCacheOutdated","expireSessionInCache","_a","trackingType","generateUUID","dateNow","session","SESSION_TIME_OUT_DELAY","throttle","clearInterval","jsonStringify","value","replacer","space","restoreObjectPrototypeToJson","detachToJsonMethod","restoreArrayPrototypeToJson","restoreValuePrototypeToJson","restoreValueToJson","object","objectToJson","noop","normalizeUrl","url","buildUrl","getLocationOrigin","isValidUrl","getOrigin","url","getLinkElementOrigin","buildUrl","getPathName","pathname","buildUrl","url","base","supportedURL","getSupportedUrl","error","jsonStringify","doc","anchorElement","baseElement","originalURL","isURLSupported","getLocationOrigin","getLinkElementOrigin","element","sanitizedHost","INTAKE_SITE_STAGING","INTAKE_SITE_US1","INTAKE_SITE_EU1","INTAKE_SITE_AP1","INTAKE_SITE_US1_FED","ENDPOINTS","INTAKE_TRACKS","createEndpointBuilder","initConfiguration","endpointType","configurationTags","buildUrlWithParameters","createEndpointUrlWithParametersBuilder","api","flushReason","retry","parameters","buildEndpointParameters","path","proxy","proxyUrl","normalizedProxyUrl_1","normalizeUrl","host","buildEndpointHost","normalizedProxyUrl_2","_a","site","INTAKE_SITE_US1","internalAnalyticsSubdomain","domainParts","extension","subdomain","INTAKE_SITE_AP1","clientToken","tags","isExperimentalFeatureEnabled","ExperimentalFeature","generateUUID","timeStampNow","TAG_SIZE_LIMIT","buildTags","configuration","env","service","version","datacenter","tags","buildTag","FORBIDDEN_CHARACTERS","key","rawValue","valueSizeLimit","display","sanitizedValue","computeTransportConfiguration","initConfiguration","tags","buildTags","endpointBuilders","computeEndpointBuilders","intakeUrlPrefixes","objectValues","builder","replicaConfiguration","computeReplicaConfiguration","assign","url","intakeEndpoint","INTAKE_SITE_US1","createEndpointBuilder","replicaEndpointBuilders","DefaultPrivacyLevel","validateAndBuildConfiguration","initConfiguration","_a","_b","_c","display","sessionSampleRate","isPercentage","addExperimentalFeatures","flag","objectHasValue","ExperimentalFeature","assign","catchUserErrors","selectSessionStoreStrategyType","ONE_KIBI_BYTE","ONE_SECOND","computeTransportConfiguration","serializeConfiguration","proxy","UNKNOWN_FUNCTION","computeStackTrace","ex","stack","stackProperty","tryToGetString","exString","startsWith","line","stackFrame","parseChromeLine","parseChromeAnonymousLine","parseWinLine","parseGeckoLine","fileUrl","filePosition","CHROME_LINE_RE","CHROME_EVAL_RE","parts","isNative","isEval","submatch","CHROME_ANONYMOUS_FUNCTION_RE","WINJS_LINE_RE","GECKO_LINE_RE","GECKO_EVAL_RE","candidate","property","value","instrumentMethod","object","method","instrumentationFactory","original","instrumentation","instrumentationWrapper","instrumentMethodAndCallOriginal","_a","before","after","args","result","callMonitored","instrumentSetter","property","originalDescriptor","noop","thisObject","value","setTimeout","ERROR_TYPES_RE","startUnhandledErrorCollection","callback","stopInstrumentingOnError","instrumentOnError","stopInstrumentingOnUnhandledRejection","instrumentUnhandledRejection","instrumentMethodAndCallOriginal","messageObj","url","line","column","errorObj","stackTrace","computeStackTrace","stack","_a","tryToParseMessage","name_1","message","name","e","reason","SANITIZE_DEFAULT_MAX_CHARACTER_COUNT","ONE_KIBI_BYTE","JSON_PATH_ROOT_ELEMENT","KEY_DECORATION_LENGTH","sanitize","source","maxCharacterCount","_a","restoreObjectPrototypeToJson","detachToJsonMethod","restoreArrayPrototypeToJson","containerQueue","visitedObjectsWithPath","sanitizedData","sanitizeProcessor","accumulatedCharacterCount","warnOverCharacterLimit","containerToProcess","separatorLength","key","targetData","parentPath","queue","sourceToSanitize","tryToApplyToJSON","sanitizePrimitivesAndFunctions","sanitizedSource","sanitizeObjects","sourceAsObject","currentPath","target","value","result","match","object","changeType","display","NO_ERROR_STACK_PRESENT_MESSAGE","computeRawError","_a","stackTrace","originalError","handlingStack","startClocks","nonErrorPrefix","source","handling","isErrorInstance","message","computeMessage","stack","hasUsableStack","toStackTraceString","causes","flattenErrorCauses","type","fingerprint","tryToGetFingerprint","jsonStringify","sanitize","result","formatErrorMessage","frame","func","args","line","column","formatErrorMessage","stack","createHandlingStack","internalFramesToSkip","error","formattedStack","callMonitored","stackTrace","computeStackTrace","toStackTraceString","flattenErrorCauses","parentSource","currentError","causes","ErrorSource","trackRuntimeError","errorObservable","startUnhandledErrorCollection","stackTrace","originalError","computeRawError","clocksNow","ErrorSource","makePublicApi","stub","publicApi","assign","callback","setDebugMode","defineGlobal","global","name","api","existingGlobalVariable","fn","catchUserErrors","addEventListener","eventTarget","eventName","listener","options","addEventListeners","eventNames","_a","_b","once","capture","passive","wrappedListener","monitor","event","stop","add","getZoneJsOriginalValue","remove","RawReportType","initReportObservable","apis","observables","includes","createCspViolationReportObservable","reportTypes","api","createReportObservable","mergeObservables","observable","Observable","handleReports","monitor","reports","report","buildRawReportFromReport","observer","stop","addEventListener","event","buildRawReportFromCspViolation","_a","type","body","buildStack","message","safeTruncate","name","sourceFile","lineNumber","columnNumber","toStackTraceString","sendToExtension","type","payload","callback","getType","value","mergeInto","destination","source","circularReferenceChecker","createCircularReferenceChecker","flags","merged_1","i","merged","getType","key","deepClone","value","combine","sources","_i","_a","sources_1","set_1","has","array","TelemetryType","ALLOWED_FRAME_URLS","TELEMETRY_EXCLUDED_SITES","INTAKE_SITE_US1_FED","telemetryConfiguration","onRawTelemetryEventCollected","startTelemetry","telemetryService","configuration","contextProvider","observable","Observable","includes","performDraw","rawEvent","event_1","toTelemetryEvent","sendToExtension","startMonitorErrorCollection","addTelemetryError","assign","event","combine","timeStampNow","arrayFrom","getExperimentalFeatures","provider","isTelemetryReplicationAllowed","configuration","INTAKE_SITE_STAGING","addTelemetryDebug","message","context","displayIfDebugEnabled","ConsoleApiName","addTelemetry","assign","TelemetryType","addTelemetryError","formatError","addTelemetryConfiguration","telemetryConfiguration","event","onRawTelemetryEventCollected","stackTrace","computeStackTrace","toStackTraceString","scrubCustomerFrames","NO_ERROR_STACK_PRESENT_MESSAGE","jsonStringify","frame","ALLOWED_FRAME_URLS","allowedFrameUrl","startsWith","END_OF_TIMES","CLEAR_OLD_VALUES_INTERVAL","ONE_MINUTE","ValueHistory","expireDelay","maxEntries","_this","setInterval","value","startTime","entry","index","endTime","_i","_a","latestEntry","duration","addDuration","clearInterval","oldTimeThreshold","relativeNow","VISIBILITY_CHECK_DELAY","ONE_MINUTE","SESSION_CONTEXT_TIMEOUT_DELAY","SESSION_TIME_OUT_DELAY","stopCallbacks","startSessionManager","sessionStoreStrategyType","productKey","computeSessionState","sessionStore","startSessionStore","sessionContextHistory","ValueHistory","buildSessionContext","relativeNow","clocksOrigin","trackActivity","trackVisibility","startTime","trackActivity","expandOrRenewSession","stop","addEventListeners","stopCallbacks","trackVisibility","expandSession","expandSessionWhenVisible","addEventListener","visibilityCheckInterval","setInterval","VISIBILITY_CHECK_DELAY","clearInterval","isServerError","status","tryToClone","response","MAX_ONGOING_BYTES_COUNT","ONE_KIBI_BYTE","MAX_ONGOING_REQUESTS","MAX_QUEUE_BYTES_COUNT","ONE_MEBI_BYTE","MAX_BACKOFF_TIME","ONE_MINUTE","INITIAL_BACKOFF_TIME","ONE_SECOND","sendWithRetryStrategy","payload","state","sendStrategy","endpointType","reportError","send","retryQueuedPayloads","scheduleRetry","setTimeout","_a","onSuccess","onFailure","response","shouldRetryRequest","reason","ErrorSource","clocksNow","previousQueue","newPayloadQueue","isServerError","newRetryState","newBandwidthMonitor","queue","createHttpRequest","endpointBuilder","bytesLimit","reportError","retryState","newRetryState","sendStrategyForRetry","payload","onResponse","fetchKeepAliveStrategy","sendWithRetryStrategy","sendBeaconStrategy","_a","data","bytesCount","flushReason","canUseBeacon","beaconUrl","isQueued","e","reportBeaconError","xhrUrl","sendXHR","hasReportedBeaconError","addTelemetryError","retry","canUseKeepAlive","isKeepAliveSupported","fetchUrl","monitor","response","url","request","addEventListener","PageExitReason","createPageExitObservable","observable","Observable","pagehideEnabled","isExperimentalFeatureEnabled","ExperimentalFeature","stopListeners","addEventListeners","event","stopBeforeUnloadListener","noop","addEventListener","isPageExitReason","reason","includes","objectValues","Batch","request","flushController","messageBytesLimit","_this","event","message","key","messages","objectValues","payload","isPageExitReason","_a","processedMessage","messageBytesCount","display","jsonStringify","computeBytesCount","separatorBytesCount","removedMessage","getEventBridge","eventBridgeGlobal","getEventBridgeGlobal","eventType","event","canUseEventBridge","currentHost","_a","getGlobalObject","bridge","allowedHost","endsWith","createFlushController","_a","messagesLimit","bytesLimit","durationLimit","pageExitObservable","sessionExpireObservable","flushObservable","Observable","event","flush","currentBytesCount","currentMessagesCount","flushReason","messagesCount","bytesCount","cancelDurationLimitTimeout","durationLimitTimeoutId","scheduleDurationLimitTimeout","setTimeout","clearTimeout","messageBytesCount","AbstractLifeCycle","eventType","data","eventCallbacks","callback","_this","other","createEventRateLimiter","eventType","limit","onLimitReached","eventCount","allowNextEvent","setTimeout","ONE_MINUTE","ErrorSource","clocksNow","runOnReadyState","expectedReadyState","callback","eventName","addEventListener","xhrObservable","xhrContexts","initXhrObservable","createXhrObservable","observable","Observable","stopInstrumentingStart","instrumentMethodAndCallOriginal","openXhr","stopInstrumentingSend","sendXhr","stopInstrumentingAbort","abortXhr","method","url","normalizeUrl","_this","context","startContext","relativeNow","clocksNow","hasBeenReported","stopInstrumentingOnReadyStateChange","onEnd","unsubscribeLoadEndListener","completeContext","elapsed","timeStampNow","shallowClone","addEventListener","fetchObservable","initFetchObservable","createFetchObservable","observable","Observable","stop","instrumentMethod","originalFetch","input","init","responsePromise","context","callMonitored","beforeSend","afterSend","method","url","normalizeUrl","startClocks","clocksNow","startContext","reportFetch","response","monitor","consoleObservablesByApi","initConsoleObservable","apis","consoleObservables","api","createConsoleObservable","mergeObservables","createConsoleObservable","api","observable","Observable","originalConsoleApi","globalConsole","params","_i","handlingStack","createHandlingStack","callMonitored","buildConsoleLog","message","param","formatConsoleParameters","stack","fingerprint","ConsoleApiName","firstErrorParam","find","toStackTraceString","computeStackTrace","tryToGetFingerprint","sanitize","formatErrorMessage","jsonStringify","BUFFER_LIMIT","BoundedBuffer","callback","length","CUSTOMER_DATA_BYTES_LIMIT","ONE_KIBI_BYTE","warnIfCustomerDataLimitReached","bytesCount","customerDataType","display","BYTES_COMPUTATION_THROTTLING_DELAY","createContextManager","customerDataType","computeBytesCountImpl","computeBytesCount","context","bytesCountCache","alreadyWarned","computeBytesCountThrottled","throttle","jsonStringify","warnIfCustomerDataLimitReached","key","value","newContext","deepClone","sanitize","property","readBytesFromStream","stream","callback","options","reader","chunks","readBytesCount","readMore","monitor","result","onDone","error","noop","bytes","limitExceeded","completeBuffer_1","offset_1","chunk","SYNTHETICS_TEST_ID_COOKIE_NAME","SYNTHETICS_RESULT_ID_COOKIE_NAME","SYNTHETICS_INJECTS_RUM_COOKIE_NAME","willSyntheticsInjectRum","getCookie","getSyntheticsTestId","value","getSyntheticsResultId","sanitizeUser","newUser","user","assign","keys","key","checkUser","isValid","getType","display","isMatchOption","item","itemType","getType","matchList","list","value","useStartsWith","startsWith","e","display","isTracingOption","item","expectedItem","getType","isMatchOption","clearTracingIfNeeded","context","startTracer","configuration","sessionManager","injectHeadersIfTracingAllowed","tracingHeaders","_a","key","shallowClone","headers_1","value","header","objectEntries","xhr","name","inject","isTracingSupported","tracingOption","find","matchList","TraceIdentifier","isNumber","performDraw","makeTracingHeaders","getCrypto","traceId","spanId","traceSampled","propagatorTypes","propagatorType","assign","radix","high","low","str","mod","offset","validateAndBuildRumConfiguration","initConfiguration","_a","_b","_c","_d","_e","_f","display","isPercentage","premiumSampleRate","traceSampleRate","allowedTracingUrls","validateAndBuildTracingOptions","baseConfiguration","validateAndBuildConfiguration","trackUserInteractions","trackFrustrations","assign","objectHasValue","DefaultPrivacyLevel","tracingOptions_1","option","isMatchOption","isTracingOption","tracingOptions_2","legacyMatchOption","tracingOption","convertLegacyMatchOptionToTracingOption","item","match","url","getOrigin","getSelectedTracingPropagators","configuration","usedTracingPropagators","getType","propagatorType","arrayFrom","serializeRumConfiguration","baseSerializedConfiguration","serializeConfiguration","buildCommonContext","globalContextManager","userContextManager","recorderApi","makeRumPublicApi","startRumImpl","recorderApi","_a","_b","_c","ignoreInitIfSyntheticsWillInjectRum","isAlreadyInitialized","globalContextManager","createContextManager","userContextManager","getInternalContextStrategy","getInitConfigurationStrategy","stopSessionStrategy","noop","getSessionReplayLinkStrategy","bufferApiCalls","BoundedBuffer","addTimingStrategy","name","time","timeStampNow","startViewStrategy","options","startClocks","clocksNow","addActionStrategy","action","commonContext","buildCommonContext","addErrorStrategy","providedError","addFeatureFlagEvaluationStrategy","key","value","initRum","initConfiguration","deepClone","willSyntheticsInjectRum","eventBridgeAvailable","canUseEventBridge","overrideInitConfigurationForBridge","canInitRum","configuration","validateAndBuildRumConfiguration","display","doStartRum","beforeInitCalls","initialViewOptions","startRumResults","startView","monitor","sanitizedOptions","rumPublicApi","makePublicApi","startTime","context","sanitize","error","handlingStack","createHandlingStack","callMonitored","newUser","checkUser","sanitizeUser","property","sanitizedProperty","assign","createDOMMutationObservable","MutationObserver","getMutationObserverConstructor","observable","Observable","observer","monitor","constructor","browserWindow","getZoneJsOriginalValue","patchedInstance","noop","originalInstance","FAKE_INITIAL_DOCUMENT","RESOURCE_TYPES","initiatorType","_","path","includes","computeResourceKind","timing","url","isValidUrl","addTelemetryDebug","getPathName","_i","RESOURCE_TYPES_1","_a","type","isType","areInOrder","numbers","i","isRequestKind","computePerformanceResourceDuration","entry","duration","startTime","responseEnd","toServerDuration","elapsed","computePerformanceResourceDetails","validEntry","toValidEntry","fetchStart","redirectStart","redirectEnd","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","details","formatTiming","hasRedirection","assign","origin","start","end","computeSize","isAllowedRequestUrl","configuration","isTextNode","node","isCommentNode","isElementNode","isNodeShadowHost","isNodeShadowRoot","shadowRoot","getChildNodes","getParentNode","INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD","ONE_MINUTE","getDocumentTraceId","document","data","getDocumentTraceDataFromMeta","getDocumentTraceDataFromComment","dateNow","traceIdMeta","traceTimeMeta","createDocumentTraceData","comment","findTraceComment","findCommaSeparatedValue","traceId","rawTraceTime","traceTime","i","getTraceCommentFromNode","node","isTextNode","isCommentNode","match","supportPerformanceObject","supportPerformanceTimingEvent","entryType","startPerformanceCollection","lifeCycle","configuration","retrieveInitialDocumentResourceTiming","timing","handleRumPerformanceEntries","performanceEntries_1","setTimeout","handlePerformanceEntryList_1","monitor","entries","mainEntries","experimentalEntries","type","observer","mainObserver","addEventListener","retrieveNavigationTiming","retrieveFirstInputTiming","callback","runOnReadyState","forcedAttributes","FAKE_INITIAL_DOCUMENT","getDocumentTraceId","navigationEntry","assign","relativePerformanceTiming","computeRelativePerformanceTiming","sendFakeTiming","startTimeStamp","dateNow","timingSent","removeEventListeners","addEventListeners","evt","relativeNow","sendTimingIfPointerIsNotCancelled","sendTiming","event","delay","result","key","isNumber","numberKey","timingElement","getRelativeTime","rumPerformanceEntries","entry","rumAllowedPerformanceEntries","isIncompleteNavigation","isForbiddenResource","isAllowedRequestUrl","getSyntheticsContext","testId","getSyntheticsTestId","resultId","getSyntheticsResultId","willSyntheticsInjectRum","getCiTestContext","_a","testExecutionId","viewportObservable","initViewportObservable","createViewportObservable","observable","Observable","updateDimension","throttle","getViewportDimension","addEventListener","visual","viewport","stopListeners","getDisplayContext","getViewportDimension","initViewportObservable","viewportDimension","limitModification","object","modifiableFieldPaths","modifier","clone","deepClone","result","objectEntries","_a","fieldPath","fieldType","newValue","get","newType","getType","set","sanitize","path","current","_i","field","isValidObjectContaining","value","fields","i","isValidObject","VIEW_MODIFIABLE_FIELD_PATHS","USER_CUSTOMIZABLE_FIELD_PATHS","modifiableFieldPathsByEvent","startRumAssembly","configuration","lifeCycle","sessionManager","viewContexts","urlContexts","actionContexts","buildCommonContext","reportError","_a","_b","assign","eventRateLimiters","createEventRateLimiter","syntheticsContext","getSyntheticsContext","ciTestContext","getCiTestContext","startTime","rawRumEvent","domainContext","savedCommonContext","customerContext","viewContext","urlContext","session","commonContext","actionId","rumContext","currentDrift","canUseEventBridge","timeStampNow","needToAssembleWithAction","getDisplayContext","serverRumEvent","combine","isEmptyObject","shouldSend","event","beforeSend","result","limitModification","display","rateLimitReached","MAX_NUMBER_OF_SELECTABLE_FOREGROUND_PERIODS","MAX_NUMBER_OF_STORED_FOREGROUND_PERIODS","foregroundPeriods","startForegroundContexts","addNewForegroundPeriod","stopForegroundTracking","trackFocus","stopBlurTracking","trackBlur","closeForegroundPeriod","isInForegroundAt","selectInForegroundPeriodsFor","currentForegroundPeriod","now","relativeNow","onFocusChange","addEventListener","event","onBlurChange","startTime","i","foregroundPeriod","eventStartTime","duration","eventEndTime","addDuration","filteredForegroundPeriods","earliestIndex","startDuration","elapsed","endTime","endDuration","toServerDuration","startInternalContext","applicationId","sessionManager","viewContexts","actionContexts","urlContexts","startTime","viewContext","urlContext","session","actionId","LifeCycle","AbstractLifeCycle","VIEW_CONTEXT_TIME_OUT_DELAY","SESSION_TIME_OUT_DELAY","startViewContexts","lifeCycle","viewContextHistory","ValueHistory","view","buildViewContext","_a","endClocks","startTime","nextRequestIndex","startRequestCollection","lifeCycle","configuration","sessionManager","tracer","startTracer","trackXhr","trackFetch","subscription","initXhrObservable","rawContext","context","isAllowedRequestUrl","getNextRequestIndex","initFetchObservable","waitForResponseToComplete","duration","result","callback","clonedResponse","tryToClone","elapsed","timeStampNow","readBytesFromStream","trackEventCounts","_a","lifeCycle","isChildEvent","_b","callback","noop","eventCounts","subscription","event","PAGE_ACTIVITY_VALIDATION_DELAY","PAGE_ACTIVITY_END_DELAY","waitPageActivityEnd","lifeCycle","domMutationObservable","configuration","pageActivityEndCallback","maxDuration","pageActivityObservable","createPageActivityObservable","doWaitPageActivityEnd","pageActivityEndTimeoutId","hasCompleted","validationTimeoutId","setTimeout","monitor","complete","maxDurationTimeoutId","timeStampNow","pageActivitySubscription","_a","isBusy","clearTimeout","lastChangeTime","stop","event","observable","Observable","subscriptions","firstRequestIndex","pendingRequestsCount","notifyPageActivity","entries","entry","isExcludedUrl","startEvent","request","stopTrackingWindowOpen","trackWindowOpen","s","requestUrl","matchList","callback","instrumentMethodAndCallOriginal","MAX_DURATION_BETWEEN_CLICKS","ONE_SECOND","MAX_DISTANCE_BETWEEN_CLICKS","createClickChain","firstClick","onFinalize","bufferedClicks","status","maxDurationBetweenClicksTimeoutId","appendClick","click","tryFinalize","clearTimeout","setTimeout","dontAcceptMoreClick","areEventsSimilar","first","second","mouseEventDistance","origin","other","DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE","getActionNameFromElement","element","userProgrammaticAttribute","getActionNameFromElementProgrammatically","getActionNameFromElementForStrategies","priorityStrategies","fallbackStrategies","targetElement","programmaticAttribute","elementWithAttribute","supportsElementClosest","name","truncate","normalizeWhitespace","supportsLabelProperty","getTextualContent","label","find","input","type","labelledByAttribute","id","getElementById","MAX_PARENTS_TO_CONSIDER","strategies","recursionCounter","_i","strategies_1","strategy","name_1","trimmedName","s","safeTruncate","refElement","text_1","removeTextFromElements","query","list","index","element_1","textToReplace","supportsInnerTextScriptAndStyleRemoval","isIE","supportsLabelPropertyResult","supportsElementClosestResult","STABLE_ATTRIBUTES","DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE","GLOBALLY_UNIQUE_SELECTOR_GETTERS","getStableAttributeSelector","getIDSelector","UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS","getClassSelector","getTagNameSelector","getSelectorFromElement","targetElement","actionNameAttribute","targetElementSelector","element","globallyUniqueSelector","findSelector","isSelectorUniqueGlobally","uniqueSelectorAmongChildren","isSelectorUniqueAmongSiblings","combineSelector","getPositionSelector","isGeneratedValue","value","cssEscape","i","className","selector","getAttributeSelector","_i","STABLE_ATTRIBUTES_1","attributeName","sibling","elementIndex","selectorGetters","predicate","childSelector","selectorGetters_1","selectorGetter","elementSelector","fullSelector","supportScopeSelector","parent","child","supportScopeSelectorCache","listenActionEvents","_a","onPointerDown","onPointerUp","selectionEmptyAtPointerDown","userActivity","clickContext","listeners","addEventListener","event","isValidPointerEvent","isSelectionEmpty","localUserActivity_1","listener","selection","MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE","computeFrustration","clicks","rageClick","isRage","isDead","hasSelectionChanged","click","i","ONE_SECOND","DEAD_CLICK_EXCLUDE_SELECTOR","elementMatches","CLICK_ACTION_MAX_DURATION","ONE_SECOND","ACTION_CONTEXT_TIME_OUT_DELAY","ONE_MINUTE","trackClickActions","lifeCycle","domMutationObservable","configuration","history","ValueHistory","stopObservable","Observable","currentClickChain","stopClickChain","stopActionEventsListener","listenActionEvents","pointerDownEvent","processPointerDown","_a","startEvent","getUserActivity","clickActionBase","hadActivityOnPointerDown","startClickAction","appendClickToClickChain","actionContexts","startTime","click","rageClick_1","createClickChain","clicks","finalizeClicks","computeClickActionBase","waitPageActivityEnd","pageActivityEndEvent","PAGE_ACTIVITY_VALIDATION_DELAY","newClick","stopWaitPageActivityEnd","viewEndedSubscription","endClocks","stopSubscription","event","actionNameAttribute","rect","getSelectorFromElement","getActionNameFromElement","id","generateUUID","startClocks","clocksNow","historyEntry","eventCountsSubscription","trackEventCounts","includes","status","activityEndTime","frustrationTypes","stop","newActivityEndTime","getRelativeTime","frustrationType","domEvents","resourceCount","errorCount","longTaskCount","clickAction","assign","elapsed","rageClick","isRage","computeFrustration","timeStampNow","startActionCollection","lifeCycle","domMutationObservable","configuration","foregroundContexts","action","processAction","actionContexts","noop","trackClickActions","savedCommonContext","assign","autoActionProperties","isAutoAction","toServerDuration","customerContext","actionEvent","combine","generateUUID","inForeground","trackConsoleError","errorObservable","subscription","initConsoleObservable","ConsoleApiName","consoleError","clocksNow","ErrorSource","trackReportError","errorObservable","subscription","initReportObservable","RawReportType","reportError","clocksNow","ErrorSource","startErrorCollection","lifeCycle","foregroundContexts","featureFlagContexts","errorObservable","Observable","trackConsoleError","trackRuntimeError","trackReportError","error","doStartErrorCollection","_a","customerContext","savedCommonContext","assign","processError","handlingStack","startClocks","stackTrace","computeStackTrace","rawError","computeRawError","ErrorSource","rawRumEvent","generateUUID","inForeground","featureFlagContext","isEmptyObject","startLongTaskCollection","lifeCycle","sessionManager","entries","_i","entries_1","entry","session","startClocks","relativeToClocks","rawRumEvent","generateUUID","toServerDuration","matchRequestTiming","request","sameNameEntries","candidates","entry","toValidEntry","isBetween","endTime","timing","addDuration","start","end","errorMargin","startResourceCollection","lifeCycle","configuration","sessionManager","pageStateHistory","request","processRequest","entries","_i","entries_1","entry","isRequestKind","processResourceEntry","_a","type","matchingTiming","matchRequestTiming","startClocks","relativeToClocks","correspondingTimingOverrides","computePerformanceEntryMetrics","tracingInfo","computeRequestTracingInfo","indexingInfo","computeIndexingInfo","duration","computeRequestDuration","pageStateInfo","computePageStateInfo","resourceEvent","combine","generateUUID","computeResourceKind","entryMetrics","computeEntryTracingInfo","timing","assign","computePerformanceResourceDuration","computeSize","computePerformanceResourceDetails","hasBeenTraced","getRulePsr","getRulePsr","configuration","isNumber","computeIndexingInfo","sessionManager","resourceStart","session","computePageStateInfo","pageStateHistory","startClocks","duration","isExperimentalFeatureEnabled","ExperimentalFeature","computeRequestDuration","_a","toServerDuration","requestCrossedFrozenState","pageState","trackFirstHiddenSingleton","stopListeners","trackFirstHidden","eventTarget","addEventListeners","event","TIMING_MAXIMUM_DELAY","ONE_MINUTE","KEEP_TRACKING_TIMINGS_AFTER_VIEW_DELAY","trackInitialViewTimings","lifeCycle","setLoadEvent","scheduleViewUpdate","timings","setTimings","newTimings","assign","stopNavigationTracking","trackNavigationTimings","stopFCPTracking","trackFirstContentfulPaintTiming","firstContentfulPaint","stopLCPTracking","trackLargestContentfulPaintTiming","largestContentfulPaint","stopFIDTracking","trackFirstInputTimings","_a","firstInputDelay","firstInputTime","stop","setTimeout","callback","entries","_i","entries_1","entry","relativeNow","firstHidden","trackFirstHidden","fcpEntry","find","eventTarget","firstInteractionTimestamp","stopEventListener","addEventListeners","event","unsubscribeLifeCycle","lcpEntry","findLast","firstInputEntry","elapsed","trackViewMetrics","lifeCycle","domMutationObservable","configuration","scheduleViewUpdate","loadingType","viewStart","viewMetrics","_a","trackLoadingTime","newLoadingTime","stopLoadingTimeTracking","setLoadEvent","stopCLSTracking","isLayoutShiftSupported","trackCumulativeLayoutShift","cumulativeLayoutShift","noop","loadType","callback","isWaitingForLoadEvent","isWaitingForActivityLoadingTime","loadingTimeCandidates","invokeCallbackIfAllCandidatesAreReceived","stop","waitPageActivityEnd","event","elapsed","loadEvent","maxClsValue","window","slidingSessionWindow","entries","_i","entries_1","entry","round","value","startTime","endTime","shouldCreateNewWindow","ONE_SECOND","supportPerformanceTimingEvent","KEEP_TRACKING_EVENT_COUNTS_AFTER_VIEW_DELAY","ONE_MINUTE","trackViewEventCounts","lifeCycle","viewId","onChange","_a","trackEventCounts","event","stop","eventCounts","setTimeout","THROTTLE_VIEW_UPDATE_PERIOD","SESSION_KEEP_ALIVE_INTERVAL","ONE_MINUTE","trackViews","location","lifeCycle","domMutationObservable","configuration","locationChangeObservable","areViewsTrackedAutomatically","initialViewOptions","currentView","startNewView","clocksOrigin","startViewLifeCycle","locationChangeSubscription","renewViewOnLocationChange","loadingType","startClocks","viewOptions","newView","pageExitEvent","PageExitReason","_a","oldLocation","newLocation","areDifferentLocation","name","time","timeStampNow","options","initialLocation","clocksNow","id","generateUUID","customTimings","documentVersion","endClocks","shallowClone","sessionIsActive","service","version","throttle","triggerViewUpdate","scheduleViewUpdate","cancelScheduleViewUpdate","_b","trackViewMetrics","setLoadEvent","stopViewMetricsTracking","viewMetrics","_c","trackInitialViewTimings","noop","scheduleStopInitialViewTimingsTracking","timings","_d","trackViewEventCounts","scheduleStopEventCountsTracking","eventCounts","keepAliveIntervalId","setInterval","currentEnd","assign","elapsed","clearInterval","relativeTime","looksLikeRelativeTime","sanitizeTiming","sanitized","display","currentLocation","otherLocation","isHashAnAnchor","getPathFromHash","hash","correspondingId","index","startViewCollection","lifeCycle","configuration","location","domMutationObservable","locationChangeObservable","foregroundContexts","featureFlagContexts","pageStateHistory","recorderApi","initialViewOptions","view","processViewUpdate","trackViewResult","trackViews","replayStats","featureFlagContext","pageStatesEnabled","isExperimentalFeatureEnabled","ExperimentalFeature","viewEvent","toServerDuration","discardNegativeDuration","isEmptyObject","mapValues","duration","isNumber","RUM_SESSION_KEY","startRumSessionManager","configuration","lifeCycle","sessionManager","startSessionManager","rawTrackingType","computeSessionState","startTime","session","isTypeTracked","plan","startRumSessionManagerStub","noop","Observable","trackingType","hasValidRumSession","performDraw","rumSessionType","startRumBatch","configuration","lifeCycle","telemetryEventObservable","reportError","pageExitObservable","sessionExpireObservable","batch","makeRumBatch","serverRumEvent","event","isTelemetryReplicationAllowed","_a","createRumBatch","primaryBatch","primaryFlushController","replicaBatch","replica","endpointBuilder","flushController","createFlushController","Batch","createHttpRequest","withReplicaApplicationId","message","combine","replicated","key","startRumEventBridge","lifeCycle","bridge","getEventBridge","serverRumEvent","URL_CONTEXT_TIME_OUT_DELAY","SESSION_TIME_OUT_DELAY","startUrlContexts","lifeCycle","locationChangeObservable","location","urlContextHistory","ValueHistory","previousViewUrl","_a","endClocks","startClocks","viewUrl","buildUrlContext","locationChangeSubscription","newLocation","current","changeTime","relativeNow","url","referrer","startTime","createLocationChangeObservable","location","currentLocation","shallowClone","observable","Observable","stopHistoryTracking","trackHistory","onLocationChange","stopHashTracking","trackHash","newLocation","onHistoryChange","stopInstrumentingPushState","instrumentMethodAndCallOriginal","stopInstrumentingReplaceState","removeListener","addEventListener","onHashChange","FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY","SESSION_TIME_OUT_DELAY","BYTES_COMPUTATION_THROTTLING_DELAY","startFeatureFlagContexts","lifeCycle","computeBytesCountImpl","computeBytesCount","isExperimentalFeatureEnabled","ExperimentalFeature","noop","featureFlagContexts","ValueHistory","bytesCountCache","alreadyWarned","_a","endClocks","startClocks","throttle","context","jsonStringify","warnIfCustomerDataLimitReached","computeBytesCountThrottled","cancelPendingComputation","startTime","currentContext","key","value","MEASURES_PERIOD_DURATION","ONE_SECOND","currentPeriodMeasures","currentBatchMeasures","batchHasRumEvent","startCustomerDataTelemetry","configuration","telemetry","lifeCycle","globalContextManager","userContextManager","featureFlagContexts","batchFlushObservable","customerDataTelemetryEnabled","performDraw","initCurrentPeriodMeasures","initCurrentBatchMeasures","event","updateMeasure","isEmptyObject","featureFlagContext","hasFeatureFlagContext","includes","_a","bytesCount","messagesCount","mergeMeasure","setInterval","sendCurrentPeriodMeasures","addTelemetryDebug","createMeasure","measure","value","target","source","MAX_PAGE_STATE_ENTRIES","MAX_PAGE_STATE_ENTRIES_SELECTABLE","PAGE_STATE_CONTEXT_TIME_OUT_DELAY","SESSION_TIME_OUT_DELAY","startPageStateHistory","maxPageStateEntriesSelectable","pageStateHistory","ValueHistory","currentPageState","addPageState","getPageState","relativeNow","stopEventListeners","addEventListeners","event","computePageState","nextPageState","startTime","eventStartTime","duration","pageStateEntries","pageStateServerEntries","limit","index","pageState","relativeStartTime","elapsed","toServerDuration","startRum","initConfiguration","configuration","recorderApi","globalContextManager","userContextManager","initialViewOptions","lifeCycle","LifeCycle","event","sendToExtension","telemetry","startRumTelemetry","_a","_b","session","viewContexts","actionContexts","reportError","error","featureFlagContexts","startFeatureFlagContexts","pageExitObservable","createPageExitObservable","canUseEventBridge","startRumSessionManagerStub","startRumSessionManager","startRumEventBridge","batch","startRumBatch","startCustomerDataTelemetry","domMutationObservable","createDOMMutationObservable","locationChangeObservable","createLocationChangeObservable","startRumEventCollection","buildCommonContext","foregroundContexts","pageStateHistory","urlContexts","addAction","addTelemetryConfiguration","serializeRumConfiguration","startLongTaskCollection","startResourceCollection","startViewCollection","addTiming","startView","addError","startErrorCollection","startRequestCollection","startPerformanceCollection","internalContext","startInternalContext","startTelemetry","bridge_1","getEventBridge","location","sessionManager","startViewContexts","startUrlContexts","startForegroundContexts","startPageStateHistory","startActionCollection","startRumAssembly","getSessionReplayUrl","configuration","_a","session","viewContext","errorType","sessionId","parameters","origin","getDatadogSiteUrl","path","rumConfiguration","site","subdomain","getSiteDefaultSubdomain","INTAKE_SITE_US1","INTAKE_SITE_EU1","INTAKE_SITE_STAGING","RecordType","NodeType","IncrementalSource","MouseInteractionType","MediaInteractionType","assembleIncrementalSnapshot","source","data","assign","RecordType","timeStampNow","NodePrivacyLevel","DefaultPrivacyLevel","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_ALLOW","PRIVACY_ATTR_VALUE_MASK","PRIVACY_ATTR_VALUE_MASK_USER_INPUT","PRIVACY_ATTR_VALUE_HIDDEN","PRIVACY_CLASS_ALLOW","PRIVACY_CLASS_MASK","PRIVACY_CLASS_MASK_USER_INPUT","PRIVACY_CLASS_HIDDEN","CENSORED_STRING_MARK","CENSORED_IMG_MARK","FORM_PRIVATE_TAG_NAMES","MAX_ATTRIBUTE_VALUE_CHAR_LENGTH","TEXT_MASKING_CHAR","getNodePrivacyLevel","node","defaultPrivacyLevel","parentNode","getParentNode","parentNodePrivacyLevel","selfNodePrivacyLevel","getNodeSelfPrivacyLevel","reducePrivacyLevel","childPrivacyLevel","NodePrivacyLevel","isElementNode","privAttr","PRIVACY_ATTR_NAME","inputElement","autocomplete","PRIVACY_ATTR_VALUE_HIDDEN","PRIVACY_CLASS_HIDDEN","PRIVACY_ATTR_VALUE_MASK","PRIVACY_CLASS_MASK","PRIVACY_ATTR_VALUE_MASK_USER_INPUT","PRIVACY_CLASS_MASK_USER_INPUT","PRIVACY_ATTR_VALUE_ALLOW","PRIVACY_CLASS_ALLOW","shouldIgnoreElement","shouldMaskNode","privacyLevel","isTextNode","isFormElement","element","FORM_PRIVATE_TAG_NAMES","censorText","text","getTextContent","textNode","ignoreWhiteSpace","_a","parentTagName","textContent","nodePrivacyLevel","isStyle","isScript","CENSORED_STRING_MARK","relAttribute","getLowerCaseAttribute","nameAttribute","propertyAttribute","name","serializedNodeIds","hasSerializedNode","node","nodeAndAncestorsHaveSerializedNode","current","isNodeShadowRoot","getParentNode","getSerializedNodeId","setSerializedNodeId","serializeNodeId","getElementInputValue","element","nodePrivacyLevel","tagName","value","shouldMaskNode","type","CENSORED_STRING_MARK","URL_IN_CSS_REF","ABSOLUTE_URL","DATA_URI","switchToAbsoluteUrl","cssText","cssHref","matchingSubstring","singleQuote","urlWrappedInSingleQuotes","doubleQuote","urlWrappedInDoubleQuotes","urlNotWrappedInQuotes","url","quote","makeUrlAbsolute","baseUrl","buildUrl","TAG_NAME_REGEX","getValidTagName","processedTagName","serializeStyleSheets","cssStyleSheets","cssStyleSheet","rules","cssRules","cssRule","styleSheet","serializeAttribute","element","nodePrivacyLevel","attributeName","configuration","NodePrivacyLevel","attributeValue","PRIVACY_ATTR_NAME","STABLE_ATTRIBUTES","tagName","CENSORED_STRING_MARK","CENSORED_IMG_MARK","startsWith","MAX_ATTRIBUTE_VALUE_CHAR_LENGTH","serializeAttributes","element","nodePrivacyLevel","options","_a","NodePrivacyLevel","safeAttrs","tagName","getValidTagName","doc","i","attribute","attributeName","attributeValue","serializeAttribute","formValue","getElementInputValue","optionElement","stylesheet","s","cssText","getCssRulesString","inputElement","shouldMaskNode","mediaElement","scrollTop","scrollLeft","serializationContext","cssStyleSheet","rules","styleSheetCssText","getCssRuleString","switchToAbsoluteUrl","rule","isCSSImportRule","serializeNodeWithId","node","options","serializedNode","serializeNode","id","getSerializedNodeId","generateNextId","serializedNodeWithId","setSerializedNodeId","_nextId","serializeChildNodes","result","childNode","serializedChildNode","serializeDocumentNode","serializeDocumentFragmentNode","serializeDocumentTypeNode","serializeElementNode","serializeTextNode","serializeCDataNode","document","NodeType","serializeStyleSheets","element","childNodes","isShadowRoot","isNodeShadowRoot","documentType","_a","tagName","getValidTagName","isSVG","isSVGElement","nodePrivacyLevel","reducePrivacyLevel","getNodeSelfPrivacyLevel","NodePrivacyLevel","_b","width","height","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_HIDDEN","attributes","serializeAttributes","childNodesSerializationOptions","assign","isNodeShadowHost","shadowRoot","el","textNode","parentTagName","textContent","getTextContent","serializeDocument","document","configuration","serializationContext","serializeNodeWithId","isTouchEvent","event","getEventTarget","isNodeShadowHost","TOLERANCE","isVisualViewportFactoredIn","visualViewport","convertMouseEventToLayoutCoordinates","clientX","clientY","normalized","getVisualViewport","getScrollX","scrollX","visual","getScrollY","scrollY","MOUSE_MOVE_OBSERVER_THRESHOLD","initMoveObserver","cb","updatePosition","throttle","event","target","getEventTarget","hasSerializedNode","coordinates","tryToComputeCoordinates","position","getSerializedNodeId","isTouchEvent","IncrementalSource","addEventListeners","_a","x","y","_b","convertMouseEventToLayoutCoordinates","visualViewportX","visualViewportY","addTelemetryDebug","SCROLL_OBSERVER_THRESHOLD","initScrollObserver","cb","defaultPrivacyLevel","elementsScrollPositions","updatePosition","throttle","event","target","getEventTarget","getNodePrivacyLevel","NodePrivacyLevel","hasSerializedNode","id","getSerializedNodeId","scrollPositions","getScrollY","getScrollX","addEventListener","_a","eventTypeToMouseInteraction","MouseInteractionType","initMouseInteractionObserver","cb","defaultPrivacyLevel","recordIds","handler","event","target","getEventTarget","getNodePrivacyLevel","NodePrivacyLevel","hasSerializedNode","id","getSerializedNodeId","type","interaction","coordinates","tryToComputeCoordinates","record","assign","assembleIncrementalSnapshot","IncrementalSource","addEventListeners","initInputObserver","cb","defaultPrivacyLevel","_a","_b","_c","domEvents","_d","target","lastInputStateMap","onElementChange","nodePrivacyLevel","getNodePrivacyLevel","NodePrivacyLevel","type","inputState","shouldMaskNode","value","getElementInputValue","cbWithDedup","name","forEach","el","hasSerializedNode","lastInputState","assign","getSerializedNodeId","stopEventListeners","addEventListeners","event","getEventTarget","instrumentationStoppers","instrumentSetter","stopper","initStyleSheetObserver","cb","checkStyleSheetAndCallback","styleSheet","callback","hasSerializedNode","getSerializedNodeId","instrumentationStoppers","instrumentMethodAndCallOriginal","rule","index","id","instrumentGroupingCSSRuleClass","cls","_this","path","getPathToNestedCSSRule","stopper","currentRule","rules_1","index_1","rules","initMediaInteractionObserver","mediaInteractionCb","defaultPrivacyLevel","handler","event","target","getEventTarget","getNodePrivacyLevel","NodePrivacyLevel","hasSerializedNode","getSerializedNodeId","MediaInteractionType","addEventListeners","initFrustrationObserver","lifeCycle","frustrationCb","recordIds","data","_a","_b","_c","RecordType","e","VISUAL_VIEWPORT_OBSERVER_THRESHOLD","initViewportResizeObserver","cb","initViewportObservable","initVisualViewportResizeObserver","visualViewport","noop","_a","throttle","getVisualViewport","updateDimension","cancelThrottle","removeListener","addEventListeners","MUTATION_PROCESS_MAX_DELAY","createMutationBatch","processMutationBatch","cancelScheduledFlush","noop","pendingMutations","flush","mutations","requestIdleCallback","callback","opts","id_1","monitor","id","initMutationObserver","mutationCallback","configuration","shadowRootsController","target","MutationObserver","getMutationObserverConstructor","noop","mutationBatch","createMutationBatch","mutations","processMutations","observer","monitor","mutation","removedNode","traverseRemovedShadowDom","filteredMutations","nodeAndAncestorsHaveSerializedNode","getNodePrivacyLevel","NodePrivacyLevel","_a","processChildListMutations","adds","removes","hasBeenSerialized","texts","processCharacterDataMutations","attributes","processAttributesMutations","addedAndMovedNodes","removedNodes","_loop_1","node","_i","mutations_1","sortedAddedAndMovedNodes","sortAddedAndMovedNodes","serializedNodeIds","addedNodeMutations","sortedAddedAndMovedNodes_1","parentNodePrivacyLevel","serializedNode","serializeNodeWithId","parentNode","getParentNode","getNextSibling","getSerializedNodeId","removedNodeMutations","parent","hasSerializedNode","nextSibling","textMutations","handledNodes","filteredMutations_1","value","getTextContent","attributeMutations","handledElements","handledAttributes","emittedMutations","filteredMutations_2","uncensoredValue","privacyLevel","attributeValue","serializeAttribute","transformedValue","inputValue","getElementInputValue","emittedMutation","nodes","a","b","position","shadowDomRemovedCallback","isNodeShadowHost","getChildNodes","child","initFocusObserver","focusCb","addEventListeners","initRecordIds","recordIds","nextId","event","initObservers","o","recordIds","initRecordIds","mutationHandler","initMutationObserver","mousemoveHandler","initMoveObserver","mouseInteractionHandler","initMouseInteractionObserver","scrollHandler","initScrollObserver","viewportResizeHandler","initViewportResizeObserver","inputHandler","initInputObserver","mediaInteractionHandler","initMediaInteractionObserver","styleSheetObserver","initStyleSheetObserver","focusHandler","initFocusObserver","visualViewportResizeHandler","initVisualViewportResizeObserver","frustrationHandler","initFrustrationObserver","createElementsScrollPositions","scrollPositionsByElement","element","scrollPositions","initShadowRootsController","configuration","_a","mutationCb","inputCb","controllerByShadowRoot","shadowRootsController","shadowRoot","initMutationObserver","stopMutationObserver","flush","stopInputObserver","initInputObserver","entry","stop","record","options","emit","elementsScrollPositions","createElementsScrollPositions","mutationCb","mutation","assembleIncrementalSnapshot","IncrementalSource","inputCb","s","shadowRootsController","initShadowRootsController","takeFullSnapshot","timestamp","serializationContext","timeStampNow","_a","getViewportDimension","width","height","RecordType","serializeDocument","getScrollX","getScrollY","getVisualViewport","initObservers","p","mouseInteractionRecord","positions","source","r","d","frustrationRecord","data","stopObservers","flushMutationsFromObservers","flushMutations","buildReplayPayload","data","metadata","rawSegmentBytesCount","formData","metadataAndSegmentSizes","assign","serializedMetadataAndSegmentSizes","MAX_STATS_HISTORY","statsPerView","getSegmentsCount","viewId","getOrCreateReplayStats","addSegment","addRecord","addWroteData","additionalBytesCount","getReplayStats","getOrCreateReplayStats","viewId","statsPerView","replayStats","MAX_STATS_HISTORY","deleteOldestStats","isFirst_1","_value","key","nextId","Segment","worker","context","creationReason","initialRecord","onWrote","onFlushed","_this","viewId","assign","RecordType","getSegmentsCount","addSegment","addRecord","removeMessageListener","addEventListener","_a","data","addWroteData","addTelemetryDebug","sendToExtension","record","reason","SEGMENT_DURATION_LIMIT","ONE_SECOND","SEGMENT_BYTES_LIMIT","startSegmentCollection","lifeCycle","applicationId","sessionManager","viewContexts","httpRequest","worker","doStartSegmentCollection","computeSegmentContext","getSegmentContext","state","unsubscribeViewCreated","flushSegment","unsubscribePageExited","pageExitEvent","flushReason","clearTimeout","createNewSegment","creationReason","initialRecord","context","segment","Segment","compressedSegmentBytesCount","data","rawSegmentBytesCount","payload","buildReplayPayload","isPageExitReason","setTimeout","record","session","viewContext","workerURL","createDeflateWorker","workerCodeFn","monitor","_a","makePakoDeflate","Deflate","constants","string2buf","deflate","rawBytesCount","event","data","additionalBytesCount","pushData","total","chunk","binaryData","fn","e","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","zero","buf","len","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH","MAX_MATCH","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","extra_dbits","extra_blbits","bl_order","DIST_CODE_LEN","static_ltree","static_dtree","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","d_code","dist","put_short","s","w","send_bits","value","length","send_code","c","tree","bi_reverse","code","res","bi_flush","gen_bitlen","desc","max_code","stree","has_stree","extra","base","h","n","m","bits","xbits","f","overflow","gen_codes","bl_count","next_code","tr_static_init","init_block","bi_windup","copy_block","header","smaller","depth","_n2","_m2","pqdownheap","k","v","j","compress_block","ltree","dtree","lc","lx","build_tree","node","scan_tree","prevlen","curlen","nextlen","count","max_count","min_count","send_tree","build_bl_tree","max_blindex","send_all_trees","lcodes","dcodes","blcodes","rank","detect_data_type","black_mask","static_init_done","_tr_init","_tr_stored_block","stored_len","last","_tr_align","_tr_flush_block","opt_lenb","static_lenb","_tr_tally","_tr_init_1","_tr_stored_block_1","_tr_flush_block_1","_tr_tally_1","_tr_align_1","trees","adler32","adler","pos","s1","s2","adler32_1","makeTable","table","crcTable","crc32","crc","t","end","i","crc32_1","messages","_tr_init$1","_tr_stored_block$1","_tr_flush_block$1","_tr_tally$1","_tr_align$1","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_OK","Z_STREAM_END","Z_STREAM_ERROR","Z_DATA_ERROR","Z_BUF_ERROR","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED$1","Z_DEFAULT_STRATEGY","Z_UNKNOWN$1","Z_DEFLATED","MAX_MEM_LEVEL","MAX_WBITS","DEF_MEM_LEVEL","LENGTH_CODES$1","LITERALS$1","L_CODES$1","D_CODES$1","BL_CODES$1","HEAP_SIZE$1","MAX_BITS$1","MIN_MATCH$1","MAX_MATCH$1","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","err","strm","errorCode","zero$1","HASH_ZLIB","prev","HASH","flush_pending","flush_block_only","put_byte","b","putShortMSB","read_buf","start","size","longest_match","cur_match","chain_length","scan","match","best_len","nice_match","limit","_win","wmask","strend","scan_end1","scan_end","fill_window","_w_size","p","more","str","deflate_stored","flush","max_block_size","max_start","deflate_fast","hash_head","bflush","deflate_slow","max_insert","deflate_rle","deflate_huff","Config","good_length","max_lazy","nice_length","max_chain","func","configuration_table","lm_init","DeflateState","deflateResetKeep","deflateReset","ret","deflateSetHeader","head","deflateInit2","level","method","windowBits","memLevel","strategy","wrap","deflateInit","beg","val","old_flush","level_flags","bstate","deflateEnd","status","deflateSetDictionary","dictionary","dictLength","tmpDict","avail","next","input","deflateInit_1","deflateInit2_1","deflateReset_1","deflateResetKeep_1","deflateSetHeader_1","deflate_2","deflateEnd_1","deflateSetDictionary_1","deflateInfo","deflate_1","flattenChunks","chunks","l","result","_i","_l","_utf8len","q","ZStream","zstream","toString","Z_NO_FLUSH$1","Z_SYNC_FLUSH","Z_FULL_FLUSH$1","Z_FINISH$1","Z_OK$1","Z_STREAM_END$1","Z_DEFAULT_COMPRESSION$1","Z_DEFAULT_STRATEGY$1","Z_DEFLATED$1","opt","dict","flush_mode","chunkSize","_flush_mode","c2","m_pos","str_len","buf_len","state","startDeflateWorker","callback","createDeflateWorkerImpl","createDeflateWorker","doStartDeflateWorker","doStartDeflateWorker","createDeflateWorkerImpl","createDeflateWorker","worker_1","addEventListener","onError","_a","data","onInitialized","error","worker","state","callback","display","isMessageCspRelated","addTelemetryError","message","includes","startRecording","lifeCycle","configuration","sessionManager","viewContexts","worker","httpRequest","reportError","error","replayRequest","createHttpRequest","SEGMENT_BYTES_LIMIT","_a","startSegmentCollection","addRecord","stopSegmentCollection","_b","record","stopRecording","takeSubsequentFullSnapshot","flushMutations","unsubscribeViewEnded","timeStampNow","RecordType","unsubscribeViewCreated","view","isBrowserSupported","getSessionReplayLink","configuration","sessionManager","viewContexts","isRecordingStarted","session","errorType","getErrorType","viewContext","getSessionReplayUrl","isBrowserSupported","makeRecorderApi","startRecordingImpl","startDeflateWorkerImpl","startDeflateWorker","canUseEventBridge","isBrowserSupported","noop","state","startStrategy","stopStrategy","getReplayStats","configuration","sessionManager","viewContexts","getSessionReplayLink","lifeCycle","session","runOnReadyState","worker","stopRecording","recorderApi","makeRecorderApi","startRecording","datadogRum","makeRumPublicApi","startRum","defineGlobal","getGlobalObject","DatadogService","constructor","startSessionReplayRecording","environment","datadogRumConfig","datadogRum","init","applicationId","clientToken","site","service","env","datadogEnv","sessionSampleRate","sessionReplaySampleRate","trackUserInteractions","trackResources","trackLongTasks","useCrossSiteSessionCookie","defaultPrivacyLevel","factory","ɵfac","providedIn","_DatadogService","ServerMiddlewareHelperService","_a","constructor","socketHelperService","statisticService","loggingService","storeSessionHelper","appDetailsFacade","storeStatisticHelper","upsertSessionDataOnServer","pipe","select","getCurrentState","filter","session","userId","take","subscribe","sessionData","sendServerUpsertSession","JSON","stringify","map","result","logMessage","loggingLevel","SessionLoggingLevel","debug","title","message","catchError","err","of","getHubTaskIdFromServer","getAllActionHandlersFromServer","sendServerGetAllActionsHandlers","actionList","length","tap","join","dispatchAction","setActionHandlers","upsertClientLocationDataOnHub","setBrowserDetails","setBrowserLocationDetails","deviceInfo","getDeviceInfo","browserDetails","browser","browser_version","device","os","os_version","ua","userAgent","isDesktop","isMobile","isTablet","setBrowserDetailsData","locationDetailsStream","locationDetails","setBrowserLocation","setBrowserLocationDetailsData","setClientIP","query","ɵɵinject","SocketHelperService","EzStatisticsService","LoggingService","Store","AppDetailsFacade","EzStoreService","factory","ɵfac","providedIn","__decorate","UntilDestroy","checkProperties","__metadata","ɵɵelementContainerStart","ɵɵelement","ɵɵproperty","AppComponent","_a","constructor","authService","sharedStateFacade","notificationService","serverMiddlewareHelperService","locationSettingsService","router","renderer","_document","uiWebOptions$","ngOnInit","applicationIsInitialized$","getApplicationIsInitialized","pipe","filter","applicationIsInitialized","untilDestroyed","subscribe","startListenNotifications","fetchBanners","getAllActionHandlersFromServer","upsertSessionDataOnServer","upsertClientLocationDataOnHub","fetchUiWebOptions","environment","getEnvironment","localStorage","setItem","getUiWebOptions","addZenDeskChatSupportScript","take","uiWebOptions","addGoogleAnalyticsScript","firstTag","document","createElement","src","GoogleAnalyticsTrackingCode","async","getElementsByTagName","appendChild","secondTag","innerHTML","getLocationPreferenceBooleanValue","script","id","body","window","ɵɵdirectiveInject","AuthService","SharedStateFacade","EzNotificationService","ServerMiddlewareHelperService","LocationSettingsService","Router","Renderer2","DOCUMENT","selectors","standalone","decls","vars","consts","template","rf","ctx","ɵɵtemplate","AppComponent_ng_container_0_Template","AppComponent_ng_template_2_Template","ɵɵtemplateRefExtractor","ɵɵpipeBind1","loading_r1","__decorate","UntilDestroy","__metadata","Document","AuthGuardService","constructor","authService","sessionFacade","userSettingsService","canActivateChild","route","state","getIsUserAuthorized","userSession","userId","loadUserSessionData","getApplicationIsInitialized","pipe","filter","isInitialized","logout","ɵɵinject","AuthService","SessionFacade","UserSettingsService","factory","ɵfac","providedIn","_AuthGuardService","ɵɵelementContainerStart","ɵɵelementStart","ɵɵelement","ɵɵtext","ɵɵelementEnd","ɵɵadvance","ɵɵproperty","i_r1","value","ɵɵtextInterpolate","label","ctx_r1","additionalCommentLabel","feedbackForm","get","FeedbackFormComponent","_a","constructor","fb","router","emailTemplateFacade","checkboxAgree","ratingOptions","feedbackTypeOptions","additionalCommentLabelOptions","ngOnInit","eventsSubscription","showPopup","pipe","untilDestroyed","subscribe","showFeedBackPopup","group","ratingType","EzFormControl","Validators","required","feedbackType","additionalComment","ngOnDestroy","unsubscribe","displayBasic","hideFeedBackPopup","reset","sendFeedBack","valid","form","request","canContact","feedbackComment","feedbackRating","find","i","pageUrl","url","sendFeedbackEmail","onFeedbackTypeChange","option","ɵɵdirectiveInject","UntypedFormBuilder","Router","EmailTemplateStateFacade","selectors","inputs","decls","vars","consts","template","rf","ctx","ɵɵlistener","ɵɵtemplate","FeedbackFormComponent_ng_container_6_Template","$event","FeedbackFormComponent_Conditional_11_Template","ɵɵstyleMap","ɵɵpureFunction0","_c0","ɵɵpipeBind1","_c1","ɵɵconditional","ReactiveFormsModule","ɵNgNoValidate","NgControlStatus","NgControlStatusGroup","FormGroupDirective","FormControlName","EzFormControlTemplateComponent","RadioButton","NgForOf","Select","EzFormControlInputComponent","EzCheckboxComponent","EzButtonsModule","EzLocalizationModule","EzLocalePipe","EmailTemplateStateModule","EzSelectOverlayDirective","EzLayoutModule","EzModalComponent","encapsulation","changeDetection","__decorate","UntilDestroy","__metadata","DynamicMenuDirective","constructor","viewContainerRef","ɵɵdirectiveInject","ViewContainerRef","selectors","_DynamicMenuDirective","theme","dt","classes","props","instance","MenuStyle","BaseStyle","ɵMenuStyle_BaseFactory","__ngFactoryType__","ɵɵgetInheritedFactory","ɵɵdefineInjectable","_c0","_c1","a0","_c2","_c3","MenuItemContent_ng_container_1_a_1_ng_container_1_Template","rf","ctx","ɵɵelementContainer","MenuItemContent_ng_container_1_a_1_Template","ɵɵelementStart","ɵɵtemplate","ɵɵelementEnd","ctx_r1","ɵɵnextContext","itemContent_r3","ɵɵreference","ɵɵproperty","ɵɵpureFunction1","ɵɵattribute","ɵɵsanitizeUrl","ɵɵadvance","MenuItemContent_ng_container_1_a_2_ng_container_1_Template","MenuItemContent_ng_container_1_a_2_Template","ɵɵpureFunction0","MenuItemContent_ng_container_1_Template","ɵɵelementContainerStart","ɵɵelementContainerEnd","MenuItemContent_ng_container_2_1_ng_template_0_Template","MenuItemContent_ng_container_2_1_Template","MenuItemContent_ng_container_2_Template","MenuItemContent_ng_template_3_span_0_Template","ɵɵelement","ɵɵclassMap","MenuItemContent_ng_template_3_span_1_Template","ɵɵtext","ɵɵtextInterpolate","MenuItemContent_ng_template_3_ng_template_2_Template","ɵɵpipe","ɵɵpipeBind1","ɵɵsanitizeHtml","MenuItemContent_ng_template_3_p_badge_4_Template","MenuItemContent_ng_template_3_Template","ɵɵtemplateRefExtractor","htmlLabel_r4","_c4","_c5","_c6","_c7","_c8","_c9","_c10","_c11","_c12","a1","_c13","_c14","_c15","Menu_div_0_div_2_ng_container_1_Template","Menu_div_0_div_2_Template","tmp_5_0","Menu_div_0_5_ng_template_0_li_0_Template","Menu_div_0_5_ng_template_0_li_1_ng_container_1_span_1_Template","submenu_r3","Menu_div_0_5_ng_template_0_li_1_ng_container_1_ng_template_2_Template","Menu_div_0_5_ng_template_0_li_1_ng_container_1_Template","htmlSubmenuLabel_r4","Menu_div_0_5_ng_template_0_li_1_ng_container_2_Template","Menu_div_0_5_ng_template_0_li_1_Template","tmp_13_0","ctx_r4","i_r6","ɵɵpureFunction2","Menu_div_0_5_ng_template_0_ng_template_2_li_0_Template","Menu_div_0_5_ng_template_0_ng_template_2_li_1_Template","_r7","ɵɵgetCurrentView","ɵɵlistener","$event","ɵɵrestoreView","ctx_r7","item_r9","j_r10","ɵɵresetView","Menu_div_0_5_ng_template_0_ng_template_2_Template","Menu_div_0_5_ng_template_0_Template","Menu_div_0_5_Template","Menu_div_0_6_ng_template_0_li_0_Template","Menu_div_0_6_ng_template_0_li_1_Template","_r11","ctx_r11","item_r13","i_r14","tmp_10_0","Menu_div_0_6_ng_template_0_Template","Menu_div_0_6_Template","Menu_div_0_div_7_ng_container_1_Template","Menu_div_0_div_7_Template","Menu_div_0_Template","_r1","tmp_19_0","SafeHtmlPipe","platformId","sanitizer","value","isPlatformBrowser","__ngFactoryType__","ɵɵdirectiveInject","PLATFORM_ID","DomSanitizer","ɵɵdefinePipe","MenuItemContent","EventEmitter","menu","event","item","forwardRef","Menu","ɵɵdefineComponent","CommonModule","NgClass","NgIf","NgTemplateOutlet","NgStyle","RouterModule","RouterLink","RouterLinkActive","Ripple","TooltipModule","BadgeModule","Badge","SharedModule","BaseComponent","computed","signal","inject","MenuStyle","overlayService","uuid","focus","zindexutils","relativePosition","absolutePosition","appendChild","isTouchDevice","id","index","childIndex","label","disabled","optionIndex","find","element","findSingle","anchorElement","matchedOptionIndex","link","links","order","originalEvent","documentTarget","isOutsideContainer","isOutsideTarget","window","ConnectedOverlayScrollHandler","subitem","OverlayService","dirIndex","ɵɵcontentQuery","PrimeTemplate","_t","ɵɵqueryRefresh","ɵɵloadQuery","ɵɵviewQuery","booleanAttribute","numberAttribute","ɵɵProvidersFeature","ɵɵInputTransformsFeature","ɵɵInheritDefinitionFeature","NgForOf","Tooltip","trigger","transition","style","animate","ɵɵelementContainerStart","ɵɵelementStart","ɵɵlistener","$event","ɵɵrestoreView","_r3","ɵɵnextContext","menu_r2","ɵɵreference","ɵɵresetView","toggle","ɵɵelementEnd","ɵɵadvance","ɵɵproperty","ɵɵpipeBind1","ctx_r3","isOpen$","DynamicMenuComponent","_a","constructor","componentFactoryResolver","dynamicMenuItemService","dynamicMenuOpened","EventEmitter","isMobileView","BehaviorSubject","ngOnInit","selectedDynamicItem$","pipe","untilDestroyed","filter","item","subscribe","loadComponent","dynamicItems$","componentFactory","resolveComponentFactory","component","viewContainerRef","appDynamicMenuComponent","clear","componentRef","createComponent","instance","data","showStatusChanged","show","next","onDynamicMenuOpened","isOpen","emit","ɵɵdirectiveInject","ComponentFactoryResolver","DynamicMenuItemService","selectors","viewQuery","rf","ctx","DynamicMenuDirective","_r1","ɵɵelement","i0","ɵɵtemplate","DynamicMenuComponent_ng_template_7_Template","DynamicMenuComponent_ng_container_8_Template","ɵɵpureFunction1","_c0","NgClass","AsyncPipe","Menu","NgIf","EzMobileOverlayComponent","encapsulation","changeDetection","__decorate","UntilDestroy","__metadata","ClickOutsideDirective","_a","constructor","elementRef","document","clickedOutside","EventEmitter","ngAfterViewInit","documentClickSubscription","fromEvent","pipe","filter","event","isInside","target","untilDestroyed","subscribe","emit","elementToCheck","nativeElement","contains","ngOnDestroy","unsubscribe","ɵɵdirectiveInject","ElementRef","DOCUMENT","selectors","outputs","__decorate","UntilDestroy","__metadata","Document","ɵɵelementContainerStart","ɵɵelement","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵadvance","ɵɵtextInterpolate","ɵɵpipeBind1","ctx_r1","userName$","ɵɵtextInterpolate2","ɵɵlistener","ɵɵrestoreView","_r3","ɵɵnextContext","ɵɵresetView","redirectToOldPlatform","_r4","_r5","toggleProfilePopup","ɵɵproperty","showProfilePopup","ProfilePopupComponent","constructor","sessionFacade","authService","locationSettingsService","userSettingsService","isMobileView","profilePopupOpened","EventEmitter","showOldPlatform","getLocationPreferenceBooleanValue","showSystemAdmin","userSession","adminLevel","ngOnInit","onProfilePopupOpened","clickedOutside","logout","fetchUserLogout","page","openTmsInSameWindow","emit","ɵɵdirectiveInject","SessionFacade","AuthService","LocationSettingsService","UserSettingsService","selectors","inputs","outputs","decls","vars","consts","template","rf","ctx","i0","_r1","ɵɵtemplate","ProfilePopupComponent_ng_container_2_Template","ProfilePopupComponent_ng_template_3_Template","ɵɵtemplateRefExtractor","ProfilePopupComponent_ng_container_6_Template","ProfilePopupComponent_li_7_Template","ProfilePopupComponent_li_8_Template","ProfilePopupComponent_ng_container_11_Template","ProfilePopupComponent_ng_container_15_Template","ɵɵpureFunction1","_c0","mobileView_r6","CommonModule","NgClass","NgIf","AsyncPipe","EzLocalizationModule","EzLocalePipe","ClickOutsideDirective","EzMobileOverlayComponent","styles","changeDetection","_ProfilePopupComponent","ɵɵelementContainerStart","ɵɵelementStart","ɵɵelement","ɵɵtext","ɵɵelementEnd","ɵɵlistener","ɵɵrestoreView","_r1","ctx_r1","ɵɵnextContext","ɵɵresetView","showFeedBackPopup","ɵɵadvance","ɵɵtextInterpolate1","ɵɵpipeBind1","serviceCode$","ɵɵtextInterpolate2","ɵɵpipeBind2","tokenExpDate","_r4","switchToGridFooter","ɵɵproperty","ɵɵtemplate","FooterComponent_ng_template_3_ng_container_0_Template","_r3","closeSidebar","openHelpPage","showMobileSwitchToGridFooterButton$","isMobileDevice","FooterComponent","_a","constructor","authService","serverMiddlewareHelperService","layoutService","sideBarIsOpen","showPopupEvent","Subject","BehaviorSubject","footerIsActive$","ngOnInit","getTokenExpirationDate","configureServiceCode","next","getHubTaskIdFromServer","pipe","distinctUntilChanged","untilDestroyed","subscribe","hubTaskId","serviceCode","getUserLocationIdFromLocalStorage","toString","window","open","toggleSidebar","changeFooterStatus","ɵɵdirectiveInject","AuthService","ServerMiddlewareHelperService","EZLayoutService","selectors","inputs","decls","vars","consts","template","rf","ctx","FooterComponent_ng_container_2_Template","FooterComponent_ng_template_3_Template","ɵɵtemplateRefExtractor","ɵɵpureFunction1","_c0","mobileView_r5","asObservable","NgIf","EzLocalizationModule","EzLocalePipe","UpperCasePipe","AsyncPipe","DatePipe","EzButtonsModule","EzButtonIconComponent","FeedbackFormComponent","DynamicMenuComponent","ProfilePopupComponent","NgStyle","styles","changeDetection","__decorate","UntilDestroy","__metadata","ɵɵelementContainerStart","ɵɵelementStart","ɵɵlistener","ɵɵrestoreView","_r1","ctx_r1","ɵɵnextContext","ɵɵresetView","toggleMenu","ɵɵelementEnd","ɵɵtext","ɵɵadvance","ɵɵtextInterpolate","ɵɵpipeBind1","pageTitle$","_r4","openZenDeskWidget","ɵɵelement","ɵɵtemplate","HeaderComponent_ng_container_8_li_3_Template","_r3","openHelpPage","onNotificationIconClick","ɵɵproperty","enableChatSupport","ɵɵpureFunction1","_c0","userHasPendingActivityItem$","_r5","onSurveyClicked","banner_r6","NotificationType","NotificationText","NotificationScope","BannerNotificationModel","Survey","BannerContentAlignment","Center","HeaderComponent_ng_container_9_ez_banner_2_Template","banners","_r7","banner_r8","HeaderComponent_ng_container_11_ez_banner_2_Template","conditionalBanners$","HeaderComponent","_a","constructor","authService","locationSettingsService","userSettingsService","fb","notificationService","layoutService","router","storeHelper","sharedStateFacade","isMobileDevice","userLocationId","userSession","currentLocationId","getLocationPreferenceBooleanValue","toastContainerId","ToastContainers","LayoutBottomHeader","banners$","showConfirmationOnLocationChange$","sessionUserId","userId","ngOnInit","headerForm","group","locationId","EzFormControl","value","disabled","defaultNotificationContainerId","setInlineNotificationContainer","subscribeOnGlobalBanners","subscribeOnUserPendingActivityItem","pipe","filter","length","map","banner","Enabled","trim","take","subscribe","data","getUserPreferenceBooleanValue","stateStreamSelector","getRouterFeatureState","untilDestroyed","route","state","url","tap","userHasPendingActivityItem","toggleSidebar","window","open","selectedLocationChanged","location","EzLocaleHelper","setCurrentLanguageLocale","cultureCode","changeUserLocation","canSwitchLocation","controls","enable","disable","updateUserPreferenceBooleanValue","removeSurveyBanner","navigateByUrl","ɵɵdirectiveInject","AuthService","LocationSettingsService","UserSettingsService","UntypedFormBuilder","EzNotificationService","EZLayoutService","Router","EzStoreService","SharedStateFacade","selectors","inputs","decls","vars","consts","template","rf","ctx","HeaderComponent_ng_container_2_Template","$event","HeaderComponent_ng_container_8_Template","HeaderComponent_ng_container_9_Template","HeaderComponent_ng_container_11_Template","get","tmp_8_0","tmp_9_0","EzFormControlTemplateComponent","ReactiveFormsModule","ɵNgNoValidate","NgControlStatus","NgControlStatusGroup","FormGroupDirective","FormControlName","NgIf","DynamicMenuComponent","EzButtonsModule","EzButtonIconComponent","ProfilePopupComponent","AsyncPipe","EzBannerComponent","NgForOf","LowerCasePipe","NgClass","LocationSelectComponent","styles","changeDetection","__decorate","UntilDestroy","__metadata","ɵɵelementStart","ɵɵlistener","ɵɵrestoreView","_r1","ctx_r1","ɵɵnextContext","ɵɵresetView","confirmationClosed","ɵɵtext","ɵɵelementEnd","ɵɵelement","closeModalDialog","onTakeClick","ɵɵproperty","ɵɵadvance","ɵɵtextInterpolate","ɵɵpipeBind1","ɵɵsanitizeHtml","ImportantMessageComponent","_a","constructor","router","layoutService","userSettingsService","showImportantMessage","importantMessageConfirmationSettings","confirmationId","title","message","showCancel","ngOnInit","userSession$","pipe","untilDestroyed","subscribe","userSession","url","includes","getUserPreferenceBooleanValue","confirmationConfirmed","showImportantMessageDialog","updateUserPreferenceBooleanValue","window","open","environment","survey_link","showConfirmationWithSettings","ɵɵdirectiveInject","Router","EZLayoutService","UserSettingsService","selectors","decls","vars","consts","template","rf","ctx","ɵɵtemplate","ImportantMessageComponent_ez_modal_0_Template","EzLayoutModule","EzModalComponent","NgIf","EzLocalizationModule","EzLocalePipe","EzEscapeHtmlPipe","EzButtonsModule","EzButtonsComponent","encapsulation","__decorate","UntilDestroy","__metadata","ɵɵelementContainerStart","ɵɵelementStart","ɵɵelement","ɵɵelementEnd","SidebarComponent","_a","constructor","cdr","authService","tmsMessageService","router","layoutService","storeHelper","ezSocketService","reportsAuthService","userSettingsService","locationSettingsService","themeStoreHelper","administrationService","sharedStateFacade","isDesktopDevice","isTabletDevice","isMobileDevice","showSideBar$","showSidebar$","environment","getEnvironment","build","connectionState","navigationMenu$","BehaviorSubject","sessionUser","userSession","routerUrl","viewDatebook","hasDirectDebitMerchantStreaming","undefined","ezlUser","ngOnInit","showCloverAuthentication","setupNavigationItems","showDirectDebitBatches","getEZLeaguesCredentials","getConnectionState","pipe","untilDestroyed","map","status","detectChanges","subscribe","tmsMessages$","msg","rebuildNavigationItems","MessageType","TmsMessageType","ScheduleDatebook","ScheduleEzView","StaffCheckInNavigateToClientProfile","GotoClientDetails","navigateByUrl","Message","stateStreamSelector","getRouterFeatureState","route","state","url","distinctUntilChanged","hasCloverMerchantSetUp$","result","toggleMenu","toggleSidebar","ezleaguesUser$","dispatchAction","getDirectDebitMerchantIsStreaming","filter","getBillingHasDirectMerchant","navigationMenu","administrationItems","getAdministrationItems","length","expanded","indexOf","push","label","LocalizationService","rks","Administration","icon","routerLink","styleClass","items","userHasPermission","Attendance","locationHasModule","LocationModulesEnum","HasCheckIn","includeCheckInDashboard","getLocationPreferenceBooleanValue","checkInNavigationItem","getCheckInNavigationItems","selfCheckinAuthorizationToken","getClientsSubItems","HasNewEmailCampaign","getEmailCampaignsItems","HasEquipment","Equipment","HasEZleagues","EZLeaguesNoSpacing","command","openEZLInNewWindow","HasSmuRegistrations","EZSignUp","getGroupsItems","HasLockers","Lockers","HasPOS","HasPOSv2","POS","uiWebOptions","PointOfSaleURL","target","reportItems","getReportItems","Reports","noPaddingQueryParams","Schedule","queryParams","getScheduleSubItems","HasTimeClock","TimeClock","RegEngine","adminLevel","Support","Chat","next","appversion","view","Day","visible","Week","Month","EZView","Datebook","Search","subitems","AuditClients","BillingStatements","Clients","emailCampaignSubItems","Drafts","NewCampaign","Scheduled","Sent","Campaigns","FailedEmails","EmailCampaigns","Groups","selfCheckinToken","checkInItems","StaffCheckIn","openTmsInNewWindow","SelfCheckIn","tmsIframeSelfCheckin","addPostValue","submitForm","CheckInDashboard","CheckIn","tempMenu","value","getMenuItem","billingLevel","DirectDebitBatches","showFinancialReports","Financial","showTrainingReports","Training","showVenueBookingReports","VenueBooking","showEquipmentReports","showTimeClockReports","showMembershipReports","Membership","showPointOfSalesReports","PointOfSales","showMarketingReports","Marketing","showSystemUsageReports","SystemUsage","showLockerReports","Locker","array","find","item","ɵɵdirectiveInject","ChangeDetectorRef","AuthService","TmsMessageService","Router","EZLayoutService","EzStoreService","EzSocketService","ReportsAuthService","UserSettingsService","LocationSettingsService","AdministrationService","SharedStateFacade","selectors","viewQuery","rf","ctx","ɵɵlistener","i0","ɵɵrestoreView","_r1","ɵɵresetView","ɵɵtemplate","SidebarComponent_ng_container_4_Template","SidebarComponent_ng_template_6_Template","ɵɵtemplateRefExtractor","ɵɵtext","ɵɵproperty","ɵɵpipeBind1","ɵɵadvance","collapsedSidebarHeader_r2","ɵɵpureFunction1","_c1","ɵɵtextInterpolate","ɵɵclassMap","EzSidemenuComponent","AsyncPipe","NgIf","NgClass","TmsIframeComponent","styles","changeDetection","__decorate","UntilDestroy","__metadata","FullLayoutComponent","_a","constructor","layoutService","storeHelper","renderer","ezNotificationService","ezStatisticsService","userSettingsService","showSideModal$","showSideBar$","showSidebar$","isDesktopDevice$","isTabletDevice$","isMobileDevice$","isIphone$","isSafariBrowser$","noRouterOutletPadding","adjustHeight","banners$","pipe","filter","banners","length","map","isSurveyIncluded","find","banner","NotificationType","BannerNotificationModel","Survey","getUserPreferenceBooleanValue","removeSurveyBanner","isSurveyBannerIncluded$","next","Enabled","NotificationText","trim","BehaviorSubject","conditionalBanner$","conditionalBanners$","ngOnInit","configureSidebar","watchSideBarValueChanges","configureHeightAndPadding","subscribeOnBannerLength","combineLatest","untilDestroyed","subscribe","isDesktopDevice","isTabletDevice","isMobileDevice","isIphone","isSafariBrowser","removeClass","document","body","toggleSidebar","addClass","distinctUntilChanged","showSideBar","stateStreamSelector","getRouterFeatureState","route","state","queryParams","noPadding","defaultIfEmpty","conditionalBanner","count","documentElement","style","setProperty","toString","ɵɵdirectiveInject","EZLayoutService","EzStoreService","Renderer2","EzNotificationService","EzStatisticsService","UserSettingsService","selectors","decls","vars","consts","template","rf","ctx","ɵɵelementStart","ɵɵelement","ɵɵelementEnd","ɵɵproperty","ɵɵpureFunction2","_c0","ɵɵpipeBind1","ɵɵadvance","ɵɵpureFunction3","_c1","NgClass","AsyncPipe","RouterOutlet","FooterComponent","EzLayoutModule","EzConfirmationModalComponent","HeaderComponent","ImportantMessageComponent","SidebarComponent","encapsulation","__decorate","UntilDestroy","__metadata","NoSidebarLayoutComponent","constructor","ngOnInit","selectors","decls","vars","consts","template","rf","ctx","ɵɵelementStart","ɵɵelement","ɵɵelementEnd","RouterOutlet","encapsulation","_NoSidebarLayoutComponent","LoginGuardService","constructor","authService","router","canActivateChild","route","state","of","queryParams","jwt","pipe","mergeMap","clearLocalStorage","claims","decodeJwt","UserId","LocationId","loginSingleSignOn","setTimeout","url","indexOf","window","location","reload","getIsUserAuthorized","map","isUserAuth","navigate","setApplicationIsInitialized","ɵɵinject","AuthService","Router","factory","ɵfac","providedIn","_LoginGuardService","AuthResolver","constructor","sharedStateFacade","resolve","route","state","fetchLocations","ɵɵinject","SharedStateFacade","factory","ɵfac","providedIn","_AuthResolver","AccessDeniedIframeComponent","_a","constructor","storeHelper","route","ngOnInit","stateStreamSelector","getRouterFeatureState","pipe","untilDestroyed","subscribe","state","queryParams","permissionCode","ɵɵdirectiveInject","EzStoreService","selectors","decls","vars","consts","template","rf","ctx","ɵɵelement","ɵɵproperty","TmsIframeComponent","encapsulation","__decorate","UntilDestroy","__metadata","getState","createFeatureSelector","CLIENT_ACCESS_FEATURE_KEY","getClientIsAccessibleForUser","createSelector","state","clientIsAccessibleForUser","ClientAccessibleToUserGuardService","constructor","router","clientAccessibleToUserStoreHelper","canActivateChild","route","activate","of","params","id","canActivateValidation","request","clientId","dispatchAction","getClientIsAccessibleForUser","stateStreamSelector","pipe","filter","getClientIsAccessibleForUserResponse","map","clientIsAccessibleForUser","navigate","clearClientIsAccessibleForUser","ɵɵinject","Router","EzStoreService","factory","ɵfac","providedIn","_ClientAccessibleToUserGuardService","routes","path","redirectTo","pathMatch","component","FullLayoutComponent","canActivateChild","AuthGuardService","resolve","resolver","AuthResolver","children","loadChildren","then","m","DashboardModule","ScheduleModule","ClientAccessibleToUserGuardService","ClientsModule","EmailCampaignsModule","GroupsModule","AttendanceModule","EquipmentModule","TimeClockModule","LockersModule","CheckInModule","ReportsModule","SupportModule","RegistrationModule","RegEngineModule","AdminModule","AccessDeniedIframeComponent","NoSidebarLayoutComponent","LoginGuardService","AuthModule","ChatModule","AppRoutingModule","RouterModule","forRoot","scrollPositionRestoration","onSameUrlNavigation","bindToComponentInputs","_AppRoutingModule","ThemeStateModule","StoreModule","forFeature","THEME_FEATURE_KEY","themeReducer","_ThemeStateModule","LoginResultStatuses","SessionEffects","constructor","actions$","authService","notificationService","sharedStateFacade","onGetUserSessionSuccess","createEffect","pipe","ofType","getUserSessionSuccess","tap","payload","configureAppSettingsWithUserSessionData","fetchEZLeaguesUser","userId","dispatch","onUserLoginSuccess","userLoginSuccess","userSingleSignOnSuccess","setJwt","signOnSignUpSuccess","onUserLoginFail","userLoginFail","setIsLogging","LoginResultStatuses","IpAddressNotAllowed","sendFailNotification","type","NotificationType","error","title","LocalizationService","rks","Failed","message","LoginNotPermitted","UserLoginFail","onUserLogout","userLogout","logout","onUserSessionOut","userSessionOut","warning","UserSessionOut","ɵɵinject","Actions","AuthService","EzNotificationService","SharedStateFacade","factory","ɵfac","_SessionEffects","initialState","failResponses","reducer","createReducer","on","addFailResponse","state","payload","__spreadProps","__spreadValues","removeFailResponse","FailResponseReducer","action","initialState","jwtToken","userGuid","currentLocationId","currentCompanyId","currentLocationTimeZone","currentLocationCurrencyCode","currentLocationCulture","currentLocationCountryCode","currentLocationPublicName","currentLocationName","currentLocationEmail","userId","error","loggingLevel","SessionLoggingLevel","debug","supportStatus","SessionSupportStatus","nosupport","userName","firstName","lastName","userCalendarId","userResourceId","userResourceCalendarId","userLocationId","userIdentifier","isActive","emailAddress","adminLevel","userPermissions","userPreferences","locationModules","locationPreferences","shareClientsAcrossLocations","selfCheckinAuthorizationToken","reducer","createReducer","on","getUserSessionSuccess","state","payload","clearUserSession","setCurrentLocationId","__spreadProps","__spreadValues","setCurrentCompanyId","setCurrentLocationTimeZone","setCurrentUserId","setUserCalendarId","addGlobalError","setUserName","setFirstName","setLastName","setLoggingLevel","setSupportStatus","setClientConnectionGuid","SessionReducer","action","initialState","hubConnected","applicationInitialized","hubConnectionActivity","hubActivity","browserDetails","browserLocationDetails","reducer","createReducer","on","setHubConnected","state","payload","__spreadProps","__spreadValues","setAppInitiated","logConnectionActivity","newHubConnectionActivity","setBrowserDetails","setBrowserLocation","AppDetailsReducer","action","MonitorPerformanceInfoResponse","EventLogResponse","initialState","trainers","salesPeople","locations","smsProviders","locationInfo","locationContactPreferences","checkInStations","programFees","taxes","resources","reservationTypes","tShirtSizes","membershipTypes","documentTemplates","membershipPlans","loadingMembershipPlans","locationJobTypes","lockerRooms","dashboard","MonitorPerformanceInfoResponse","eventLogs","EventLogResponse","uiWebOptions","customFields","cashRegisters","ezleaguesUser","userHasPendingActivityItem","reducer","createReducer","on","getTrainersOnLoadSuccess","state","payload","__spreadProps","__spreadValues","getTrainersOnLoadFail","getSalesPeopleOnLoadSuccess","getSalesPeopleOnLoadFail","getLocationsOnLoadSuccess","getLocationsOnLoadFail","getSMSProvidersOnLoadSuccess","getSMSProvidersOnLoadFail","getLocationInfoOnLoadSuccess","getLocationInfoOnLoadFail","getCheckInStationsOnLoadSuccess","getCheckInStationsOnLoadFail","getProgramFeesSuccess","getProgramFeesFail","getTaxesSuccess","getTaxesFail","getLocationContactPreferencesOnLoadSuccess","getResourcesAndScheduleGroupsSuccess","getResourcesAndScheduleGroupsFail","getReservationTypesOnLoadSuccess","getReservationTypesOnLoadFail","getTShirtSizesOnLoadSuccess","getTShirtSizesOnLoadFail","getMembershipPlansOnLoad","getMembershipPlansOnLoadSuccess","getMembershipPlansOnLoadFail","getMembershipTypesOnLoadSuccess","getMembershipTypesOnLoadFail","getDocumentTemplateOnLoadSuccess","getDocumentTemplateOnLoadFail","getLocationJobTypesOnLoadSuccess","getLocationJobTypesOnLoadFail","getLockerRoomsSuccess","getLockerRoomsFail","getDashboardOnLoadSuccess","getDashboardOnLoadFail","getDashboardWithTimeSuccess","getDashboardWithTimeFail","getEventLogOnLoadSuccess","getEventLogOnLoadFail","getEventLogTimeByRangeSuccess","getEventLogTimeByRangeFail","getUiWebOptionsSuccess","getUiWebOptionsFail","getCustomFieldsSuccess","getCustomFieldsFail","getCashRegistersSuccess","getCashRegistersFail","getEZLUserSuccess","hasUserPendingActivityItemSuccess","hasPendingActivity","hasUserPendingActivityItemFail","clearMembershipPlansState","SharedStateReducer","action","SocketEffects","factory","ɵfac","_SocketEffects","CustomRouteReuseStrategy","constructor","handlers","shouldDetach","route","routeConfig","loadChildren","shouldReuse","data","store","handler","getUrl","shouldAttach","retrieve","shouldReuseRoute","future","current","reUseUrl","path","AppModule","bootstrap","AppComponent","LocalizationService","SharedStateFacade","SessionFacade","AppDetailsFacade","provide","RouterStateSerializer","useClass","CustomSerializer","LOCALE_ID","useValue","EzLocaleHelper","locale","currencyCode","provideAppInitializer","datadogRumFactory","inject","DatadogService","socketProviderFactory","SocketProvider","localizationResourcesFactory","EZ_CRYPTO_PASSWORD","environment","encryption_key","EZ_JWT_KEY","jwt_key","EZ_APP_NAME","client_software","EZ_BUILD_VERSION","appversion","build","EZ_SOCKET_KEY","tms_hub_key","EZ_HUB_ENDPOINT","tmshub","EZ_USER_FILES_ENDPOINT","file_upload_url","RouteReuseStrategy","CustomRouteReuseStrategy","provideHttpClient","withInterceptorsFromDi","imports","BrowserModule","BrowserAnimationsModule","FormsModule","ReactiveFormsModule","AppRoutingModule","ThemeStateModule","EzStoreModule","EzNotificationModule","EzLocalizationModule","EzStatisticsModule","EzSocketModule","EzSpinnerComponent","StoreModule","forFeature","SessionReducer","AppDetailsReducer","SharedStateReducer","FailResponseReducer","routerReducer","metaReducers","EffectsModule","SessionEffects","SocketEffects","forRoot","StoreRouterConnectingModule","stateKey","runtimeChecks","strictStateImmutability","strictActionImmutability","StoreDevtoolsModule","instrument","name","maxAge","logOnly","ToastrModule","JwtModule","config","tokenGetter","localStorage","getItem","_AppModule","environment","production","enableProdMode","platformBrowser","bootstrapModule","AppModule","catch","err","console","error"],"x_google_ignoreList":[0,1,2,3,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,175]}