{ "version": 3, "sources": ["../../../node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@rails/actioncable/src/index.js", "../../../node_modules/@statsig/client-core/src/$_StatsigGlobal.js", "../../../node_modules/@statsig/client-core/src/TypingUtils.js", "../../../node_modules/@statsig/client-core/src/Hashing.js", "../../../node_modules/@statsig/client-core/src/Log.js", "../../../node_modules/@statsig/client-core/src/NetworkConfig.js", "../../../node_modules/@statsig/client-core/src/SafeJs.js", "../../../node_modules/@statsig/client-core/src/StatsigEvent.js", "../../../node_modules/@statsig/client-core/src/StorageProvider.js", "../../../node_modules/@statsig/client-core/src/UrlOverrides.js", "../../../node_modules/@statsig/client-core/src/VisibilityObserving.js", "../../../node_modules/@statsig/client-core/src/EventLogger.js", "../../../node_modules/@statsig/client-core/src/StatsigMetadata.js", "../../../node_modules/@statsig/client-core/src/CacheKey.js", "../../../node_modules/@statsig/client-core/src/ClientInterfaces.js", "../../../node_modules/@statsig/client-core/src/UUID.js", "../../../node_modules/@statsig/client-core/src/StableID.js", "../../../node_modules/@statsig/client-core/src/StatsigUser.js", "../../../node_modules/@statsig/client-core/src/TypedJsonParse.js", "../../../node_modules/@statsig/client-core/src/DataAdapterCore.js", "../../../node_modules/@statsig/client-core/src/DownloadConfigSpecsResponse.js", "../../../node_modules/@statsig/client-core/src/SDKType.js", "../../../node_modules/@statsig/client-core/src/ErrorBoundary.js", "../../../node_modules/@statsig/client-core/src/EvaluationOptions.js", "../../../node_modules/@statsig/client-core/src/EvaluationTypes.js", "../../../node_modules/@statsig/client-core/src/InitializeResponse.js", "../../../node_modules/@statsig/client-core/src/Diagnostics.js", "../../../node_modules/@statsig/client-core/src/SessionID.js", "../../../node_modules/@statsig/client-core/src/NetworkCore.js", "../../../node_modules/@statsig/client-core/src/OverrideAdapter.js", "../../../node_modules/@statsig/client-core/src/ParamStoreTypes.js", "../../../node_modules/@statsig/client-core/src/StatsigClientBase.js", "../../../node_modules/@statsig/client-core/src/StatsigClientEventEmitter.js", "../../../node_modules/@statsig/client-core/src/StatsigDataAdapter.js", "../../../node_modules/@statsig/client-core/src/StatsigOptionsCommon.js", "../../../node_modules/@statsig/client-core/src/StatsigTypeFactories.js", "../../../node_modules/@statsig/client-core/src/StatsigTypes.js", "../../../node_modules/@statsig/client-core/src/index.js", "../../../node_modules/@statsig/js-client/src/EvaluationStore.js", "../../../node_modules/@statsig/js-client/src/EvaluationResponseDeltas.js", "../../../node_modules/@statsig/js-client/src/Network.js", "../../../node_modules/@statsig/js-client/src/ParamStoreGetterFactory.js", "../../../node_modules/@statsig/js-client/src/StatsigEvaluationsDataAdapter.js", "../../../node_modules/@statsig/js-client/src/StatsigClient.js", "../../../node_modules/@statsig/js-client/src/index.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/utils.js", "../../../node_modules/rrweb/es/rrweb/packages/types/dist/types.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/error-handler.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/observer.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/cross-origin-iframe-mirror.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/iframe-manager.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js", "../../../node_modules/rrweb/es/rrweb/ext/tslib/tslib.es6.js", "../../../node_modules/rrweb/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js", "../../../node_modules/rrweb/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__funcToSource.js", "../../../node_modules/rrweb/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js", "../../../node_modules/rrweb/es/rrweb/_virtual/image-bitmap-data-url-worker.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/processed-node-manager.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/record/index.js", "../../../node_modules/rrweb/es/rrweb/packages/rrdom/es/rrdom.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/index.js", "../../../node_modules/rrweb/es/rrweb/ext/fflate/esm/browser.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/packer/base.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/packer/pack.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/packer/unpack.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/plugins/console/record/index.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/canvas/2d.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/canvas/index.js", "../../../node_modules/rrweb/es/rrweb/ext/mitt/dist/mitt.mjs.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/smoothscroll.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/timer.js", "../../../node_modules/rrweb/es/rrweb/ext/@xstate/fsm/es/index.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/machine.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/replay/index.js", "../../../node_modules/rrweb/es/rrweb/packages/rrweb/src/entries/all.js", "../../../node_modules/@statsig/session-replay/src/SessionReplayClient.js", "../../../node_modules/@statsig/session-replay/src/SessionReplay.js", "../../../node_modules/@statsig/session-replay/src/index.js", "../../../node_modules/@statsig/web-analytics/src/Utils.js", "../../../node_modules/@statsig/web-analytics/src/payloadUtils.js", "../../../node_modules/@statsig/web-analytics/src/AutoCapture.js", "../../../node_modules/@statsig/web-analytics/src/index.js", "../../../node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/@popperjs/core/lib/modifiers/index.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/@popperjs/core/lib/popper-lite.js", "../../../node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/@popperjs/core/lib/index.js", "../../../node_modules/cropperjs/dist/cropper.js", "../../../node_modules/crypt/crypt.js", "../../../node_modules/charenc/charenc.js", "../../../node_modules/is-buffer/index.js", "../../../node_modules/md5/md5.js", "../../../node_modules/lodash/isArray.js", "../../../node_modules/lodash/_freeGlobal.js", "../../../node_modules/lodash/_root.js", "../../../node_modules/lodash/_Symbol.js", "../../../node_modules/lodash/_getRawTag.js", "../../../node_modules/lodash/_objectToString.js", "../../../node_modules/lodash/_baseGetTag.js", "../../../node_modules/lodash/isObjectLike.js", "../../../node_modules/lodash/isSymbol.js", "../../../node_modules/lodash/_isKey.js", "../../../node_modules/lodash/isObject.js", "../../../node_modules/lodash/isFunction.js", "../../../node_modules/lodash/_coreJsData.js", "../../../node_modules/lodash/_isMasked.js", "../../../node_modules/lodash/_toSource.js", "../../../node_modules/lodash/_baseIsNative.js", "../../../node_modules/lodash/_getValue.js", "../../../node_modules/lodash/_getNative.js", "../../../node_modules/lodash/_nativeCreate.js", "../../../node_modules/lodash/_hashClear.js", "../../../node_modules/lodash/_hashDelete.js", "../../../node_modules/lodash/_hashGet.js", "../../../node_modules/lodash/_hashHas.js", "../../../node_modules/lodash/_hashSet.js", "../../../node_modules/lodash/_Hash.js", "../../../node_modules/lodash/_listCacheClear.js", "../../../node_modules/lodash/eq.js", "../../../node_modules/lodash/_assocIndexOf.js", "../../../node_modules/lodash/_listCacheDelete.js", "../../../node_modules/lodash/_listCacheGet.js", "../../../node_modules/lodash/_listCacheHas.js", "../../../node_modules/lodash/_listCacheSet.js", "../../../node_modules/lodash/_ListCache.js", "../../../node_modules/lodash/_Map.js", "../../../node_modules/lodash/_mapCacheClear.js", "../../../node_modules/lodash/_isKeyable.js", "../../../node_modules/lodash/_getMapData.js", "../../../node_modules/lodash/_mapCacheDelete.js", "../../../node_modules/lodash/_mapCacheGet.js", "../../../node_modules/lodash/_mapCacheHas.js", "../../../node_modules/lodash/_mapCacheSet.js", "../../../node_modules/lodash/_MapCache.js", "../../../node_modules/lodash/memoize.js", "../../../node_modules/lodash/_memoizeCapped.js", "../../../node_modules/lodash/_stringToPath.js", "../../../node_modules/lodash/_arrayMap.js", "../../../node_modules/lodash/_baseToString.js", "../../../node_modules/lodash/toString.js", "../../../node_modules/lodash/_castPath.js", "../../../node_modules/lodash/_toKey.js", "../../../node_modules/lodash/_baseGet.js", "../../../node_modules/lodash/get.js", "../../../node_modules/lodash/_baseHas.js", "../../../node_modules/lodash/_baseIsArguments.js", "../../../node_modules/lodash/isArguments.js", "../../../node_modules/lodash/_isIndex.js", "../../../node_modules/lodash/isLength.js", "../../../node_modules/lodash/_hasPath.js", "../../../node_modules/lodash/has.js", "../../../node_modules/lodash/_defineProperty.js", "../../../node_modules/lodash/_baseAssignValue.js", "../../../node_modules/lodash/_assignValue.js", "../../../node_modules/lodash/_baseSet.js", "../../../node_modules/lodash/set.js", "../../../node_modules/lodash/setWith.js", "../../../node_modules/lodash/_setCacheAdd.js", "../../../node_modules/lodash/_setCacheHas.js", "../../../node_modules/lodash/_SetCache.js", "../../../node_modules/lodash/_baseFindIndex.js", "../../../node_modules/lodash/_baseIsNaN.js", "../../../node_modules/lodash/_strictIndexOf.js", "../../../node_modules/lodash/_baseIndexOf.js", "../../../node_modules/lodash/_arrayIncludes.js", "../../../node_modules/lodash/_arrayIncludesWith.js", "../../../node_modules/lodash/_cacheHas.js", "../../../node_modules/lodash/_Set.js", "../../../node_modules/lodash/noop.js", "../../../node_modules/lodash/_setToArray.js", "../../../node_modules/lodash/_createSet.js", "../../../node_modules/lodash/_baseUniq.js", "../../../node_modules/lodash/uniq.js", "../../../node_modules/lodash/_baseSlice.js", "../../../node_modules/lodash/_castSlice.js", "../../../node_modules/lodash/_hasUnicode.js", "../../../node_modules/lodash/_asciiToArray.js", "../../../node_modules/lodash/_unicodeToArray.js", "../../../node_modules/lodash/_stringToArray.js", "../../../node_modules/lodash/_createCaseFirst.js", "../../../node_modules/lodash/upperFirst.js", "../../../node_modules/lodash/capitalize.js", "../../../node_modules/lodash/_arrayReduce.js", "../../../node_modules/lodash/_basePropertyOf.js", "../../../node_modules/lodash/_deburrLetter.js", "../../../node_modules/lodash/deburr.js", "../../../node_modules/lodash/_asciiWords.js", "../../../node_modules/lodash/_hasUnicodeWord.js", "../../../node_modules/lodash/_unicodeWords.js", "../../../node_modules/lodash/words.js", "../../../node_modules/lodash/_createCompounder.js", "../../../node_modules/lodash/camelCase.js", "../../../node_modules/lodash/_baseRepeat.js", "../../../node_modules/lodash/isArrayLike.js", "../../../node_modules/lodash/_isIterateeCall.js", "../../../node_modules/lodash/_trimmedEndIndex.js", "../../../node_modules/lodash/_baseTrim.js", "../../../node_modules/lodash/toNumber.js", "../../../node_modules/lodash/toFinite.js", "../../../node_modules/lodash/toInteger.js", "../../../node_modules/lodash/repeat.js", "../../../node_modules/lodash/_arrayPush.js", "../../../node_modules/lodash/_isFlattenable.js", "../../../node_modules/lodash/_baseFlatten.js", "../../../node_modules/lodash/_stackClear.js", "../../../node_modules/lodash/_stackDelete.js", "../../../node_modules/lodash/_stackGet.js", "../../../node_modules/lodash/_stackHas.js", "../../../node_modules/lodash/_stackSet.js", "../../../node_modules/lodash/_Stack.js", "../../../node_modules/lodash/_arraySome.js", "../../../node_modules/lodash/_equalArrays.js", "../../../node_modules/lodash/_Uint8Array.js", "../../../node_modules/lodash/_mapToArray.js", "../../../node_modules/lodash/_equalByTag.js", "../../../node_modules/lodash/_baseGetAllKeys.js", "../../../node_modules/lodash/_arrayFilter.js", "../../../node_modules/lodash/stubArray.js", "../../../node_modules/lodash/_getSymbols.js", "../../../node_modules/lodash/_baseTimes.js", "../../../node_modules/lodash/stubFalse.js", "../../../node_modules/lodash/isBuffer.js", "../../../node_modules/lodash/_baseIsTypedArray.js", "../../../node_modules/lodash/_baseUnary.js", "../../../node_modules/lodash/_nodeUtil.js", "../../../node_modules/lodash/isTypedArray.js", "../../../node_modules/lodash/_arrayLikeKeys.js", "../../../node_modules/lodash/_isPrototype.js", "../../../node_modules/lodash/_overArg.js", "../../../node_modules/lodash/_nativeKeys.js", "../../../node_modules/lodash/_baseKeys.js", "../../../node_modules/lodash/keys.js", "../../../node_modules/lodash/_getAllKeys.js", "../../../node_modules/lodash/_equalObjects.js", "../../../node_modules/lodash/_DataView.js", "../../../node_modules/lodash/_Promise.js", "../../../node_modules/lodash/_WeakMap.js", "../../../node_modules/lodash/_getTag.js", "../../../node_modules/lodash/_baseIsEqualDeep.js", "../../../node_modules/lodash/_baseIsEqual.js", "../../../node_modules/lodash/_baseIsMatch.js", "../../../node_modules/lodash/_isStrictComparable.js", "../../../node_modules/lodash/_getMatchData.js", "../../../node_modules/lodash/_matchesStrictComparable.js", "../../../node_modules/lodash/_baseMatches.js", "../../../node_modules/lodash/_baseHasIn.js", "../../../node_modules/lodash/hasIn.js", "../../../node_modules/lodash/_baseMatchesProperty.js", "../../../node_modules/lodash/identity.js", "../../../node_modules/lodash/_baseProperty.js", "../../../node_modules/lodash/_basePropertyDeep.js", "../../../node_modules/lodash/property.js", "../../../node_modules/lodash/_baseIteratee.js", "../../../node_modules/lodash/_createBaseFor.js", "../../../node_modules/lodash/_baseFor.js", "../../../node_modules/lodash/_baseForOwn.js", "../../../node_modules/lodash/_createBaseEach.js", "../../../node_modules/lodash/_baseEach.js", "../../../node_modules/lodash/_baseMap.js", "../../../node_modules/lodash/_baseSortBy.js", "../../../node_modules/lodash/_compareAscending.js", "../../../node_modules/lodash/_compareMultiple.js", "../../../node_modules/lodash/_baseOrderBy.js", "../../../node_modules/lodash/_apply.js", "../../../node_modules/lodash/_overRest.js", "../../../node_modules/lodash/constant.js", "../../../node_modules/lodash/_baseSetToString.js", "../../../node_modules/lodash/_shortOut.js", "../../../node_modules/lodash/_setToString.js", "../../../node_modules/lodash/_baseRest.js", "../../../node_modules/lodash/sortBy.js", "../../../node_modules/lodash/_baseZipObject.js", "../../../node_modules/lodash/zipObject.js", "../../../node_modules/lodash/flattenDeep.js", "../../../node_modules/lodash/_baseRange.js", "../../../node_modules/lodash/_createRange.js", "../../../node_modules/lodash/range.js", "../../../node_modules/choices.js/public/assets/scripts/choices.js", "../../../node_modules/clipboard-copy/index.js", "../../../node_modules/@stripe/stripe-js/dist/pure.js", "../../../node_modules/@stripe/stripe-js/pure.js", "../../../node_modules/gridstack/src/utils.ts", "../../../node_modules/gridstack/src/gridstack-engine.ts", "../../../node_modules/gridstack/src/types.ts", "../../../node_modules/gridstack/src/dd-manager.ts", "../../../node_modules/gridstack/src/dd-touch.ts", "../../../node_modules/gridstack/src/dd-resizable-handle.ts", "../../../node_modules/gridstack/src/dd-base-impl.ts", "../../../node_modules/gridstack/src/dd-resizable.ts", "../../../node_modules/gridstack/src/dd-draggable.ts", "../../../node_modules/gridstack/src/dd-droppable.ts", "../../../node_modules/gridstack/src/dd-element.ts", "../../../node_modules/gridstack/src/dd-gridstack.ts", "../../../node_modules/gridstack/src/gridstack.ts", "../../../node_modules/global/window.js", "../../../node_modules/global/document.js", "../../../node_modules/keycode/index.js", "../../../node_modules/safe-json-parse/tuple.js", "../../../node_modules/@babel/runtime/helpers/extends.js", "../../../node_modules/is-function/index.js", "../../../node_modules/@videojs/xhr/lib/http-handler.js", "../../../node_modules/@videojs/xhr/lib/index.js", "../../../node_modules/videojs-vtt.js/lib/vtt.js", "../../../node_modules/videojs-vtt.js/lib/vttcue.js", "../../../node_modules/videojs-vtt.js/lib/vttregion.js", "../../../node_modules/videojs-vtt.js/lib/browser-index.js", "../../../node_modules/url-toolkit/src/url-toolkit.js", "../../../node_modules/@xmldom/xmldom/lib/conventions.js", "../../../node_modules/@xmldom/xmldom/lib/dom.js", "../../../node_modules/@xmldom/xmldom/lib/entities.js", "../../../node_modules/@xmldom/xmldom/lib/sax.js", "../../../node_modules/@xmldom/xmldom/lib/dom-parser.js", "../../../node_modules/@xmldom/xmldom/lib/index.js", "../../../node_modules/mux.js/lib/utils/numbers.js", "../../../node_modules/mux.js/lib/tools/parse-sidx.js", "../../../node_modules/mux.js/lib/utils/clock.js", "../../../node_modules/react/cjs/react.production.min.js", "../../../node_modules/react/index.js", "../../../node_modules/scheduler/cjs/scheduler.production.min.js", "../../../node_modules/scheduler/index.js", "../../../node_modules/react-dom/cjs/react-dom.production.min.js", "../../../node_modules/react-dom/index.js", "../../../node_modules/react-dom/client.js", "../../../node_modules/is-retry-allowed/index.js", "../../../node_modules/eventemitter2/lib/eventemitter2.js", "../../../node_modules/lodash.debounce/index.js", "../../../node_modules/react-fast-compare/index.js", "../../../node_modules/warning/warning.js", "../../../node_modules/lottie-web/build/player/lottie.js", "../../../node_modules/react-is/cjs/react-is.production.min.js", "../../../node_modules/react-is/index.js", "../../../node_modules/shallowequal/index.js", "../../../node_modules/@emotion/stylis/dist/stylis.browser.esm.js", "../../../node_modules/@emotion/unitless/dist/unitless.browser.esm.js", "../../../node_modules/@emotion/memoize/dist/emotion-memoize.cjs.prod.js", "../../../node_modules/@emotion/memoize/dist/emotion-memoize.cjs.js", "../../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.prod.js", "../../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.js", "../../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.default.js", "../../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.mjs", "../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js", "../../../node_modules/styled-components/src/utils/interleave.js", "../../../node_modules/styled-components/src/utils/isPlainObject.js", "../../../node_modules/styled-components/src/utils/empties.js", "../../../node_modules/styled-components/src/utils/isFunction.js", "../../../node_modules/styled-components/src/utils/getComponentName.js", "../../../node_modules/styled-components/src/utils/isStyledComponent.js", "../../../node_modules/styled-components/src/constants.js", "../../../node_modules/styled-components/src/utils/error.js", "../../../node_modules/styled-components/src/utils/errors.js", "../../../node_modules/styled-components/src/sheet/GroupedTag.js", "../../../node_modules/styled-components/src/sheet/GroupIDAllocator.js", "../../../node_modules/styled-components/src/sheet/Rehydration.js", "../../../node_modules/styled-components/src/utils/nonce.js", "../../../node_modules/styled-components/src/sheet/dom.js", "../../../node_modules/styled-components/src/sheet/Tag.js", "../../../node_modules/styled-components/src/sheet/Sheet.js", "../../../node_modules/styled-components/src/utils/generateAlphabeticName.js", "../../../node_modules/styled-components/src/utils/hash.js", "../../../node_modules/styled-components/src/utils/isStaticRules.js", "../../../node_modules/styled-components/src/models/ComponentStyle.js", "../../../node_modules/styled-components/src/utils/stylis.js", "../../../node_modules/styled-components/src/utils/stylisPluginInsertRule.js", "../../../node_modules/styled-components/src/models/StyleSheetManager.js", "../../../node_modules/styled-components/src/models/Keyframes.js", "../../../node_modules/styled-components/src/utils/hyphenateStyleName.js", "../../../node_modules/styled-components/src/utils/flatten.js", "../../../node_modules/styled-components/src/utils/isStatelessFunction.js", "../../../node_modules/styled-components/src/utils/addUnitIfNeeded.js", "../../../node_modules/styled-components/src/constructors/css.js", "../../../node_modules/styled-components/src/utils/checkDynamicCreation.js", "../../../node_modules/styled-components/src/utils/determineTheme.js", "../../../node_modules/styled-components/src/utils/escape.js", "../../../node_modules/styled-components/src/utils/generateComponentId.js", "../../../node_modules/styled-components/src/utils/isTag.js", "../../../node_modules/styled-components/src/utils/mixinDeep.js", "../../../node_modules/styled-components/src/models/ThemeProvider.js", "../../../node_modules/styled-components/src/models/StyledComponent.js", "../../../node_modules/styled-components/src/utils/generateDisplayName.js", "../../../node_modules/styled-components/src/utils/joinStrings.js", "../../../node_modules/styled-components/src/utils/createWarnTooManyClasses.js", "../../../node_modules/styled-components/src/utils/domElements.js", "../../../node_modules/styled-components/src/constructors/styled.js", "../../../node_modules/styled-components/src/constructors/constructWithOptions.js", "../../../node_modules/styled-components/src/models/GlobalStyle.js", "../../../node_modules/styled-components/src/constructors/createGlobalStyle.js", "../../../node_modules/styled-components/src/constructors/keyframes.js", "../../../node_modules/styled-components/src/models/ServerStyleSheet.js", "../../../node_modules/styled-components/src/hoc/withTheme.js", "../../../node_modules/styled-components/src/hooks/useTheme.js", "../../../node_modules/styled-components/src/secretInternals.js", "../../../node_modules/styled-components/src/base.js", "../../../node_modules/client-only/index.js", "../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js", "../../../node_modules/use-sync-external-store/shim/index.js", "../../../node_modules/swr/_internal/dist/index.js", "../../../node_modules/swr/core/dist/index.js", "../../../node_modules/swr/immutable/dist/index.js", "../../../node_modules/core-js-pure/modules/es.error.to-string.js", "../../../node_modules/core-js-pure/internals/fails.js", "../../../node_modules/core-js-pure/internals/function-bind-native.js", "../../../node_modules/core-js-pure/internals/function-uncurry-this.js", "../../../node_modules/core-js-pure/internals/classof-raw.js", "../../../node_modules/core-js-pure/internals/indexed-object.js", "../../../node_modules/core-js-pure/internals/is-null-or-undefined.js", "../../../node_modules/core-js-pure/internals/require-object-coercible.js", "../../../node_modules/core-js-pure/internals/to-indexed-object.js", "../../../node_modules/core-js-pure/internals/add-to-unscopables.js", "../../../node_modules/core-js-pure/internals/iterators.js", "../../../node_modules/core-js-pure/internals/global.js", "../../../node_modules/core-js-pure/internals/document-all.js", "../../../node_modules/core-js-pure/internals/is-callable.js", "../../../node_modules/core-js-pure/internals/weak-map-basic-detection.js", "../../../node_modules/core-js-pure/internals/is-object.js", "../../../node_modules/core-js-pure/internals/descriptors.js", "../../../node_modules/core-js-pure/internals/document-create-element.js", "../../../node_modules/core-js-pure/internals/ie8-dom-define.js", "../../../node_modules/core-js-pure/internals/v8-prototype-define-bug.js", "../../../node_modules/core-js-pure/internals/an-object.js", "../../../node_modules/core-js-pure/internals/function-call.js", "../../../node_modules/core-js-pure/internals/path.js", "../../../node_modules/core-js-pure/internals/get-built-in.js", "../../../node_modules/core-js-pure/internals/object-is-prototype-of.js", "../../../node_modules/core-js-pure/internals/engine-user-agent.js", "../../../node_modules/core-js-pure/internals/engine-v8-version.js", "../../../node_modules/core-js-pure/internals/symbol-constructor-detection.js", "../../../node_modules/core-js-pure/internals/use-symbol-as-uid.js", "../../../node_modules/core-js-pure/internals/is-symbol.js", "../../../node_modules/core-js-pure/internals/try-to-string.js", "../../../node_modules/core-js-pure/internals/a-callable.js", "../../../node_modules/core-js-pure/internals/get-method.js", "../../../node_modules/core-js-pure/internals/ordinary-to-primitive.js", "../../../node_modules/core-js-pure/internals/is-pure.js", "../../../node_modules/core-js-pure/internals/define-global-property.js", "../../../node_modules/core-js-pure/internals/shared-store.js", "../../../node_modules/core-js-pure/internals/shared.js", "../../../node_modules/core-js-pure/internals/to-object.js", "../../../node_modules/core-js-pure/internals/has-own-property.js", "../../../node_modules/core-js-pure/internals/uid.js", "../../../node_modules/core-js-pure/internals/well-known-symbol.js", "../../../node_modules/core-js-pure/internals/to-primitive.js", "../../../node_modules/core-js-pure/internals/to-property-key.js", "../../../node_modules/core-js-pure/internals/object-define-property.js", "../../../node_modules/core-js-pure/internals/create-property-descriptor.js", "../../../node_modules/core-js-pure/internals/create-non-enumerable-property.js", "../../../node_modules/core-js-pure/internals/shared-key.js", "../../../node_modules/core-js-pure/internals/hidden-keys.js", "../../../node_modules/core-js-pure/internals/internal-state.js", "../../../node_modules/core-js-pure/internals/function-apply.js", "../../../node_modules/core-js-pure/internals/function-uncurry-this-clause.js", "../../../node_modules/core-js-pure/internals/object-property-is-enumerable.js", "../../../node_modules/core-js-pure/internals/object-get-own-property-descriptor.js", "../../../node_modules/core-js-pure/internals/is-forced.js", "../../../node_modules/core-js-pure/internals/function-bind-context.js", "../../../node_modules/core-js-pure/internals/export.js", "../../../node_modules/core-js-pure/internals/function-name.js", "../../../node_modules/core-js-pure/internals/math-trunc.js", "../../../node_modules/core-js-pure/internals/to-integer-or-infinity.js", "../../../node_modules/core-js-pure/internals/to-absolute-index.js", "../../../node_modules/core-js-pure/internals/to-length.js", "../../../node_modules/core-js-pure/internals/length-of-array-like.js", "../../../node_modules/core-js-pure/internals/array-includes.js", "../../../node_modules/core-js-pure/internals/object-keys-internal.js", "../../../node_modules/core-js-pure/internals/enum-bug-keys.js", "../../../node_modules/core-js-pure/internals/object-keys.js", "../../../node_modules/core-js-pure/internals/object-define-properties.js", "../../../node_modules/core-js-pure/internals/html.js", "../../../node_modules/core-js-pure/internals/object-create.js", "../../../node_modules/core-js-pure/internals/correct-prototype-getter.js", "../../../node_modules/core-js-pure/internals/object-get-prototype-of.js", "../../../node_modules/core-js-pure/internals/define-built-in.js", "../../../node_modules/core-js-pure/internals/iterators-core.js", "../../../node_modules/core-js-pure/internals/to-string-tag-support.js", "../../../node_modules/core-js-pure/internals/classof.js", "../../../node_modules/core-js-pure/internals/object-to-string.js", "../../../node_modules/core-js-pure/internals/set-to-string-tag.js", "../../../node_modules/core-js-pure/internals/iterator-create-constructor.js", "../../../node_modules/core-js-pure/internals/function-uncurry-this-accessor.js", "../../../node_modules/core-js-pure/internals/a-possible-prototype.js", "../../../node_modules/core-js-pure/internals/object-set-prototype-of.js", "../../../node_modules/core-js-pure/internals/iterator-define.js", "../../../node_modules/core-js-pure/internals/create-iter-result-object.js", "../../../node_modules/core-js-pure/modules/es.array.iterator.js", "../../../node_modules/core-js-pure/modules/es.object.keys.js", "../../../node_modules/core-js-pure/modules/es.object.to-string.js", "../../../node_modules/core-js-pure/internals/object-get-own-property-names.js", "../../../node_modules/core-js-pure/internals/create-property.js", "../../../node_modules/core-js-pure/internals/array-slice-simple.js", "../../../node_modules/core-js-pure/internals/object-get-own-property-names-external.js", "../../../node_modules/core-js-pure/internals/array-buffer-non-extensible.js", "../../../node_modules/core-js-pure/internals/object-is-extensible.js", "../../../node_modules/core-js-pure/internals/freezing.js", "../../../node_modules/core-js-pure/internals/internal-metadata.js", "../../../node_modules/core-js-pure/internals/is-array-iterator-method.js", "../../../node_modules/core-js-pure/internals/get-iterator-method.js", "../../../node_modules/core-js-pure/internals/get-iterator.js", "../../../node_modules/core-js-pure/internals/iterator-close.js", "../../../node_modules/core-js-pure/internals/iterate.js", "../../../node_modules/core-js-pure/internals/an-instance.js", "../../../node_modules/core-js-pure/internals/is-array.js", "../../../node_modules/core-js-pure/internals/inspect-source.js", "../../../node_modules/core-js-pure/internals/is-constructor.js", "../../../node_modules/core-js-pure/internals/array-species-constructor.js", "../../../node_modules/core-js-pure/internals/array-species-create.js", "../../../node_modules/core-js-pure/internals/array-iteration.js", "../../../node_modules/core-js-pure/internals/collection.js", "../../../node_modules/core-js-pure/internals/define-built-in-accessor.js", "../../../node_modules/core-js-pure/internals/define-built-ins.js", "../../../node_modules/core-js-pure/internals/set-species.js", "../../../node_modules/core-js-pure/internals/collection-strong.js", "../../../node_modules/core-js-pure/modules/es.map.constructor.js", "../../../node_modules/core-js-pure/modules/es.map.js", "../../../node_modules/core-js-pure/modules/es.set.constructor.js", "../../../node_modules/core-js-pure/modules/es.set.js", "../../../node_modules/core-js-pure/internals/engine-is-node.js", "../../../node_modules/core-js-pure/internals/try-node-require.js", "../../../node_modules/core-js-pure/internals/to-string.js", "../../../node_modules/core-js-pure/internals/normalize-string-argument.js", "../../../node_modules/core-js-pure/internals/error-to-string.js", "../../../node_modules/core-js-pure/internals/dom-exception-constants.js", "../../../node_modules/core-js-pure/internals/error-stack-clear.js", "../../../node_modules/core-js-pure/modules/web.dom-exception.constructor.js", "../../../node_modules/core-js-pure/internals/inherit-if-required.js", "../../../node_modules/core-js-pure/modules/web.dom-exception.stack.js", "../../../node_modules/core-js-pure/modules/web.dom-exception.to-string-tag.js", "../../../node_modules/core-js-pure/internals/validate-arguments-length.js", "../../../node_modules/core-js-pure/internals/regexp-flags.js", "../../../node_modules/core-js-pure/internals/regexp-get-flags.js", "../../../node_modules/core-js-pure/internals/caller.js", "../../../node_modules/core-js-pure/internals/map-helpers.js", "../../../node_modules/core-js-pure/internals/set-helpers.js", "../../../node_modules/core-js-pure/internals/iterate-simple.js", "../../../node_modules/core-js-pure/internals/set-iterate.js", "../../../node_modules/core-js-pure/internals/engine-is-deno.js", "../../../node_modules/core-js-pure/internals/engine-is-browser.js", "../../../node_modules/core-js-pure/internals/structured-clone-proper-transfer.js", "../../../node_modules/core-js-pure/internals/detach-transferable.js", "../../../node_modules/core-js-pure/internals/error-stack-installable.js", "../../../node_modules/core-js-pure/modules/web.structured-clone.js", "../../../node_modules/core-js-pure/stable/structured-clone.js", "../../../node_modules/core-js-pure/actual/structured-clone.js", "../../../node_modules/uuid/dist/commonjs-browser/rng.js", "../../../node_modules/uuid/dist/commonjs-browser/regex.js", "../../../node_modules/uuid/dist/commonjs-browser/validate.js", "../../../node_modules/uuid/dist/commonjs-browser/stringify.js", "../../../node_modules/uuid/dist/commonjs-browser/v1.js", "../../../node_modules/uuid/dist/commonjs-browser/parse.js", "../../../node_modules/uuid/dist/commonjs-browser/v35.js", "../../../node_modules/uuid/dist/commonjs-browser/md5.js", "../../../node_modules/uuid/dist/commonjs-browser/v3.js", "../../../node_modules/uuid/dist/commonjs-browser/native.js", "../../../node_modules/uuid/dist/commonjs-browser/v4.js", "../../../node_modules/uuid/dist/commonjs-browser/sha1.js", "../../../node_modules/uuid/dist/commonjs-browser/v5.js", "../../../node_modules/uuid/dist/commonjs-browser/nil.js", "../../../node_modules/uuid/dist/commonjs-browser/version.js", "../../../node_modules/uuid/dist/commonjs-browser/index.js", "../../../node_modules/prop-types/lib/ReactPropTypesSecret.js", "../../../node_modules/prop-types/factoryWithThrowingShims.js", "../../../node_modules/prop-types/index.js", "../../../node_modules/react-portal/es/utils.js", "../../../node_modules/react-portal/es/Portal.js", "../../../node_modules/react-portal/es/LegacyPortal.js", "../../../node_modules/react-portal/es/PortalCompat.js", "../../../node_modules/react-portal/es/PortalWithState.js", "../../../node_modules/react-portal/es/index.js", "../../../node_modules/zod/lib/helpers/util.js", "../../../node_modules/zod/lib/ZodError.js", "../../../node_modules/zod/lib/locales/en.js", "../../../node_modules/zod/lib/errors.js", "../../../node_modules/zod/lib/helpers/parseUtil.js", "../../../node_modules/zod/lib/helpers/typeAliases.js", "../../../node_modules/zod/lib/helpers/errorUtil.js", "../../../node_modules/zod/lib/types.js", "../../../node_modules/zod/lib/external.js", "../../../node_modules/zod/lib/index.js", "../../../node_modules/dompurify/src/utils.js", "../../../node_modules/dompurify/src/tags.js", "../../../node_modules/dompurify/src/attrs.js", "../../../node_modules/dompurify/src/regexp.js", "../../../node_modules/dompurify/src/purify.js", "../../../node_modules/object-assign/index.js", "../../../node_modules/@styled-system/core/dist/index.esm.js", "../../../node_modules/@styled-system/layout/dist/index.esm.js", "../../../node_modules/@styled-system/color/dist/index.esm.js", "../../../node_modules/@styled-system/typography/dist/index.esm.js", "../../../node_modules/@styled-system/flexbox/dist/index.esm.js", "../../../node_modules/@styled-system/grid/dist/index.esm.js", "../../../node_modules/@styled-system/border/dist/index.esm.js", "../../../node_modules/@styled-system/background/dist/index.esm.js", "../../../node_modules/@styled-system/position/dist/index.esm.js", "../../../node_modules/@styled-system/space/dist/index.esm.js", "../../../node_modules/@styled-system/shadow/dist/index.esm.js", "../../../node_modules/@styled-system/css/dist/index.esm.js", "../../../node_modules/@styled-system/variant/dist/index.esm.js", "../../../node_modules/styled-system/dist/index.esm.js", "../../../node_modules/@frigade/react/src/FrigadeProvider/index.tsx", "../../../node_modules/@frigade/react/src/components/DataFetcher/index.tsx", "../../../node_modules/@frigade/react/src/api/flows.ts", "../../../node_modules/@frigade/react/src/api/common.ts", "../../../node_modules/@frigade/react/src/api/version.ts", "../../../node_modules/@frigade/react/src/api/flow-responses.ts", "../../../node_modules/@frigade/react/src/api/user-flow-states.ts", "../../../node_modules/@frigade/react/src/api/flow-opens.ts", "../../../node_modules/@frigade/react/src/shared/deepmerge.ts", "../../../node_modules/@frigade/react/src/shared/parse.ts", "../../../node_modules/@frigade/react/src/shared/completion-util.ts", "../../../node_modules/@frigade/react/src/api/users.tsx", "../../../node_modules/@frigade/react/src/FrigadeForm/index.tsx", "../../../node_modules/@frigade/react/src/components/Modal/index.tsx", "../../../node_modules/@frigade/react/src/components/Modal/ModalBackground.tsx", "../../../node_modules/@frigade/react/src/shared/appearance.ts", "../../../node_modules/@frigade/react/src/components/Icons/Close.tsx", "../../../node_modules/@frigade/react/src/components/branding/PoweredByFrigade.tsx", "../../../node_modules/@frigade/react/src/components/Icons/FrigadeLogo.tsx", "../../../node_modules/@frigade/react/src/components/branding/styled.ts", "../../../node_modules/@frigade/react/src/components/Tooltips/styled.ts", "../../../node_modules/@frigade/react/src/components/CornerModal/index.tsx", "../../../node_modules/@frigade/react/src/hooks/useTheme.ts", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/MultiInputStepType.tsx", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/TextField/index.tsx", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/shared/styled.tsx", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/shared/Label.tsx", "../../../node_modules/@frigade/react/src/types/index.tsx", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/shared/SubLabel.tsx", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/shared/validation.ts", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/MultipleChoice/index.tsx", "../../../node_modules/@frigade/react/src/components/Forms/MultiInputStepType/form-components/MultipleChoiceList/index.tsx", "../../../node_modules/@frigade/react/src/components/CheckBox/index.tsx", "../../../node_modules/@frigade/react/src/components/Progress/ProgressRing/ProgressRing.tsx", "../../../node_modules/@frigade/react/src/shared/sanitizer.ts", "../../../node_modules/@frigade/react/src/components/TitleSubtitle/TitleSubtitle.tsx", "../../../node_modules/@frigade/react/src/components/Icons/Warning.tsx", "../../../node_modules/@frigade/react/src/FrigadeForm/styled.ts", "../../../node_modules/@frigade/react/src/FrigadeForm/FormFooter.tsx", "../../../node_modules/@frigade/react/src/components/Button/index.tsx", "../../../node_modules/@frigade/react/src/components/Spinner/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeForm/FormPagination.tsx", "../../../node_modules/@frigade/react/src/components/Forms/LinkCollectionStepType/index.tsx", "../../../node_modules/@frigade/react/src/hooks/useCTAClickSideEffects.ts", "../../../node_modules/@frigade/react/src/components/Forms/CallToActionStepType/CallToActionStepType.tsx", "../../../node_modules/@frigade/react/src/components/Icons/Play.tsx", "../../../node_modules/@frigade/react/src/components/Video/VideoCard.tsx", "../../../node_modules/@frigade/react/src/components/Forms/SelectListStepType/SelectListStepType.tsx", "../../../node_modules/@frigade/react/src/components/Forms/SelectListStepType/styled.ts", "../../../node_modules/@frigade/react/src/FrigadeForm/FormContent.tsx", "../../../node_modules/@frigade/react/src/components/RenderInlineStyles.tsx", "../../../node_modules/@frigade/react/src/hooks/useFlowImpressions.ts", "../../../node_modules/@frigade/react/src/api/organizations.tsx", "../../../node_modules/@frigade/react/src/shared/appearanceToOverrides.ts", "../../../node_modules/@frigade/react/src/components/Button/Button.styles.ts", "../../../node_modules/@frigade/react/src/components/Box/index.tsx", "../../../node_modules/@frigade/react/src/components/Text/Text.styles.ts", "../../../node_modules/@frigade/react/src/shared/theme.ts", "../../../node_modules/@frigade/react/src/components/HeroChecklist/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeChecklist/index.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/HeroChecklist/HeroChecklist.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/HeroChecklist/StepChecklistItem.tsx", "../../../node_modules/@frigade/react/src/components/CheckBoxRow/index.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/HeroChecklist/styled.ts", "../../../node_modules/@frigade/react/src/components/Checklists/Checklist/ProgressBar.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/Checklist/styled.ts", "../../../node_modules/@frigade/react/src/components/checklist-step-content/HeroStepContent.tsx", "../../../node_modules/@frigade/react/src/components/checklist-step-content/shared/TitleSubtitleWithCTA.tsx", "../../../node_modules/@frigade/react/src/components/checklist-step-content/shared/TitleSubtitle.tsx", "../../../node_modules/@frigade/react/src/components/checklist-step-content/shared/CTA.tsx", "../../../node_modules/@frigade/react/src/components/Video/VideoPlayer.tsx", "../../../node_modules/@frigade/react/src/components/checklist-step-content/VideoCarousel.tsx", "../../../node_modules/@frigade/react/src/components/checklist-step-content/CodeSnippetContent.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/ChecklistWithGuide/ChecklistWithGuide.tsx", "../../../node_modules/@frigade/react/src/components/Icons/Chevron.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/ChecklistWithGuide/styled.ts", "../../../node_modules/@frigade/react/src/components/styled.ts", "../../../node_modules/@frigade/react/src/components/Guides/Guide.tsx", "../../../node_modules/@frigade/react/src/components/Guides/styled.ts", "../../../node_modules/@frigade/react/src/components/Checklists/CondensedChecklist/CondensedChecklist.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/CondensedChecklist/CollapsibleStep/index.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/CondensedChecklist/CollapsibleStep/styled.ts", "../../../node_modules/@frigade/react/src/components/Checklists/CondensedChecklist/styled.ts", "../../../node_modules/@frigade/react/src/components/Checklists/CarouselChecklist/index.tsx", "../../../node_modules/@frigade/react/src/hooks/useMediaQuery.ts", "../../../node_modules/@frigade/react/src/components/Checklists/CarouselChecklist/CarouselCard.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/CarouselChecklist/styled.ts", "../../../node_modules/@frigade/react/src/FrigadeProgressBadge/index.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/MiniProgressBadge/index.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/MiniProgressBadge/styled.ts", "../../../node_modules/@frigade/react/src/components/Checklists/FullWidthProgressBadge/index.tsx", "../../../node_modules/@frigade/react/src/components/Checklists/FullWidthProgressBadge/styled.ts", "../../../node_modules/@frigade/react/src/FrigadeGuide/FrigadeGuide.tsx", "../../../node_modules/@frigade/react/src/FrigadeTour/index.tsx", "../../../node_modules/@frigade/react/src/components/Tooltips/Tooltips.tsx", "../../../node_modules/@frigade/react/src/components/Tooltips/position.ts", "../../../node_modules/@frigade/react/src/hooks/useDebug.ts", "../../../node_modules/@frigade/react/src/FrigadeSupportWidget/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeSupportWidget/styled.ts", "../../../node_modules/@frigade/react/src/components/Icons/Question.tsx", "../../../node_modules/@frigade/react/src/components/Icons/QuestionCircle.tsx", "../../../node_modules/@frigade/react/src/FrigadeEmbeddedTip/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeEmbeddedTip/styled.ts", "../../../node_modules/@frigade/react/src/FrigadeAnnouncement/styled.ts", "../../../node_modules/@frigade/react/src/components/Media/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeBanner/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeBanner/styled.ts", "../../../node_modules/@frigade/react/src/components/Icons/Info.tsx", "../../../node_modules/@frigade/react/src/FrigadeNPSSurvey/index.tsx", "../../../node_modules/@frigade/react/src/FrigadeNPSSurvey/styled.ts", "../../../node_modules/@frigade/react/src/FrigadeAnnouncement/index.tsx", "../../../node_modules/@frigade/react/src/components/Button/TEMP_index.tsx", "../../../node_modules/@frigade/react/src/components/Text/index.tsx", "../../../node_modules/@frigade/react/src/index.ts", "../../../node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js", "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/typeof.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/toPrimitive.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/toPropertyKey.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/defineProperty.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/objectSpread2.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/arrayWithHoles.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/arrayLikeToArray.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/nonIterableRest.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/slicedToArray.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/objectWithoutProperties.js", "../../../node_modules/react-select/dist/useStateManager-ce23061c.cjs.prod.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/extends.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/classCallCheck.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/createClass.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/setPrototypeOf.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/inherits.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/getPrototypeOf.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/assertThisInitialized.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/createSuper.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/iterableToArray.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/nonIterableSpread.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/toConsumableArray.js", "../../../node_modules/@emotion/react/node_modules/@emotion/sheet/dist/emotion-sheet.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/sheet/dist/emotion-sheet.cjs.js", "../../../node_modules/stylis/src/Enum.js", "../../../node_modules/stylis/src/Utility.js", "../../../node_modules/stylis/src/Tokenizer.js", "../../../node_modules/stylis/src/Parser.js", "../../../node_modules/stylis/src/Prefixer.js", "../../../node_modules/stylis/src/Serializer.js", "../../../node_modules/stylis/src/Middleware.js", "../../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.prod.js", "../../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js", "../../../node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/cache/dist/emotion-cache.cjs.js", "../../../node_modules/@emotion/react/node_modules/@babel/runtime/helpers/extends.js", "../../../node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/utils/dist/emotion-utils.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/utils/dist/emotion-utils.cjs.js", "../../../node_modules/@emotion/react/node_modules/@emotion/hash/dist/emotion-hash.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/hash/dist/emotion-hash.cjs.js", "../../../node_modules/@emotion/react/node_modules/@emotion/unitless/dist/emotion-unitless.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/unitless/dist/emotion-unitless.cjs.js", "../../../node_modules/@emotion/react/node_modules/@emotion/serialize/dist/emotion-serialize.cjs.prod.js", "../../../node_modules/@emotion/react/node_modules/@emotion/serialize/dist/emotion-serialize.cjs.js", "../../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.cjs.prod.js", "../../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.cjs.js", "../../../node_modules/@emotion/react/dist/emotion-element-4300ad44.cjs.prod.js", "../../../node_modules/@emotion/react/dist/emotion-react.cjs.prod.js", "../../../node_modules/@emotion/react/dist/emotion-react.cjs.js", "../../../node_modules/react-select/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js", "../../../node_modules/@floating-ui/dom/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js", "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js", "../../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js", "../../../node_modules/react-select/dist/index-665c4ed8.cjs.prod.js", "../../../node_modules/memoize-one/dist/memoize-one.esm.js", "../../../node_modules/react-select/dist/Select-5dacb5ba.cjs.prod.js", "../../../node_modules/react-select/node_modules/@emotion/sheet/dist/emotion-sheet.cjs.prod.js", "../../../node_modules/react-select/node_modules/@emotion/sheet/dist/emotion-sheet.cjs.js", "../../../node_modules/react-select/node_modules/@emotion/cache/dist/emotion-cache.cjs.prod.js", "../../../node_modules/react-select/node_modules/@emotion/cache/dist/emotion-cache.cjs.js", "../../../node_modules/react-select/dist/react-select.cjs.prod.js", "../../../node_modules/react-select/dist/react-select.cjs.js", "../../../node_modules/react-select/dist/react-select.cjs.default.js", "../../../node_modules/@sendbird/chat/lib/__bundle-2aa1a987.js", "../../../node_modules/@sendbird/chat/lib/__bundle-40c7abbd.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-EQ2jMcm0.js", "../../../node_modules/@sendbird/src/_externals/lamejs/lame.all.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-qotlr2QN.js", "../../../node_modules/classnames/index.js", "../../../node_modules/react/cjs/react-jsx-runtime.production.min.js", "../../../node_modules/react/jsx-runtime.js", "../../../node_modules/invariant/browser.js", "../../../node_modules/short-number/index.js", "../../../node_modules/phone/dist/data/country_phone_data.js", "../../../node_modules/phone/dist/lib/utility.js", "../../../node_modules/phone/dist/index.js", "../../../node_modules/timezone-select-js/lib/tz.data.js", "../../../node_modules/timezone-select-js/lib/tz.helper.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js", "../../javascript/application.js", "../../../node_modules/universal-cookie/esm/index.mjs", "../../../node_modules/uuid/dist/esm-browser/rng.js", "../../../node_modules/uuid/dist/esm-browser/stringify.js", "../../../node_modules/uuid/dist/esm-browser/native.js", "../../../node_modules/uuid/dist/esm-browser/v4.js", "../../javascript/utils/get-env.ts", "../../../node_modules/bootstrap/js/src/util/index.js", "../../../node_modules/bootstrap/js/src/dom/event-handler.js", "../../../node_modules/bootstrap/js/src/dom/data.js", "../../../node_modules/bootstrap/js/src/base-component.js", "../../../node_modules/bootstrap/js/src/util/component-functions.js", "../../../node_modules/bootstrap/js/src/alert.js", "../../../node_modules/bootstrap/js/src/button.js", "../../../node_modules/bootstrap/js/src/dom/manipulator.js", "../../../node_modules/bootstrap/js/src/dom/selector-engine.js", "../../../node_modules/bootstrap/js/src/carousel.js", "../../../node_modules/bootstrap/js/src/collapse.js", "../../../node_modules/bootstrap/js/src/dropdown.js", "../../../node_modules/bootstrap/js/src/util/scrollbar.js", "../../../node_modules/bootstrap/js/src/util/backdrop.js", "../../../node_modules/bootstrap/js/src/util/focustrap.js", "../../../node_modules/bootstrap/js/src/modal.js", "../../../node_modules/bootstrap/js/src/offcanvas.js", "../../../node_modules/bootstrap/js/src/util/sanitizer.js", "../../../node_modules/bootstrap/js/src/tooltip.js", "../../../node_modules/bootstrap/js/src/popover.js", "../../../node_modules/bootstrap/js/src/scrollspy.js", "../../../node_modules/bootstrap/js/src/tab.js", "../../../node_modules/bootstrap/js/src/toast.js", "../../javascript/utilities.ts", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../javascript/controllers/activity_feed_loader_controller.ts", "../../javascript/controllers/activity_feed_oauth_controller.ts", "../../javascript/controllers/alert_controller.js", "../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js", "../../javascript/controllers/audio_embed_controller.ts", "../../../node_modules/hotkeys-js/dist/hotkeys.esm.js", "../../../node_modules/stimulus-use/dist/index.js", "../../javascript/controllers/audio_form_controller.ts", "../../javascript/fetch.ts", "../../javascript/controllers/auto_save_controller.js", "../../javascript/controllers/auto_submit_controller.js", "../../javascript/controllers/autoscroll_controller.ts", "../../javascript/controllers/avatar_image_picker_controller.ts", "../../javascript/controllers/block_form_controller.ts", "../../../node_modules/js-base64/base64.mjs", "../../../node_modules/@imgix/js-core/dist/index.esm.js", "../../../node_modules/ufo/dist/index.mjs", "../../javascript/utils/asserts.ts", "../../javascript/controllers/block_image_controller.ts", "../../../node_modules/i18n-js/src/I18n.ts", "../../../node_modules/i18n-js/src/Locales.ts", "../../../node_modules/make-plural/plurals.mjs", "../../../node_modules/i18n-js/src/Pluralization.ts", "../../../node_modules/i18n-js/src/helpers/camelCaseKeys.ts", "../../../node_modules/i18n-js/src/helpers/isSet.ts", "../../../node_modules/i18n-js/src/helpers/createTranslationOptions.ts", "../../../node_modules/bignumber.js/bignumber.mjs", "../../../node_modules/i18n-js/src/helpers/expandRoundMode.ts", "../../../node_modules/i18n-js/src/helpers/formatNumber.ts", "../../../node_modules/i18n-js/src/helpers/roundNumber.ts", "../../../node_modules/i18n-js/src/helpers/getFullScope.ts", "../../../node_modules/i18n-js/src/helpers/inferType.ts", "../../../node_modules/i18n-js/src/helpers/interpolate.ts", "../../../node_modules/i18n-js/src/helpers/lookup.ts", "../../../node_modules/i18n-js/src/helpers/numberToDelimited.ts", "../../../node_modules/i18n-js/src/helpers/numberToHuman.ts", "../../../node_modules/i18n-js/src/helpers/numberToHumanSize.ts", "../../../node_modules/i18n-js/src/helpers/parseDate.ts", "../../../node_modules/i18n-js/src/helpers/pluralize.ts", "../../../node_modules/i18n-js/src/helpers/propertyFlatList.ts", "../../../node_modules/i18n-js/src/helpers/strftime.ts", "../../../node_modules/i18n-js/src/helpers/timeAgoInWords.ts", "../../../node_modules/i18n-js/src/MissingTranslation.ts", "../../javascript/locales.json", "../../javascript/utils/i18n.ts", "../../javascript/controllers/buy_now_controller.ts", "../../javascript/controllers/carousel_controller.ts", "../../javascript/controllers/cart_controller.js", "../../javascript/controllers/categories_dropdown_controller.js", "../../javascript/icons/svg-icons.ts", "../../../node_modules/js-confetti/dist/es/index.js", "../../javascript/controllers/celebrate_controller.ts", "../../javascript/controllers/change_payment_method_controller.ts", "../../javascript/controllers/character_limit_controller.js", "../../javascript/controllers/checkbox_reveal_controller.ts", "../../javascript/controllers/choices_controller.ts", "../../javascript/controllers/click_elsewhere_controller.ts", "../../javascript/controllers/clipboard_controller.ts", "../../javascript/controllers/collapse_controller.ts", "../../javascript/controllers/collect_payment_info_form_controller.ts", "../../javascript/controllers/confirm_follow_controller.ts", "../../javascript/controllers/constant_refresh_frame_controller.ts", "../../javascript/controllers/country_state_select_controller.js", "../../javascript/controllers/create_block_controller.js", "../../javascript/controllers/custom_categories_dropdown_controller.js", "../../javascript/controllers/custom_gender_controller.ts", "../../../node_modules/vanilla-colorful/src/lib/utils/math.ts", "../../../node_modules/vanilla-colorful/src/lib/utils/convert.ts", "../../../node_modules/vanilla-colorful/src/lib/utils/compare.ts", "../../../node_modules/vanilla-colorful/src/lib/utils/dom.ts", "../../../node_modules/vanilla-colorful/src/lib/components/slider.ts", "../../../node_modules/vanilla-colorful/src/lib/components/hue.ts", "../../../node_modules/vanilla-colorful/src/lib/components/saturation.ts", "../../../node_modules/vanilla-colorful/src/lib/styles/color-picker.ts", "../../../node_modules/vanilla-colorful/src/lib/styles/hue.ts", "../../../node_modules/vanilla-colorful/src/lib/styles/saturation.ts", "../../../node_modules/vanilla-colorful/src/lib/components/color-picker.ts", "../../../node_modules/vanilla-colorful/src/lib/entrypoints/hex.ts", "../../../node_modules/vanilla-colorful/src/hex-color-picker.ts", "../../javascript/controllers/customize_theme_form_controller.ts", "../../../node_modules/luxon/src/errors.js", "../../../node_modules/luxon/src/impl/formats.js", "../../../node_modules/luxon/src/zone.js", "../../../node_modules/luxon/src/zones/systemZone.js", "../../../node_modules/luxon/src/zones/IANAZone.js", "../../../node_modules/luxon/src/impl/locale.js", "../../../node_modules/luxon/src/zones/fixedOffsetZone.js", "../../../node_modules/luxon/src/zones/invalidZone.js", "../../../node_modules/luxon/src/impl/zoneUtil.js", "../../../node_modules/luxon/src/settings.js", "../../../node_modules/luxon/src/impl/util.js", "../../../node_modules/luxon/src/impl/english.js", "../../../node_modules/luxon/src/impl/formatter.js", "../../../node_modules/luxon/src/impl/invalid.js", "../../../node_modules/luxon/src/impl/regexParser.js", "../../../node_modules/luxon/src/duration.js", "../../../node_modules/luxon/src/interval.js", "../../../node_modules/luxon/src/info.js", "../../../node_modules/luxon/src/impl/diff.js", "../../../node_modules/luxon/src/impl/digits.js", "../../../node_modules/luxon/src/impl/tokenParser.js", "../../../node_modules/luxon/src/impl/conversions.js", "../../../node_modules/luxon/src/datetime.js", "../../javascript/controllers/datetime_controller.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/errors.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/namespace.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-format-localization.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/datetime.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/service-locator.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/calendar-modes.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionsStore.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/validation.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/event-emitter.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/default-options.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/typeChecker.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionProcessor.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/optionConverter.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/dates.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/utilities/action-types.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/date-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/month-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/year-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/calendar/decade-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/time-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/hour-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/minute-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/time/second-display.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/collapse.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/display/index.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/actions.ts", "../../../node_modules/@eonasdan/tempus-dominus/src/js/tempus-dominus.ts", "../../javascript/controllers/datetime_picker_controller.ts", "../../javascript/controllers/delete_confirmation_controller.js", "../../javascript/controllers/deselect_radio_button_controller.js", "../../javascript/debounce.ts", "../../javascript/controllers/domain_input_controller.ts", "../../javascript/controllers/donate_form_controller.js", "../../javascript/controllers/download_controller.ts", "../../javascript/controllers/drafts_controller.js", "../../javascript/controllers/drawer_controller.ts", "../../javascript/controllers/dropdown_controller.js", "../../javascript/controllers/multi_image_selector_controller.js", "../../javascript/controllers/form_helpers_controller.js", "../../javascript/controllers/dropzone_controller.js", "../../javascript/controllers/duet_date_controller.ts", "../../javascript/templates/loading.js", "../../javascript/controllers/editable_block_controller.js", "../../javascript/controllers/embedded_checkout_controller.js", "../../javascript/controllers/event_duration_controller.ts", "../../../node_modules/video.js/dist/video.es.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/resolve-url.js", "../../../node_modules/@babel/runtime/helpers/esm/extends.js", "../../../node_modules/@videojs/vhs-utils/es/stream.js", "../../../node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js", "../../../node_modules/m3u8-parser/dist/m3u8-parser.es.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/codecs.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/media-types.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/byte-helpers.js", "../../../node_modules/@videojs/vhs-utils/es/resolve-url.js", "../../../node_modules/mpd-parser/dist/mpd-parser.es.js", "../../../node_modules/@videojs/vhs-utils/es/media-groups.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/id3-helpers.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/opus-helpers.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/mp4-helpers.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/ebml-helpers.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/nal-helpers.js", "../../../node_modules/video.js/node_modules/@videojs/vhs-utils/es/containers.js", "../../javascript/controllers/expanded_view_controller.ts", "../../javascript/controllers/extra_wide_offcanvas_controller.js", "../../javascript/controllers/file_upload_controller.ts", "../../javascript/controllers/fit_text_controller.ts", "../../javascript/controllers/follow_profile_controller.ts", "../../javascript/controllers/form_success_controller.js", "../../javascript/controllers/gallery_controller.ts", "../../javascript/controllers/gridstack_controller.ts", "../../javascript/controllers/header_scroll_controller.js", "../../javascript/controllers/hero_image_picker_controller.ts", "../../javascript/controllers/image_fit_controller.js", "../../javascript/controllers/image_gallery_controller.js", "../../javascript/controllers/image_selector_controller.js", "../../javascript/controllers/impersonate_alert_controller.ts", "../../javascript/controllers/inapp_notifications_controller.ts", "../../javascript/components/Notifications/index.jsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Button/Button.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/KnockFeedProvider/KnockFeedProvider.tsx", "../../../node_modules/zustand/esm/index.mjs", "../../../node_modules/@knocklabs/react-notification-feed/src/hooks/useAuthenticatedKnockClient.ts", "../../../node_modules/@babel/runtime/helpers/esm/typeof.js", "../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js", "../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js", "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js", "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js", "../../../node_modules/axios/lib/helpers/bind.js", "../../../node_modules/axios/lib/utils.js", "../../../node_modules/axios/lib/core/AxiosError.js", "../../../node_modules/axios/lib/helpers/null.js", "../../../node_modules/axios/lib/helpers/toFormData.js", "../../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js", "../../../node_modules/axios/lib/helpers/buildURL.js", "../../../node_modules/axios/lib/core/InterceptorManager.js", "../../../node_modules/axios/lib/defaults/transitional.js", "../../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js", "../../../node_modules/axios/lib/platform/browser/classes/FormData.js", "../../../node_modules/axios/lib/platform/browser/classes/Blob.js", "../../../node_modules/axios/lib/platform/browser/index.js", "../../../node_modules/axios/lib/platform/common/utils.js", "../../../node_modules/axios/lib/platform/index.js", "../../../node_modules/axios/lib/helpers/toURLEncodedForm.js", "../../../node_modules/axios/lib/helpers/formDataToJSON.js", "../../../node_modules/axios/lib/defaults/index.js", "../../../node_modules/axios/lib/helpers/parseHeaders.js", "../../../node_modules/axios/lib/core/AxiosHeaders.js", "../../../node_modules/axios/lib/core/transformData.js", "../../../node_modules/axios/lib/cancel/isCancel.js", "../../../node_modules/axios/lib/cancel/CanceledError.js", "../../../node_modules/axios/lib/core/settle.js", "../../../node_modules/axios/lib/helpers/parseProtocol.js", "../../../node_modules/axios/lib/helpers/speedometer.js", "../../../node_modules/axios/lib/helpers/throttle.js", "../../../node_modules/axios/lib/helpers/progressEventReducer.js", "../../../node_modules/axios/lib/helpers/isURLSameOrigin.js", "../../../node_modules/axios/lib/helpers/cookies.js", "../../../node_modules/axios/lib/helpers/isAbsoluteURL.js", "../../../node_modules/axios/lib/helpers/combineURLs.js", "../../../node_modules/axios/lib/core/buildFullPath.js", "../../../node_modules/axios/lib/core/mergeConfig.js", "../../../node_modules/axios/lib/helpers/resolveConfig.js", "../../../node_modules/axios/lib/adapters/xhr.js", "../../../node_modules/axios/lib/helpers/composeSignals.js", "../../../node_modules/axios/lib/helpers/trackStream.js", "../../../node_modules/axios/lib/adapters/fetch.js", "../../../node_modules/axios/lib/adapters/adapters.js", "../../../node_modules/axios/lib/core/dispatchRequest.js", "../../../node_modules/axios/lib/env/data.js", "../../../node_modules/axios/lib/helpers/validator.js", "../../../node_modules/axios/lib/core/Axios.js", "../../../node_modules/axios/lib/cancel/CancelToken.js", "../../../node_modules/axios/lib/helpers/spread.js", "../../../node_modules/axios/lib/helpers/isAxiosError.js", "../../../node_modules/axios/lib/helpers/HttpStatusCode.js", "../../../node_modules/axios/lib/axios.js", "../../../node_modules/axios/index.js", "../../../node_modules/axios-retry/es/index.mjs", "../../../node_modules/phoenix/assets/js/phoenix/utils.js", "../../../node_modules/phoenix/assets/js/phoenix/constants.js", "../../../node_modules/phoenix/assets/js/phoenix/push.js", "../../../node_modules/phoenix/assets/js/phoenix/timer.js", "../../../node_modules/phoenix/assets/js/phoenix/channel.js", "../../../node_modules/phoenix/assets/js/phoenix/ajax.js", "../../../node_modules/phoenix/assets/js/phoenix/longpoll.js", "../../../node_modules/phoenix/assets/js/phoenix/presence.js", "../../../node_modules/phoenix/assets/js/phoenix/serializer.js", "../../../node_modules/phoenix/assets/js/phoenix/socket.js", "../../../node_modules/@knocklabs/client/src/api.ts", "../../../node_modules/@knocklabs/client/src/clients/feed/feed.ts", "../../../node_modules/zustand/esm/vanilla.mjs", "../../../node_modules/@knocklabs/client/src/networkStatus.ts", "../../../node_modules/@knocklabs/client/src/clients/feed/utils.ts", "../../../node_modules/@knocklabs/client/src/clients/feed/store.ts", "../../../node_modules/@knocklabs/client/src/clients/feed/index.ts", "../../../node_modules/@knocklabs/client/src/clients/preferences/index.ts", "../../../node_modules/@knocklabs/client/src/clients/users/index.ts", "../../../node_modules/@knocklabs/client/src/knock.ts", "../../../node_modules/@knocklabs/client/src/index.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/hooks/useOnBottomScroll.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/hooks/useNotifications.ts", "../../../node_modules/date-fns/esm/_lib/defaultOptions/index.js", "../../../node_modules/date-fns/node_modules/@babel/runtime/helpers/esm/typeof.js", "../../../node_modules/date-fns/esm/_lib/requiredArgs/index.js", "../../../node_modules/date-fns/esm/toDate/index.js", "../../../node_modules/date-fns/esm/compareAsc/index.js", "../../../node_modules/date-fns/esm/differenceInCalendarMonths/index.js", "../../../node_modules/date-fns/esm/endOfDay/index.js", "../../../node_modules/date-fns/esm/endOfMonth/index.js", "../../../node_modules/date-fns/esm/isLastDayOfMonth/index.js", "../../../node_modules/date-fns/esm/differenceInMonths/index.js", "../../../node_modules/date-fns/esm/differenceInMilliseconds/index.js", "../../../node_modules/date-fns/esm/_lib/roundingMethods/index.js", "../../../node_modules/date-fns/esm/differenceInSeconds/index.js", "../../../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js", "../../../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js", "../../../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js", "../../../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js", "../../../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/en-US/index.js", "../../../node_modules/date-fns/esm/_lib/defaultLocale/index.js", "../../../node_modules/date-fns/esm/_lib/assign/index.js", "../../../node_modules/date-fns/esm/_lib/cloneObject/index.js", "../../../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js", "../../../node_modules/date-fns/esm/formatDistance/index.js", "../../../node_modules/date-fns/esm/constants/index.js", "../../../node_modules/date-fns/esm/_lib/toInteger/index.js", "../../../node_modules/date-fns/esm/parseISO/index.js", "../../../node_modules/@knocklabs/react-notification-feed/src/utils.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/components/KnockFeedProvider/KnockFeedContainer.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/KnockI18nProvider/KnockI18nProvider.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/i18n/languages/en.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/i18n/languages/de.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/i18n/index.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Button/ButtonSpinner.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Spinner/Spinner.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Button/ButtonGroup.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/EmptyFeed/EmptyFeed.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/hooks/useTranslations.ts", "../../../node_modules/date-fns/esm/locale/index.js", "../../../node_modules/date-fns/esm/locale/af/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/af/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/af/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/af/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/af/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/af/index.js", "../../../node_modules/date-fns/esm/locale/ar/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ar/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ar/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ar/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ar/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ar/index.js", "../../../node_modules/date-fns/esm/locale/ar-DZ/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ar-DZ/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ar-DZ/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ar-DZ/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ar-DZ/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ar-DZ/index.js", "../../../node_modules/date-fns/esm/locale/ar-EG/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ar-EG/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ar-EG/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ar-EG/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ar-EG/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ar-EG/index.js", "../../../node_modules/date-fns/esm/locale/ar-MA/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ar-MA/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ar-MA/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ar-MA/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ar-MA/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ar-MA/index.js", "../../../node_modules/date-fns/esm/locale/ar-SA/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ar-SA/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ar-SA/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ar-SA/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ar-SA/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ar-SA/index.js", "../../../node_modules/date-fns/esm/locale/ar-TN/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ar-TN/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ar-TN/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ar-TN/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ar-TN/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ar-TN/index.js", "../../../node_modules/date-fns/esm/locale/az/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/az/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/az/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/az/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/az/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/az/index.js", "../../../node_modules/date-fns/esm/locale/be/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/be/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js", "../../../node_modules/date-fns/esm/_lib/isSameUTCWeek/index.js", "../../../node_modules/date-fns/esm/locale/be/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/be/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/be/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/be/index.js", "../../../node_modules/date-fns/esm/locale/be-tarask/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/be-tarask/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/be-tarask/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/be-tarask/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/be-tarask/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/be-tarask/index.js", "../../../node_modules/date-fns/esm/locale/bg/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/bg/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/bg/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/bg/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/bg/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/bg/index.js", "../../../node_modules/date-fns/esm/locale/bn/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/bn/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/bn/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/bn/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/bn/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/bn/index.js", "../../../node_modules/date-fns/esm/locale/bs/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/bs/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/bs/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/bs/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/bs/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/bs/index.js", "../../../node_modules/date-fns/esm/locale/ca/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ca/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ca/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ca/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ca/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ca/index.js", "../../../node_modules/date-fns/esm/locale/cs/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/cs/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/cs/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/cs/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/cs/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/cs/index.js", "../../../node_modules/date-fns/esm/locale/cy/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/cy/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/cy/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/cy/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/cy/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/cy/index.js", "../../../node_modules/date-fns/esm/locale/da/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/da/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/da/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/da/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/da/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/da/index.js", "../../../node_modules/date-fns/esm/locale/de/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/de/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/de/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/de/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/de/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/de/index.js", "../../../node_modules/date-fns/esm/locale/de-AT/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/de-AT/index.js", "../../../node_modules/date-fns/esm/locale/el/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/el/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/el/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/el/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/el/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/el/index.js", "../../../node_modules/date-fns/esm/locale/en-AU/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-AU/index.js", "../../../node_modules/date-fns/esm/locale/en-CA/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/en-CA/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-CA/index.js", "../../../node_modules/date-fns/esm/locale/en-GB/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-GB/index.js", "../../../node_modules/date-fns/esm/locale/en-IE/index.js", "../../../node_modules/date-fns/esm/locale/en-IN/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-IN/index.js", "../../../node_modules/date-fns/esm/locale/en-NZ/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-NZ/index.js", "../../../node_modules/date-fns/esm/locale/en-ZA/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/en-ZA/index.js", "../../../node_modules/date-fns/esm/locale/eo/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/eo/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/eo/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/eo/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/eo/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/eo/index.js", "../../../node_modules/date-fns/esm/locale/es/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/es/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/es/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/es/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/es/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/es/index.js", "../../../node_modules/date-fns/esm/locale/et/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/et/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/et/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/et/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/et/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/et/index.js", "../../../node_modules/date-fns/esm/locale/eu/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/eu/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/eu/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/eu/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/eu/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/eu/index.js", "../../../node_modules/date-fns/esm/locale/fa-IR/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/fa-IR/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/fa-IR/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/fa-IR/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/fa-IR/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/fa-IR/index.js", "../../../node_modules/date-fns/esm/locale/fi/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/fi/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/fi/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/fi/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/fi/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/fi/index.js", "../../../node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/fr/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/fr/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/fr/index.js", "../../../node_modules/date-fns/esm/locale/fr-CA/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/fr-CA/index.js", "../../../node_modules/date-fns/esm/locale/fr-CH/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/fr-CH/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/fr-CH/index.js", "../../../node_modules/date-fns/esm/locale/fy/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/fy/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/fy/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/fy/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/fy/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/fy/index.js", "../../../node_modules/date-fns/esm/locale/gd/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/gd/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/gd/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/gd/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/gd/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/gd/index.js", "../../../node_modules/date-fns/esm/locale/gl/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/gl/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/gl/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/gl/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/gl/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/gl/index.js", "../../../node_modules/date-fns/esm/locale/gu/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/gu/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/gu/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/gu/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/gu/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/gu/index.js", "../../../node_modules/date-fns/esm/locale/he/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/he/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/he/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/he/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/he/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/he/index.js", "../../../node_modules/date-fns/esm/locale/hi/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/hi/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/hi/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/hi/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/hi/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/hi/index.js", "../../../node_modules/date-fns/esm/locale/hr/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/hr/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/hr/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/hr/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/hr/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/hr/index.js", "../../../node_modules/date-fns/esm/locale/ht/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ht/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ht/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ht/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ht/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ht/index.js", "../../../node_modules/date-fns/esm/locale/hu/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/hu/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/hu/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/hu/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/hu/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/hu/index.js", "../../../node_modules/date-fns/esm/locale/hy/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/hy/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/hy/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/hy/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/hy/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/hy/index.js", "../../../node_modules/date-fns/esm/locale/id/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/id/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/id/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/id/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/id/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/id/index.js", "../../../node_modules/date-fns/esm/locale/is/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/is/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/is/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/is/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/is/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/is/index.js", "../../../node_modules/date-fns/esm/locale/it/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/it/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/it/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/it/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/it/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/it/index.js", "../../../node_modules/date-fns/esm/locale/it-CH/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/it-CH/index.js", "../../../node_modules/date-fns/esm/locale/ja/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ja/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ja/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ja/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ja/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ja/index.js", "../../../node_modules/date-fns/esm/locale/ja-Hira/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ja-Hira/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ja-Hira/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ja-Hira/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ja-Hira/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ja-Hira/index.js", "../../../node_modules/date-fns/esm/locale/ka/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ka/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ka/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ka/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ka/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ka/index.js", "../../../node_modules/date-fns/esm/locale/kk/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/kk/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/kk/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/kk/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/kk/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/kk/index.js", "../../../node_modules/date-fns/esm/locale/km/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/km/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/km/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/km/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/km/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/km/index.js", "../../../node_modules/date-fns/esm/locale/kn/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/kn/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/kn/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/kn/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/kn/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/kn/index.js", "../../../node_modules/date-fns/esm/locale/ko/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ko/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ko/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ko/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ko/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ko/index.js", "../../../node_modules/date-fns/esm/locale/lb/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/lb/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/lb/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/lb/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/lb/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/lb/index.js", "../../../node_modules/date-fns/esm/locale/lt/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/lt/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/lt/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/lt/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/lt/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/lt/index.js", "../../../node_modules/date-fns/esm/locale/lv/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/lv/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/lv/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/lv/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/lv/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/lv/index.js", "../../../node_modules/date-fns/esm/locale/mk/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/mk/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/mk/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/mk/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/mk/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/mk/index.js", "../../../node_modules/date-fns/esm/locale/mn/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/mn/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/mn/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/mn/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/mn/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/mn/index.js", "../../../node_modules/date-fns/esm/locale/ms/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ms/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ms/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ms/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ms/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ms/index.js", "../../../node_modules/date-fns/esm/locale/mt/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/mt/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/mt/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/mt/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/mt/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/mt/index.js", "../../../node_modules/date-fns/esm/locale/nb/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/nb/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/nb/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/nb/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/nb/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/nb/index.js", "../../../node_modules/date-fns/esm/locale/nl/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/nl/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/nl/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/nl/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/nl/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/nl/index.js", "../../../node_modules/date-fns/esm/locale/nl-BE/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/nl-BE/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/nl-BE/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/nl-BE/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/nl-BE/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/nl-BE/index.js", "../../../node_modules/date-fns/esm/locale/nn/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/nn/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/nn/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/nn/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/nn/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/nn/index.js", "../../../node_modules/date-fns/esm/locale/oc/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/oc/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/oc/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/oc/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/oc/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/oc/index.js", "../../../node_modules/date-fns/esm/locale/pl/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/pl/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/pl/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/pl/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/pl/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/pl/index.js", "../../../node_modules/date-fns/esm/locale/pt/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/pt/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/pt/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/pt/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/pt/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/pt/index.js", "../../../node_modules/date-fns/esm/locale/pt-BR/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/pt-BR/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/pt-BR/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/pt-BR/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/pt-BR/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/pt-BR/index.js", "../../../node_modules/date-fns/esm/locale/ro/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ro/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ro/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ro/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ro/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ro/index.js", "../../../node_modules/date-fns/esm/locale/ru/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ru/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ru/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ru/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ru/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ru/index.js", "../../../node_modules/date-fns/esm/locale/sk/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/sk/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/sk/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/sk/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/sk/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/sk/index.js", "../../../node_modules/date-fns/esm/locale/sl/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/sl/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/sl/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/sl/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/sl/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/sl/index.js", "../../../node_modules/date-fns/esm/locale/sq/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/sq/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/sq/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/sq/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/sq/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/sq/index.js", "../../../node_modules/date-fns/esm/locale/sr/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/sr/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/sr/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/sr/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/sr/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/sr/index.js", "../../../node_modules/date-fns/esm/locale/sr-Latn/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/sr-Latn/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/sr-Latn/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/sr-Latn/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/sr-Latn/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/sr-Latn/index.js", "../../../node_modules/date-fns/esm/locale/sv/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/sv/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/sv/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/sv/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/sv/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/sv/index.js", "../../../node_modules/date-fns/esm/locale/ta/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ta/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ta/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ta/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ta/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ta/index.js", "../../../node_modules/date-fns/esm/locale/te/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/te/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/te/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/te/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/te/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/te/index.js", "../../../node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/th/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/th/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/th/index.js", "../../../node_modules/date-fns/esm/locale/tr/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/tr/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/tr/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/tr/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/tr/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/tr/index.js", "../../../node_modules/date-fns/esm/locale/ug/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/ug/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/ug/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/ug/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/ug/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/ug/index.js", "../../../node_modules/date-fns/esm/locale/uk/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/uk/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/uk/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/uk/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/uk/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/uk/index.js", "../../../node_modules/date-fns/esm/locale/uz/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/uz/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/uz/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/uz/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/uz/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/uz/index.js", "../../../node_modules/date-fns/esm/locale/uz-Cyrl/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/uz-Cyrl/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/uz-Cyrl/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/uz-Cyrl/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/uz-Cyrl/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/uz-Cyrl/index.js", "../../../node_modules/date-fns/esm/locale/vi/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/vi/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/vi/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/vi/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/vi/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/vi/index.js", "../../../node_modules/date-fns/esm/locale/zh-CN/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/zh-CN/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/zh-CN/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/zh-CN/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/zh-CN/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/zh-CN/index.js", "../../../node_modules/date-fns/esm/locale/zh-HK/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/zh-HK/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/zh-HK/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/zh-HK/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/zh-HK/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/zh-HK/index.js", "../../../node_modules/date-fns/esm/locale/zh-TW/_lib/formatDistance/index.js", "../../../node_modules/date-fns/esm/locale/zh-TW/_lib/formatLong/index.js", "../../../node_modules/date-fns/esm/locale/zh-TW/_lib/formatRelative/index.js", "../../../node_modules/date-fns/esm/locale/zh-TW/_lib/localize/index.js", "../../../node_modules/date-fns/esm/locale/zh-TW/_lib/match/index.js", "../../../node_modules/date-fns/esm/locale/zh-TW/index.js", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Icons/Bell.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Icons/CheckmarkCircle.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Icons/ChevronDown.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/Icons/CloseCircle.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationCell/NotificationCell.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationCell/Avatar.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationCell/ArchiveButton.tsx", "../../../node_modules/react-popper-tooltip/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../../../node_modules/react-popper-tooltip/node_modules/@babel/runtime/helpers/esm/extends.js", "../../../node_modules/react-popper/lib/esm/utils.js", "../../../node_modules/react-popper/lib/esm/usePopper.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/react-popper/node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/react-popper-tooltip/src/utils.ts", "../../../node_modules/react-popper-tooltip/src/usePopperTooltip.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationFeed/NotificationFeed.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/constants.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationFeed/NotificationFeedHeader.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationFeed/Dropdown.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationFeed/MarkAsRead.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/hooks/useFeedSettings.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationFeedPopover/NotificationFeedPopover.tsx", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/react-popper/lib/esm/utils.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/react-popper/lib/esm/usePopper.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/userAgent.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/@knocklabs/react-notification-feed/node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/@knocklabs/react-notification-feed/src/hooks/useComponentVisible.ts", "../../../node_modules/@knocklabs/react-notification-feed/src/components/NotificationIconButton/NotificationIconButton.tsx", "../../../node_modules/@knocklabs/react-notification-feed/src/components/UnseenBadge/UnseenBadge.tsx", "../../javascript/controllers/instagram_username_controller.ts", "../../javascript/controllers/is_scrolled_controller.ts", "../../javascript/controllers/is_scrolling_controller.ts", "../../javascript/controllers/license_code_reveal_controller.js", "../../javascript/controllers/license_codes_counter_controller.js", "../../javascript/controllers/license_codes_form_controller.js", "../../javascript/controllers/link_input_formatter_controller.js", "../../javascript/controllers/load_after_click_controller.js", "../../javascript/controllers/login_controller.js", "../../javascript/controllers/membership_management_controller.js", "../../javascript/controllers/membership_post_controller.js", "../../javascript/controllers/membership_tier_editor_date_toggle_controller.js", "../../javascript/controllers/modal_login_controller.ts", "../../javascript/controllers/modal_waitlist_controller.ts", "../../javascript/controllers/multi_select_dropdown_controller.js", "../../javascript/controllers/notification_center_controller.js", "../../javascript/controllers/offcanvas_controller.js", "../../javascript/controllers/onboarding_controller.ts", "../../javascript/components/Frigade/index.tsx", "../../javascript/components/Frigade/components/OnboardingForm.tsx", "../../javascript/components/Frigade/components/LocationTypeahead.tsx", "../../javascript/components/Frigade/utils.ts", "../../javascript/components/Frigade/components/CategoryTypeahead.tsx", "../../javascript/components/Frigade/components/ProfilePicture.tsx", "../../javascript/components/Frigade/components/TextareaWithCharacterCount.tsx", "../../javascript/components/Frigade/components/WelcomeSplash.tsx", "../../javascript/components/Frigade/components/Header.tsx", "../../javascript/components/Frigade/components/OnboardingFormStyles.tsx", "../../javascript/components/Frigade/components/Blocks.tsx", "../../../node_modules/@tabler/icons-react/src/defaultAttributes.js", "../../../node_modules/@tabler/icons-react/src/createReactComponent.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandApplePodcast.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandFacebook.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandInstagram.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandLinkedin.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandLinktree.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandMessenger.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandPatreon.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandPinterest.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandSnapchat.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandSoundcloud.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandSpotify.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandTiktok.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandVimeo.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandWhatsapp.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandX.js", "../../../node_modules/@tabler/icons-react/src/icons/IconBrandYoutube.js", "../../../node_modules/@tabler/icons-react/src/icons/IconChevronDown.js", "../../../node_modules/@tabler/icons-react/src/icons/IconLink.js", "../../../node_modules/@tabler/icons-react/src/icons/IconMailbox.js", "../../../node_modules/@tabler/icons-react/src/icons/IconProgress.js", "../../../node_modules/@tabler/icons-react/src/icons/IconStack3.js", "../../../node_modules/@tabler/icons-react/src/icons/IconTrashX.js", "../../javascript/components/Frigade/icons/Plus.tsx", "../../javascript/components/Frigade/components/Customize.tsx", "../../javascript/components/Frigade/components/SocialLinks.tsx", "../../../node_modules/framer-motion/dist/es/motion/index.mjs", "../../../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs", "../../../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs", "../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs", "../../../node_modules/framer-motion/dist/es/context/PresenceContext.mjs", "../../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs", "../../../node_modules/framer-motion/dist/es/utils/is-browser.mjs", "../../../node_modules/framer-motion/dist/es/context/LazyContext.mjs", "../../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs", "../../../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs", "../../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/variant-props.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs", "../../../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/definitions.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/load-features.mjs", "../../../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs", "../../../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs", "../../../node_modules/framer-motion/dist/es/motion/utils/symbol.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs", "../../../node_modules/framer-motion/dist/es/render/html/use-props.mjs", "../../../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs", "../../../node_modules/framer-motion/dist/es/render/html/utils/transform.mjs", "../../../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs", "../../../node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs", "../../../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs", "../../../node_modules/framer-motion/dist/es/utils/clamp.mjs", "../../../node_modules/framer-motion/dist/es/value/types/numbers/index.mjs", "../../../node_modules/framer-motion/dist/es/value/types/utils.mjs", "../../../node_modules/framer-motion/dist/es/value/types/numbers/units.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs", "../../../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs", "../../../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs", "../../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs", "../../../node_modules/framer-motion/dist/es/render/html/utils/render.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs", "../../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs", "../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs", "../../../node_modules/framer-motion/dist/es/utils/use-constant.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs", "../../../node_modules/framer-motion/dist/es/utils/resolve-value.mjs", "../../../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs", "../../../node_modules/framer-motion/dist/es/utils/noop.mjs", "../../../node_modules/framer-motion/dist/es/frameloop/render-step.mjs", "../../../node_modules/framer-motion/dist/es/frameloop/batcher.mjs", "../../../node_modules/framer-motion/dist/es/frameloop/frame.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/config-motion.mjs", "../../../node_modules/framer-motion/dist/es/render/html/config-motion.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs", "../../../node_modules/framer-motion/dist/es/events/add-dom-event.mjs", "../../../node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.mjs", "../../../node_modules/framer-motion/dist/es/events/event-info.mjs", "../../../node_modules/framer-motion/dist/es/events/add-pointer-event.mjs", "../../../node_modules/framer-motion/dist/es/utils/pipe.mjs", "../../../node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/Feature.mjs", "../../../node_modules/framer-motion/dist/es/gestures/hover.mjs", "../../../node_modules/framer-motion/dist/es/gestures/focus.mjs", "../../../node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs", "../../../node_modules/framer-motion/dist/es/gestures/press.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/gestures.mjs", "../../../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs", "../../../node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs", "../../../node_modules/framer-motion/dist/es/utils/errors.mjs", "../../../node_modules/framer-motion/dist/es/utils/time-conversion.mjs", "../../../node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs", "../../../node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs", "../../../node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs", "../../../node_modules/framer-motion/dist/es/easing/ease.mjs", "../../../node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs", "../../../node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs", "../../../node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs", "../../../node_modules/framer-motion/dist/es/easing/circ.mjs", "../../../node_modules/framer-motion/dist/es/easing/back.mjs", "../../../node_modules/framer-motion/dist/es/easing/anticipate.mjs", "../../../node_modules/framer-motion/dist/es/easing/utils/map.mjs", "../../../node_modules/framer-motion/dist/es/value/types/color/utils.mjs", "../../../node_modules/framer-motion/dist/es/value/types/color/rgba.mjs", "../../../node_modules/framer-motion/dist/es/value/types/color/hex.mjs", "../../../node_modules/framer-motion/dist/es/value/types/color/hsla.mjs", "../../../node_modules/framer-motion/dist/es/value/types/color/index.mjs", "../../../node_modules/framer-motion/dist/es/utils/mix.mjs", "../../../node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs", "../../../node_modules/framer-motion/dist/es/utils/mix-color.mjs", "../../../node_modules/framer-motion/dist/es/value/types/complex/index.mjs", "../../../node_modules/framer-motion/dist/es/utils/mix-complex.mjs", "../../../node_modules/framer-motion/dist/es/utils/progress.mjs", "../../../node_modules/framer-motion/dist/es/utils/interpolate.mjs", "../../../node_modules/framer-motion/dist/es/utils/offsets/fill.mjs", "../../../node_modules/framer-motion/dist/es/utils/offsets/default.mjs", "../../../node_modules/framer-motion/dist/es/utils/offsets/time.mjs", "../../../node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs", "../../../node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs", "../../../node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs", "../../../node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs", "../../../node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs", "../../../node_modules/framer-motion/dist/es/animation/generators/inertia.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/js/driver-frameloop.mjs", "../../../node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/js/index.mjs", "../../../node_modules/framer-motion/dist/es/utils/memo.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.mjs", "../../../node_modules/framer-motion/dist/es/animation/animators/instant.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs", "../../../node_modules/framer-motion/dist/es/value/types/complex/filter.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs", "../../../node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/is-none.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/keyframes.mjs", "../../../node_modules/framer-motion/dist/es/animation/utils/transitions.mjs", "../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs", "../../../node_modules/framer-motion/dist/es/value/use-will-change/is.mjs", "../../../node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs", "../../../node_modules/framer-motion/dist/es/utils/array.mjs", "../../../node_modules/framer-motion/dist/es/utils/subscription-manager.mjs", "../../../node_modules/framer-motion/dist/es/value/index.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/setters.mjs", "../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs", "../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs", "../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/animation/index.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/animations.mjs", "../../../node_modules/framer-motion/dist/es/utils/distance.mjs", "../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs", "../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/models.mjs", "../../../node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs", "../../../node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs", "../../../node_modules/framer-motion/dist/es/projection/utils/measure.mjs", "../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs", "../../../node_modules/framer-motion/dist/es/gestures/drag/index.mjs", "../../../node_modules/framer-motion/dist/es/gestures/pan/index.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs", "../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs", "../../../node_modules/framer-motion/dist/es/projection/node/state.mjs", "../../../node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs", "../../../node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs", "../../../node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/copy.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs", "../../../node_modules/framer-motion/dist/es/projection/geometry/utils.mjs", "../../../node_modules/framer-motion/dist/es/projection/shared/stack.mjs", "../../../node_modules/framer-motion/dist/es/projection/styles/transform.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs", "../../../node_modules/framer-motion/dist/es/utils/delay.mjs", "../../../node_modules/framer-motion/dist/es/debug/record.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs", "../../../node_modules/framer-motion/dist/es/animation/interfaces/single-value.mjs", "../../../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs", "../../../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs", "../../../node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/drag.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs", "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs", "../../../node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs", "../../../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs", "../../../node_modules/framer-motion/dist/es/render/store.mjs", "../../../node_modules/framer-motion/dist/es/render/VisualElement.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs", "../../../node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs", "../../../node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs", "../../../node_modules/framer-motion/dist/es/motion/features/layout.mjs", "../../../node_modules/framer-motion/dist/es/render/dom/motion.mjs", "../../../node_modules/framer-motion/dist/es/components/Reorder/Group.mjs", "../../../node_modules/framer-motion/dist/es/context/ReorderContext.mjs", "../../../node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs", "../../../node_modules/framer-motion/dist/es/components/Reorder/Item.mjs", "../../../node_modules/framer-motion/dist/es/value/use-motion-value.mjs", "../../../node_modules/framer-motion/dist/es/utils/transform.mjs", "../../../node_modules/framer-motion/dist/es/value/use-combine-values.mjs", "../../../node_modules/framer-motion/dist/es/value/use-computed.mjs", "../../../node_modules/framer-motion/dist/es/value/use-transform.mjs", "../../../node_modules/framer-motion/dist/es/components/Reorder/index.mjs", "../../javascript/components/Frigade/components/SocialLinkContent.tsx", "../../../node_modules/react-select/dist/react-select.cjs.mjs", "../../javascript/components/Frigade/components/SocialConnections.tsx", "../../javascript/components/Frigade/components/AnnouncementsAndTours.tsx", "../../javascript/components/Frigade/components/EditorStyles.tsx", "../../javascript/components/Frigade/components/DataSyncer.tsx", "../../javascript/components/Frigade/constants.ts", "../../javascript/controllers/online_course_access_controller.js", "../../javascript/controllers/order_item_controller.js", "../../javascript/controllers/overflow_class_toggle_controller.ts", "../../javascript/controllers/page_access_level_controller.ts", "../../javascript/controllers/pages_controller.ts", "../../javascript/controllers/password_validation_controller.ts", "../../javascript/controllers/persist_event_list_title_controller.js", "../../javascript/controllers/phone_number_verification_controller.ts", "../../javascript/controllers/places_search_controller.js", "../../javascript/controllers/profile_banner_controller.ts", "../../javascript/controllers/profile_publish_form_controller.ts", "../../javascript/controllers/progress_bar_controller.ts", "../../javascript/controllers/publish_profile_controller.ts", "../../javascript/controllers/purchase_disabled_button_controller.ts", "../../javascript/controllers/reaction_controller.ts", "../../javascript/controllers/refresh_frame_controller.ts", "../../javascript/controllers/request_indicator_controller.js", "../../javascript/controllers/rewards_user_info_controller.ts", "../../javascript/controllers/scroll_to_controller.js", "../../javascript/controllers/scroll_to_top_controller.ts", "../../javascript/controllers/scroll_top_trigger_controller.ts", "../../javascript/controllers/select_dropdown_controller.js", "../../javascript/controllers/sendbird_comments_controller.js", "../../javascript/components/Comments/index.jsx", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-c5jegKUx.js", "../../../node_modules/@sendbird/uikit-react/SendbirdProvider.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/context.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/constants/applicationAttributes.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/hooks/useGroupChannelList/index.js", "../../../node_modules/@sendbird/chat/lib/__bundle-e7528661.js", "../../../node_modules/@sendbird/chat/lib/__bundle-aef84d74.js", "../../../node_modules/@sendbird/chat/lib/__bundle-d2843f48.js", "../../../node_modules/@sendbird/chat/lib/__bundle-c336221f.js", "../../../node_modules/@sendbird/chat/lib/__bundle-dcf38291.js", "../../../node_modules/@sendbird/chat/lib/__bundle-0a755511.js", "../../../node_modules/@sendbird/chat/lib/__bundle-67579cd7.js", "../../../node_modules/@sendbird/chat/groupChannel.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/hooks/useAsyncEffect.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/hooks/useGroupChannelHandler.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/hooks/useUniqId.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/hooks/usePreservedCallback.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/hooks/useGroupChannelList/reducer.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/utils/snakeToCamel.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/utils/isSameType.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/utils/mergeObject.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/initialConfig.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/configManager.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/utils/validators.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/updators/updateCommonConfigs.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/updators/updateGroupChannelConfigs.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/updators/updateOpenChannelConfigs.js", "../../../node_modules/@sendbird/uikit-tools/dist/esm/uikitConfiguration/internal/utils.js", "../../../node_modules/@sendbird/uikit-react/withSendbird.js", "../../../node_modules/css-vars-ponyfill/node_modules/get-css-data/dist/get-css-data.esm.js", "../../../node_modules/css-vars-ponyfill/node_modules/balanced-match/index.js", "../../../node_modules/css-vars-ponyfill/src/parse-css.js", "../../../node_modules/css-vars-ponyfill/src/parse-vars.js", "../../../node_modules/css-vars-ponyfill/src/stringify-css.js", "../../../node_modules/css-vars-ponyfill/src/walk-css.js", "../../../node_modules/css-vars-ponyfill/src/transform-css.js", "../../../node_modules/css-vars-ponyfill/src/index.js", "../../../node_modules/@sendbird/node_modules/ts-pattern/dist/index.module.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-DGEj-Zfy.js", "../../../node_modules/@sendbird/chat/poll.js", "../../../node_modules/@sendbird/chat/lib/__bundle-73c94aed.js", "../../../node_modules/@sendbird/chat/index.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-dJsyeOhk.js", "../../../node_modules/@sendbird/chat/openChannel.js", "../../../node_modules/@sendbird/uikit-react/utils/message/getOutgoingMessageState.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-CQMOLj5V.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-XtwZ5oLQ.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-OQ0EWLYP.js", "../../../node_modules/@sendbird/uikit-react/useSendbirdStateContext.js", "../../../node_modules/@sendbird/uikit-react/VoiceRecorder/context.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-ZSLOjQvb.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-LdRGfmOs.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/locale/en-US/index.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-vUampZQQ.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-yCtFACB5.js", "../../../node_modules/@sendbird/uikit-react/ui/IconButton.js", "../../../node_modules/@sendbird/uikit-react/ui/Button.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-u2CeAx57.js", "../../../node_modules/@sendbird/src/svgs/icon-add.svg", "../../../node_modules/@sendbird/src/svgs/icon-arrow-left.svg", "../../../node_modules/@sendbird/src/svgs/icon-attach.svg", "../../../node_modules/@sendbird/src/svgs/icon-audio-on-lined.svg", "../../../node_modules/@sendbird/src/svgs/icon-ban.svg", "../../../node_modules/@sendbird/src/svgs/icon-broadcast.svg", "../../../node_modules/@sendbird/src/svgs/icon-camera.svg", "../../../node_modules/@sendbird/src/svgs/icon-channels.svg", "../../../node_modules/@sendbird/src/svgs/icon-chat.svg", "../../../node_modules/@sendbird/src/svgs/icon-chat-filled.svg", "../../../node_modules/@sendbird/src/svgs/icon-chevron-down.svg", "../../../node_modules/@sendbird/src/svgs/icon-chevron-right.svg", "../../../node_modules/@sendbird/src/svgs/icon-close.svg", "../../../node_modules/@sendbird/src/svgs/icon-collapse.svg", "../../../node_modules/@sendbird/src/svgs/icon-copy.svg", "../../../node_modules/@sendbird/src/svgs/icon-create.svg", "../../../node_modules/@sendbird/src/svgs/icon-delete.svg", "../../../node_modules/@sendbird/src/svgs/icon-disconnected.svg", "../../../node_modules/@sendbird/src/svgs/icon-document.svg", "../../../node_modules/@sendbird/src/svgs/icon-done.svg", "../../../node_modules/@sendbird/src/svgs/icon-done-all.svg", "../../../node_modules/@sendbird/src/svgs/icon-download.svg", "../../../node_modules/@sendbird/src/svgs/icon-edit.svg", "../../../node_modules/@sendbird/src/svgs/icon-emoji-more.svg", "../../../node_modules/@sendbird/src/svgs/icon-error.svg", "../../../node_modules/@sendbird/src/svgs/icon-expand.svg", "../../../node_modules/@sendbird/src/svgs/icon-file-audio.svg", "../../../node_modules/@sendbird/src/svgs/icon-file-document.svg", "../../../node_modules/@sendbird/src/svgs/icon-freeze.svg", "../../../node_modules/@sendbird/src/svgs/icon-gif.svg", "../../../node_modules/@sendbird/src/svgs/icon-info.svg", "../../../node_modules/@sendbird/src/svgs/icon-leave.svg", "../../../node_modules/@sendbird/src/svgs/icon-members.svg", "../../../node_modules/@sendbird/src/svgs/icon-message.svg", "../../../node_modules/@sendbird/src/svgs/icon-moderations.svg", "../../../node_modules/@sendbird/src/svgs/icon-more.svg", "../../../node_modules/@sendbird/src/svgs/icon-mute.svg", "../../../node_modules/@sendbird/src/svgs/icon-notifications.svg", "../../../node_modules/@sendbird/src/svgs/icon-notifications-off-filled.svg", "../../../node_modules/@sendbird/src/svgs/icon-operator.svg", "../../../node_modules/@sendbird/src/svgs/icon-photo.svg", "../../../node_modules/@sendbird/src/svgs/icon-play.svg", "../../../node_modules/@sendbird/src/svgs/icon-plus.svg", "../../../node_modules/@sendbird/src/svgs/icon-question.svg", "../../../node_modules/@sendbird/src/svgs/icon-refresh.svg", "../../../node_modules/@sendbird/src/svgs/icon-remove.svg", "../../../node_modules/@sendbird/src/svgs/icon-reply-filled.svg", "../../../node_modules/@sendbird/src/svgs/icon-search.svg", "../../../node_modules/@sendbird/src/svgs/icon-send.svg", "../../../node_modules/@sendbird/src/svgs/icon-settings-filled.svg", "../../../node_modules/@sendbird/src/svgs/icon-slide-left.svg", "../../../node_modules/@sendbird/src/svgs/icon-spinner.svg", "../../../node_modules/@sendbird/src/svgs/icon-supergroup.svg", "../../../node_modules/@sendbird/src/svgs/icon-thread.svg", "../../../node_modules/@sendbird/src/svgs/icon-thumbnail-none.svg", "../../../node_modules/@sendbird/src/svgs/icon-toggleoff.svg", "../../../node_modules/@sendbird/src/svgs/icon-toggleon.svg", "../../../node_modules/@sendbird/src/svgs/icon-user.svg", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-v0zf-Toj.js", "../../../node_modules/@sendbird/uikit-react/hooks/useModal.js", "../../../node_modules/@sendbird/uikit-react/App.js", "../../../node_modules/@sendbird/uikit-react/ChannelList.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-SmfpNG66.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-OwUIW9B_.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-J3Xwcu_c.js", "../../../node_modules/@sendbird/uikit-react/ChannelList/components/ChannelListUI.js", "../../../node_modules/@sendbird/uikit-react/ChannelList/components/ChannelListHeader.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-HbEA73mt.js", "../../../node_modules/@sendbird/uikit-react/ui/ImageRenderer.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-7JHtC_JJ.js", "../../../node_modules/@sendbird/uikit-react/ChannelList/components/AddChannel.js", "../../../node_modules/@sendbird/uikit-react/CreateChannel.js", "../../../node_modules/@sendbird/uikit-react/CreateChannel/components/CreateChannelUI.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-S1smGX8b.js", "../../../node_modules/@sendbird/uikit-react/sendbirdSelectors.js", "../../../node_modules/@sendbird/uikit-react/CreateChannel/components/InviteUsers.js", "../../../node_modules/@sendbird/uikit-react/ui/UserListItem.js", "../../../node_modules/@sendbird/uikit-react/ui/MutedAvatarOverlay.js", "../../../node_modules/@sendbird/uikit-react/ui/Checkbox.js", "../../../node_modules/@sendbird/uikit-react/ui/UserProfile.js", "../../../node_modules/@sendbird/uikit-react/ui/ContextMenu.js", "../../../node_modules/@sendbird/uikit-react/ui/SortByRow.js", "../../../node_modules/@sendbird/uikit-react/CreateChannel/components/SelectChannelType.js", "../../../node_modules/@sendbird/uikit-react/ChannelList/components/ChannelPreview.js", "../../../node_modules/@sendbird/uikit-react/ui/ChannelAvatar.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-c944_BvY.js", "../../../node_modules/@sendbird/uikit-react/ui/Badge.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-UwlFw2lK.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/requiredArgs/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/toDate/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isDate/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isValid/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/toInteger/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/addMilliseconds/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/subMilliseconds/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/defaultOptions/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/getUTCWeek/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/addLeadingZeros/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/format/formatters/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/format/longFormatters/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/_lib/protectedTokens/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/format/index.js", "../../../node_modules/@sendbird/uikit-react/ui/Loader.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/startOfDay/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isSameDay/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isToday/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isSameYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isThisYear/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/addDays/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/subDays/index.js", "../../../node_modules/@sendbird/node_modules/date-fns/esm/isYesterday/index.js", "../../../node_modules/@sendbird/uikit-react/ui/MentionUserLabel.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-okmgQKUZ.js", "../../../node_modules/@sendbird/uikit-react/ui/TextButton.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-mAbwjJsi.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/TypingIndicator.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-kPskppps.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-fwLsGp6N.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-HfYRQGkt.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-Bjgxg83b.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-tc0rEnB_.js", "../../../node_modules/@sendbird/uikit-react/Channel/hooks/useInitialMessagesFetch.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-5uv0Aei2.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-5HYqTaTr.js", "../../../node_modules/@sendbird/uikit-react/ChannelList/components/ChannelPreviewAction.js", "../../../node_modules/@sendbird/uikit-react/EditUserProfile.js", "../../../node_modules/@sendbird/uikit-react/EditUserProfile/context.js", "../../../node_modules/@sendbird/uikit-react/EditUserProfile/components/EditUserProfileUI.js", "../../../node_modules/@sendbird/uikit-react/ui/Input.js", "../../../node_modules/@sendbird/uikit-react/ui/PlaceHolder.js", "../../../node_modules/@sendbird/uikit-react/Channel.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/ChannelUI.js", "../../../node_modules/@sendbird/uikit-react/ui/ConnectionStatus.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/ChannelHeader.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-_43SdcJP.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-5qCLkG6l.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/Message.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/SuggestedMentionList.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-rgIbMndg.js", "../../../node_modules/@sendbird/uikit-react/Thread/context.js", "../../../node_modules/@sendbird/uikit-react/Thread/context/types.js", "../../../node_modules/@sendbird/uikit-react/ui/DateSeparator.js", "../../../node_modules/@sendbird/uikit-react/ui/MessageInput.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-ejXMvNVx.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-Ha6WT0Hp.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-ZxBmutMJ.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-dBXZk5Y3.js", "../../../node_modules/@sendbird/uikit-react/ui/MessageContent.js", "../../../node_modules/@sendbird/uikit-react/ui/MessageItemMenu.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-OuijNFkl.js", "../../../node_modules/@sendbird/uikit-react/ui/MessageItemReactionMenu.js", "../../../node_modules/@sendbird/uikit-react/ui/ReactionButton.js", "../../../node_modules/@sendbird/uikit-react/ui/EmojiReactions.js", "../../../node_modules/@sendbird/uikit-react/ui/ReactionBadge.js", "../../../node_modules/@sendbird/uikit-react/ui/BottomSheet.js", "../../../node_modules/@sendbird/uikit-react/ui/Tooltip.js", "../../../node_modules/@sendbird/uikit-react/ui/TooltipWrapper.js", "../../../node_modules/@sendbird/uikit-react/Message/context.js", "../../../node_modules/@sendbird/uikit-react/ui/AdminMessage.js", "../../../node_modules/@sendbird/uikit-react/ui/QuoteMessage.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-7jjAs2HK.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-QScSctu4.js", "../../../node_modules/@sendbird/uikit-react/ui/ThreadReplies.js", "../../../node_modules/@sendbird/uikit-react/ui/OGMessageItemBody.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-J87QWRh3.js", "../../../node_modules/@sendbird/uikit-react/ui/MentionLabel.js", "../../../node_modules/@sendbird/uikit-react/ui/LinkLabel.js", "../../../node_modules/@sendbird/uikit-react/ui/TextMessageItemBody.js", "../../../node_modules/@sendbird/uikit-react/ui/FileMessageItemBody.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-rMW82DKu.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-DB4PuqmB.js", "../../../node_modules/@sendbird/uikit-react/ui/VoiceMessageItemBody.js", "../../../node_modules/@sendbird/uikit-react/ui/ProgressBar.js", "../../../node_modules/@sendbird/uikit-react/VoicePlayer/useVoicePlayer.js", "../../../node_modules/@sendbird/uikit-react/ui/PlaybackTime.js", "../../../node_modules/@sendbird/uikit-react/ui/ThumbnailMessageItemBody.js", "../../../node_modules/@sendbird/uikit-react/ui/UnknownMessageItemBody.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/FileViewer.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/RemoveMessageModal.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-f7C0xlTH.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-bLXmqujU.js", "../../../node_modules/@sendbird/uikit-react/Message/hooks/useDirtyGetMentions.js", "../../../node_modules/@sendbird/uikit-react/Channel/utils/compareMessagesForGrouping.js", "../../../node_modules/@sendbird/uikit-react/Channel/utils/getMessagePartsInfo.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/UnreadCount.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/FrozenNotification.js", "../../../node_modules/@sendbird/uikit-react/ui/TypingIndicatorBubble.js", "../../../node_modules/@sendbird/uikit-react/Channel/components/MessageInput.js", "../../../node_modules/@sendbird/uikit-react/ui/QuoteMessageInput.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-hDMLfh4n.js", "../../../node_modules/@sendbird/uikit-react/VoiceRecorder/useVoiceRecorder.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-LKILWG-V.js", "../../../node_modules/@sendbird/uikit-react/Channel/hooks/useHandleUploadFiles.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-XyLdN-Hr.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/ChannelSettingsUI.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/context.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/ChannelProfile.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/EditDetailsModal.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/ModerationPanel.js", "../../../node_modules/@sendbird/uikit-react/ui/Accordion.js", "../../../node_modules/@sendbird/uikit-react/ui/AccordionGroup.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-4wKb8u1C.js", "../../../node_modules/@sendbird/uikit-react/ui/Toggle.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/UserListItem.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-b0USVddN.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/LeaveChannel.js", "../../../node_modules/@sendbird/uikit-react/ChannelSettings/components/UserPanel.js", "../../../node_modules/@sendbird/uikit-react/MessageSearch.js", "../../../node_modules/@sendbird/uikit-react/MessageSearch/components/MessageSearchUI.js", "../../../node_modules/@sendbird/uikit-react/MessageSearch/context.js", "../../../node_modules/@sendbird/uikit-react/ui/MessageSearchItem.js", "../../../node_modules/@sendbird/uikit-react/ui/MessageSearchFileItem.js", "../../../node_modules/@sendbird/uikit-react/Thread.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ThreadUI.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ParentMessageInfo.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-4nIx2RJD.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ParentMessageInfoItem.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ThreadHeader.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ThreadList.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ThreadListItem.js", "../../../node_modules/@sendbird/uikit-react/Thread/components/ThreadMessageInput.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel/components/OpenChannelUI.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-lcfgNAH-.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel/components/OpenChannelInput.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel/components/FrozenChannelNotification.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel/components/OpenChannelHeader.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel/components/OpenChannelMessageList.js", "../../../node_modules/@sendbird/uikit-react/OpenChannel/components/OpenChannelMessage.js", "../../../node_modules/@sendbird/uikit-react/ui/OpenchannelUserMessage.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-GYn98g4i.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-dwc9j36U.js", "../../../node_modules/@sendbird/uikit-react/ui/OpenChannelAdminMessage.js", "../../../node_modules/@sendbird/uikit-react/ui/OpenchannelOGMessage.js", "../../../node_modules/@sendbird/uikit-react/ui/OpenchannelThumbnailMessage.js", "../../../node_modules/@sendbird/uikit-react/ui/OpenchannelFileMessage.js", "../../../node_modules/@sendbird/uikit-react/OpenChannelSettings.js", "../../../node_modules/@sendbird/uikit-react/OpenChannelSettings/components/OpenChannelSettingsUI.js", "../../../node_modules/@sendbird/uikit-react/OpenChannelSettings/context.js", "../../../node_modules/@sendbird/uikit-react/OpenChannelSettings/components/OperatorUI.js", "../../../node_modules/@sendbird/uikit-react/OpenChannelSettings/components/OpenChannelProfile.js", "../../../node_modules/@sendbird/uikit-react/ui/OpenChannelAvatar.js", "../../../node_modules/@sendbird/uikit-react/OpenChannelSettings/components/EditDetailsModal.js", "../../../node_modules/@sendbird/uikit-react/chunks/bundle-Lcy_97mA.js", "../../../node_modules/@sendbird/uikit-react/index.js", "../../javascript/components/Comments/LoadingState.jsx", "../../javascript/components/utils/TimeAgo.jsx", "../../javascript/components/Comments/CommentsEmptyState.jsx", "../../javascript/components/SendbirdChat/ChatAvatar.jsx", "../../javascript/components/Comments/CommentsChannel.jsx", "../../../node_modules/@sendbird/uikit-react/Channel/context.js", "../../javascript/components/Comments/CommentsThread.jsx", "../../javascript/components/Comments/CommentsMessage.jsx", "../../../node_modules/react-bootstrap/esm/Dropdown.js", "../../../node_modules/dom-helpers/esm/querySelectorAll.js", "../../../node_modules/dom-helpers/esm/canUseDOM.js", "../../../node_modules/dom-helpers/esm/addEventListener.js", "../../../node_modules/@restart/ui/esm/Dropdown.js", "../../../node_modules/@restart/ui/node_modules/uncontrollable/lib/esm/index.js", "../../../node_modules/@restart/hooks/esm/usePrevious.js", "../../../node_modules/@restart/hooks/esm/useForceUpdate.js", "../../../node_modules/@restart/hooks/esm/useEventListener.js", "../../../node_modules/@restart/hooks/esm/useEventCallback.js", "../../../node_modules/@restart/hooks/esm/useCommittedRef.js", "../../../node_modules/@restart/ui/esm/DropdownContext.js", "../../../node_modules/@restart/ui/esm/DropdownMenu.js", "../../../node_modules/@restart/hooks/esm/useCallbackRef.js", "../../../node_modules/@restart/ui/esm/usePopper.js", "../../../node_modules/dequal/dist/index.mjs", "../../../node_modules/@restart/hooks/esm/useSafeState.js", "../../../node_modules/@restart/hooks/esm/useMounted.js", "../../../node_modules/@restart/ui/esm/popper.js", "../../../node_modules/@popperjs/core/lib/popper-base.js", "../../../node_modules/dom-helpers/esm/contains.js", "../../../node_modules/dom-helpers/esm/removeEventListener.js", "../../../node_modules/dom-helpers/esm/listen.js", "../../../node_modules/dom-helpers/esm/ownerDocument.js", "../../../node_modules/@restart/ui/esm/useClickOutside.js", "../../../node_modules/@restart/ui/esm/mergeOptionsWithPopperConfig.js", "../../../node_modules/@restart/ui/esm/DropdownToggle.js", "../../../node_modules/@react-aria/ssr/dist/packages/@react-aria/ssr/src/index.ts", "../../../node_modules/@react-aria/ssr/dist/packages/@react-aria/ssr/src/SSRProvider.tsx", "../../../node_modules/@restart/ui/esm/DropdownItem.js", "../../../node_modules/@restart/ui/esm/SelectableContext.js", "../../../node_modules/@restart/ui/esm/NavContext.js", "../../../node_modules/@restart/ui/esm/Button.js", "../../../node_modules/@restart/ui/esm/DataKey.js", "../../../node_modules/@restart/ui/esm/useWindow.js", "../../../node_modules/uncontrollable/node_modules/@babel/runtime/helpers/esm/extends.js", "../../../node_modules/uncontrollable/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../../../node_modules/uncontrollable/lib/esm/hook.js", "../../../node_modules/uncontrollable/lib/esm/utils.js", "../../../node_modules/uncontrollable/lib/esm/uncontrollable.js", "../../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js", "../../../node_modules/react-bootstrap/esm/DropdownContext.js", "../../../node_modules/react-bootstrap/esm/DropdownDivider.js", "../../../node_modules/react-bootstrap/esm/ThemeProvider.js", "../../../node_modules/react-bootstrap/esm/DropdownHeader.js", "../../../node_modules/react-bootstrap/esm/DropdownItem.js", "../../../node_modules/@restart/ui/esm/Anchor.js", "../../../node_modules/@restart/hooks/esm/useGlobalListener.js", "../../../node_modules/@restart/hooks/esm/useInterval.js", "../../../node_modules/@restart/hooks/esm/useRafInterval.js", "../../../node_modules/@restart/hooks/esm/useMergeState.js", "../../../node_modules/@restart/hooks/esm/useImage.js", "../../../node_modules/@restart/hooks/esm/useResizeObserver.js", "../../../node_modules/@restart/hooks/esm/useIsomorphicEffect.js", "../../../node_modules/react-bootstrap/esm/DropdownItemText.js", "../../../node_modules/react-bootstrap/esm/DropdownMenu.js", "../../../node_modules/@restart/hooks/esm/useMergedRefs.js", "../../../node_modules/react-bootstrap/esm/InputGroupContext.js", "../../../node_modules/react-bootstrap/esm/NavbarContext.js", "../../../node_modules/react-bootstrap/esm/useWrappedRefWithWarning.js", "../../../node_modules/react-bootstrap/esm/DropdownToggle.js", "../../../node_modules/react-bootstrap/esm/Button.js", "../../javascript/components/Comments/CommentsMessageInput.jsx", "../../../node_modules/emoji-picker-react/src/DomUtils/classNames.ts", "../../../node_modules/emoji-picker-react/src/DomUtils/focusElement.ts", "../../../node_modules/emoji-picker-react/src/components/context/ElementRefContext.tsx", "../../../node_modules/emoji-picker-react/src/types/exposedTypes.ts", "../../../node_modules/emoji-picker-react/src/config/categoryConfig.ts", "../../../node_modules/emoji-picker-react/src/config/cdnUrls.ts", "../../../node_modules/emoji-picker-react/src/data/skinToneVariations.ts", "../../../node_modules/emoji-picker-react/src/dataUtils/DataTypes.ts", "../../../node_modules/emoji-picker-react/src/dataUtils/alphaNumericEmojiIndex.ts", "../../../node_modules/emoji-picker-react/src/dataUtils/emojiSelectors.ts", "../../../node_modules/emoji-picker-react/src/config/config.ts", "../../../node_modules/emoji-picker-react/src/components/context/PickerConfigContext.tsx", "../../../node_modules/emoji-picker-react/src/config/mutableConfig.ts", "../../../node_modules/emoji-picker-react/src/config/useConfig.ts", "../../../node_modules/emoji-picker-react/src/hooks/useDebouncedState.ts", "../../../node_modules/emoji-picker-react/src/hooks/useHideEmojisByUniocode.ts", "../../../node_modules/emoji-picker-react/src/hooks/useDisallowedEmojis.ts", "../../../node_modules/emoji-picker-react/src/hooks/useInitialLoad.ts", "../../../node_modules/emoji-picker-react/src/components/context/PickerContext.tsx", "../../../node_modules/emoji-picker-react/src/hooks/useDisallowMouseMove.ts", "../../../node_modules/emoji-picker-react/src/DomUtils/elementPositionInRow.ts", "../../../node_modules/emoji-picker-react/src/DomUtils/selectors.ts", "../../../node_modules/emoji-picker-react/src/dataUtils/parseNativeEmoji.ts", "../../../node_modules/emoji-picker-react/src/dataUtils/suggested.ts", "../../../node_modules/emoji-picker-react/src/typeRefinements/typeRefinements.ts", "../../../node_modules/emoji-picker-react/src/hooks/useCloseAllOpenToggles.ts", "../../../node_modules/emoji-picker-react/src/hooks/useSetVariationPicker.ts", "../../../node_modules/emoji-picker-react/src/hooks/useMouseDownHandlers.ts", "../../../node_modules/emoji-picker-react/src/hooks/useOnScroll.ts", "../../../node_modules/emoji-picker-react/src/DomUtils/scrollTo.ts", "../../../node_modules/emoji-picker-react/src/hooks/useFocus.ts", "../../../node_modules/emoji-picker-react/src/hooks/useFilter.ts", "../../../node_modules/emoji-picker-react/src/hooks/useIsEmojiHidden.ts", "../../../node_modules/emoji-picker-react/node_modules/style-inject/dist/style-inject.es.js", "../../../node_modules/emoji-picker-react/src/components/atoms/Button.tsx", "../../../node_modules/emoji-picker-react/src/components/emoji/ClickableEmojiButton.tsx", "../../../node_modules/emoji-picker-react/src/components/emoji/EmojiImg.tsx", "../../../node_modules/emoji-picker-react/src/components/emoji/NativeEmoji.tsx", "../../../node_modules/emoji-picker-react/src/components/emoji/ViewOnlyEmoji.tsx", "../../../node_modules/emoji-picker-react/src/components/emoji/Emoji.tsx", "../../../node_modules/emoji-picker-react/src/components/body/EmojiCategory.tsx", "../../../node_modules/emoji-picker-react/src/components/body/Suggested.tsx", "../../../node_modules/emoji-picker-react/src/components/body/EmojiList.tsx", "../../../node_modules/emoji-picker-react/src/DomUtils/keyboardNavigation.ts", "../../../node_modules/emoji-picker-react/src/components/body/EmojiVariationPicker.tsx", "../../../node_modules/emoji-picker-react/src/components/body/Body.tsx", "../../../node_modules/emoji-picker-react/src/hooks/useEmojiPreviewEvents.ts", "../../../node_modules/emoji-picker-react/src/hooks/useShouldShowSkinTonePicker.ts", "../../../node_modules/emoji-picker-react/src/components/Layout/Flex.tsx", "../../../node_modules/emoji-picker-react/src/components/Layout/Space.tsx", "../../../node_modules/emoji-picker-react/src/components/Layout/Absolute.tsx", "../../../node_modules/emoji-picker-react/src/components/Layout/Relative.tsx", "../../../node_modules/emoji-picker-react/src/components/header/SkinTonePicker.tsx", "../../../node_modules/emoji-picker-react/src/components/footer/Preview.tsx", "../../../node_modules/emoji-picker-react/src/DomUtils/categoryNameFromDom.ts", "../../../node_modules/emoji-picker-react/src/hooks/useActiveCategoryScrollDetection.ts", "../../../node_modules/emoji-picker-react/src/hooks/useIsSearchMode.ts", "../../../node_modules/emoji-picker-react/src/hooks/useScrollCategoryIntoView.ts", "../../../node_modules/emoji-picker-react/src/hooks/useShouldHideCustomEmojis.ts", "../../../node_modules/emoji-picker-react/src/components/navigation/CategoryNavigation.tsx", "../../../node_modules/emoji-picker-react/src/components/header/CssSearch.tsx", "../../../node_modules/emoji-picker-react/src/components/header/Search.tsx", "../../../node_modules/emoji-picker-react/src/components/header/Header.tsx", "../../../node_modules/emoji-picker-react/src/DomUtils/getActiveElement.ts", "../../../node_modules/emoji-picker-react/src/hooks/useKeyboardNavigation.ts", "../../../node_modules/emoji-picker-react/src/hooks/preloadEmoji.ts", "../../../node_modules/emoji-picker-react/src/hooks/useOnFocus.ts", "../../../node_modules/emoji-picker-react/src/components/main/PickerMain.tsx", "../../../node_modules/emoji-picker-react/src/EmojiPickerReact.tsx", "../../../node_modules/emoji-picker-react/src/components/ErrorBoundary.tsx", "../../../node_modules/emoji-picker-react/src/components/emoji/ExportedEmoji.tsx", "../../../node_modules/emoji-picker-react/src/index.tsx", "../../javascript/components/icons/Emoji.jsx", "../../javascript/components/icons/Menu.jsx", "../../../node_modules/react-bootstrap/esm/Toast.js", "../../../node_modules/@restart/hooks/esm/useTimeout.js", "../../../node_modules/@restart/hooks/esm/useUpdatedRef.js", "../../../node_modules/@restart/hooks/esm/useWillUnmount.js", "../../../node_modules/react-bootstrap/esm/ToastFade.js", "../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js", "../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js", "../../../node_modules/react-transition-group/esm/Transition.js", "../../../node_modules/react-transition-group/esm/config.js", "../../../node_modules/react-transition-group/esm/TransitionGroupContext.js", "../../../node_modules/react-transition-group/esm/utils/reflow.js", "../../../node_modules/react-bootstrap/esm/Fade.js", "../../../node_modules/dom-helpers/esm/ownerWindow.js", "../../../node_modules/dom-helpers/esm/getComputedStyle.js", "../../../node_modules/dom-helpers/esm/hyphenate.js", "../../../node_modules/dom-helpers/esm/hyphenateStyle.js", "../../../node_modules/dom-helpers/esm/isTransform.js", "../../../node_modules/dom-helpers/esm/css.js", "../../../node_modules/dom-helpers/esm/triggerEvent.js", "../../../node_modules/dom-helpers/esm/transitionEnd.js", "../../../node_modules/react-bootstrap/esm/transitionEndListener.js", "../../../node_modules/react-bootstrap/esm/triggerBrowserReflow.js", "../../../node_modules/react-bootstrap/esm/TransitionWrapper.js", "../../../node_modules/react-bootstrap/esm/safeFindDOMNode.js", "../../../node_modules/react-bootstrap/esm/ToastHeader.js", "../../../node_modules/react-bootstrap/esm/CloseButton.js", "../../../node_modules/react-bootstrap/esm/ToastContext.js", "../../../node_modules/react-bootstrap/esm/ToastBody.js", "../../../node_modules/react-bootstrap/esm/ToastContainer.js", "../../javascript/components/icons/BackArrowCircle.jsx", "../../javascript/components/SendbirdChat/ChatPlaceholder.jsx", "../../javascript/components/icons/ChatBubble.jsx", "../../javascript/components/SendbirdChat/ChannelHeader.jsx", "../../javascript/components/icons/ThreeDots.jsx", "../../javascript/components/SendbirdChat/EditProfileModal.jsx", "../../../node_modules/react-bootstrap/esm/Accordion.js", "../../../node_modules/react-bootstrap/esm/AccordionBody.js", "../../../node_modules/react-bootstrap/esm/AccordionCollapse.js", "../../../node_modules/react-bootstrap/esm/Collapse.js", "../../../node_modules/react-bootstrap/esm/createChainedFunction.js", "../../../node_modules/react-bootstrap/esm/AccordionContext.js", "../../../node_modules/react-bootstrap/esm/AccordionItemContext.js", "../../../node_modules/react-bootstrap/esm/AccordionButton.js", "../../../node_modules/react-bootstrap/esm/AccordionHeader.js", "../../../node_modules/react-bootstrap/esm/AccordionItem.js", "../../../node_modules/react-bootstrap/esm/divWithClassName.js", "../../../node_modules/react-bootstrap/esm/ElementChildren.js", "../../../node_modules/react-bootstrap/esm/Col.js", "../../../node_modules/react-bootstrap/esm/Form.js", "../../../node_modules/react-bootstrap/esm/FormCheck.js", "../../../node_modules/react-bootstrap/esm/Feedback.js", "../../../node_modules/react-bootstrap/esm/FormCheckInput.js", "../../../node_modules/react-bootstrap/esm/FormContext.js", "../../../node_modules/react-bootstrap/esm/FormCheckLabel.js", "../../../node_modules/react-bootstrap/esm/FormControl.js", "../../../node_modules/react-bootstrap/esm/FormFloating.js", "../../../node_modules/react-bootstrap/esm/FormGroup.js", "../../../node_modules/react-bootstrap/esm/FormLabel.js", "../../../node_modules/react-bootstrap/esm/FormRange.js", "../../../node_modules/react-bootstrap/esm/FormSelect.js", "../../../node_modules/react-bootstrap/esm/FormText.js", "../../../node_modules/react-bootstrap/esm/Switch.js", "../../../node_modules/react-bootstrap/esm/FloatingLabel.js", "../../../node_modules/react-bootstrap/esm/Modal.js", "../../../node_modules/dom-helpers/esm/scrollbarSize.js", "../../../node_modules/dom-helpers/esm/activeElement.js", "../../../node_modules/@restart/ui/esm/Modal.js", "../../../node_modules/@restart/ui/esm/getScrollbarWidth.js", "../../../node_modules/@restart/ui/esm/ModalManager.js", "../../../node_modules/@restart/ui/esm/useWaitForDOMRef.js", "../../../node_modules/@restart/ui/esm/ImperativeTransition.js", "../../../node_modules/@restart/ui/esm/NoopTransition.js", "../../../node_modules/@restart/ui/esm/utils.js", "../../../node_modules/dom-helpers/esm/hasClass.js", "../../../node_modules/dom-helpers/esm/addClass.js", "../../../node_modules/dom-helpers/esm/removeClass.js", "../../../node_modules/react-bootstrap/esm/BootstrapModalManager.js", "../../../node_modules/react-bootstrap/esm/ModalBody.js", "../../../node_modules/react-bootstrap/esm/ModalContext.js", "../../../node_modules/react-bootstrap/esm/ModalDialog.js", "../../../node_modules/react-bootstrap/esm/ModalFooter.js", "../../../node_modules/react-bootstrap/esm/ModalHeader.js", "../../../node_modules/react-bootstrap/esm/AbstractModalHeader.js", "../../../node_modules/react-bootstrap/esm/ModalTitle.js", "../../javascript/components/icons/CloseCircle.jsx", "../../javascript/components/Toasts/index.jsx", "../../javascript/controllers/sendbird_controller.ts", "../../javascript/components/SendbirdChat/index.jsx", "../../javascript/components/SendbirdChat/Chat.jsx", "../../javascript/components/SendbirdChat/ChannelListHeader.jsx", "../../javascript/components/SendbirdChat/ChannelPreview.jsx", "../../javascript/components/icons/PlusCircle.jsx", "../../javascript/components/SendbirdChat/ChannelSettings.jsx", "../../javascript/components/SendbirdChat/ChannelSettingsProfile.jsx", "../../javascript/components/SendbirdChat/AddEditChannelDetailsModal.jsx", "../../javascript/components/SendbirdChat/ChannelSettingsModerationPanel.jsx", "../../javascript/components/icons/Crown.jsx", "../../javascript/components/icons/GreaterThan.jsx", "../../javascript/components/icons/People.jsx", "../../javascript/components/icons/MutedPeople.jsx", "../../javascript/components/icons/BannedPeople.jsx", "../../javascript/components/icons/Frozen.jsx", "../../javascript/components/icons/ThreeVerticalDots.jsx", "../../javascript/controllers/settings_nav_controller.ts", "../../javascript/controllers/shopify_form_controller.js", "../../javascript/controllers/signup_details_form_controller.js", "../../javascript/controllers/signup_first_action_controller.ts", "../../javascript/controllers/silent_submit_controller.ts", "../../javascript/controllers/social_links_form_controller.js", "../../../node_modules/@kurkle/color/dist/color.esm.js", "../../../node_modules/chart.js/src/helpers/helpers.core.ts", "../../../node_modules/chart.js/src/helpers/helpers.math.ts", "../../../node_modules/chart.js/src/helpers/helpers.collection.ts", "../../../node_modules/chart.js/src/helpers/helpers.extras.ts", "../../../node_modules/chart.js/src/helpers/helpers.easing.ts", "../../../node_modules/chart.js/src/helpers/helpers.color.ts", "../../../node_modules/chart.js/src/core/core.animations.defaults.js", "../../../node_modules/chart.js/src/core/core.layouts.defaults.js", "../../../node_modules/chart.js/src/helpers/helpers.intl.ts", "../../../node_modules/chart.js/src/core/core.ticks.js", "../../../node_modules/chart.js/src/core/core.scale.defaults.js", "../../../node_modules/chart.js/src/core/core.defaults.js", "../../../node_modules/chart.js/src/helpers/helpers.canvas.js", "../../../node_modules/chart.js/src/helpers/helpers.options.ts", "../../../node_modules/chart.js/src/helpers/helpers.config.js", "../../../node_modules/chart.js/src/helpers/helpers.curve.ts", "../../../node_modules/chart.js/src/helpers/helpers.dom.ts", "../../../node_modules/chart.js/src/helpers/helpers.interpolation.ts", "../../../node_modules/chart.js/src/helpers/helpers.rtl.ts", "../../../node_modules/chart.js/src/helpers/helpers.segment.js", "../../../node_modules/chart.js/src/core/core.animator.js", "../../../node_modules/chart.js/src/core/core.animation.js", "../../../node_modules/chart.js/src/core/core.animations.js", "../../../node_modules/chart.js/src/core/core.datasetController.js", "../../../node_modules/chart.js/src/controllers/controller.bar.js", "../../../node_modules/chart.js/src/controllers/controller.bubble.js", "../../../node_modules/chart.js/src/controllers/controller.doughnut.js", "../../../node_modules/chart.js/src/controllers/controller.line.js", "../../../node_modules/chart.js/src/controllers/controller.polarArea.js", "../../../node_modules/chart.js/src/controllers/controller.pie.js", "../../../node_modules/chart.js/src/controllers/controller.radar.js", "../../../node_modules/chart.js/src/controllers/controller.scatter.js", "../../../node_modules/chart.js/src/core/core.adapters.ts", "../../../node_modules/chart.js/src/core/core.interaction.js", "../../../node_modules/chart.js/src/core/core.layouts.js", "../../../node_modules/chart.js/src/platform/platform.base.js", "../../../node_modules/chart.js/src/platform/platform.basic.js", "../../../node_modules/chart.js/src/platform/platform.dom.js", "../../../node_modules/chart.js/src/platform/index.js", "../../../node_modules/chart.js/src/core/core.element.ts", "../../../node_modules/chart.js/src/core/core.scale.autoskip.js", "../../../node_modules/chart.js/src/core/core.scale.js", "../../../node_modules/chart.js/src/core/core.typedRegistry.js", "../../../node_modules/chart.js/src/core/core.registry.js", "../../../node_modules/chart.js/src/core/core.plugins.js", "../../../node_modules/chart.js/src/core/core.config.js", "../../../node_modules/chart.js/src/core/core.controller.js", "../../../node_modules/chart.js/src/elements/element.arc.ts", "../../../node_modules/chart.js/src/elements/element.line.js", "../../../node_modules/chart.js/src/elements/element.point.ts", "../../../node_modules/chart.js/src/elements/element.bar.js", "../../../node_modules/chart.js/src/plugins/plugin.colors.ts", "../../../node_modules/chart.js/src/plugins/plugin.decimation.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/filler.segment.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/filler.helper.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/filler.options.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/filler.target.stack.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/simpleArc.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/filler.target.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/filler.drawing.js", "../../../node_modules/chart.js/src/plugins/plugin.filler/index.js", "../../../node_modules/chart.js/src/plugins/plugin.legend.js", "../../../node_modules/chart.js/src/plugins/plugin.title.js", "../../../node_modules/chart.js/src/plugins/plugin.subtitle.js", "../../../node_modules/chart.js/src/plugins/plugin.tooltip.js", "../../../node_modules/chart.js/src/scales/scale.category.js", "../../../node_modules/chart.js/src/scales/scale.linearbase.js", "../../../node_modules/chart.js/src/scales/scale.linear.js", "../../../node_modules/chart.js/src/scales/scale.logarithmic.js", "../../../node_modules/chart.js/src/scales/scale.radialLinear.js", "../../../node_modules/chart.js/src/scales/scale.time.js", "../../../node_modules/chart.js/src/scales/scale.timeseries.js", "../../../node_modules/chart.js/src/index.ts", "../../../node_modules/chartjs-adapter-luxon/dist/chartjs-adapter-luxon.esm.js", "../../javascript/controllers/stats_controller.ts", "../../javascript/controllers/statsig_controller.ts", "../../javascript/controllers/sticky_stuck_controller.ts", "../../javascript/controllers/stock_images_controller.js", "../../javascript/controllers/synced_field_controller.ts", "../../javascript/controllers/tax_category_dropdown_controller.js", "../../javascript/controllers/text_form_controller.ts", "../../javascript/controllers/tiktok_oauth_controller.ts", "../../javascript/controllers/timezone_dropdown_controller.ts", "../../javascript/utils/timezones.ts", "../../javascript/controllers/tip_controller.ts", "../../javascript/controllers/toast_controller.ts", "../../javascript/controllers/toast_message_controller.ts", "../../javascript/controllers/tooltip_controller.ts", "../../../node_modules/posthog-js/src/config.ts", "../../../node_modules/posthog-js/src/uuidv7.ts", "../../../node_modules/posthog-js/src/utils.ts", "../../../node_modules/posthog-js/src/autocapture-utils.ts", "../../../node_modules/posthog-js/src/extensions/rageclick.ts", "../../../node_modules/posthog-js/src/storage.ts", "../../../node_modules/posthog-js/src/posthog-persistence.ts", "../../../node_modules/posthog-js/src/autocapture.ts", "../../../node_modules/posthog-js/src/posthog-featureflags.ts", "../../../node_modules/posthog-js/src/extensions/sessionrecording-utils.ts", "../../../node_modules/posthog-js/src/extensions/sessionrecording.ts", "../../../node_modules/posthog-js/src/extensions/web-performance.ts", "../../../node_modules/posthog-js/src/decide.ts", "../../../node_modules/posthog-js/src/extensions/cloud.ts", "../../../node_modules/posthog-js/src/extensions/toolbar.ts", "../../../node_modules/posthog-js/src/gdpr-utils.ts", "../../../node_modules/posthog-js/src/base-request-queue.ts", "../../../node_modules/posthog-js/src/request-queue.ts", "../../../node_modules/posthog-js/src/capture-metrics.ts", "../../../node_modules/posthog-js/node_modules/fflate/esm/browser.js", "../../../node_modules/posthog-js/src/types.ts", "../../../node_modules/posthog-js/src/send-request.ts", "../../../node_modules/posthog-js/src/retry-queue.ts", "../../../node_modules/posthog-js/src/sessionid.ts", "../../../node_modules/posthog-js/src/extensions/sentry-integration.ts", "../../../node_modules/posthog-js/src/extensions/segment-integration.ts", "../../../node_modules/posthog-js/src/page-view-id.ts", "../../../node_modules/posthog-js/src/extensions/exceptions/type-checking.ts", "../../../node_modules/posthog-js/src/extensions/exceptions/stack-trace.ts", "../../../node_modules/posthog-js/src/extensions/exceptions/error-conversion.ts", "../../../node_modules/posthog-js/src/extensions/exceptions/exception-autocapture.ts", "../../../node_modules/posthog-js/src/posthog-surveys.ts", "../../../node_modules/posthog-js/src/posthog-core.ts", "../../../node_modules/posthog-js/src/compression.ts", "../../../node_modules/posthog-js/src/loader-module.ts", "../../javascript/controllers/track_events_controller.js", "../../javascript/controllers/truncated_text_controller.js", "../../../node_modules/videojs-event-tracking/dist/videojs-event-tracking.es.js", "../../../node_modules/ahoy.js/dist/ahoy.esm.js", "../../javascript/utils/ahoy.ts", "../../javascript/controllers/video_controller.ts", "../../javascript/controllers/video_form_controller.ts", "../../javascript/controllers/wide_offcanvas_controller.js", "../../javascript/controllers/index.js", "../../../node_modules/js-cookie/dist/js.cookie.mjs", "../../javascript/utils/events.js", "../../../node_modules/trix/src/trix/config/attachments.js", "../../../node_modules/trix/src/trix/config/block_attributes.js", "../../../node_modules/trix/src/trix/config/browser.js", "../../../node_modules/trix/src/trix/config/lang.js", "../../../node_modules/trix/src/trix/config/file_size_formatting.js", "../../../node_modules/trix/src/trix/constants.js", "../../../node_modules/trix/src/trix/core/helpers/extend.js", "../../../node_modules/trix/src/trix/core/helpers/dom.js", "../../../node_modules/trix/src/trix/config/input.js", "../../../node_modules/trix/src/trix/config/key_names.js", "../../../node_modules/trix/src/trix/config/parser.js", "../../../node_modules/trix/src/trix/config/text_attributes.js", "../../../node_modules/trix/src/trix/config/toolbar.js", "../../../node_modules/trix/src/trix/config/undo.js", "../../../node_modules/trix/src/trix/config/css.js", "../../../node_modules/trix/src/trix/core/basic_object.js", "../../../node_modules/trix/src/trix/core/utilities/utf16_string.js", "../../../node_modules/trix/src/trix/core/object.js", "../../../node_modules/trix/src/trix/core/helpers/arrays.js", "../../../node_modules/trix/src/trix/core/helpers/bidi.js", "../../../node_modules/trix/src/trix/core/helpers/config.js", "../../../node_modules/trix/src/trix/core/helpers/custom_elements.js", "../../../node_modules/trix/src/trix/core/helpers/events.js", "../../../node_modules/trix/src/trix/core/helpers/functions.js", "../../../node_modules/trix/src/trix/core/helpers/objects.js", "../../../node_modules/trix/src/trix/core/helpers/ranges.js", "../../../node_modules/trix/src/trix/observers/selection_change_observer.js", "../../../node_modules/trix/src/trix/core/helpers/strings.js", "../../../node_modules/trix/src/trix/core/collections/hash.js", "../../../node_modules/trix/src/trix/core/collections/object_group.js", "../../../node_modules/trix/src/trix/core/collections/object_map.js", "../../../node_modules/trix/src/trix/core/collections/element_store.js", "../../../node_modules/trix/src/trix/core/utilities/operation.js", "../../../node_modules/trix/src/trix/views/object_view.js", "../../../node_modules/trix/src/trix/models/html_sanitizer.js", "../../../node_modules/trix/src/trix/views/attachment_view.js", "../../../node_modules/trix/src/trix/views/previewable_attachment_view.js", "../../../node_modules/trix/src/trix/views/piece_view.js", "../../../node_modules/trix/src/trix/views/text_view.js", "../../../node_modules/trix/src/trix/views/block_view.js", "../../../node_modules/trix/src/trix/views/document_view.js", "../../../node_modules/trix/src/trix/models/piece.js", "../../../node_modules/trix/src/trix/operations/image_preload_operation.js", "../../../node_modules/trix/src/trix/models/attachment.js", "../../../node_modules/trix/src/trix/models/attachment_piece.js", "../../../node_modules/trix/src/trix/models/string_piece.js", "../../../node_modules/trix/src/trix/models/splittable_list.js", "../../../node_modules/trix/src/trix/models/text.js", "../../../node_modules/trix/src/trix/models/block.js", "../../../node_modules/trix/src/trix/models/document.js", "../../../node_modules/trix/src/trix/models/html_parser.js", "../../../node_modules/trix/src/trix/core/serialization.js", "../../../node_modules/trix/src/trix/models/managed_attachment.js", "../../../node_modules/trix/src/trix/models/attachment_manager.js", "../../../node_modules/trix/src/trix/models/line_break_insertion.js", "../../../node_modules/trix/src/trix/models/composition.js", "../../../node_modules/trix/src/trix/models/undo_manager.js", "../../../node_modules/trix/src/trix/filters/filter.js", "../../../node_modules/trix/src/trix/filters/attachment_gallery_filter.js", "../../../node_modules/trix/src/trix/models/editor.js", "../../../node_modules/trix/src/trix/models/location_mapper.js", "../../../node_modules/trix/src/trix/models/point_mapper.js", "../../../node_modules/trix/src/trix/models/selection_manager.js", "../../../node_modules/trix/src/trix/controllers/attachment_editor_controller.js", "../../../node_modules/trix/src/trix/controllers/composition_controller.js", "../../../node_modules/trix/src/trix/controllers/controller.js", "../../../node_modules/trix/src/trix/observers/mutation_observer.js", "../../../node_modules/trix/src/trix/operations/file_verification_operation.js", "../../../node_modules/trix/src/trix/models/flaky_android_keyboard_detector.js", "../../../node_modules/trix/src/trix/controllers/input_controller.js", "../../../node_modules/trix/src/trix/controllers/level_0_input_controller.js", "../../../node_modules/trix/src/trix/controllers/level_2_input_controller.js", "../../../node_modules/trix/src/trix/controllers/toolbar_controller.js", "../../../node_modules/trix/src/trix/controllers/editor_controller.js", "../../../node_modules/trix/src/trix/elements/trix_toolbar_element.js", "../../../node_modules/trix/src/trix/elements/trix_editor_element.js", "../../../node_modules/trix/src/trix/trix.js", "../../javascript/trix_extensions.js", "../../../node_modules/@rails/actiontext/node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js", "../../../node_modules/@rails/actiontext/app/javascript/actiontext/attachment_upload.js", "../../../node_modules/@rails/actiontext/app/javascript/actiontext/index.js"], "sourcesContent": ["export default {\n logger: self.console,\n WebSocket: self.WebSocket\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n// ActionCable.logger.enabled = true\n//\n// Example:\n//\n// import * as ActionCable from '@rails/actioncable'\n//\n// ActionCable.logger.enabled = true\n// ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n log(...messages) {\n if (this.enabled) {\n messages.push(Date.now())\n adapters.logger.log(\"[ActionCable]\", ...messages)\n }\n },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n constructor(connection) {\n this.visibilityDidChange = this.visibilityDidChange.bind(this)\n this.connection = connection\n this.reconnectAttempts = 0\n }\n\n start() {\n if (!this.isRunning()) {\n this.startedAt = now()\n delete this.stoppedAt\n this.startPolling()\n addEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n }\n }\n\n stop() {\n if (this.isRunning()) {\n this.stoppedAt = now()\n this.stopPolling()\n removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(\"ConnectionMonitor stopped\")\n }\n }\n\n isRunning() {\n return this.startedAt && !this.stoppedAt\n }\n\n recordPing() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n this.recordPing()\n delete this.disconnectedAt\n logger.log(\"ConnectionMonitor recorded connect\")\n }\n\n recordDisconnect() {\n this.disconnectedAt = now()\n logger.log(\"ConnectionMonitor recorded disconnect\")\n }\n\n // Private\n\n startPolling() {\n this.stopPolling()\n this.poll()\n }\n\n stopPolling() {\n clearTimeout(this.pollTimeout)\n }\n\n poll() {\n this.pollTimeout = setTimeout(() => {\n this.reconnectIfStale()\n this.poll()\n }\n , this.getPollInterval())\n }\n\n getPollInterval() {\n const { staleThreshold, reconnectionBackoffRate } = this.constructor\n const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n const jitter = jitterMax * Math.random()\n return staleThreshold * 1000 * backoff * (1 + jitter)\n }\n\n reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n this.reconnectAttempts++\n if (this.disconnectedRecently()) {\n logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n } else {\n logger.log(\"ConnectionMonitor reopening\")\n this.connection.reopen()\n }\n }\n }\n\n get refreshedAt() {\n return this.pingedAt ? this.pingedAt : this.startedAt\n }\n\n connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n }\n\n disconnectedRecently() {\n return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n }\n\n visibilityDidChange() {\n if (document.visibilityState === \"visible\") {\n setTimeout(() => {\n if (this.connectionIsStale() || !this.connection.isOpen()) {\n logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n this.connection.reopen()\n }\n }\n , 200)\n }\n }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n \"message_types\": {\n \"welcome\": \"welcome\",\n \"disconnect\": \"disconnect\",\n \"ping\": \"ping\",\n \"confirmation\": \"confirm_subscription\",\n \"rejection\": \"reject_subscription\"\n },\n \"disconnect_reasons\": {\n \"unauthorized\": \"unauthorized\",\n \"invalid_request\": \"invalid_request\",\n \"server_restart\": \"server_restart\"\n },\n \"default_mount_path\": \"/cable\",\n \"protocols\": [\n \"actioncable-v1-json\",\n \"actioncable-unsupported\"\n ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n constructor(consumer) {\n this.open = this.open.bind(this)\n this.consumer = consumer\n this.subscriptions = this.consumer.subscriptions\n this.monitor = new ConnectionMonitor(this)\n this.disconnected = true\n }\n\n send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data))\n return true\n } else {\n return false\n }\n }\n\n open() {\n if (this.isActive()) {\n logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n return false\n } else {\n logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${protocols}`)\n if (this.webSocket) { this.uninstallEventHandlers() }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols)\n this.installEventHandlers()\n this.monitor.start()\n return true\n }\n }\n\n close({allowReconnect} = {allowReconnect: true}) {\n if (!allowReconnect) { this.monitor.stop() }\n // Avoid closing websockets in a \"connecting\" state due to Safari 15.1+ bug. See: https://github.com/rails/rails/issues/43835#issuecomment-1002288478\n if (this.isOpen()) {\n return this.webSocket.close()\n }\n }\n\n reopen() {\n logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n if (this.isActive()) {\n try {\n return this.close()\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error)\n }\n finally {\n logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n setTimeout(this.open, this.constructor.reopenDelay)\n }\n } else {\n return this.open()\n }\n }\n\n getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol\n }\n }\n\n isOpen() {\n return this.isState(\"open\")\n }\n\n isActive() {\n return this.isState(\"open\", \"connecting\")\n }\n\n // Private\n\n isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n }\n\n isState(...states) {\n return indexOf.call(states, this.getState()) >= 0\n }\n\n getState() {\n if (this.webSocket) {\n for (let state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase()\n }\n }\n }\n return null\n }\n\n installEventHandlers() {\n for (let eventName in this.events) {\n const handler = this.events[eventName].bind(this)\n this.webSocket[`on${eventName}`] = handler\n }\n }\n\n uninstallEventHandlers() {\n for (let eventName in this.events) {\n this.webSocket[`on${eventName}`] = function() {}\n }\n }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n message(event) {\n if (!this.isProtocolSupported()) { return }\n const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect()\n return this.subscriptions.reload()\n case message_types.disconnect:\n logger.log(`Disconnecting. Reason: ${reason}`)\n return this.close({allowReconnect: reconnect})\n case message_types.ping:\n return this.monitor.recordPing()\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier)\n return this.subscriptions.notify(identifier, \"connected\")\n case message_types.rejection:\n return this.subscriptions.reject(identifier)\n default:\n return this.subscriptions.notify(identifier, \"received\", message)\n }\n },\n\n open() {\n logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n this.disconnected = false\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n return this.close({allowReconnect: false})\n }\n },\n\n close(event) {\n logger.log(\"WebSocket onclose event\")\n if (this.disconnected) { return }\n this.disconnected = true\n this.monitor.recordDisconnect()\n return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n },\n\n error() {\n logger.log(\"WebSocket onerror event\")\n }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n// connected() {\n// // Called once the subscription has been successfully completed\n// },\n//\n// disconnected({ willAttemptReconnect: boolean }) {\n// // Called when the client has disconnected with the server.\n// // The object will have an `willAttemptReconnect` property which\n// // says whether the client has the intention of attempting\n// // to reconnect.\n// },\n//\n// appear() {\n// this.perform('appear', {appearing_on: this.appearingOn()})\n// },\n//\n// away() {\n// this.perform('away')\n// },\n//\n// appearingOn() {\n// $('main').data('appearing-on')\n// }\n// })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n// class AppearanceChannel < ApplicationActionCable::Channel\n// def subscribed\n// current_user.appear\n// end\n//\n// def unsubscribed\n// current_user.disappear\n// end\n//\n// def appear(data)\n// current_user.appear on: data['appearing_on']\n// end\n//\n// def away\n// current_user.away\n// end\n// end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n if (properties != null) {\n for (let key in properties) {\n const value = properties[key]\n object[key] = value\n }\n }\n return object\n}\n\nexport default class Subscription {\n constructor(consumer, params = {}, mixin) {\n this.consumer = consumer\n this.identifier = JSON.stringify(params)\n extend(this, mixin)\n }\n\n // Perform a channel action with the optional data passed as an attribute\n perform(action, data = {}) {\n data.action = action\n return this.send(data)\n }\n\n send(data) {\n return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n }\n\n unsubscribe() {\n return this.consumer.subscriptions.remove(this)\n }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n constructor(subscriptions) {\n this.subscriptions = subscriptions\n this.pendingSubscriptions = []\n }\n\n guarantee(subscription) {\n if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n this.pendingSubscriptions.push(subscription) \n }\n else {\n logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n }\n this.startGuaranteeing()\n }\n\n forget(subscription) {\n logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n }\n\n startGuaranteeing() {\n this.stopGuaranteeing()\n this.retrySubscribing()\n }\n \n stopGuaranteeing() {\n clearTimeout(this.retryTimeout)\n }\n\n retrySubscribing() {\n this.retryTimeout = setTimeout(() => {\n if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n this.pendingSubscriptions.map((subscription) => {\n logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n this.subscriptions.subscribe(subscription)\n })\n }\n }\n , 500)\n }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n constructor(consumer) {\n this.consumer = consumer\n this.guarantor = new SubscriptionGuarantor(this)\n this.subscriptions = []\n }\n\n create(channelName, mixin) {\n const channel = channelName\n const params = typeof channel === \"object\" ? channel : {channel}\n const subscription = new Subscription(this.consumer, params, mixin)\n return this.add(subscription)\n }\n\n // Private\n\n add(subscription) {\n this.subscriptions.push(subscription)\n this.consumer.ensureActiveConnection()\n this.notify(subscription, \"initialized\")\n this.subscribe(subscription)\n return subscription\n }\n\n remove(subscription) {\n this.forget(subscription)\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\")\n }\n return subscription\n }\n\n reject(identifier) {\n return this.findAll(identifier).map((subscription) => {\n this.forget(subscription)\n this.notify(subscription, \"rejected\")\n return subscription\n })\n }\n\n forget(subscription) {\n this.guarantor.forget(subscription)\n this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n return subscription\n }\n\n findAll(identifier) {\n return this.subscriptions.filter((s) => s.identifier === identifier)\n }\n\n reload() {\n return this.subscriptions.map((subscription) =>\n this.subscribe(subscription))\n }\n\n notifyAll(callbackName, ...args) {\n return this.subscriptions.map((subscription) =>\n this.notify(subscription, callbackName, ...args))\n }\n\n notify(subscription, callbackName, ...args) {\n let subscriptions\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription)\n } else {\n subscriptions = [subscription]\n }\n\n return subscriptions.map((subscription) =>\n (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n }\n\n subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription)\n }\n }\n\n confirmSubscription(identifier) {\n logger.log(`Subscription confirmed ${identifier}`)\n this.findAll(identifier).map((subscription) =>\n this.guarantor.forget(subscription))\n }\n\n sendCommand(subscription, command) {\n const {identifier} = subscription\n return this.consumer.send({command, identifier})\n }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n// App.cable.disconnect()\n//\n// and to restart the connection:\n//\n// App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n constructor(url) {\n this._url = url\n this.subscriptions = new Subscriptions(this)\n this.connection = new Connection(this)\n }\n\n get url() {\n return createWebSocketURL(this._url)\n }\n\n send(data) {\n return this.connection.send(data)\n }\n\n connect() {\n return this.connection.open()\n }\n\n disconnect() {\n return this.connection.close({allowReconnect: false})\n }\n\n ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open()\n }\n }\n}\n\nexport function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url()\n }\n\n if (url && !/^wss?:/i.test(url)) {\n const a = document.createElement(\"a\")\n a.href = url\n // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n a.href = a.href\n a.protocol = a.protocol.replace(\"http\", \"ws\")\n return a.href\n } else {\n return url\n }\n}\n", "import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n Connection,\n ConnectionMonitor,\n Consumer,\n INTERNAL,\n Subscription,\n Subscriptions,\n SubscriptionGuarantor,\n adapters,\n createWebSocketURL,\n logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n return new Consumer(url)\n}\n\nexport function getConfig(name) {\n const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n if (element) {\n return element.getAttribute(\"content\")\n }\n}\n", "\"use strict\";\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nvar _a, _b, _c;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._getInstance = exports._getStatsigGlobalFlag = exports._getStatsigGlobal = void 0;\nconst _getStatsigGlobal = () => {\n return __STATSIG__ ? __STATSIG__ : statsigGlobal;\n};\nexports._getStatsigGlobal = _getStatsigGlobal;\nconst _getStatsigGlobalFlag = (flag) => {\n return (0, exports._getStatsigGlobal)()[flag];\n};\nexports._getStatsigGlobalFlag = _getStatsigGlobalFlag;\nconst _getInstance = (sdkKey) => {\n const gbl = (0, exports._getStatsigGlobal)();\n if (!sdkKey) {\n return gbl.lastInstance;\n }\n return gbl.instances && gbl.instances[sdkKey];\n};\nexports._getInstance = _getInstance;\nconst GLOBAL_KEY = '__STATSIG__';\nconst _window = typeof window !== 'undefined' ? window : {};\nconst _global = typeof global !== 'undefined' ? global : {};\nconst _globalThis = typeof globalThis !== 'undefined' ? globalThis : {};\nconst statsigGlobal = (_c = (_b = (_a = _window[GLOBAL_KEY]) !== null && _a !== void 0 ? _a : _global[GLOBAL_KEY]) !== null && _b !== void 0 ? _b : _globalThis[GLOBAL_KEY]) !== null && _c !== void 0 ? _c : {\n instance: exports._getInstance,\n};\n_window[GLOBAL_KEY] = statsigGlobal;\n_global[GLOBAL_KEY] = statsigGlobal;\n_globalThis[GLOBAL_KEY] = statsigGlobal;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._isTypeMatch = exports._typeOf = void 0;\nfunction _typeOf(input) {\n return Array.isArray(input) ? 'array' : typeof input;\n}\nexports._typeOf = _typeOf;\nfunction _isTypeMatch(a, b) {\n const typeOf = (x) => (Array.isArray(x) ? 'array' : typeof x);\n return typeOf(a) === typeOf(b);\n}\nexports._isTypeMatch = _isTypeMatch;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._getSortedObject = exports._DJB2Object = exports._DJB2 = void 0;\nconst TypingUtils_1 = require(\"./TypingUtils\");\nconst _DJB2 = (value) => {\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n const character = value.charCodeAt(i);\n hash = (hash << 5) - hash + character;\n hash = hash & hash; // Convert to 32bit integer\n }\n return String(hash >>> 0);\n};\nexports._DJB2 = _DJB2;\nconst _DJB2Object = (value, maxLevels) => {\n return (0, exports._DJB2)(JSON.stringify((0, exports._getSortedObject)(value, maxLevels)));\n};\nexports._DJB2Object = _DJB2Object;\nconst _getSortedObject = (object, maxDepth) => {\n if (object == null) {\n return null;\n }\n const keys = Object.keys(object).sort();\n const sortedObject = {};\n keys.forEach((key) => {\n const value = object[key];\n if (maxDepth === 0 || (0, TypingUtils_1._typeOf)(value) !== 'object') {\n sortedObject[key] = value;\n return;\n }\n sortedObject[key] = (0, exports._getSortedObject)(value, maxDepth != null ? maxDepth - 1 : maxDepth);\n });\n return sortedObject;\n};\nexports._getSortedObject = _getSortedObject;\n", "\"use strict\";\n/* eslint-disable no-console */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Log = exports.LogLevel = void 0;\nfunction addTag(args) {\n args.unshift('[Statsig]');\n return args; // ['[Statsig]', ...args];\n}\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"None\"] = 0] = \"None\";\n LogLevel[LogLevel[\"Error\"] = 1] = \"Error\";\n LogLevel[LogLevel[\"Warn\"] = 2] = \"Warn\";\n LogLevel[LogLevel[\"Info\"] = 3] = \"Info\";\n LogLevel[LogLevel[\"Debug\"] = 4] = \"Debug\";\n})(LogLevel || (exports.LogLevel = LogLevel = {}));\nclass Log {\n static info(...args) {\n if (this.level >= LogLevel.Info) {\n console.info(...addTag(args));\n }\n }\n static debug(...args) {\n if (this.level >= LogLevel.Debug) {\n console.debug(...addTag(args));\n }\n }\n static warn(...args) {\n if (this.level >= LogLevel.Warn) {\n console.warn(...addTag(args));\n }\n }\n static error(...args) {\n if (this.level >= LogLevel.Error) {\n console.error(...addTag(args));\n }\n }\n}\nexports.Log = Log;\nLog.level = LogLevel.Error;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NetworkParam = exports.NetworkDefault = void 0;\nexports.NetworkDefault = {\n eventsApi: 'https://prodregistryv2.org/v1',\n initializeApi: 'https://featureassets.org/v1',\n specsApi: 'https://assetsconfigcdn.org/v1',\n};\nvar NetworkParam;\n(function (NetworkParam) {\n NetworkParam[\"EventCount\"] = \"ec\";\n NetworkParam[\"SdkKey\"] = \"k\";\n NetworkParam[\"SdkType\"] = \"st\";\n NetworkParam[\"SdkVersion\"] = \"sv\";\n NetworkParam[\"Time\"] = \"t\";\n NetworkParam[\"SessionID\"] = \"sid\";\n NetworkParam[\"StatsigEncoded\"] = \"se\";\n NetworkParam[\"IsGzipped\"] = \"gz\";\n})(NetworkParam || (exports.NetworkParam = NetworkParam = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._getCurrentPageUrlSafe = exports._addDocumentEventListenerSafe = exports._addWindowEventListenerSafe = exports._isServerEnv = exports._getDocumentSafe = exports._getWindowSafe = void 0;\nconst _getWindowSafe = () => {\n return typeof window !== 'undefined' ? window : null;\n};\nexports._getWindowSafe = _getWindowSafe;\nconst _getDocumentSafe = () => {\n var _a;\n const win = (0, exports._getWindowSafe)();\n return (_a = win === null || win === void 0 ? void 0 : win.document) !== null && _a !== void 0 ? _a : null;\n};\nexports._getDocumentSafe = _getDocumentSafe;\nconst _isServerEnv = () => {\n if ((0, exports._getDocumentSafe)() !== null) {\n return false;\n }\n const isNode = typeof process !== 'undefined' &&\n process.versions != null &&\n process.versions.node != null;\n const isVercel = typeof EdgeRuntime === 'string';\n return isVercel || isNode;\n};\nexports._isServerEnv = _isServerEnv;\nconst _addWindowEventListenerSafe = (key, listener) => {\n const win = (0, exports._getWindowSafe)();\n if (typeof (win === null || win === void 0 ? void 0 : win.addEventListener) === 'function') {\n win.addEventListener(key, listener);\n }\n};\nexports._addWindowEventListenerSafe = _addWindowEventListenerSafe;\nconst _addDocumentEventListenerSafe = (key, listener) => {\n const doc = (0, exports._getDocumentSafe)();\n if (typeof (doc === null || doc === void 0 ? void 0 : doc.addEventListener) === 'function') {\n doc.addEventListener(key, listener);\n }\n};\nexports._addDocumentEventListenerSafe = _addDocumentEventListenerSafe;\nconst _getCurrentPageUrlSafe = () => {\n var _a;\n try {\n return (_a = (0, exports._getWindowSafe)()) === null || _a === void 0 ? void 0 : _a.location.href.split(/[?#]/)[0];\n }\n catch (_b) {\n return;\n }\n};\nexports._getCurrentPageUrlSafe = _getCurrentPageUrlSafe;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._createLayerParameterExposure = exports._createConfigExposure = exports._createGateExposure = exports._isExposureEvent = void 0;\nconst CONFIG_EXPOSURE_NAME = 'statsig::config_exposure';\nconst GATE_EXPOSURE_NAME = 'statsig::gate_exposure';\nconst LAYER_EXPOSURE_NAME = 'statsig::layer_exposure';\nconst _createExposure = (eventName, user, details, metadata, secondaryExposures) => {\n return {\n eventName,\n user,\n value: null,\n metadata: _addEvaluationDetailsToMetadata(details, metadata),\n secondaryExposures,\n time: Date.now(),\n };\n};\nconst _isExposureEvent = ({ eventName, }) => {\n return eventName === GATE_EXPOSURE_NAME || eventName === CONFIG_EXPOSURE_NAME;\n};\nexports._isExposureEvent = _isExposureEvent;\nconst _createGateExposure = (user, gate) => {\n var _a, _b;\n return _createExposure(GATE_EXPOSURE_NAME, user, gate.details, {\n gate: gate.name,\n gateValue: String(gate.value),\n ruleID: gate.ruleID,\n }, (_b = (_a = gate.__evaluation) === null || _a === void 0 ? void 0 : _a.secondary_exposures) !== null && _b !== void 0 ? _b : []);\n};\nexports._createGateExposure = _createGateExposure;\nconst _createConfigExposure = (user, config) => {\n var _a, _b;\n return _createExposure(CONFIG_EXPOSURE_NAME, user, config.details, {\n config: config.name,\n ruleID: config.ruleID,\n }, (_b = (_a = config.__evaluation) === null || _a === void 0 ? void 0 : _a.secondary_exposures) !== null && _b !== void 0 ? _b : []);\n};\nexports._createConfigExposure = _createConfigExposure;\nconst _createLayerParameterExposure = (user, layer, parameterName) => {\n var _a, _b, _c;\n const evaluation = layer.__evaluation;\n const isExplicit = ((_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.explicit_parameters) === null || _a === void 0 ? void 0 : _a.includes(parameterName)) === true;\n let allocatedExperiment = '';\n let secondaryExposures = (_b = evaluation === null || evaluation === void 0 ? void 0 : evaluation.undelegated_secondary_exposures) !== null && _b !== void 0 ? _b : [];\n if (isExplicit) {\n allocatedExperiment = (_c = evaluation.allocated_experiment_name) !== null && _c !== void 0 ? _c : '';\n secondaryExposures = evaluation.secondary_exposures;\n }\n return _createExposure(LAYER_EXPOSURE_NAME, user, layer.details, {\n config: layer.name,\n parameterName,\n ruleID: layer.ruleID,\n allocatedExperiment,\n isExplicitParameter: String(isExplicit),\n }, secondaryExposures);\n};\nexports._createLayerParameterExposure = _createLayerParameterExposure;\nconst _addEvaluationDetailsToMetadata = (details, metadata) => {\n metadata['reason'] = details.reason;\n if (details.lcut) {\n metadata['lcut'] = String(details.lcut);\n }\n if (details.receivedAt) {\n metadata['receivedAt'] = String(details.receivedAt);\n }\n return metadata;\n};\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._setObjectInStorage = exports._getObjectFromStorage = exports.Storage = void 0;\nconst Log_1 = require(\"./Log\");\nconst SafeJs_1 = require(\"./SafeJs\");\nconst inMemoryStore = {};\nconst _resolve = (input) => Promise.resolve(input);\nconst _inMemoryProvider = {\n _getProviderName: () => 'InMemory',\n _getItemSync: (key) => inMemoryStore[key] ? inMemoryStore[key] : null,\n _getItem: (key) => _resolve(inMemoryStore[key] ? inMemoryStore[key] : null),\n _setItem: (key, value) => ((inMemoryStore[key] = value), _resolve()),\n _removeItem: (key) => (delete inMemoryStore[key], _resolve()),\n _getAllKeys: () => _resolve(Object.keys(inMemoryStore)),\n};\nlet _localStorageProvider = null;\ntry {\n const win = (0, SafeJs_1._getWindowSafe)();\n if (win &&\n win.localStorage &&\n typeof win.localStorage.getItem === 'function') {\n _localStorageProvider = {\n _getProviderName: () => 'LocalStorage',\n _getItemSync: (key) => win.localStorage.getItem(key),\n _getItem: (key) => _resolve(win.localStorage.getItem(key)),\n _setItem: (key, value) => (win.localStorage.setItem(key, value), _resolve()),\n _removeItem: (key) => (win.localStorage.removeItem(key), _resolve()),\n _getAllKeys: () => _resolve(Object.keys(win.localStorage)),\n };\n }\n}\ncatch (error) {\n Log_1.Log.warn('Failed to setup localStorageProvider.');\n}\nlet _main = _localStorageProvider !== null && _localStorageProvider !== void 0 ? _localStorageProvider : _inMemoryProvider;\nlet _current = _main;\nfunction _inMemoryBreaker(get) {\n try {\n return get();\n }\n catch (error) {\n if (error instanceof Error && error.name === 'SecurityError') {\n exports.Storage._setProvider(_inMemoryProvider);\n return null;\n }\n throw error;\n }\n}\nexports.Storage = {\n _getProviderName: () => _current._getProviderName(),\n _getItem: (key) => __awaiter(void 0, void 0, void 0, function* () { return _inMemoryBreaker(() => _current._getItem(key)); }),\n _getItemSync: (key) => _inMemoryBreaker(() => _current._getItemSync ? _current._getItemSync(key) : null),\n _setItem: (key, value) => _current._setItem(key, value),\n _removeItem: (key) => _current._removeItem(key),\n _getAllKeys: () => _current._getAllKeys(),\n // StorageProviderManagment\n _setProvider: (newProvider) => {\n _main = newProvider;\n _current = newProvider;\n },\n _setDisabled: (isDisabled) => {\n if (isDisabled) {\n _current = _inMemoryProvider;\n }\n else {\n _current = _main;\n }\n },\n};\nfunction _getObjectFromStorage(key) {\n return __awaiter(this, void 0, void 0, function* () {\n const value = yield exports.Storage._getItem(key);\n return JSON.parse(value !== null && value !== void 0 ? value : 'null');\n });\n}\nexports._getObjectFromStorage = _getObjectFromStorage;\nfunction _setObjectInStorage(key, obj) {\n return __awaiter(this, void 0, void 0, function* () {\n yield exports.Storage._setItem(key, JSON.stringify(obj));\n });\n}\nexports._setObjectInStorage = _setObjectInStorage;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._getOverridableUrl = void 0;\nfunction _getOverridableUrl(overrideUrl, overrideApi, defaultEndpoint, defaultApi) {\n if (overrideUrl) {\n return overrideUrl;\n }\n else if (overrideApi) {\n return `${overrideApi}${defaultEndpoint}`;\n }\n else {\n return `${defaultApi}${defaultEndpoint}`;\n }\n}\nexports._getOverridableUrl = _getOverridableUrl;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._notifyVisibilityChanged = exports._subscribeToVisiblityChanged = exports._isUnloading = exports._isCurrentlyVisible = void 0;\nconst SafeJs_1 = require(\"./SafeJs\");\nconst FOREGROUND = 'foreground';\nconst BACKGROUND = 'background';\nconst LISTENERS = [];\nlet current = FOREGROUND;\nlet isUnloading = false;\nconst _isCurrentlyVisible = () => {\n return current === FOREGROUND;\n};\nexports._isCurrentlyVisible = _isCurrentlyVisible;\nconst _isUnloading = () => isUnloading;\nexports._isUnloading = _isUnloading;\nconst _subscribeToVisiblityChanged = (listener) => {\n LISTENERS.unshift(listener);\n};\nexports._subscribeToVisiblityChanged = _subscribeToVisiblityChanged;\nconst _notifyVisibilityChanged = (visibility) => {\n if (visibility === current) {\n return;\n }\n current = visibility;\n LISTENERS.forEach((l) => l(visibility));\n};\nexports._notifyVisibilityChanged = _notifyVisibilityChanged;\n(0, SafeJs_1._addWindowEventListenerSafe)('focus', () => {\n isUnloading = false;\n (0, exports._notifyVisibilityChanged)(FOREGROUND);\n});\n(0, SafeJs_1._addWindowEventListenerSafe)('blur', () => (0, exports._notifyVisibilityChanged)(BACKGROUND));\n(0, SafeJs_1._addWindowEventListenerSafe)('beforeunload', () => {\n isUnloading = true;\n (0, exports._notifyVisibilityChanged)(BACKGROUND);\n});\n(0, SafeJs_1._addDocumentEventListenerSafe)('visibilitychange', () => {\n (0, exports._notifyVisibilityChanged)(document.visibilityState === 'visible' ? FOREGROUND : BACKGROUND);\n});\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventLogger = void 0;\nconst Hashing_1 = require(\"./Hashing\");\nconst Log_1 = require(\"./Log\");\nconst NetworkConfig_1 = require(\"./NetworkConfig\");\nconst SafeJs_1 = require(\"./SafeJs\");\nconst StatsigEvent_1 = require(\"./StatsigEvent\");\nconst StorageProvider_1 = require(\"./StorageProvider\");\nconst UrlOverrides_1 = require(\"./UrlOverrides\");\nconst VisibilityObserving_1 = require(\"./VisibilityObserving\");\nconst DEFAULT_QUEUE_SIZE = 50;\nconst DEFAULT_FLUSH_INTERVAL_MS = 10000;\nconst MAX_DEDUPER_KEYS = 1000;\nconst DEDUPER_WINDOW_DURATION_MS = 60000;\nconst MAX_FAILED_LOGS = 500;\nconst QUICK_FLUSH_WINDOW_MS = 200;\nconst EVENT_LOGGER_MAP = {};\nconst _safeFlushAndForget = (sdkKey) => {\n var _a;\n (_a = EVENT_LOGGER_MAP[sdkKey]) === null || _a === void 0 ? void 0 : _a.flush().catch(() => {\n // noop\n });\n};\nclass EventLogger {\n constructor(_sdkKey, _emitter, _network, _options) {\n var _a;\n this._sdkKey = _sdkKey;\n this._emitter = _emitter;\n this._network = _network;\n this._options = _options;\n this._queue = [];\n this._lastExposureTimeMap = {};\n this._nonExposedChecks = {};\n this._hasRunQuickFlush = false;\n this._creationTime = Date.now();\n EVENT_LOGGER_MAP[_sdkKey] = this;\n this._isLoggingDisabled = (_options === null || _options === void 0 ? void 0 : _options.disableLogging) === true;\n this._maxQueueSize = (_a = _options === null || _options === void 0 ? void 0 : _options.loggingBufferMaxSize) !== null && _a !== void 0 ? _a : DEFAULT_QUEUE_SIZE;\n const config = _options === null || _options === void 0 ? void 0 : _options.networkConfig;\n this._logEventUrl = (0, UrlOverrides_1._getOverridableUrl)(config === null || config === void 0 ? void 0 : config.logEventUrl, config === null || config === void 0 ? void 0 : config.api, '/rgstr', NetworkConfig_1.NetworkDefault.eventsApi);\n (0, VisibilityObserving_1._subscribeToVisiblityChanged)((visibility) => {\n if (visibility === 'background') {\n _safeFlushAndForget(_sdkKey);\n }\n });\n this._retryFailedLogs();\n this._startBackgroundFlushInterval();\n }\n setLoggingDisabled(isDisabled) {\n this._isLoggingDisabled = isDisabled;\n }\n enqueue(event) {\n if (!this._shouldLogEvent(event)) {\n return;\n }\n this._normalizeAndAppendEvent(event);\n this._quickFlushIfNeeded();\n if (this._queue.length > this._maxQueueSize) {\n _safeFlushAndForget(this._sdkKey);\n }\n }\n incrementNonExposureCount(name) {\n var _a;\n const current = (_a = this._nonExposedChecks[name]) !== null && _a !== void 0 ? _a : 0;\n this._nonExposedChecks[name] = current + 1;\n }\n reset() {\n this._lastExposureTimeMap = {};\n }\n shutdown() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._flushIntervalId) {\n clearInterval(this._flushIntervalId);\n this._flushIntervalId = null;\n }\n yield this.flush();\n });\n }\n flush() {\n return __awaiter(this, void 0, void 0, function* () {\n this._appendAndResetNonExposedChecks();\n if (this._queue.length === 0) {\n return;\n }\n const events = this._queue;\n this._queue = [];\n return this._sendEvents(events);\n });\n }\n /**\n * We 'Quick Flush' following the very first event enqueued\n * within the quick flush window\n */\n _quickFlushIfNeeded() {\n if (this._hasRunQuickFlush) {\n return;\n }\n this._hasRunQuickFlush = true;\n if (Date.now() - this._creationTime > QUICK_FLUSH_WINDOW_MS) {\n return;\n }\n setTimeout(() => _safeFlushAndForget(this._sdkKey), QUICK_FLUSH_WINDOW_MS);\n }\n _shouldLogEvent(event) {\n if (!(0, StatsigEvent_1._isExposureEvent)(event)) {\n return true;\n }\n const user = event.user ? event.user : {};\n const metadata = event.metadata ? event.metadata : {};\n const key = [\n event.eventName,\n user.userID,\n metadata['gate'],\n metadata['config'],\n metadata['ruleID'],\n ].join('|');\n const previous = this._lastExposureTimeMap[key];\n const now = Date.now();\n if (previous && now - previous < DEDUPER_WINDOW_DURATION_MS) {\n return false;\n }\n if (Object.keys(this._lastExposureTimeMap).length > MAX_DEDUPER_KEYS) {\n this._lastExposureTimeMap = {};\n }\n this._lastExposureTimeMap[key] = now;\n return true;\n }\n _sendEvents(events) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (this._isLoggingDisabled) {\n this._saveFailedLogsToStorage(events);\n return;\n }\n try {\n const isInBackground = !(0, VisibilityObserving_1._isCurrentlyVisible)();\n const shouldUseBeacon = isInBackground &&\n this._network.isBeaconSupported() &&\n ((_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.networkConfig) === null || _b === void 0 ? void 0 : _b.networkOverrideFunc) == null;\n const response = shouldUseBeacon\n ? yield this._sendEventsViaBeacon(events)\n : yield this._sendEventsViaPost(events);\n if (response.success) {\n this._emitter({\n name: 'logs_flushed',\n events,\n });\n }\n else {\n this._saveFailedLogsToStorage(events);\n }\n }\n catch (_c) {\n Log_1.Log.warn('Failed to flush events.');\n }\n });\n }\n _sendEventsViaPost(events) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield this._network.post(this._getRequestData(events));\n const code = (_a = result === null || result === void 0 ? void 0 : result.code) !== null && _a !== void 0 ? _a : -1;\n return { success: code >= 200 && code < 300 };\n });\n }\n _sendEventsViaBeacon(events) {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n success: yield this._network.beacon(this._getRequestData(events)),\n };\n });\n }\n _getRequestData(events) {\n return {\n sdkKey: this._sdkKey,\n data: {\n events,\n },\n url: this._logEventUrl,\n retries: 3,\n isCompressable: true,\n params: {\n [NetworkConfig_1.NetworkParam.EventCount]: String(events.length),\n },\n };\n }\n _saveFailedLogsToStorage(events) {\n while (events.length > MAX_FAILED_LOGS) {\n events.shift();\n }\n const storageKey = this._getStorageKey();\n (0, StorageProvider_1._setObjectInStorage)(storageKey, events).catch(() => {\n Log_1.Log.warn('Unable to save failed logs to storage');\n });\n }\n _retryFailedLogs() {\n const storageKey = this._getStorageKey();\n (() => __awaiter(this, void 0, void 0, function* () {\n const events = yield (0, StorageProvider_1._getObjectFromStorage)(storageKey);\n if (!events) {\n return;\n }\n yield StorageProvider_1.Storage._removeItem(storageKey);\n yield this._sendEvents(events);\n }))().catch(() => {\n Log_1.Log.warn('Failed to flush stored logs');\n });\n }\n _getStorageKey() {\n return `statsig.failed_logs.${(0, Hashing_1._DJB2)(this._sdkKey)}`;\n }\n _normalizeAndAppendEvent(event) {\n if (event.user) {\n event.user = Object.assign({}, event.user);\n delete event.user.privateAttributes;\n }\n const extras = {};\n const currentPage = this._getCurrentPageUrl();\n if (currentPage) {\n extras.statsigMetadata = { currentPage };\n }\n const final = Object.assign(Object.assign({}, event), extras);\n Log_1.Log.debug('Enqueued Event:', final);\n this._queue.push(final);\n }\n _appendAndResetNonExposedChecks() {\n if (Object.keys(this._nonExposedChecks).length === 0) {\n return;\n }\n this._normalizeAndAppendEvent({\n eventName: 'statsig::non_exposed_checks',\n user: null,\n time: Date.now(),\n metadata: {\n checks: Object.assign({}, this._nonExposedChecks),\n },\n });\n this._nonExposedChecks = {};\n }\n _getCurrentPageUrl() {\n var _a;\n if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.includeCurrentPageUrlWithEvents) === false) {\n return;\n }\n return (0, SafeJs_1._getCurrentPageUrlSafe)();\n }\n _startBackgroundFlushInterval() {\n var _a, _b;\n if ((0, SafeJs_1._isServerEnv)()) {\n return; // do not run in server environments\n }\n const flushInterval = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.loggingIntervalMs) !== null && _b !== void 0 ? _b : DEFAULT_FLUSH_INTERVAL_MS;\n const intervalId = setInterval(() => {\n const logger = EVENT_LOGGER_MAP[this._sdkKey];\n if (logger._flushIntervalId !== intervalId) {\n clearInterval(intervalId);\n }\n else {\n _safeFlushAndForget(this._sdkKey);\n }\n }, flushInterval);\n this._flushIntervalId = intervalId;\n }\n}\nexports.EventLogger = EventLogger;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;\nexports.SDK_VERSION = '1.4.0';\nlet metadata = {\n sdkVersion: exports.SDK_VERSION,\n sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients\n};\nexports.StatsigMetadataProvider = {\n get: () => metadata,\n add: (additions) => {\n metadata = Object.assign(Object.assign({}, metadata), additions);\n },\n};\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._getStorageKey = exports._getUserStorageKey = void 0;\nconst Hashing_1 = require(\"./Hashing\");\nfunction _getUserStorageKey(sdkKey, user, customKeyGenerator) {\n var _a;\n if (customKeyGenerator) {\n return customKeyGenerator(sdkKey, user);\n }\n const cids = user && user.customIDs ? user.customIDs : {};\n const parts = [\n `uid:${(_a = user === null || user === void 0 ? void 0 : user.userID) !== null && _a !== void 0 ? _a : ''}`,\n `cids:${Object.keys(cids)\n .sort((leftKey, rightKey) => leftKey.localeCompare(rightKey))\n .map((key) => `${key}-${cids[key]}`)\n .join(',')}`,\n `k:${sdkKey}`,\n ];\n return (0, Hashing_1._DJB2)(parts.join('|'));\n}\nexports._getUserStorageKey = _getUserStorageKey;\nfunction _getStorageKey(sdkKey, user, customKeyGenerator) {\n if (user) {\n return _getUserStorageKey(sdkKey, user, customKeyGenerator);\n }\n return (0, Hashing_1._DJB2)(`k:${sdkKey}`);\n}\nexports._getStorageKey = _getStorageKey;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getUUID = void 0;\nfunction getUUID() {\n if (typeof crypto !== 'undefined' &&\n typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n let d = new Date().getTime();\n let d2 = (typeof performance !== 'undefined' &&\n performance.now &&\n performance.now() * 1000) ||\n 0;\n const y = '89ab'[Math.floor(Math.random() * 4)];\n return `xxxxxxxx-xxxx-4xxx-${y}xxx-xxxxxxxxxxxx`.replace(/[xy]/g, (c) => {\n let r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n }\n else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === 'x' ? r : (r & 0x7) | 0x8).toString(16);\n });\n}\nexports.getUUID = getUUID;\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StableID = void 0;\nconst CacheKey_1 = require(\"./CacheKey\");\nconst Log_1 = require(\"./Log\");\nconst StorageProvider_1 = require(\"./StorageProvider\");\nconst UUID_1 = require(\"./UUID\");\nconst PROMISE_MAP = {};\nexports.StableID = {\n get: (sdkKey) => __awaiter(void 0, void 0, void 0, function* () {\n if (PROMISE_MAP[sdkKey] == null) {\n PROMISE_MAP[sdkKey] = _loadFromStorage(sdkKey).then((stableID) => {\n if (stableID != null) {\n return stableID;\n }\n const newStableID = (0, UUID_1.getUUID)();\n _persistToStorage(newStableID, sdkKey);\n return newStableID;\n });\n }\n return PROMISE_MAP[sdkKey];\n }),\n setOverride: (override, sdkKey) => {\n PROMISE_MAP[sdkKey] = Promise.resolve(override);\n _persistToStorage(override, sdkKey);\n },\n};\nfunction _getStableIDStorageKey(sdkKey) {\n return `statsig.stable_id.${(0, CacheKey_1._getStorageKey)(sdkKey)}`;\n}\nfunction _persistToStorage(stableID, sdkKey) {\n const storageKey = _getStableIDStorageKey(sdkKey);\n (0, StorageProvider_1._setObjectInStorage)(storageKey, stableID).catch(() => {\n Log_1.Log.warn('Failed to save StableID');\n });\n}\nfunction _loadFromStorage(sdkKey) {\n const storageKey = _getStableIDStorageKey(sdkKey);\n return (0, StorageProvider_1._getObjectFromStorage)(storageKey);\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._getFullUserHash = exports._normalizeUser = void 0;\nconst Hashing_1 = require(\"./Hashing\");\nconst Log_1 = require(\"./Log\");\nfunction _normalizeUser(original, environment) {\n try {\n const copy = JSON.parse(JSON.stringify(original));\n if (environment != null) {\n copy.statsigEnvironment = environment;\n }\n return copy;\n }\n catch (error) {\n Log_1.Log.error('Failed to JSON.stringify user');\n return {};\n }\n}\nexports._normalizeUser = _normalizeUser;\nfunction _getFullUserHash(user) {\n return user ? (0, Hashing_1._DJB2Object)(user) : null;\n}\nexports._getFullUserHash = _getFullUserHash;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._typedJsonParse = void 0;\nconst Log_1 = require(\"./Log\");\n/**\n *\n * @param {string} data The values to parse into T\n * @param {string} guard A field that must exists on the parsed object for the parse to be valid\n * @param {string} error An error to print via Log.error() when parsing fails\n * @returns {T | null} The parse object T or null if it failed\n */\nfunction _typedJsonParse(data, guard, typeName) {\n try {\n const result = JSON.parse(data);\n if (typeof result === 'object' &&\n guard in result) {\n return result;\n }\n return result;\n }\n catch (_a) {\n // noop\n }\n Log_1.Log.error(`Failed to parse ${typeName}`);\n return null;\n}\nexports._typedJsonParse = _typedJsonParse;\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DataAdapterCore = void 0;\nconst Log_1 = require(\"./Log\");\nconst StableID_1 = require(\"./StableID\");\nconst StatsigUser_1 = require(\"./StatsigUser\");\nconst StorageProvider_1 = require(\"./StorageProvider\");\nconst TypedJsonParse_1 = require(\"./TypedJsonParse\");\nconst CACHE_LIMIT = 10;\nclass DataAdapterCore {\n constructor(_adapterName, _cacheSuffix) {\n this._adapterName = _adapterName;\n this._cacheSuffix = _cacheSuffix;\n this._options = null;\n this._sdkKey = null;\n this._lastModifiedStoreKey = `statsig.last_modified_time.${_cacheSuffix}`;\n this._inMemoryCache = new InMemoryCache();\n }\n attach(sdkKey, options) {\n this._sdkKey = sdkKey;\n this._options = options;\n }\n getDataSync(user) {\n const cacheKey = this._getCacheKey(user);\n const inMem = this._inMemoryCache.get(cacheKey, user);\n if (inMem) {\n return inMem;\n }\n const cache = this._loadFromCache(cacheKey);\n if (cache) {\n this._inMemoryCache.add(cacheKey, cache);\n return this._inMemoryCache.get(cacheKey, user);\n }\n return null;\n }\n setData(data, user) {\n var _a;\n const normalized = user && (0, StatsigUser_1._normalizeUser)(user, (_a = this._options) === null || _a === void 0 ? void 0 : _a.environment);\n const cacheKey = this._getCacheKey(normalized);\n this._inMemoryCache.add(cacheKey, _makeDataAdapterResult('Bootstrap', data, null, normalized));\n }\n /**\n * (Internal Use Only) - Used by \\@statsig/react-native-bindings to prime the cache from AsyncStorage\n *\n * @param {Record} cache The values to merge into _inMemoryCache\n */\n __primeInMemoryCache(cache) {\n this._inMemoryCache.merge(cache);\n }\n _getDataAsyncImpl(current, user, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cache = current !== null && current !== void 0 ? current : this.getDataSync(user);\n const ops = [this._fetchAndPrepFromNetwork(cache, user, options)];\n if (options === null || options === void 0 ? void 0 : options.timeoutMs) {\n ops.push(new Promise((r) => setTimeout(r, options.timeoutMs)).then(() => {\n Log_1.Log.debug('Fetching latest value timed out');\n return null;\n }));\n }\n return yield Promise.race(ops);\n });\n }\n _prefetchDataImpl(user, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheKey = this._getCacheKey(user);\n const result = yield this._getDataAsyncImpl(null, user, options);\n if (result) {\n this._inMemoryCache.add(cacheKey, Object.assign(Object.assign({}, result), { source: 'Prefetch' }));\n }\n });\n }\n _fetchAndPrepFromNetwork(cachedResult, user, options) {\n return __awaiter(this, void 0, void 0, function* () {\n let cachedData = null;\n if (cachedResult && this._isCachedResultValidFor204(cachedResult, user)) {\n cachedData = cachedResult.data;\n }\n const latest = yield this._fetchFromNetwork(cachedData, user, options);\n if (!latest) {\n Log_1.Log.debug('No response returned for latest value');\n return null;\n }\n const response = (0, TypedJsonParse_1._typedJsonParse)(latest, 'has_updates', 'Response');\n const sdkKey = this._getSdkKey();\n const stableID = yield StableID_1.StableID.get(sdkKey);\n let result = null;\n if ((response === null || response === void 0 ? void 0 : response.has_updates) === true) {\n result = _makeDataAdapterResult('Network', latest, stableID, user);\n }\n else if (cachedData && (response === null || response === void 0 ? void 0 : response.has_updates) === false) {\n result = _makeDataAdapterResult('NetworkNotModified', cachedData, stableID, user);\n }\n else {\n return null;\n }\n const cacheKey = this._getCacheKey(user);\n this._inMemoryCache.add(cacheKey, result);\n yield this._writeToCache(cacheKey, result);\n return result;\n });\n }\n _getSdkKey() {\n if (this._sdkKey != null) {\n return this._sdkKey;\n }\n Log_1.Log.error(`${this._adapterName} is not attached to a Client`);\n return '';\n }\n _loadFromCache(cacheKey) {\n var _a;\n const cache = (_a = StorageProvider_1.Storage._getItemSync) === null || _a === void 0 ? void 0 : _a.call(StorageProvider_1.Storage, cacheKey);\n if (cache == null) {\n return null;\n }\n const result = (0, TypedJsonParse_1._typedJsonParse)(cache, 'source', 'Cached Result');\n return result ? Object.assign(Object.assign({}, result), { source: 'Cache' }) : null;\n }\n _writeToCache(cacheKey, result) {\n return __awaiter(this, void 0, void 0, function* () {\n yield StorageProvider_1.Storage._setItem(cacheKey, JSON.stringify(result));\n yield this._runLocalStorageCacheEviction(cacheKey);\n });\n }\n _runLocalStorageCacheEviction(cacheKey) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const lastModifiedTimeMap = (_a = (yield (0, StorageProvider_1._getObjectFromStorage)(this._lastModifiedStoreKey))) !== null && _a !== void 0 ? _a : {};\n lastModifiedTimeMap[cacheKey] = Date.now();\n const evictable = _getEvictableKey(lastModifiedTimeMap, CACHE_LIMIT);\n if (evictable) {\n delete lastModifiedTimeMap[evictable];\n yield StorageProvider_1.Storage._removeItem(evictable);\n }\n yield (0, StorageProvider_1._setObjectInStorage)(this._lastModifiedStoreKey, lastModifiedTimeMap);\n });\n }\n}\nexports.DataAdapterCore = DataAdapterCore;\nfunction _makeDataAdapterResult(source, data, stableID, user) {\n return {\n source,\n data,\n receivedAt: Date.now(),\n stableID,\n fullUserHash: (0, StatsigUser_1._getFullUserHash)(user),\n };\n}\nclass InMemoryCache {\n constructor() {\n this._data = {};\n }\n get(cacheKey, user) {\n var _a;\n const result = this._data[cacheKey];\n const cached = result === null || result === void 0 ? void 0 : result.stableID;\n const provided = (_a = user === null || user === void 0 ? void 0 : user.customIDs) === null || _a === void 0 ? void 0 : _a.stableID;\n if (provided && cached && provided !== cached) {\n Log_1.Log.warn(\"'StatsigUser.customIDs.stableID' mismatch\");\n return null;\n }\n return result;\n }\n add(cacheKey, value) {\n const oldest = _getEvictableKey(this._data, CACHE_LIMIT - 1);\n if (oldest) {\n delete this._data[oldest];\n }\n this._data[cacheKey] = value;\n }\n merge(values) {\n this._data = Object.assign(Object.assign({}, this._data), values);\n }\n}\nfunction _getEvictableKey(data, limit) {\n const keys = Object.keys(data);\n if (keys.length <= limit) {\n return null;\n }\n return keys.reduce((prevKey, currKey) => {\n const prev = data[prevKey];\n const current = data[currKey];\n if (typeof prev === 'object' && typeof current === 'object') {\n return current.receivedAt < prev.receivedAt ? currKey : prevKey;\n }\n return current < prev ? currKey : prevKey;\n });\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SDKType = void 0;\nconst SDK_CLIENT = {};\nlet suffix;\nexports.SDKType = {\n _get: (sdkKey) => {\n var _a;\n return ((_a = SDK_CLIENT[sdkKey]) !== null && _a !== void 0 ? _a : 'js-mono') + (suffix !== null && suffix !== void 0 ? suffix : '');\n },\n _setClientType(sdkKey, client) {\n SDK_CLIENT[sdkKey] = client;\n },\n _setBindingType(binding) {\n if (!suffix || suffix === '-react') {\n suffix = '-' + binding;\n }\n },\n};\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ErrorBoundary = exports.EXCEPTION_ENDPOINT = void 0;\nconst Log_1 = require(\"./Log\");\nconst SDKType_1 = require(\"./SDKType\");\nconst StatsigMetadata_1 = require(\"./StatsigMetadata\");\nexports.EXCEPTION_ENDPOINT = 'https://statsigapi.net/v1/sdk_exception';\nconst UNKNOWN_ERROR = '[Statsig] UnknownError';\nclass ErrorBoundary {\n constructor(_sdkKey, _options, _emitter) {\n this._sdkKey = _sdkKey;\n this._options = _options;\n this._emitter = _emitter;\n this._seen = new Set();\n }\n wrap(instance) {\n try {\n const obj = instance;\n _getAllInstanceMethodNames(obj).forEach((name) => {\n const original = obj[name];\n if ('$EB' in original) {\n return;\n }\n obj[name] = (...args) => {\n return this._capture(name, () => original.apply(instance, args));\n };\n obj[name].$EB = true;\n });\n }\n catch (err) {\n this._onError('eb:wrap', err);\n }\n }\n logError(tag, error) {\n this._onError(tag, error);\n }\n _capture(tag, task) {\n try {\n const res = task();\n if (res && res instanceof Promise) {\n return res.catch((err) => this._onError(tag, err));\n }\n return res;\n }\n catch (error) {\n this._onError(tag, error);\n return null;\n }\n }\n _onError(tag, error) {\n try {\n Log_1.Log.warn(`Caught error in ${tag}`, { error });\n const impl = () => __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g;\n const unwrapped = (error ? error : Error(UNKNOWN_ERROR));\n const isError = unwrapped instanceof Error;\n const name = isError ? unwrapped.name : 'No Name';\n if (this._seen.has(name)) {\n return;\n }\n this._seen.add(name);\n if ((_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.networkConfig) === null || _b === void 0 ? void 0 : _b.preventAllNetworkTraffic) {\n (_c = this._emitter) === null || _c === void 0 ? void 0 : _c.call(this, { name: 'error', error });\n return;\n }\n const sdkType = SDKType_1.SDKType._get(this._sdkKey);\n const statsigMetadata = StatsigMetadata_1.StatsigMetadataProvider.get();\n const info = isError ? unwrapped.stack : _getDescription(unwrapped);\n const body = JSON.stringify(Object.assign({ tag, exception: name, info }, Object.assign(Object.assign({}, statsigMetadata), { sdkType })));\n const func = (_f = (_e = (_d = this._options) === null || _d === void 0 ? void 0 : _d.networkConfig) === null || _e === void 0 ? void 0 : _e.networkOverrideFunc) !== null && _f !== void 0 ? _f : fetch;\n yield func(exports.EXCEPTION_ENDPOINT, {\n method: 'POST',\n headers: {\n 'STATSIG-API-KEY': this._sdkKey,\n 'STATSIG-SDK-TYPE': String(sdkType),\n 'STATSIG-SDK-VERSION': String(statsigMetadata.sdkVersion),\n 'Content-Type': 'application/json',\n },\n body,\n });\n (_g = this._emitter) === null || _g === void 0 ? void 0 : _g.call(this, { name: 'error', error });\n });\n impl()\n .then(() => {\n /* noop */\n })\n .catch(() => {\n /* noop */\n });\n }\n catch (_error) {\n /* noop */\n }\n }\n}\nexports.ErrorBoundary = ErrorBoundary;\nfunction _getDescription(obj) {\n try {\n return JSON.stringify(obj);\n }\n catch (_a) {\n return UNKNOWN_ERROR;\n }\n}\nfunction _getAllInstanceMethodNames(instance) {\n const names = new Set();\n let proto = Object.getPrototypeOf(instance);\n while (proto && proto !== Object.prototype) {\n Object.getOwnPropertyNames(proto)\n .filter((prop) => typeof (proto === null || proto === void 0 ? void 0 : proto[prop]) === 'function')\n .forEach((name) => names.add(name));\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(names);\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Diagnostics = void 0;\nclass Diagnostics {\n static mark() {\n //\n }\n}\nexports.Diagnostics = Diagnostics;\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StatsigSession = exports.SessionID = void 0;\nconst CacheKey_1 = require(\"./CacheKey\");\nconst Log_1 = require(\"./Log\");\nconst StorageProvider_1 = require(\"./StorageProvider\");\nconst UUID_1 = require(\"./UUID\");\nconst MAX_SESSION_IDLE_TIME = 30 * 60 * 1000; // 30 minutes\nconst MAX_SESSION_AGE = 4 * 60 * 60 * 1000; // 4 hours\nconst PROMISE_MAP = {};\nexports.SessionID = {\n get: (sdkKey) => __awaiter(void 0, void 0, void 0, function* () {\n return exports.StatsigSession.get(sdkKey).then((x) => x.data.sessionID);\n }),\n};\nexports.StatsigSession = {\n get: (sdkKey) => __awaiter(void 0, void 0, void 0, function* () {\n if (PROMISE_MAP[sdkKey] == null) {\n PROMISE_MAP[sdkKey] = _loadSession(sdkKey);\n }\n const session = yield PROMISE_MAP[sdkKey];\n return _bumpSession(session);\n }),\n overrideInitialSessionID: (override, sdkKey) => {\n PROMISE_MAP[sdkKey] = _overrideSessionId(override, sdkKey);\n },\n};\nfunction _loadSession(sdkKey) {\n return __awaiter(this, void 0, void 0, function* () {\n let data = yield _loadFromStorage(sdkKey);\n const now = Date.now();\n if (!data) {\n data = {\n sessionID: (0, UUID_1.getUUID)(),\n startTime: now,\n lastUpdate: now,\n };\n }\n return {\n data,\n sdkKey,\n };\n });\n}\nfunction _overrideSessionId(override, sdkKey) {\n const now = Date.now();\n return Promise.resolve({\n data: {\n sessionID: override,\n startTime: now,\n lastUpdate: now,\n },\n sdkKey,\n });\n}\nfunction _bumpSession(session) {\n const now = Date.now();\n const data = session.data;\n if (_isIdle(data) || _hasRunTooLong(data)) {\n data.sessionID = (0, UUID_1.getUUID)();\n data.startTime = now;\n }\n data.lastUpdate = now;\n _persistToStorage(data, session.sdkKey);\n clearTimeout(session.idleTimeoutID);\n clearTimeout(session.ageTimeoutID);\n const lifetime = now - data.startTime;\n const sdkKey = session.sdkKey;\n session.idleTimeoutID = _createSessionTimeout(sdkKey, MAX_SESSION_IDLE_TIME);\n session.ageTimeoutID = _createSessionTimeout(sdkKey, MAX_SESSION_AGE - lifetime);\n return session;\n}\nfunction _createSessionTimeout(sdkKey, duration) {\n return setTimeout(() => {\n const client = __STATSIG__ === null || __STATSIG__ === void 0 ? void 0 : __STATSIG__.instance(sdkKey);\n if (client) {\n client.$emt({ name: 'session_expired' });\n }\n }, duration);\n}\nfunction _isIdle({ lastUpdate }) {\n return Date.now() - lastUpdate > MAX_SESSION_IDLE_TIME;\n}\nfunction _hasRunTooLong({ startTime }) {\n return Date.now() - startTime > MAX_SESSION_AGE;\n}\nfunction _getSessionIDStorageKey(sdkKey) {\n return `statsig.session_id.${(0, CacheKey_1._getStorageKey)(sdkKey)}`;\n}\nfunction _persistToStorage(session, sdkKey) {\n const storageKey = _getSessionIDStorageKey(sdkKey);\n (0, StorageProvider_1._setObjectInStorage)(storageKey, session).catch(() => {\n Log_1.Log.warn('Failed to save SessionID');\n });\n}\nfunction _loadFromStorage(sdkKey) {\n const storageKey = _getSessionIDStorageKey(sdkKey);\n return (0, StorageProvider_1._getObjectFromStorage)(storageKey);\n}\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NetworkCore = void 0;\nrequire(\"./$_StatsigGlobal\");\nconst __StatsigGlobal_1 = require(\"./$_StatsigGlobal\");\nconst Diagnostics_1 = require(\"./Diagnostics\");\nconst Log_1 = require(\"./Log\");\nconst NetworkConfig_1 = require(\"./NetworkConfig\");\nconst SDKType_1 = require(\"./SDKType\");\nconst SafeJs_1 = require(\"./SafeJs\");\nconst SessionID_1 = require(\"./SessionID\");\nconst StableID_1 = require(\"./StableID\");\nconst StatsigMetadata_1 = require(\"./StatsigMetadata\");\nconst VisibilityObserving_1 = require(\"./VisibilityObserving\");\nconst DEFAULT_TIMEOUT_MS = 10000;\nclass NetworkCore {\n constructor(options, _emitter) {\n this._emitter = _emitter;\n this._timeout = DEFAULT_TIMEOUT_MS;\n this._netConfig = {};\n this._options = {};\n if (options) {\n this._options = options;\n }\n if (this._options.networkConfig) {\n this._netConfig = this._options.networkConfig;\n }\n if (this._netConfig.networkTimeoutMs) {\n this._timeout = this._netConfig.networkTimeoutMs;\n }\n }\n post(args) {\n return __awaiter(this, void 0, void 0, function* () {\n let body = yield this._getPopulatedBody(args);\n if (args.isStatsigEncodable) {\n body = this._attemptToEncodeString(args, body);\n }\n return this._sendRequest(Object.assign({ method: 'POST', body }, args));\n });\n }\n get(args) {\n return this._sendRequest(Object.assign({ method: 'GET' }, args));\n }\n isBeaconSupported() {\n return (typeof navigator !== 'undefined' &&\n typeof navigator.sendBeacon === 'function');\n }\n beacon(args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!_ensureValidSdkKey(args)) {\n return false;\n }\n const body = yield this._getPopulatedBody(args);\n const url = yield this._getPopulatedURL(args);\n const nav = navigator;\n return nav.sendBeacon.bind(nav)(url, body);\n });\n }\n _sendRequest(args) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!_ensureValidSdkKey(args)) {\n return null;\n }\n if (this._netConfig.preventAllNetworkTraffic) {\n return null;\n }\n const { method, body, retries } = args;\n const controller = typeof AbortController !== 'undefined' ? new AbortController() : null;\n const handle = setTimeout(() => controller === null || controller === void 0 ? void 0 : controller.abort(`Timeout of ${this._timeout}ms expired.`), this._timeout);\n const url = yield this._getPopulatedURL(args);\n let response = null;\n const keepalive = (0, VisibilityObserving_1._isUnloading)();\n try {\n const config = {\n method,\n body,\n headers: Object.assign({}, args.headers),\n signal: controller === null || controller === void 0 ? void 0 : controller.signal,\n priority: args.priority,\n keepalive,\n };\n const func = (_a = this._netConfig.networkOverrideFunc) !== null && _a !== void 0 ? _a : fetch;\n response = yield func(url, config);\n clearTimeout(handle);\n if (!response.ok) {\n const text = yield response.text().catch(() => 'No Text');\n const err = new Error(`NetworkError: ${url} ${text}`);\n err.name = 'NetworkError';\n throw err;\n }\n const text = yield response.text();\n Diagnostics_1.Diagnostics.mark();\n return {\n body: text,\n code: response.status,\n };\n }\n catch (error) {\n const errorMessage = _getErrorMessage(controller, error);\n Diagnostics_1.Diagnostics.mark();\n if (!retries || retries <= 0) {\n (_b = this._emitter) === null || _b === void 0 ? void 0 : _b.call(this, { name: 'error', error });\n Log_1.Log.error(`A networking error occured during ${method} request to ${url}.`, errorMessage, error);\n return null;\n }\n return this._sendRequest(Object.assign(Object.assign({}, args), { retries: retries - 1 }));\n }\n });\n }\n _getPopulatedURL(args) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = Object.assign({ [NetworkConfig_1.NetworkParam.SdkKey]: args.sdkKey, [NetworkConfig_1.NetworkParam.SdkType]: SDKType_1.SDKType._get(args.sdkKey), [NetworkConfig_1.NetworkParam.SdkVersion]: StatsigMetadata_1.SDK_VERSION, [NetworkConfig_1.NetworkParam.Time]: String(Date.now()), [NetworkConfig_1.NetworkParam.SessionID]: yield SessionID_1.SessionID.get(args.sdkKey) }, args.params);\n const query = Object.keys(params)\n .map((key) => {\n return `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`;\n })\n .join('&');\n return `${args.url}${query ? `?${query}` : ''}`;\n });\n }\n _getPopulatedBody(args) {\n return __awaiter(this, void 0, void 0, function* () {\n const { data, sdkKey } = args;\n const stableID = yield StableID_1.StableID.get(sdkKey);\n const sessionID = yield SessionID_1.SessionID.get(sdkKey);\n const sdkType = SDKType_1.SDKType._get(sdkKey);\n return JSON.stringify(Object.assign(Object.assign({}, data), { statsigMetadata: Object.assign(Object.assign({}, StatsigMetadata_1.StatsigMetadataProvider.get()), { stableID,\n sessionID,\n sdkType }) }));\n });\n }\n _attemptToEncodeString(args, input) {\n var _a, _b;\n const win = (0, SafeJs_1._getWindowSafe)();\n if (!args.isStatsigEncodable ||\n this._options.disableStatsigEncoding ||\n (0, __StatsigGlobal_1._getStatsigGlobalFlag)('no-encode') != null ||\n !(win === null || win === void 0 ? void 0 : win.btoa)) {\n return input;\n }\n try {\n const result = (_a = win.btoa(input).split('').reverse().join('')) !== null && _a !== void 0 ? _a : input;\n args.params = Object.assign(Object.assign({}, ((_b = args.params) !== null && _b !== void 0 ? _b : {})), { [NetworkConfig_1.NetworkParam.StatsigEncoded]: '1' });\n return result;\n }\n catch (_c) {\n Log_1.Log.warn('/initialize request encoding failed');\n return input;\n }\n }\n}\nexports.NetworkCore = NetworkCore;\nconst _ensureValidSdkKey = (args) => {\n if (!args.sdkKey) {\n Log_1.Log.warn('Unable to make request without an SDK key');\n return false;\n }\n return true;\n};\nfunction _getErrorMessage(controller, error) {\n if ((controller === null || controller === void 0 ? void 0 : controller.signal.aborted) &&\n typeof controller.signal.reason === 'string') {\n return controller.signal.reason;\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error instanceof Error) {\n return `${error.name}: ${error.message}`;\n }\n return 'Unknown Error';\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StatsigClientBase = void 0;\nrequire(\"./$_StatsigGlobal\");\nconst __StatsigGlobal_1 = require(\"./$_StatsigGlobal\");\nconst ErrorBoundary_1 = require(\"./ErrorBoundary\");\nconst EventLogger_1 = require(\"./EventLogger\");\nconst Log_1 = require(\"./Log\");\nconst SafeJs_1 = require(\"./SafeJs\");\nconst SessionID_1 = require(\"./SessionID\");\nconst StorageProvider_1 = require(\"./StorageProvider\");\nclass StatsigClientBase {\n constructor(sdkKey, adapter, network, options) {\n var _a, _b;\n this.loadingStatus = 'Uninitialized';\n this._listeners = {};\n const emitter = this.$emt.bind(this);\n (options === null || options === void 0 ? void 0 : options.logLevel) != null && (Log_1.Log.level = options.logLevel);\n (options === null || options === void 0 ? void 0 : options.disableStorage) && StorageProvider_1.Storage._setDisabled(true);\n (options === null || options === void 0 ? void 0 : options.initialSessionID) &&\n SessionID_1.StatsigSession.overrideInitialSessionID(options.initialSessionID, sdkKey);\n this._sdkKey = sdkKey;\n this._options = options !== null && options !== void 0 ? options : {};\n this._overrideAdapter = (_a = options === null || options === void 0 ? void 0 : options.overrideAdapter) !== null && _a !== void 0 ? _a : null;\n this._logger = new EventLogger_1.EventLogger(sdkKey, emitter, network, options);\n this._errorBoundary = new ErrorBoundary_1.ErrorBoundary(sdkKey, options, emitter);\n this._errorBoundary.wrap(this);\n this._errorBoundary.wrap(network);\n this._errorBoundary.wrap(adapter);\n this._errorBoundary.wrap(this._logger);\n if (!(0, SafeJs_1._isServerEnv)()) {\n const statsigGlobal = (0, __StatsigGlobal_1._getStatsigGlobal)();\n const instances = (_b = statsigGlobal.instances) !== null && _b !== void 0 ? _b : {};\n const inst = this;\n if (instances[sdkKey] != null) {\n Log_1.Log.warn('Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys.');\n }\n instances[sdkKey] = inst;\n statsigGlobal.lastInstance = inst;\n statsigGlobal.instances = instances;\n __STATSIG__ = statsigGlobal;\n }\n this.dataAdapter = adapter;\n this.dataAdapter.attach(sdkKey, options);\n this._primeReadyRipcord();\n }\n /**\n * Updates runtime configuration options for the SDK, allowing toggling of certain behaviors such as logging and storage to comply with user preferences or regulations such as GDPR.\n *\n * @param {StatsigRuntimeMutableOptions} options - The configuration options that dictate the runtime behavior of the SDK.\n */\n updateRuntimeOptions(options) {\n if (options.disableLogging != null) {\n this._options.disableLogging = options.disableLogging;\n this._logger.setLoggingDisabled(options.disableLogging);\n }\n if (options.disableStorage != null) {\n this._options.disableStorage = options.disableStorage;\n StorageProvider_1.Storage._setDisabled(options.disableStorage);\n }\n }\n /**\n * Flushes any currently queued events.\n */\n flush() {\n return this._logger.flush();\n }\n /**\n * Gracefully shuts down the SDK, ensuring that all pending events are send before the SDK stops.\n * This function emits a 'pre_shutdown' event and then waits for the logger to complete its shutdown process.\n *\n * @returns {Promise} A promise that resolves when all shutdown procedures, including logging shutdown, have been completed.\n */\n shutdown() {\n return __awaiter(this, void 0, void 0, function* () {\n this.$emt({ name: 'pre_shutdown' });\n yield this._logger.shutdown();\n });\n }\n /**\n * Subscribes a callback function to a specific {@link StatsigClientEvent} or all StatsigClientEvents if the wildcard '*' is used.\n * Once subscribed, the listener callback will be invoked whenever the specified event is emitted.\n *\n * @param {StatsigClientEventName} event - The name of the event to subscribe to, or '*' to subscribe to all events.\n * @param {StatsigClientEventCallback} listener - The callback function to execute when the event occurs. The function receives event-specific data as its parameter.\n * @see {@link off} for unsubscribing from events.\n */\n on(event, listener) {\n if (!this._listeners[event]) {\n this._listeners[event] = [];\n }\n this._listeners[event].push(listener);\n }\n /**\n * Unsubscribes a previously registered callback function from a specific {@link StatsigClientEvent} or all StatsigClientEvents if the wildcard '*' is used.\n *\n * @param {StatsigClientEventName} event - The name of the event from which to unsubscribe, or '*' to unsubscribe from all events.\n * @param {StatsigClientEventCallback} listener - The callback function to remove from the event's notification list.\n * @see {@link on} for subscribing to events.\n */\n off(event, listener) {\n if (this._listeners[event]) {\n const index = this._listeners[event].indexOf(listener);\n if (index !== -1) {\n this._listeners[event].splice(index, 1);\n }\n }\n }\n $on(event, listener) {\n listener.__isInternal = true;\n this.on(event, listener);\n }\n $emt(event) {\n var _a;\n const barrier = (listener) => {\n try {\n listener(event);\n }\n catch (error) {\n if (listener.__isInternal === true) {\n this._errorBoundary.logError(`__emit:${event.name}`, error);\n return;\n }\n Log_1.Log.error(`An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.`, event);\n }\n };\n if (this._listeners[event.name]) {\n this._listeners[event.name].forEach((l) => barrier(l));\n }\n (_a = this._listeners['*']) === null || _a === void 0 ? void 0 : _a.forEach(barrier);\n }\n _setStatus(newStatus, values) {\n this.loadingStatus = newStatus;\n this.$emt({ name: 'values_updated', status: newStatus, values });\n }\n _enqueueExposure(name, exposure, options) {\n if ((options === null || options === void 0 ? void 0 : options.disableExposureLog) === true) {\n this._logger.incrementNonExposureCount(name);\n return;\n }\n this._logger.enqueue(exposure);\n }\n}\nexports.StatsigClientBase = StatsigClientBase;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DataAdapterCachePrefix = void 0;\nexports.DataAdapterCachePrefix = 'statsig.cached';\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._makeTypedGet = exports._mergeOverride = exports._makeLayer = exports._makeExperiment = exports._makeDynamicConfig = exports._makeFeatureGate = void 0;\nconst TypingUtils_1 = require(\"./TypingUtils\");\nconst DEFAULT_RULE = 'default';\nfunction _makeEvaluation(name, details, evaluation, value) {\n var _a;\n return {\n name,\n details,\n ruleID: (_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.rule_id) !== null && _a !== void 0 ? _a : DEFAULT_RULE,\n __evaluation: evaluation,\n value,\n };\n}\nfunction _makeFeatureGate(name, details, evaluation) {\n return _makeEvaluation(name, details, evaluation, (evaluation === null || evaluation === void 0 ? void 0 : evaluation.value) === true);\n}\nexports._makeFeatureGate = _makeFeatureGate;\nfunction _makeDynamicConfig(name, details, evaluation) {\n var _a;\n const value = (_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.value) !== null && _a !== void 0 ? _a : {};\n return Object.assign(Object.assign({}, _makeEvaluation(name, details, evaluation, value)), { get: _makeTypedGet(evaluation === null || evaluation === void 0 ? void 0 : evaluation.value) });\n}\nexports._makeDynamicConfig = _makeDynamicConfig;\nfunction _makeExperiment(name, details, evaluation) {\n var _a;\n const result = _makeDynamicConfig(name, details, evaluation);\n return Object.assign(Object.assign({}, result), { groupName: (_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.group_name) !== null && _a !== void 0 ? _a : null });\n}\nexports._makeExperiment = _makeExperiment;\nfunction _makeLayer(name, details, evaluation, exposeFunc) {\n var _a, _b;\n return Object.assign(Object.assign({}, _makeEvaluation(name, details, evaluation, undefined)), { get: _makeTypedGet(evaluation === null || evaluation === void 0 ? void 0 : evaluation.value, exposeFunc), groupName: (_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.group_name) !== null && _a !== void 0 ? _a : null, __value: (_b = evaluation === null || evaluation === void 0 ? void 0 : evaluation.value) !== null && _b !== void 0 ? _b : {} });\n}\nexports._makeLayer = _makeLayer;\nfunction _mergeOverride(original, overridden, value, exposeFunc) {\n return Object.assign(Object.assign(Object.assign({}, original), overridden), { get: _makeTypedGet(value, exposeFunc) });\n}\nexports._mergeOverride = _mergeOverride;\nfunction _makeTypedGet(value, exposeFunc) {\n return (param, fallback) => {\n var _a;\n const found = (_a = value === null || value === void 0 ? void 0 : value[param]) !== null && _a !== void 0 ? _a : null;\n if (found == null) {\n return (fallback !== null && fallback !== void 0 ? fallback : null);\n }\n if (fallback != null && !(0, TypingUtils_1._isTypeMatch)(found, fallback)) {\n return (fallback !== null && fallback !== void 0 ? fallback : null);\n }\n exposeFunc === null || exposeFunc === void 0 ? void 0 : exposeFunc(param);\n return found;\n };\n}\nexports._makeTypedGet = _makeTypedGet;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n", "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Log = exports.Storage = exports.EventLogger = void 0;\n/** Statsig Global should go first */\nrequire(\"./$_StatsigGlobal\");\nconst EventLogger_1 = require(\"./EventLogger\");\nObject.defineProperty(exports, \"EventLogger\", { enumerable: true, get: function () { return EventLogger_1.EventLogger; } });\nconst Log_1 = require(\"./Log\");\nObject.defineProperty(exports, \"Log\", { enumerable: true, get: function () { return Log_1.Log; } });\nconst StatsigMetadata_1 = require(\"./StatsigMetadata\");\nconst StorageProvider_1 = require(\"./StorageProvider\");\nObject.defineProperty(exports, \"Storage\", { enumerable: true, get: function () { return StorageProvider_1.Storage; } });\n__exportStar(require(\"./$_StatsigGlobal\"), exports);\n__exportStar(require(\"./CacheKey\"), exports);\n__exportStar(require(\"./ClientInterfaces\"), exports);\n__exportStar(require(\"./DataAdapterCore\"), exports);\n__exportStar(require(\"./DownloadConfigSpecsResponse\"), exports);\n__exportStar(require(\"./ErrorBoundary\"), exports);\n__exportStar(require(\"./EvaluationOptions\"), exports);\n__exportStar(require(\"./EvaluationTypes\"), exports);\n__exportStar(require(\"./Hashing\"), exports);\n__exportStar(require(\"./InitializeResponse\"), exports);\n__exportStar(require(\"./Log\"), exports);\n__exportStar(require(\"./NetworkCore\"), exports);\n__exportStar(require(\"./NetworkConfig\"), exports);\n__exportStar(require(\"./OverrideAdapter\"), exports);\n__exportStar(require(\"./ParamStoreTypes\"), exports);\n__exportStar(require(\"./SafeJs\"), exports);\n__exportStar(require(\"./SDKType\"), exports);\n__exportStar(require(\"./SessionID\"), exports);\n__exportStar(require(\"./StableID\"), exports);\n__exportStar(require(\"./StatsigClientBase\"), exports);\n__exportStar(require(\"./StatsigClientEventEmitter\"), exports);\n__exportStar(require(\"./StatsigDataAdapter\"), exports);\n__exportStar(require(\"./StatsigEvent\"), exports);\n__exportStar(require(\"./StatsigMetadata\"), exports);\n__exportStar(require(\"./StatsigOptionsCommon\"), exports);\n__exportStar(require(\"./StatsigTypeFactories\"), exports);\n__exportStar(require(\"./StatsigTypes\"), exports);\n__exportStar(require(\"./StatsigUser\"), exports);\n__exportStar(require(\"./StorageProvider\"), exports);\n__exportStar(require(\"./TypedJsonParse\"), exports);\n__exportStar(require(\"./TypingUtils\"), exports);\n__exportStar(require(\"./UrlOverrides\"), exports);\n__exportStar(require(\"./UUID\"), exports);\n__exportStar(require(\"./VisibilityObserving\"), exports);\n__STATSIG__ = Object.assign(Object.assign({}, (__STATSIG__ !== null && __STATSIG__ !== void 0 ? __STATSIG__ : {})), { Log: Log_1.Log,\n SDK_VERSION: StatsigMetadata_1.SDK_VERSION });\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_core_1 = require(\"@statsig/client-core\");\nclass EvaluationStore {\n constructor() {\n this._rawValues = null;\n this._values = null;\n this._source = 'Uninitialized';\n this._lcut = 0;\n this._receivedAt = 0;\n }\n reset() {\n this._values = null;\n this._rawValues = null;\n this._source = 'Loading';\n this._lcut = 0;\n this._receivedAt = 0;\n }\n finalize() {\n if (this._values) {\n return;\n }\n this._source = 'NoValues';\n }\n getValues() {\n return this._rawValues\n ? (0, client_core_1._typedJsonParse)(this._rawValues, 'has_updates', 'EvaluationStoreValues')\n : null;\n }\n setValues(result) {\n if (!result) {\n return;\n }\n const values = (0, client_core_1._typedJsonParse)(result.data, 'has_updates', 'EvaluationResponse');\n if ((values === null || values === void 0 ? void 0 : values.has_updates) !== true) {\n return;\n }\n this._rawValues = result.data;\n this._lcut = values.time;\n this._receivedAt = result.receivedAt;\n this._source = result.source;\n this._values = values;\n }\n getGate(name) {\n var _a;\n return this._getDetailedStoreResult((_a = this._values) === null || _a === void 0 ? void 0 : _a.feature_gates, name);\n }\n getConfig(name) {\n var _a;\n return this._getDetailedStoreResult((_a = this._values) === null || _a === void 0 ? void 0 : _a.dynamic_configs, name);\n }\n getLayer(name) {\n var _a;\n return this._getDetailedStoreResult((_a = this._values) === null || _a === void 0 ? void 0 : _a.layer_configs, name);\n }\n getParamStore(name) {\n var _a;\n return this._getDetailedStoreResult((_a = this._values) === null || _a === void 0 ? void 0 : _a.param_stores, name);\n }\n _getDetailedStoreResult(lookup, name) {\n let result = null;\n if (lookup) {\n result = lookup[name] ? lookup[name] : lookup[(0, client_core_1._DJB2)(name)];\n }\n return {\n result,\n details: this._getDetails(result == null),\n };\n }\n _getDetails(isUnrecognized) {\n if (this._source === 'Uninitialized' || this._source === 'NoValues') {\n return { reason: this._source };\n }\n const subreason = isUnrecognized ? 'Unrecognized' : 'Recognized';\n const reason = `${this._source}:${subreason}`;\n return {\n reason,\n lcut: this._lcut,\n receivedAt: this._receivedAt,\n };\n }\n}\nexports.default = EvaluationStore;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._resolveDeltasResponse = void 0;\nconst client_core_1 = require(\"@statsig/client-core\");\nconst MAX_DELTAS_SORT_DEPTH = 2;\nfunction _resolveDeltasResponse(cache, deltasString) {\n const deltas = (0, client_core_1._typedJsonParse)(deltasString, 'checksum', 'DeltasEvaluationResponse');\n if (!deltas) {\n return {\n hadBadDeltaChecksum: true,\n };\n }\n const merged = _mergeDeltasIntoCache(cache, deltas);\n const resolved = _handleDeletedEntries(merged);\n const actualChecksum = (0, client_core_1._DJB2Object)({\n feature_gates: resolved.feature_gates,\n dynamic_configs: resolved.dynamic_configs,\n layer_configs: resolved.layer_configs,\n }, MAX_DELTAS_SORT_DEPTH);\n const isMatch = actualChecksum === deltas.checksumV2;\n if (!isMatch) {\n return {\n hadBadDeltaChecksum: true,\n badChecksum: actualChecksum,\n badMergedConfigs: resolved,\n badFullResponse: deltas.deltas_full_response,\n };\n }\n return JSON.stringify(resolved);\n}\nexports._resolveDeltasResponse = _resolveDeltasResponse;\nfunction _mergeDeltasIntoCache(cache, deltas) {\n return Object.assign(Object.assign(Object.assign({}, cache), deltas), { feature_gates: Object.assign(Object.assign({}, cache.feature_gates), deltas.feature_gates), layer_configs: Object.assign(Object.assign({}, cache.layer_configs), deltas.layer_configs), dynamic_configs: Object.assign(Object.assign({}, cache.dynamic_configs), deltas.dynamic_configs) });\n}\nfunction _handleDeletedEntries(deltas) {\n const result = deltas;\n _deleteEntriesInRecord(deltas.deleted_gates, result.feature_gates);\n delete result.deleted_gates;\n _deleteEntriesInRecord(deltas.deleted_configs, result.dynamic_configs);\n delete result.deleted_configs;\n _deleteEntriesInRecord(deltas.deleted_layers, result.layer_configs);\n delete result.deleted_layers;\n return result;\n}\nfunction _deleteEntriesInRecord(keys, values) {\n keys === null || keys === void 0 ? void 0 : keys.forEach((key) => {\n delete values[key];\n });\n}\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_core_1 = require(\"@statsig/client-core\");\nconst EvaluationResponseDeltas_1 = require(\"./EvaluationResponseDeltas\");\nclass StatsigNetwork extends client_core_1.NetworkCore {\n constructor(options, emitter) {\n super(options, emitter);\n const config = options === null || options === void 0 ? void 0 : options.networkConfig;\n this._initializeUrl = (0, client_core_1._getOverridableUrl)(config === null || config === void 0 ? void 0 : config.initializeUrl, config === null || config === void 0 ? void 0 : config.api, '/initialize', client_core_1.NetworkDefault.initializeApi);\n }\n fetchEvaluations(sdkKey, current, priority, user) {\n return __awaiter(this, void 0, void 0, function* () {\n const cache = current\n ? (0, client_core_1._typedJsonParse)(current, 'has_updates', 'InitializeResponse')\n : null;\n let data = {\n user,\n hash: 'djb2',\n deltasResponseRequested: false,\n };\n if (cache === null || cache === void 0 ? void 0 : cache.has_updates) {\n data = Object.assign(Object.assign({}, data), { sinceTime: cache.time, previousDerivedFields: 'derived_fields' in cache ? cache.derived_fields : {}, deltasResponseRequested: true });\n }\n return this._fetchEvaluations(sdkKey, cache, data, priority);\n });\n }\n _fetchEvaluations(sdkKey, cache, data, priority) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield this.post({\n sdkKey,\n url: this._initializeUrl,\n data,\n retries: 2,\n isStatsigEncodable: true,\n priority,\n });\n if ((response === null || response === void 0 ? void 0 : response.code) === 204) {\n return '{\"has_updates\": false}';\n }\n if ((response === null || response === void 0 ? void 0 : response.code) !== 200) {\n return (_a = response === null || response === void 0 ? void 0 : response.body) !== null && _a !== void 0 ? _a : null;\n }\n if ((cache === null || cache === void 0 ? void 0 : cache.has_updates) !== true ||\n ((_b = response.body) === null || _b === void 0 ? void 0 : _b.includes('\"is_delta\":true')) !== true ||\n data.deltasResponseRequested !== true) {\n return response.body;\n }\n const result = (0, EvaluationResponseDeltas_1._resolveDeltasResponse)(cache, response.body);\n if (typeof result === 'string') {\n return result;\n }\n // retry without deltas\n return this._fetchEvaluations(sdkKey, cache, Object.assign(Object.assign(Object.assign({}, data), result), { deltasResponseRequested: false }), priority);\n });\n }\n}\nexports.default = StatsigNetwork;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._makeParamStoreGetter = void 0;\nconst client_core_1 = require(\"@statsig/client-core\");\nconst NO_EXPOSURE_OPT = {\n disableExposureLog: true,\n};\nfunction _shouldLogExposure(options) {\n return options == null || options.disableExposureLog === false;\n}\nfunction _shouldReturnFallback(value, fallback) {\n return fallback != null && !(0, client_core_1._isTypeMatch)(value, fallback);\n}\nfunction _getMappedStaticValue(param, _options) {\n return param.value;\n}\nfunction _getMappedGateValue(client, param, options) {\n const gate = client.getFeatureGate(param.gate_name, _shouldLogExposure(options) ? undefined : NO_EXPOSURE_OPT);\n if (gate.value) {\n return param.pass_value;\n }\n return param.fail_value;\n}\nfunction _getMappedDynamicConfigValue(client, param, fallback, options) {\n const config = client.getDynamicConfig(param.config_name, NO_EXPOSURE_OPT);\n const value = config.get(param.param_name);\n if (_shouldReturnFallback(value, fallback)) {\n return fallback;\n }\n if (_shouldLogExposure(options)) {\n client.getDynamicConfig(param.config_name);\n }\n return value;\n}\nfunction _getMappedExperimentValue(client, param, fallback, options) {\n const experiment = client.getExperiment(param.experiment_name, NO_EXPOSURE_OPT);\n const value = experiment.get(param.param_name);\n if (_shouldReturnFallback(value, fallback)) {\n return fallback;\n }\n if (_shouldLogExposure(options)) {\n client.getExperiment(param.experiment_name);\n }\n return value;\n}\nfunction _getMappedLayerValue(client, param, fallback, options) {\n const layer = client.getLayer(param.layer_name, NO_EXPOSURE_OPT);\n const value = layer.get(param.param_name);\n if (_shouldReturnFallback(value, fallback)) {\n return fallback;\n }\n if (_shouldLogExposure(options)) {\n client.getLayer(param.layer_name).get(param.param_name);\n }\n return value;\n}\nfunction _makeParamStoreGetter(client, config, options) {\n return (paramName, fallback) => {\n if (config == null) {\n return fallback;\n }\n const param = config[paramName];\n if (param == null ||\n (fallback != null && (0, client_core_1._typeOf)(fallback) !== param.param_type)) {\n return fallback;\n }\n switch (param.ref_type) {\n case 'static':\n return _getMappedStaticValue(param, options);\n case 'gate':\n return _getMappedGateValue(client, param, options);\n case 'dynamic_config':\n return _getMappedDynamicConfigValue(client, param, fallback, options);\n case 'experiment':\n return _getMappedExperimentValue(client, param, fallback, options);\n case 'layer':\n return _getMappedLayerValue(client, param, fallback, options);\n default:\n return fallback;\n }\n };\n}\nexports._makeParamStoreGetter = _makeParamStoreGetter;\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StatsigEvaluationsDataAdapter = void 0;\nconst client_core_1 = require(\"@statsig/client-core\");\nconst Network_1 = require(\"./Network\");\nclass StatsigEvaluationsDataAdapter extends client_core_1.DataAdapterCore {\n constructor() {\n super('EvaluationsDataAdapter', 'evaluations');\n this._network = null;\n this._options = null;\n }\n attach(sdkKey, options) {\n super.attach(sdkKey, options);\n this._network = new Network_1.default(options !== null && options !== void 0 ? options : {});\n }\n getDataAsync(current, user, options) {\n return this._getDataAsyncImpl(current, user, options);\n }\n prefetchData(user, options) {\n return this._prefetchDataImpl(user, options);\n }\n setData(data) {\n const values = (0, client_core_1._typedJsonParse)(data, 'has_updates', 'data');\n if (values && 'user' in values) {\n super.setData(data, values.user);\n }\n else {\n client_core_1.Log.error('StatsigUser not found');\n }\n }\n setDataLegacy(data, user) {\n super.setData(data, user);\n }\n _fetchFromNetwork(current, user, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield ((_a = this._network) === null || _a === void 0 ? void 0 : _a.fetchEvaluations(this._getSdkKey(), current, options === null || options === void 0 ? void 0 : options.priority, user));\n return result !== null && result !== void 0 ? result : null;\n });\n }\n _getCacheKey(user) {\n var _a;\n const key = (0, client_core_1._getStorageKey)(this._getSdkKey(), user, (_a = this._options) === null || _a === void 0 ? void 0 : _a.customUserCacheKeyFunc);\n return `${client_core_1.DataAdapterCachePrefix}.${this._cacheSuffix}.${key}`;\n }\n _isCachedResultValidFor204(result, user) {\n return (result.fullUserHash != null &&\n result.fullUserHash === (0, client_core_1._getFullUserHash)(user));\n }\n}\nexports.StatsigEvaluationsDataAdapter = StatsigEvaluationsDataAdapter;\n", "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_core_1 = require(\"@statsig/client-core\");\nconst EvaluationStore_1 = require(\"./EvaluationStore\");\nconst Network_1 = require(\"./Network\");\nconst ParamStoreGetterFactory_1 = require(\"./ParamStoreGetterFactory\");\nconst StatsigEvaluationsDataAdapter_1 = require(\"./StatsigEvaluationsDataAdapter\");\nclass StatsigClient extends client_core_1.StatsigClientBase {\n /**\n * Retrieves an instance of the StatsigClient based on the provided SDK key.\n * If no SDK key is provided, the method returns the most recently created instance of the StatsigClient.\n * The method ensures that each unique SDK key corresponds to a single instance of StatsigClient, effectively implementing a singleton pattern for each key.\n *\n * @param {string} [sdkKey] - Optional. The SDK key used to identify a specific instance of the StatsigClient. If omitted, the method returns the last created instance.\n * @returns {StatsigClient|undefined} Returns the StatsigClient instance associated with the given SDK key, or undefined if no instance is associated with the key or if no key is provided and no instances exist.\n */\n static instance(sdkKey) {\n const instance = (0, client_core_1._getStatsigGlobal)().instance(sdkKey);\n if (instance instanceof StatsigClient) {\n return instance;\n }\n client_core_1.Log.warn((0, client_core_1._isServerEnv)()\n ? 'StatsigClient.instance is not supported in server environments'\n : 'Unable to find StatsigClient instance');\n return new StatsigClient(sdkKey !== null && sdkKey !== void 0 ? sdkKey : '', {});\n }\n /**\n * StatsigClient constructor\n *\n * @param {string} sdkKey A Statsig client SDK key. eg \"client-xyz123...\"\n * @param {StatsigUser} user StatsigUser object containing various attributes related to a user.\n * @param {StatsigOptions | null} options StatsigOptions, used to customize the behavior of the SDK.\n */\n constructor(sdkKey, user, options = null) {\n var _a;\n client_core_1.SDKType._setClientType(sdkKey, 'javascript-client');\n const network = new Network_1.default(options, (e) => {\n this.$emt(e);\n });\n super(sdkKey, (_a = options === null || options === void 0 ? void 0 : options.dataAdapter) !== null && _a !== void 0 ? _a : new StatsigEvaluationsDataAdapter_1.StatsigEvaluationsDataAdapter(), network, options);\n this._store = new EvaluationStore_1.default();\n this._user = user;\n }\n /**\n * Initializes the StatsigClient using cached values. This method sets up the client synchronously by utilizing previously cached values.\n * After initialization, cache values are updated in the background for future use, either in subsequent sessions or when `updateUser` is called.\n * This is useful for quickly starting with the last-known-good configurations while refreshing data to keep settings up-to-date.\n *\n * @see {@link initializeAsync} for the asynchronous version of this method.\n */\n initializeSync() {\n this.updateUserSync(this._user);\n }\n /**\n * Initializes the StatsigClient asynchronously by first using cached values and then updating to the latest values from the network.\n * Once the network values are fetched, they replace the existing cached values. If this method's promise is not awaited,\n * there might be a transition from cached to network values during the session, which can affect consistency.\n * This method is useful when it's acceptable to begin with potentially stale data and switch to the latest configuration as it becomes available.\n *\n * @param {AsyncOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {Promise} A promise that resolves once the client is fully initialized with the latest values from the network or a timeout (if set) is hit.\n * @see {@link initializeSync} for the synchronous version of this method.\n */\n initializeAsync(options) {\n return this.updateUserAsync(this._user, options);\n }\n /**\n * Synchronously updates the user in the Statsig client and switches the internal state to use cached values for the newly specified user.\n * After the initial switch to cached values, this method updates these values in the background, preparing them for future sessions or subsequent calls to updateUser.\n * This method ensures the client is quickly ready with available data.\n *\n * @param {StatsigUser} user - The new StatsigUser for which the client should update its internal state.\n * @see {@link updateUserAsync} for the asynchronous version of this method.\n */\n updateUserSync(user) {\n this._resetForUser(user);\n const result = this.dataAdapter.getDataSync(this._user);\n this._store.setValues(result);\n this._finalizeUpdate(result);\n this._runPostUpdate(result !== null && result !== void 0 ? result : null, this._user);\n }\n /**\n * Asynchronously updates the user in the Statsig client by initially using cached values and then fetching the latest values from the network.\n * When the latest values are fetched, they replace the cached values. If the promise returned by this method is not awaited,\n * the client's state may shift from cached to updated network values during the session, potentially affecting consistency.\n * This method is best used in scenarios where up-to-date configuration is critical and initial delays are acceptable.\n *\n * @param {StatsigUser} user - The new StatsigUser for which the client should update its internal state.\n * @param {AsyncOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {Promise} A promise that resolves once the client is fully updated with the latest values from the network or a timeout (if set) is hit.\n * @see {@link updateUserSync} for the synchronous version of this method.\n */\n updateUserAsync(user, options) {\n return __awaiter(this, void 0, void 0, function* () {\n this._resetForUser(user);\n const initiator = this._user;\n let result = this.dataAdapter.getDataSync(initiator);\n this._setStatus('Loading', result);\n this._store.setValues(result);\n result = yield this.dataAdapter.getDataAsync(result, initiator, options);\n // ensure the user hasn't changed while we were waiting\n if (initiator !== this._user) {\n return;\n }\n this._store.setValues(result);\n this._finalizeUpdate(result);\n });\n }\n /**\n * Retrieves a synchronous context containing data currently being used by the SDK. Represented as a {@link PrecomputedEvaluationsContext} object.\n *\n * @returns {PrecomputedEvaluationsContext} The current synchronous context for the this StatsigClient instance.\n * @see {@link getAsyncContext} for the asynchronous version of the context that includes more information.\n */\n getContext() {\n return {\n sdkKey: this._sdkKey,\n options: this._options,\n values: this._store.getValues(),\n user: JSON.parse(JSON.stringify(this._user)),\n errorBoundary: this._errorBoundary,\n };\n }\n /**\n * Asynchronously retrieves a context similar to that provided by {@link getContext}, but with additional properties fetched asynchronously, such as session and stable IDs. This is useful for situations where these IDs are required and are not immediately available.\n *\n * @returns {PrecomputedEvaluationsAsyncContext} An object containing the current values.\n * @see {@link getContext} for the synchronous version of the context that this function extends.\n */\n getAsyncContext() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, this.getContext()), { session: yield client_core_1.StatsigSession.get(this._sdkKey), stableID: yield client_core_1.StableID.get(this._sdkKey) });\n });\n }\n /**\n * Retrieves the value of a feature gate for the current user, represented as a simple boolean.\n *\n * @param {string} name - The name of the feature gate to retrieve.\n * @param {FeatureGateEvaluationOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {boolean} - The boolean value representing the gate's current evaluation results for the user.\n */\n checkGate(name, options) {\n return this.getFeatureGate(name, options).value;\n }\n /**\n * Retrieves the value of a feature gate for the current user, represented as a {@link FeatureGate} object.\n *\n * @param {string} name - The name of the feature gate to retrieve.\n * @param {FeatureGateEvaluationOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {FeatureGate} - The {@link FeatureGate} object representing the gate's current evaluation results for the user.\n */\n getFeatureGate(name, options) {\n var _a, _b;\n const { result: evaluation, details } = this._store.getGate(name);\n const gate = (0, client_core_1._makeFeatureGate)(name, details, evaluation);\n const overridden = (_b = (_a = this._overrideAdapter) === null || _a === void 0 ? void 0 : _a.getGateOverride) === null || _b === void 0 ? void 0 : _b.call(_a, gate, this._user, options);\n const result = overridden !== null && overridden !== void 0 ? overridden : gate;\n this._enqueueExposure(name, (0, client_core_1._createGateExposure)(this._user, result), options);\n this.$emt({ name: 'gate_evaluation', gate: result });\n return result;\n }\n /**\n * Retrieves the value of a dynamic config for the current user.\n *\n * @param {string} name The name of the dynamic config to get.\n * @param {DynamicConfigEvaluationOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {DynamicConfig} - The {@link DynamicConfig} object representing the dynamic configs's current evaluation results for the user.\n */\n getDynamicConfig(name, options) {\n var _a, _b;\n const { result: evaluation, details } = this._store.getConfig(name);\n const config = (0, client_core_1._makeDynamicConfig)(name, details, evaluation);\n const overridden = (_b = (_a = this._overrideAdapter) === null || _a === void 0 ? void 0 : _a.getDynamicConfigOverride) === null || _b === void 0 ? void 0 : _b.call(_a, config, this._user, options);\n const result = overridden !== null && overridden !== void 0 ? overridden : config;\n this._enqueueExposure(name, (0, client_core_1._createConfigExposure)(this._user, result), options);\n this.$emt({ name: 'dynamic_config_evaluation', dynamicConfig: result });\n return result;\n }\n /**\n * Retrieves the value of a experiment for the current user.\n *\n * @param {string} name The name of the experiment to get.\n * @param {ExperimentEvaluationOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {Experiment} - The {@link Experiment} object representing the experiments's current evaluation results for the user.\n */\n getExperiment(name, options) {\n var _a, _b;\n const { result: evaluation, details } = this._store.getConfig(name);\n const experiment = (0, client_core_1._makeExperiment)(name, details, evaluation);\n const overridden = (_b = (_a = this._overrideAdapter) === null || _a === void 0 ? void 0 : _a.getExperimentOverride) === null || _b === void 0 ? void 0 : _b.call(_a, experiment, this._user, options);\n const result = overridden !== null && overridden !== void 0 ? overridden : experiment;\n this._enqueueExposure(name, (0, client_core_1._createConfigExposure)(this._user, result), options);\n this.$emt({ name: 'experiment_evaluation', experiment: result });\n return result;\n }\n /**\n * Retrieves the value of a layer for the current user.\n *\n * @param {string} name The name of the layer to get.\n * @param {LayerEvaluationOptions} [options] - Optional. Additional options to customize the method call.\n * @returns {Layer} - The {@link Layer} object representing the layers's current evaluation results for the user.\n */\n getLayer(name, options) {\n var _a, _b, _c;\n const { result: evaluation, details } = this._store.getLayer(name);\n const layer = (0, client_core_1._makeLayer)(name, details, evaluation);\n const overridden = (_b = (_a = this._overrideAdapter) === null || _a === void 0 ? void 0 : _a.getLayerOverride) === null || _b === void 0 ? void 0 : _b.call(_a, layer, this._user, options);\n const result = (0, client_core_1._mergeOverride)(layer, overridden, (_c = overridden === null || overridden === void 0 ? void 0 : overridden.__value) !== null && _c !== void 0 ? _c : layer.__value, (param) => {\n this._enqueueExposure(name, (0, client_core_1._createLayerParameterExposure)(this._user, result, param), options);\n });\n this.$emt({ name: 'layer_evaluation', layer: result });\n return result;\n }\n getParameterStore(name, options) {\n const { result: configuration, details } = this._store.getParamStore(name);\n this._logger.incrementNonExposureCount(name);\n return {\n name,\n details,\n __configuration: configuration,\n get: (0, ParamStoreGetterFactory_1._makeParamStoreGetter)(this, configuration, options),\n };\n }\n /**\n * Logs an event to the internal logging system. This function allows logging by either passing a fully formed event object or by specifying the event name with optional value and metadata.\n *\n * @param {StatsigEvent|string} eventOrName - The event object conforming to the StatsigEvent interface, or the name of the event as a string.\n * @param {string|number} value - Optional. The value associated with the event, which can be a string or a number. This parameter is ignored if the first parameter is a StatsigEvent object.\n * @param {Record} metadata - Optional. A key-value record containing metadata about the event. This is also ignored if the first parameter is an event object.\n */\n logEvent(eventOrName, value, metadata) {\n const event = typeof eventOrName === 'string'\n ? {\n eventName: eventOrName,\n value,\n metadata,\n }\n : eventOrName;\n this._logger.enqueue(Object.assign(Object.assign({}, event), { user: this._user, time: Date.now() }));\n }\n _primeReadyRipcord() {\n this.$on('error', () => {\n this.loadingStatus === 'Loading' && this._finalizeUpdate(null);\n });\n }\n _finalizeUpdate(values) {\n this._store.finalize();\n this._setStatus('Ready', values);\n }\n _runPostUpdate(current, user) {\n this.dataAdapter\n .getDataAsync(current, user, { priority: 'low' })\n .catch((err) => {\n client_core_1.Log.error('An error occurred after update.', err);\n });\n }\n _resetForUser(user) {\n var _a;\n this._logger.reset();\n this._store.reset();\n this._user = (0, client_core_1._normalizeUser)(user, this._options.environment);\n const stableIdOverride = (_a = this._user.customIDs) === null || _a === void 0 ? void 0 : _a.stableID;\n if (stableIdOverride) {\n client_core_1.StableID.setOverride(stableIdOverride, this._sdkKey);\n }\n }\n}\nexports.default = StatsigClient;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StatsigClient = void 0;\nconst StatsigClient_1 = require(\"./StatsigClient\");\nexports.StatsigClient = StatsigClient_1.default;\n__STATSIG__ = Object.assign(Object.assign({}, (__STATSIG__ !== null && __STATSIG__ !== void 0 ? __STATSIG__ : {})), { StatsigClient: StatsigClient_1.default });\nexports.default = __STATSIG__;\n", "var NodeType;\r\n(function (NodeType) {\r\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\r\n return n.nodeType === n.ELEMENT_NODE;\r\n}\r\nfunction isShadowRoot(n) {\r\n const host = n === null || n === void 0 ? void 0 : n.host;\r\n return Boolean((host === null || host === void 0 ? void 0 : host.shadowRoot) === n);\r\n}\r\nfunction isNativeShadowDom(shadowRoot) {\r\n return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\r\n}\r\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\r\n if (cssText.includes(' background-clip: text;') &&\r\n !cssText.includes(' -webkit-background-clip: text;')) {\r\n cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\r\n }\r\n return cssText;\r\n}\r\nfunction escapeImportStatement(rule) {\r\n const { cssText } = rule;\r\n if (cssText.split('\"').length < 3)\r\n return cssText;\r\n const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\r\n if (rule.layerName === '') {\r\n statement.push(`layer`);\r\n }\r\n else if (rule.layerName) {\r\n statement.push(`layer(${rule.layerName})`);\r\n }\r\n if (rule.supportsText) {\r\n statement.push(`supports(${rule.supportsText})`);\r\n }\r\n if (rule.media.length) {\r\n statement.push(rule.media.mediaText);\r\n }\r\n return statement.join(' ') + ';';\r\n}\r\nfunction stringifyStylesheet(s) {\r\n try {\r\n const rules = s.rules || s.cssRules;\r\n return rules\r\n ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\r\n : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n}\r\nfunction stringifyRule(rule) {\r\n let importStringified;\r\n if (isCSSImportRule(rule)) {\r\n try {\r\n importStringified =\r\n stringifyStylesheet(rule.styleSheet) ||\r\n escapeImportStatement(rule);\r\n }\r\n catch (error) {\r\n }\r\n }\r\n else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\r\n return fixSafariColons(rule.cssText);\r\n }\r\n return importStringified || rule.cssText;\r\n}\r\nfunction fixSafariColons(cssStringified) {\r\n const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\r\n return cssStringified.replace(regex, '$1\\\\$2');\r\n}\r\nfunction isCSSImportRule(rule) {\r\n return 'styleSheet' in rule;\r\n}\r\nfunction isCSSStyleRule(rule) {\r\n return 'selectorText' in rule;\r\n}\r\nclass Mirror {\r\n constructor() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n getId(n) {\r\n var _a;\r\n if (!n)\r\n return -1;\r\n const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\r\n return id !== null && id !== void 0 ? id : -1;\r\n }\r\n getNode(id) {\r\n return this.idNodeMap.get(id) || null;\r\n }\r\n getIds() {\r\n return Array.from(this.idNodeMap.keys());\r\n }\r\n getMeta(n) {\r\n return this.nodeMetaMap.get(n) || null;\r\n }\r\n removeNodeFromMap(n) {\r\n const id = this.getId(n);\r\n this.idNodeMap.delete(id);\r\n if (n.childNodes) {\r\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n }\r\n }\r\n has(id) {\r\n return this.idNodeMap.has(id);\r\n }\r\n hasNode(node) {\r\n return this.nodeMetaMap.has(node);\r\n }\r\n add(n, meta) {\r\n const id = meta.id;\r\n this.idNodeMap.set(id, n);\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n replace(id, n) {\r\n const oldNode = this.getNode(id);\r\n if (oldNode) {\r\n const meta = this.nodeMetaMap.get(oldNode);\r\n if (meta)\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n this.idNodeMap.set(id, n);\r\n }\r\n reset() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n}\r\nfunction createMirror() {\r\n return new Mirror();\r\n}\r\nfunction maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }) {\r\n let text = value || '';\r\n const actualType = type && toLowerCase(type);\r\n if (maskInputOptions[tagName.toLowerCase()] ||\r\n (actualType && maskInputOptions[actualType])) {\r\n if (maskInputFn) {\r\n text = maskInputFn(text, element);\r\n }\r\n else {\r\n text = '*'.repeat(text.length);\r\n }\r\n }\r\n return text;\r\n}\r\nfunction toLowerCase(str) {\r\n return str.toLowerCase();\r\n}\r\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nfunction is2DCanvasBlank(canvas) {\r\n const ctx = canvas.getContext('2d');\r\n if (!ctx)\r\n return true;\r\n const chunkSize = 50;\r\n for (let x = 0; x < canvas.width; x += chunkSize) {\r\n for (let y = 0; y < canvas.height; y += chunkSize) {\r\n const getImageData = ctx.getImageData;\r\n const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\r\n ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\r\n : getImageData;\r\n const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\r\n if (pixelBuffer.some((pixel) => pixel !== 0))\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction isNodeMetaEqual(a, b) {\r\n if (!a || !b || a.type !== b.type)\r\n return false;\r\n if (a.type === NodeType.Document)\r\n return a.compatMode === b.compatMode;\r\n else if (a.type === NodeType.DocumentType)\r\n return (a.name === b.name &&\r\n a.publicId === b.publicId &&\r\n a.systemId === b.systemId);\r\n else if (a.type === NodeType.Comment ||\r\n a.type === NodeType.Text ||\r\n a.type === NodeType.CDATA)\r\n return a.textContent === b.textContent;\r\n else if (a.type === NodeType.Element)\r\n return (a.tagName === b.tagName &&\r\n JSON.stringify(a.attributes) ===\r\n JSON.stringify(b.attributes) &&\r\n a.isSVG === b.isSVG &&\r\n a.needBlock === b.needBlock);\r\n return false;\r\n}\r\nfunction getInputType(element) {\r\n const type = element.type;\r\n return element.hasAttribute('data-rr-is-password')\r\n ? 'password'\r\n : type\r\n ?\r\n toLowerCase(type)\r\n : null;\r\n}\r\nfunction extractFileExtension(path, baseURL) {\r\n var _a;\r\n let url;\r\n try {\r\n url = new URL(path, baseURL !== null && baseURL !== void 0 ? baseURL : window.location.href);\r\n }\r\n catch (err) {\r\n return null;\r\n }\r\n const regex = /\\.([0-9a-z]+)(?:$)/i;\r\n const match = url.pathname.match(regex);\r\n return (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;\r\n}\n\nlet _id = 1;\r\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\r\nconst IGNORED_NODE = -2;\r\nfunction genId() {\r\n return _id++;\r\n}\r\nfunction getValidTagName(element) {\r\n if (element instanceof HTMLFormElement) {\r\n return 'form';\r\n }\r\n const processedTagName = toLowerCase(element.tagName);\r\n if (tagNameRegex.test(processedTagName)) {\r\n return 'div';\r\n }\r\n return processedTagName;\r\n}\r\nfunction extractOrigin(url) {\r\n let origin = '';\r\n if (url.indexOf('//') > -1) {\r\n origin = url.split('/').slice(0, 3).join('/');\r\n }\r\n else {\r\n origin = url.split('/')[0];\r\n }\r\n origin = origin.split('?')[0];\r\n return origin;\r\n}\r\nlet canvasService;\r\nlet canvasCtx;\r\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\r\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\r\nconst URL_WWW_MATCH = /^www\\..*/i;\r\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\r\nfunction absoluteToStylesheet(cssText, href) {\r\n return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\r\n const filePath = path1 || path2 || path3;\r\n const maybeQuote = quote1 || quote2 || '';\r\n if (!filePath) {\r\n return origin;\r\n }\r\n if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (DATA_URI.test(filePath)) {\r\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\r\n }\r\n if (filePath[0] === '/') {\r\n return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\r\n }\r\n const stack = href.split('/');\r\n const parts = filePath.split('/');\r\n stack.pop();\r\n for (const part of parts) {\r\n if (part === '.') {\r\n continue;\r\n }\r\n else if (part === '..') {\r\n stack.pop();\r\n }\r\n else {\r\n stack.push(part);\r\n }\r\n }\r\n return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\r\n });\r\n}\r\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\r\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\r\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\r\n if (attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n let pos = 0;\r\n function collectCharacters(regEx) {\r\n let chars;\r\n const match = regEx.exec(attributeValue.substring(pos));\r\n if (match) {\r\n chars = match[0];\r\n pos += chars.length;\r\n return chars;\r\n }\r\n return '';\r\n }\r\n const output = [];\r\n while (true) {\r\n collectCharacters(SRCSET_COMMAS_OR_SPACES);\r\n if (pos >= attributeValue.length) {\r\n break;\r\n }\r\n let url = collectCharacters(SRCSET_NOT_SPACES);\r\n if (url.slice(-1) === ',') {\r\n url = absoluteToDoc(doc, url.substring(0, url.length - 1));\r\n output.push(url);\r\n }\r\n else {\r\n let descriptorsStr = '';\r\n url = absoluteToDoc(doc, url);\r\n let inParens = false;\r\n while (true) {\r\n const c = attributeValue.charAt(pos);\r\n if (c === '') {\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (!inParens) {\r\n if (c === ',') {\r\n pos += 1;\r\n output.push((url + descriptorsStr).trim());\r\n break;\r\n }\r\n else if (c === '(') {\r\n inParens = true;\r\n }\r\n }\r\n else {\r\n if (c === ')') {\r\n inParens = false;\r\n }\r\n }\r\n descriptorsStr += c;\r\n pos += 1;\r\n }\r\n }\r\n }\r\n return output.join(', ');\r\n}\r\nfunction absoluteToDoc(doc, attributeValue) {\r\n if (!attributeValue || attributeValue.trim() === '') {\r\n return attributeValue;\r\n }\r\n const a = doc.createElement('a');\r\n a.href = attributeValue;\r\n return a.href;\r\n}\r\nfunction isSVGElement(el) {\r\n return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\r\n}\r\nfunction getHref() {\r\n const a = document.createElement('a');\r\n a.href = '';\r\n return a.href;\r\n}\r\nfunction transformAttribute(doc, tagName, name, value) {\r\n if (!value) {\r\n return value;\r\n }\r\n if (name === 'src' ||\r\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'xlink:href' && value[0] !== '#') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'background' &&\r\n (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\r\n return absoluteToDoc(doc, value);\r\n }\r\n else if (name === 'srcset') {\r\n return getAbsoluteSrcsetString(doc, value);\r\n }\r\n else if (name === 'style') {\r\n return absoluteToStylesheet(value, getHref());\r\n }\r\n else if (tagName === 'object' && name === 'data') {\r\n return absoluteToDoc(doc, value);\r\n }\r\n return value;\r\n}\r\nfunction ignoreAttribute(tagName, name, _value) {\r\n return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\r\n}\r\nfunction _isBlockedElement(element, blockClass, blockSelector) {\r\n try {\r\n if (typeof blockClass === 'string') {\r\n if (element.classList.contains(blockClass)) {\r\n return true;\r\n }\r\n }\r\n else {\r\n for (let eIndex = element.classList.length; eIndex--;) {\r\n const className = element.classList[eIndex];\r\n if (blockClass.test(className)) {\r\n return true;\r\n }\r\n }\r\n }\r\n if (blockSelector) {\r\n return element.matches(blockSelector);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n return false;\r\n}\r\nfunction classMatchesRegex(node, regex, checkAncestors) {\r\n if (!node)\r\n return false;\r\n if (node.nodeType !== node.ELEMENT_NODE) {\r\n if (!checkAncestors)\r\n return false;\r\n return classMatchesRegex(node.parentNode, regex, checkAncestors);\r\n }\r\n for (let eIndex = node.classList.length; eIndex--;) {\r\n const className = node.classList[eIndex];\r\n if (regex.test(className)) {\r\n return true;\r\n }\r\n }\r\n if (!checkAncestors)\r\n return false;\r\n return classMatchesRegex(node.parentNode, regex, checkAncestors);\r\n}\r\nfunction needMaskingText(node, maskTextClass, maskTextSelector, checkAncestors) {\r\n try {\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n if (el === null)\r\n return false;\r\n if (typeof maskTextClass === 'string') {\r\n if (checkAncestors) {\r\n if (el.closest(`.${maskTextClass}`))\r\n return true;\r\n }\r\n else {\r\n if (el.classList.contains(maskTextClass))\r\n return true;\r\n }\r\n }\r\n else {\r\n if (classMatchesRegex(el, maskTextClass, checkAncestors))\r\n return true;\r\n }\r\n if (maskTextSelector) {\r\n if (checkAncestors) {\r\n if (el.closest(maskTextSelector))\r\n return true;\r\n }\r\n else {\r\n if (el.matches(maskTextSelector))\r\n return true;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n }\r\n return false;\r\n}\r\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\r\n const win = iframeEl.contentWindow;\r\n if (!win) {\r\n return;\r\n }\r\n let fired = false;\r\n let readyState;\r\n try {\r\n readyState = win.document.readyState;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (readyState !== 'complete') {\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, iframeLoadTimeout);\r\n iframeEl.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n return;\r\n }\r\n const blankUrl = 'about:blank';\r\n if (win.location.href !== blankUrl ||\r\n iframeEl.src === blankUrl ||\r\n iframeEl.src === '') {\r\n setTimeout(listener, 0);\r\n return iframeEl.addEventListener('load', listener);\r\n }\r\n iframeEl.addEventListener('load', listener);\r\n}\r\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\r\n let fired = false;\r\n let styleSheetLoaded;\r\n try {\r\n styleSheetLoaded = link.sheet;\r\n }\r\n catch (error) {\r\n return;\r\n }\r\n if (styleSheetLoaded)\r\n return;\r\n const timer = setTimeout(() => {\r\n if (!fired) {\r\n listener();\r\n fired = true;\r\n }\r\n }, styleSheetLoadTimeout);\r\n link.addEventListener('load', () => {\r\n clearTimeout(timer);\r\n fired = true;\r\n listener();\r\n });\r\n}\r\nfunction serializeNode(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, needsMask, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\r\n const rootId = getRootId(doc, mirror);\r\n switch (n.nodeType) {\r\n case n.DOCUMENT_NODE:\r\n if (n.compatMode !== 'CSS1Compat') {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n compatMode: n.compatMode,\r\n };\r\n }\r\n else {\r\n return {\r\n type: NodeType.Document,\r\n childNodes: [],\r\n };\r\n }\r\n case n.DOCUMENT_TYPE_NODE:\r\n return {\r\n type: NodeType.DocumentType,\r\n name: n.name,\r\n publicId: n.publicId,\r\n systemId: n.systemId,\r\n rootId,\r\n };\r\n case n.ELEMENT_NODE:\r\n return serializeElementNode(n, {\r\n doc,\r\n blockClass,\r\n blockSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n rootId,\r\n });\r\n case n.TEXT_NODE:\r\n return serializeTextNode(n, {\r\n needsMask,\r\n maskTextFn,\r\n rootId,\r\n });\r\n case n.CDATA_SECTION_NODE:\r\n return {\r\n type: NodeType.CDATA,\r\n textContent: '',\r\n rootId,\r\n };\r\n case n.COMMENT_NODE:\r\n return {\r\n type: NodeType.Comment,\r\n textContent: n.textContent || '',\r\n rootId,\r\n };\r\n default:\r\n return false;\r\n }\r\n}\r\nfunction getRootId(doc, mirror) {\r\n if (!mirror.hasNode(doc))\r\n return undefined;\r\n const docId = mirror.getId(doc);\r\n return docId === 1 ? undefined : docId;\r\n}\r\nfunction serializeTextNode(n, options) {\r\n var _a;\r\n const { needsMask, maskTextFn, rootId } = options;\r\n const parentTagName = n.parentNode && n.parentNode.tagName;\r\n let textContent = n.textContent;\r\n const isStyle = parentTagName === 'STYLE' ? true : undefined;\r\n const isScript = parentTagName === 'SCRIPT' ? true : undefined;\r\n if (isStyle && textContent) {\r\n try {\r\n if (n.nextSibling || n.previousSibling) {\r\n }\r\n else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\r\n textContent = stringifyStylesheet(n.parentNode.sheet);\r\n }\r\n }\r\n catch (err) {\r\n console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\r\n }\r\n textContent = absoluteToStylesheet(textContent, getHref());\r\n }\r\n if (isScript) {\r\n textContent = 'SCRIPT_PLACEHOLDER';\r\n }\r\n if (!isStyle && !isScript && textContent && needsMask) {\r\n textContent = maskTextFn\r\n ? maskTextFn(textContent, n.parentElement)\r\n : textContent.replace(/[\\S]/g, '*');\r\n }\r\n return {\r\n type: NodeType.Text,\r\n textContent: textContent || '',\r\n isStyle,\r\n rootId,\r\n };\r\n}\r\nfunction serializeElementNode(n, options) {\r\n const { doc, blockClass, blockSelector, inlineStylesheet, maskInputOptions = {}, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, } = options;\r\n const needBlock = _isBlockedElement(n, blockClass, blockSelector);\r\n const tagName = getValidTagName(n);\r\n let attributes = {};\r\n const len = n.attributes.length;\r\n for (let i = 0; i < len; i++) {\r\n const attr = n.attributes[i];\r\n if (!ignoreAttribute(tagName, attr.name, attr.value)) {\r\n attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value);\r\n }\r\n }\r\n if (tagName === 'link' && inlineStylesheet) {\r\n const stylesheet = Array.from(doc.styleSheets).find((s) => {\r\n return s.href === n.href;\r\n });\r\n let cssText = null;\r\n if (stylesheet) {\r\n cssText = stringifyStylesheet(stylesheet);\r\n }\r\n if (cssText) {\r\n delete attributes.rel;\r\n delete attributes.href;\r\n attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\r\n }\r\n }\r\n if (tagName === 'style' &&\r\n n.sheet &&\r\n !(n.innerText || n.textContent || '').trim().length) {\r\n const cssText = stringifyStylesheet(n.sheet);\r\n if (cssText) {\r\n attributes._cssText = absoluteToStylesheet(cssText, getHref());\r\n }\r\n }\r\n if (tagName === 'input' || tagName === 'textarea' || tagName === 'select') {\r\n const value = n.value;\r\n const checked = n.checked;\r\n if (attributes.type !== 'radio' &&\r\n attributes.type !== 'checkbox' &&\r\n attributes.type !== 'submit' &&\r\n attributes.type !== 'button' &&\r\n value) {\r\n attributes.value = maskInputValue({\r\n element: n,\r\n type: getInputType(n),\r\n tagName,\r\n value,\r\n maskInputOptions,\r\n maskInputFn,\r\n });\r\n }\r\n else if (checked) {\r\n attributes.checked = checked;\r\n }\r\n }\r\n if (tagName === 'option') {\r\n if (n.selected && !maskInputOptions['select']) {\r\n attributes.selected = true;\r\n }\r\n else {\r\n delete attributes.selected;\r\n }\r\n }\r\n if (tagName === 'canvas' && recordCanvas) {\r\n if (n.__context === '2d') {\r\n if (!is2DCanvasBlank(n)) {\r\n attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n }\r\n else if (!('__context' in n)) {\r\n const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n const blankCanvas = document.createElement('canvas');\r\n blankCanvas.width = n.width;\r\n blankCanvas.height = n.height;\r\n const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n if (canvasDataURL !== blankCanvasDataURL) {\r\n attributes.rr_dataURL = canvasDataURL;\r\n }\r\n }\r\n }\r\n if (tagName === 'img' && inlineImages) {\r\n if (!canvasService) {\r\n canvasService = doc.createElement('canvas');\r\n canvasCtx = canvasService.getContext('2d');\r\n }\r\n const image = n;\r\n const oldValue = image.crossOrigin;\r\n image.crossOrigin = 'anonymous';\r\n const recordInlineImage = () => {\r\n image.removeEventListener('load', recordInlineImage);\r\n try {\r\n canvasService.width = image.naturalWidth;\r\n canvasService.height = image.naturalHeight;\r\n canvasCtx.drawImage(image, 0, 0);\r\n attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\r\n }\r\n catch (err) {\r\n console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\r\n }\r\n oldValue\r\n ? (attributes.crossOrigin = oldValue)\r\n : image.removeAttribute('crossorigin');\r\n };\r\n if (image.complete && image.naturalWidth !== 0)\r\n recordInlineImage();\r\n else\r\n image.addEventListener('load', recordInlineImage);\r\n }\r\n if (tagName === 'audio' || tagName === 'video') {\r\n attributes.rr_mediaState = n.paused\r\n ? 'paused'\r\n : 'played';\r\n attributes.rr_mediaCurrentTime = n.currentTime;\r\n }\r\n if (!newlyAddedElement) {\r\n if (n.scrollLeft) {\r\n attributes.rr_scrollLeft = n.scrollLeft;\r\n }\r\n if (n.scrollTop) {\r\n attributes.rr_scrollTop = n.scrollTop;\r\n }\r\n }\r\n if (needBlock) {\r\n const { width, height } = n.getBoundingClientRect();\r\n attributes = {\r\n class: attributes.class,\r\n rr_width: `${width}px`,\r\n rr_height: `${height}px`,\r\n };\r\n }\r\n if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\r\n if (!n.contentDocument) {\r\n attributes.rr_src = attributes.src;\r\n }\r\n delete attributes.src;\r\n }\r\n let isCustomElement;\r\n try {\r\n if (customElements.get(tagName))\r\n isCustomElement = true;\r\n }\r\n catch (e) {\r\n }\r\n return {\r\n type: NodeType.Element,\r\n tagName,\r\n attributes,\r\n childNodes: [],\r\n isSVG: isSVGElement(n) || undefined,\r\n needBlock,\r\n rootId,\r\n isCustom: isCustomElement,\r\n };\r\n}\r\nfunction lowerIfExists(maybeAttr) {\r\n if (maybeAttr === undefined || maybeAttr === null) {\r\n return '';\r\n }\r\n else {\r\n return maybeAttr.toLowerCase();\r\n }\r\n}\r\nfunction slimDOMExcluded(sn, slimDOMOptions) {\r\n if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\r\n return true;\r\n }\r\n else if (sn.type === NodeType.Element) {\r\n if (slimDOMOptions.script &&\r\n (sn.tagName === 'script' ||\r\n (sn.tagName === 'link' &&\r\n (sn.attributes.rel === 'preload' ||\r\n sn.attributes.rel === 'modulepreload') &&\r\n sn.attributes.as === 'script') ||\r\n (sn.tagName === 'link' &&\r\n sn.attributes.rel === 'prefetch' &&\r\n typeof sn.attributes.href === 'string' &&\r\n extractFileExtension(sn.attributes.href) === 'js'))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headFavicon &&\r\n ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\r\n (sn.tagName === 'meta' &&\r\n (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\r\n lowerIfExists(sn.attributes.name) === 'application-name' ||\r\n lowerIfExists(sn.attributes.rel) === 'icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\r\n lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\r\n return true;\r\n }\r\n else if (sn.tagName === 'meta') {\r\n if (slimDOMOptions.headMetaDescKeywords &&\r\n lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaSocial &&\r\n (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\r\n lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\r\n lowerIfExists(sn.attributes.name) === 'pinterest')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaRobots &&\r\n (lowerIfExists(sn.attributes.name) === 'robots' ||\r\n lowerIfExists(sn.attributes.name) === 'googlebot' ||\r\n lowerIfExists(sn.attributes.name) === 'bingbot')) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaHttpEquiv &&\r\n sn.attributes['http-equiv'] !== undefined) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaAuthorship &&\r\n (lowerIfExists(sn.attributes.name) === 'author' ||\r\n lowerIfExists(sn.attributes.name) === 'generator' ||\r\n lowerIfExists(sn.attributes.name) === 'framework' ||\r\n lowerIfExists(sn.attributes.name) === 'publisher' ||\r\n lowerIfExists(sn.attributes.name) === 'progid' ||\r\n lowerIfExists(sn.attributes.property).match(/^article:/) ||\r\n lowerIfExists(sn.attributes.property).match(/^product:/))) {\r\n return true;\r\n }\r\n else if (slimDOMOptions.headMetaVerification &&\r\n (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\r\n lowerIfExists(sn.attributes.name) === 'csrf-token' ||\r\n lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\r\n lowerIfExists(sn.attributes.name) === 'verify-v1' ||\r\n lowerIfExists(sn.attributes.name) === 'verification' ||\r\n lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nfunction serializeNodeWithId(n, options) {\r\n const { doc, mirror, blockClass, blockSelector, maskTextClass, maskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\r\n let { needsMask } = options;\r\n let { preserveWhiteSpace = true } = options;\r\n if (!needsMask &&\r\n n.childNodes) {\r\n const checkAncestors = needsMask === undefined;\r\n needsMask = needMaskingText(n, maskTextClass, maskTextSelector, checkAncestors);\r\n }\r\n const _serializedNode = serializeNode(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n keepIframeSrcFn,\r\n newlyAddedElement,\r\n });\r\n if (!_serializedNode) {\r\n console.warn(n, 'not serialized');\r\n return null;\r\n }\r\n let id;\r\n if (mirror.hasNode(n)) {\r\n id = mirror.getId(n);\r\n }\r\n else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\r\n (!preserveWhiteSpace &&\r\n _serializedNode.type === NodeType.Text &&\r\n !_serializedNode.isStyle &&\r\n !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\r\n id = IGNORED_NODE;\r\n }\r\n else {\r\n id = genId();\r\n }\r\n const serializedNode = Object.assign(_serializedNode, { id });\r\n mirror.add(n, serializedNode);\r\n if (id === IGNORED_NODE) {\r\n return null;\r\n }\r\n if (onSerialize) {\r\n onSerialize(n);\r\n }\r\n let recordChild = !skipChild;\r\n if (serializedNode.type === NodeType.Element) {\r\n recordChild = recordChild && !serializedNode.needBlock;\r\n delete serializedNode.needBlock;\r\n const shadowRoot = n.shadowRoot;\r\n if (shadowRoot && isNativeShadowDom(shadowRoot))\r\n serializedNode.isShadowHost = true;\r\n }\r\n if ((serializedNode.type === NodeType.Document ||\r\n serializedNode.type === NodeType.Element) &&\r\n recordChild) {\r\n if (slimDOMOptions.headWhitespace &&\r\n serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'head') {\r\n preserveWhiteSpace = false;\r\n }\r\n const bypassOptions = {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n };\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'textarea' &&\r\n serializedNode.attributes.value !== undefined) ;\r\n else {\r\n for (const childN of Array.from(n.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n }\r\n if (isElement(n) && n.shadowRoot) {\r\n for (const childN of Array.from(n.shadowRoot.childNodes)) {\r\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\r\n if (serializedChildNode) {\r\n isNativeShadowDom(n.shadowRoot) &&\r\n (serializedChildNode.isShadow = true);\r\n serializedNode.childNodes.push(serializedChildNode);\r\n }\r\n }\r\n }\r\n }\r\n if (n.parentNode &&\r\n isShadowRoot(n.parentNode) &&\r\n isNativeShadowDom(n.parentNode)) {\r\n serializedNode.isShadow = true;\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'iframe') {\r\n onceIframeLoaded(n, () => {\r\n const iframeDoc = n.contentDocument;\r\n if (iframeDoc && onIframeLoad) {\r\n const serializedIframeNode = serializeNodeWithId(iframeDoc, {\r\n doc: iframeDoc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedIframeNode) {\r\n onIframeLoad(n, serializedIframeNode);\r\n }\r\n }\r\n }, iframeLoadTimeout);\r\n }\r\n if (serializedNode.type === NodeType.Element &&\r\n serializedNode.tagName === 'link' &&\r\n typeof serializedNode.attributes.rel === 'string' &&\r\n (serializedNode.attributes.rel === 'stylesheet' ||\r\n (serializedNode.attributes.rel === 'preload' &&\r\n typeof serializedNode.attributes.href === 'string' &&\r\n extractFileExtension(serializedNode.attributes.href) === 'css'))) {\r\n onceStylesheetLoaded(n, () => {\r\n if (onStylesheetLoad) {\r\n const serializedLinkNode = serializeNodeWithId(n, {\r\n doc,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n needsMask,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n });\r\n if (serializedLinkNode) {\r\n onStylesheetLoad(n, serializedLinkNode);\r\n }\r\n }\r\n }, stylesheetLoadTimeout);\r\n }\r\n return serializedNode;\r\n}\r\nfunction snapshot(n, options) {\r\n const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n password: true,\r\n }\r\n : maskAllInputs === false\r\n ? {\r\n password: true,\r\n }\r\n : maskAllInputs;\r\n const slimDOMOptions = slimDOM === true || slimDOM === 'all'\r\n ?\r\n {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaDescKeywords: slimDOM === 'all',\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaAuthorship: true,\r\n headMetaVerification: true,\r\n }\r\n : slimDOM === false\r\n ? {}\r\n : slimDOM;\r\n return serializeNodeWithId(n, {\r\n doc: n,\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n skipChild: false,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n inlineImages,\r\n recordCanvas,\r\n preserveWhiteSpace,\r\n onSerialize,\r\n onIframeLoad,\r\n iframeLoadTimeout,\r\n onStylesheetLoad,\r\n stylesheetLoadTimeout,\r\n keepIframeSrcFn,\r\n newlyAddedElement: false,\r\n });\r\n}\r\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\r\nfunction parse(css, options = {}) {\r\n let lineno = 1;\r\n let column = 1;\r\n function updatePosition(str) {\r\n const lines = str.match(/\\n/g);\r\n if (lines) {\r\n lineno += lines.length;\r\n }\r\n const i = str.lastIndexOf('\\n');\r\n column = i === -1 ? column + str.length : str.length - i;\r\n }\r\n function position() {\r\n const start = { line: lineno, column };\r\n return (node) => {\r\n node.position = new Position(start);\r\n whitespace();\r\n return node;\r\n };\r\n }\r\n class Position {\r\n constructor(start) {\r\n this.start = start;\r\n this.end = { line: lineno, column };\r\n this.source = options.source;\r\n }\r\n }\r\n Position.prototype.content = css;\r\n const errorsList = [];\r\n function error(msg) {\r\n const err = new Error(`${options.source || ''}:${lineno}:${column}: ${msg}`);\r\n err.reason = msg;\r\n err.filename = options.source;\r\n err.line = lineno;\r\n err.column = column;\r\n err.source = css;\r\n if (options.silent) {\r\n errorsList.push(err);\r\n }\r\n else {\r\n throw err;\r\n }\r\n }\r\n function stylesheet() {\r\n const rulesList = rules();\r\n return {\r\n type: 'stylesheet',\r\n stylesheet: {\r\n source: options.source,\r\n rules: rulesList,\r\n parsingErrors: errorsList,\r\n },\r\n };\r\n }\r\n function open() {\r\n return match(/^{\\s*/);\r\n }\r\n function close() {\r\n return match(/^}/);\r\n }\r\n function rules() {\r\n let node;\r\n const rules = [];\r\n whitespace();\r\n comments(rules);\r\n while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\r\n if (node) {\r\n rules.push(node);\r\n comments(rules);\r\n }\r\n }\r\n return rules;\r\n }\r\n function match(re) {\r\n const m = re.exec(css);\r\n if (!m) {\r\n return;\r\n }\r\n const str = m[0];\r\n updatePosition(str);\r\n css = css.slice(str.length);\r\n return m;\r\n }\r\n function whitespace() {\r\n match(/^\\s*/);\r\n }\r\n function comments(rules = []) {\r\n let c;\r\n while ((c = comment())) {\r\n if (c) {\r\n rules.push(c);\r\n }\r\n c = comment();\r\n }\r\n return rules;\r\n }\r\n function comment() {\r\n const pos = position();\r\n if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\r\n return;\r\n }\r\n let i = 2;\r\n while ('' !== css.charAt(i) &&\r\n ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\r\n ++i;\r\n }\r\n i += 2;\r\n if ('' === css.charAt(i - 1)) {\r\n return error('End of comment missing');\r\n }\r\n const str = css.slice(2, i - 2);\r\n column += 2;\r\n updatePosition(str);\r\n css = css.slice(i);\r\n column += 2;\r\n return pos({\r\n type: 'comment',\r\n comment: str,\r\n });\r\n }\r\n function selector() {\r\n const m = match(/^([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n return trim(m[0])\r\n .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\r\n .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\r\n return m.replace(/,/g, '\\u200C');\r\n })\r\n .split(/\\s*(?![^(]*\\)),\\s*/)\r\n .map((s) => {\r\n return s.replace(/\\u200C/g, ',');\r\n });\r\n }\r\n function declaration() {\r\n const pos = position();\r\n const propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\r\n if (!propMatch) {\r\n return;\r\n }\r\n const prop = trim(propMatch[0]);\r\n if (!match(/^:\\s*/)) {\r\n return error(`property missing ':'`);\r\n }\r\n const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\r\n const ret = pos({\r\n type: 'declaration',\r\n property: prop.replace(commentre, ''),\r\n value: val ? trim(val[0]).replace(commentre, '') : '',\r\n });\r\n match(/^[;\\s]*/);\r\n return ret;\r\n }\r\n function declarations() {\r\n const decls = [];\r\n if (!open()) {\r\n return error(`missing '{'`);\r\n }\r\n comments(decls);\r\n let decl;\r\n while ((decl = declaration())) {\r\n if (decl !== false) {\r\n decls.push(decl);\r\n comments(decls);\r\n }\r\n decl = declaration();\r\n }\r\n if (!close()) {\r\n return error(`missing '}'`);\r\n }\r\n return decls;\r\n }\r\n function keyframe() {\r\n let m;\r\n const vals = [];\r\n const pos = position();\r\n while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\r\n vals.push(m[1]);\r\n match(/^,\\s*/);\r\n }\r\n if (!vals.length) {\r\n return;\r\n }\r\n return pos({\r\n type: 'keyframe',\r\n values: vals,\r\n declarations: declarations(),\r\n });\r\n }\r\n function atkeyframes() {\r\n const pos = position();\r\n let m = match(/^@([-\\w]+)?keyframes\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n const vendor = m[1];\r\n m = match(/^([-\\w]+)\\s*/);\r\n if (!m) {\r\n return error('@keyframes missing name');\r\n }\r\n const name = m[1];\r\n if (!open()) {\r\n return error(`@keyframes missing '{'`);\r\n }\r\n let frame;\r\n let frames = comments();\r\n while ((frame = keyframe())) {\r\n frames.push(frame);\r\n frames = frames.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@keyframes missing '}'`);\r\n }\r\n return pos({\r\n type: 'keyframes',\r\n name,\r\n vendor,\r\n keyframes: frames,\r\n });\r\n }\r\n function atsupports() {\r\n const pos = position();\r\n const m = match(/^@supports *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const supports = trim(m[1]);\r\n if (!open()) {\r\n return error(`@supports missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@supports missing '}'`);\r\n }\r\n return pos({\r\n type: 'supports',\r\n supports,\r\n rules: style,\r\n });\r\n }\r\n function athost() {\r\n const pos = position();\r\n const m = match(/^@host\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n if (!open()) {\r\n return error(`@host missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@host missing '}'`);\r\n }\r\n return pos({\r\n type: 'host',\r\n rules: style,\r\n });\r\n }\r\n function atmedia() {\r\n const pos = position();\r\n const m = match(/^@media *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const media = trim(m[1]);\r\n if (!open()) {\r\n return error(`@media missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@media missing '}'`);\r\n }\r\n return pos({\r\n type: 'media',\r\n media,\r\n rules: style,\r\n });\r\n }\r\n function atcustommedia() {\r\n const pos = position();\r\n const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\r\n if (!m) {\r\n return;\r\n }\r\n return pos({\r\n type: 'custom-media',\r\n name: trim(m[1]),\r\n media: trim(m[2]),\r\n });\r\n }\r\n function atpage() {\r\n const pos = position();\r\n const m = match(/^@page */);\r\n if (!m) {\r\n return;\r\n }\r\n const sel = selector() || [];\r\n if (!open()) {\r\n return error(`@page missing '{'`);\r\n }\r\n let decls = comments();\r\n let decl;\r\n while ((decl = declaration())) {\r\n decls.push(decl);\r\n decls = decls.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@page missing '}'`);\r\n }\r\n return pos({\r\n type: 'page',\r\n selectors: sel,\r\n declarations: decls,\r\n });\r\n }\r\n function atdocument() {\r\n const pos = position();\r\n const m = match(/^@([-\\w]+)?document *([^{]+)/);\r\n if (!m) {\r\n return;\r\n }\r\n const vendor = trim(m[1]);\r\n const doc = trim(m[2]);\r\n if (!open()) {\r\n return error(`@document missing '{'`);\r\n }\r\n const style = comments().concat(rules());\r\n if (!close()) {\r\n return error(`@document missing '}'`);\r\n }\r\n return pos({\r\n type: 'document',\r\n document: doc,\r\n vendor,\r\n rules: style,\r\n });\r\n }\r\n function atfontface() {\r\n const pos = position();\r\n const m = match(/^@font-face\\s*/);\r\n if (!m) {\r\n return;\r\n }\r\n if (!open()) {\r\n return error(`@font-face missing '{'`);\r\n }\r\n let decls = comments();\r\n let decl;\r\n while ((decl = declaration())) {\r\n decls.push(decl);\r\n decls = decls.concat(comments());\r\n }\r\n if (!close()) {\r\n return error(`@font-face missing '}'`);\r\n }\r\n return pos({\r\n type: 'font-face',\r\n declarations: decls,\r\n });\r\n }\r\n const atimport = _compileAtrule('import');\r\n const atcharset = _compileAtrule('charset');\r\n const atnamespace = _compileAtrule('namespace');\r\n function _compileAtrule(name) {\r\n const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\r\n return () => {\r\n const pos = position();\r\n const m = match(re);\r\n if (!m) {\r\n return;\r\n }\r\n const ret = { type: name };\r\n ret[name] = m[1].trim();\r\n return pos(ret);\r\n };\r\n }\r\n function atrule() {\r\n if (css[0] !== '@') {\r\n return;\r\n }\r\n return (atkeyframes() ||\r\n atmedia() ||\r\n atcustommedia() ||\r\n atsupports() ||\r\n atimport() ||\r\n atcharset() ||\r\n atnamespace() ||\r\n atdocument() ||\r\n atpage() ||\r\n athost() ||\r\n atfontface());\r\n }\r\n function rule() {\r\n const pos = position();\r\n const sel = selector();\r\n if (!sel) {\r\n return error('selector missing');\r\n }\r\n comments();\r\n return pos({\r\n type: 'rule',\r\n selectors: sel,\r\n declarations: declarations(),\r\n });\r\n }\r\n return addParent(stylesheet());\r\n}\r\nfunction trim(str) {\r\n return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\r\n}\r\nfunction addParent(obj, parent) {\r\n const isNode = obj && typeof obj.type === 'string';\r\n const childParent = isNode ? obj : parent;\r\n for (const k of Object.keys(obj)) {\r\n const value = obj[k];\r\n if (Array.isArray(value)) {\r\n value.forEach((v) => {\r\n addParent(v, childParent);\r\n });\r\n }\r\n else if (value && typeof value === 'object') {\r\n addParent(value, childParent);\r\n }\r\n }\r\n if (isNode) {\r\n Object.defineProperty(obj, 'parent', {\r\n configurable: true,\r\n writable: true,\r\n enumerable: false,\r\n value: parent || null,\r\n });\r\n }\r\n return obj;\r\n}\n\nconst tagMap = {\r\n script: 'noscript',\r\n altglyph: 'altGlyph',\r\n altglyphdef: 'altGlyphDef',\r\n altglyphitem: 'altGlyphItem',\r\n animatecolor: 'animateColor',\r\n animatemotion: 'animateMotion',\r\n animatetransform: 'animateTransform',\r\n clippath: 'clipPath',\r\n feblend: 'feBlend',\r\n fecolormatrix: 'feColorMatrix',\r\n fecomponenttransfer: 'feComponentTransfer',\r\n fecomposite: 'feComposite',\r\n feconvolvematrix: 'feConvolveMatrix',\r\n fediffuselighting: 'feDiffuseLighting',\r\n fedisplacementmap: 'feDisplacementMap',\r\n fedistantlight: 'feDistantLight',\r\n fedropshadow: 'feDropShadow',\r\n feflood: 'feFlood',\r\n fefunca: 'feFuncA',\r\n fefuncb: 'feFuncB',\r\n fefuncg: 'feFuncG',\r\n fefuncr: 'feFuncR',\r\n fegaussianblur: 'feGaussianBlur',\r\n feimage: 'feImage',\r\n femerge: 'feMerge',\r\n femergenode: 'feMergeNode',\r\n femorphology: 'feMorphology',\r\n feoffset: 'feOffset',\r\n fepointlight: 'fePointLight',\r\n fespecularlighting: 'feSpecularLighting',\r\n fespotlight: 'feSpotLight',\r\n fetile: 'feTile',\r\n feturbulence: 'feTurbulence',\r\n foreignobject: 'foreignObject',\r\n glyphref: 'glyphRef',\r\n lineargradient: 'linearGradient',\r\n radialgradient: 'radialGradient',\r\n};\r\nfunction getTagName(n) {\r\n let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\r\n if (tagName === 'link' && n.attributes._cssText) {\r\n tagName = 'style';\r\n }\r\n return tagName;\r\n}\r\nfunction escapeRegExp(str) {\r\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\nconst MEDIA_SELECTOR = /(max|min)-device-(width|height)/;\r\nconst MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, 'g');\r\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\r\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\r\nfunction adaptCssForReplay(cssText, cache) {\r\n const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\r\n if (cachedStyle)\r\n return cachedStyle;\r\n const ast = parse(cssText, {\r\n silent: true,\r\n });\r\n if (!ast.stylesheet) {\r\n return cssText;\r\n }\r\n const selectors = [];\r\n const medias = [];\r\n function getSelectors(rule) {\r\n if ('selectors' in rule && rule.selectors) {\r\n rule.selectors.forEach((selector) => {\r\n if (HOVER_SELECTOR.test(selector)) {\r\n selectors.push(selector);\r\n }\r\n });\r\n }\r\n if ('media' in rule && rule.media && MEDIA_SELECTOR.test(rule.media)) {\r\n medias.push(rule.media);\r\n }\r\n if ('rules' in rule && rule.rules) {\r\n rule.rules.forEach(getSelectors);\r\n }\r\n }\r\n getSelectors(ast.stylesheet);\r\n let result = cssText;\r\n if (selectors.length > 0) {\r\n const selectorMatcher = new RegExp(selectors\r\n .filter((selector, index) => selectors.indexOf(selector) === index)\r\n .sort((a, b) => b.length - a.length)\r\n .map((selector) => {\r\n return escapeRegExp(selector);\r\n })\r\n .join('|'), 'g');\r\n result = result.replace(selectorMatcher, (selector) => {\r\n const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\r\n return `${selector}, ${newSelector}`;\r\n });\r\n }\r\n if (medias.length > 0) {\r\n const mediaMatcher = new RegExp(medias\r\n .filter((media, index) => medias.indexOf(media) === index)\r\n .sort((a, b) => b.length - a.length)\r\n .map((media) => {\r\n return escapeRegExp(media);\r\n })\r\n .join('|'), 'g');\r\n result = result.replace(mediaMatcher, (media) => {\r\n return media.replace(MEDIA_SELECTOR_GLOBAL, '$1-$2');\r\n });\r\n }\r\n cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\r\n return result;\r\n}\r\nfunction createCache() {\r\n const stylesWithHoverClass = new Map();\r\n return {\r\n stylesWithHoverClass,\r\n };\r\n}\r\nfunction buildNode(n, options) {\r\n var _a;\r\n const { doc, hackCss, cache } = options;\r\n switch (n.type) {\r\n case NodeType.Document:\r\n return doc.implementation.createDocument(null, '', null);\r\n case NodeType.DocumentType:\r\n return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\r\n case NodeType.Element: {\r\n const tagName = getTagName(n);\r\n let node;\r\n if (n.isSVG) {\r\n node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\r\n }\r\n else {\r\n if (n.isCustom &&\r\n ((_a = doc.defaultView) === null || _a === void 0 ? void 0 : _a.customElements) &&\r\n !doc.defaultView.customElements.get(n.tagName))\r\n doc.defaultView.customElements.define(n.tagName, class extends doc.defaultView.HTMLElement {\r\n });\r\n node = doc.createElement(tagName);\r\n }\r\n const specialAttributes = {};\r\n for (const name in n.attributes) {\r\n if (!Object.prototype.hasOwnProperty.call(n.attributes, name)) {\r\n continue;\r\n }\r\n let value = n.attributes[name];\r\n if (tagName === 'option' &&\r\n name === 'selected' &&\r\n value === false) {\r\n continue;\r\n }\r\n if (value === null) {\r\n continue;\r\n }\r\n if (value === true)\r\n value = '';\r\n if (name.startsWith('rr_')) {\r\n specialAttributes[name] = value;\r\n continue;\r\n }\r\n const isTextarea = tagName === 'textarea' && name === 'value';\r\n const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\r\n if (isRemoteOrDynamicCss && hackCss && typeof value === 'string') {\r\n value = adaptCssForReplay(value, cache);\r\n }\r\n if ((isTextarea || isRemoteOrDynamicCss) && typeof value === 'string') {\r\n node.appendChild(doc.createTextNode(value));\r\n n.childNodes = [];\r\n continue;\r\n }\r\n try {\r\n if (n.isSVG && name === 'xlink:href') {\r\n node.setAttributeNS('http://www.w3.org/1999/xlink', name, value.toString());\r\n }\r\n else if (name === 'onload' ||\r\n name === 'onclick' ||\r\n name.substring(0, 7) === 'onmouse') {\r\n node.setAttribute('_' + name, value.toString());\r\n }\r\n else if (tagName === 'meta' &&\r\n n.attributes['http-equiv'] === 'Content-Security-Policy' &&\r\n name === 'content') {\r\n node.setAttribute('csp-content', value.toString());\r\n continue;\r\n }\r\n else if (tagName === 'link' &&\r\n (n.attributes.rel === 'preload' ||\r\n n.attributes.rel === 'modulepreload') &&\r\n n.attributes.as === 'script') {\r\n }\r\n else if (tagName === 'link' &&\r\n n.attributes.rel === 'prefetch' &&\r\n typeof n.attributes.href === 'string' &&\r\n n.attributes.href.endsWith('.js')) {\r\n }\r\n else if (tagName === 'img' &&\r\n n.attributes.srcset &&\r\n n.attributes.rr_dataURL) {\r\n node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\r\n }\r\n else {\r\n node.setAttribute(name, value.toString());\r\n }\r\n }\r\n catch (error) {\r\n }\r\n }\r\n for (const name in specialAttributes) {\r\n const value = specialAttributes[name];\r\n if (tagName === 'canvas' && name === 'rr_dataURL') {\r\n const image = document.createElement('img');\r\n image.onload = () => {\r\n const ctx = node.getContext('2d');\r\n if (ctx) {\r\n ctx.drawImage(image, 0, 0, image.width, image.height);\r\n }\r\n };\r\n image.src = value.toString();\r\n if (node.RRNodeType)\r\n node.rr_dataURL = value.toString();\r\n }\r\n else if (tagName === 'img' && name === 'rr_dataURL') {\r\n const image = node;\r\n if (!image.currentSrc.startsWith('data:')) {\r\n image.setAttribute('rrweb-original-src', n.attributes.src);\r\n image.src = value.toString();\r\n }\r\n }\r\n if (name === 'rr_width') {\r\n node.style.width = value.toString();\r\n }\r\n else if (name === 'rr_height') {\r\n node.style.height = value.toString();\r\n }\r\n else if (name === 'rr_mediaCurrentTime' &&\r\n typeof value === 'number') {\r\n node.currentTime = value;\r\n }\r\n else if (name === 'rr_mediaState') {\r\n switch (value) {\r\n case 'played':\r\n node\r\n .play()\r\n .catch((e) => console.warn('media playback error', e));\r\n break;\r\n case 'paused':\r\n node.pause();\r\n break;\r\n }\r\n }\r\n }\r\n if (n.isShadowHost) {\r\n if (!node.shadowRoot) {\r\n node.attachShadow({ mode: 'open' });\r\n }\r\n else {\r\n while (node.shadowRoot.firstChild) {\r\n node.shadowRoot.removeChild(node.shadowRoot.firstChild);\r\n }\r\n }\r\n }\r\n return node;\r\n }\r\n case NodeType.Text:\r\n return doc.createTextNode(n.isStyle && hackCss\r\n ? adaptCssForReplay(n.textContent, cache)\r\n : n.textContent);\r\n case NodeType.CDATA:\r\n return doc.createCDATASection(n.textContent);\r\n case NodeType.Comment:\r\n return doc.createComment(n.textContent);\r\n default:\r\n return null;\r\n }\r\n}\r\nfunction buildNodeWithSN(n, options) {\r\n const { doc, mirror, skipChild = false, hackCss = true, afterAppend, cache, } = options;\r\n if (mirror.has(n.id)) {\r\n const nodeInMirror = mirror.getNode(n.id);\r\n const meta = mirror.getMeta(nodeInMirror);\r\n if (isNodeMetaEqual(meta, n))\r\n return mirror.getNode(n.id);\r\n }\r\n let node = buildNode(n, { doc, hackCss, cache });\r\n if (!node) {\r\n return null;\r\n }\r\n if (n.rootId && mirror.getNode(n.rootId) !== doc) {\r\n mirror.replace(n.rootId, doc);\r\n }\r\n if (n.type === NodeType.Document) {\r\n doc.close();\r\n doc.open();\r\n if (n.compatMode === 'BackCompat' &&\r\n n.childNodes &&\r\n n.childNodes[0].type !== NodeType.DocumentType) {\r\n if (n.childNodes[0].type === NodeType.Element &&\r\n 'xmlns' in n.childNodes[0].attributes &&\r\n n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\r\n doc.write('');\r\n }\r\n else {\r\n doc.write('');\r\n }\r\n }\r\n node = doc;\r\n }\r\n mirror.add(node, n);\r\n if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\r\n !skipChild) {\r\n for (const childN of n.childNodes) {\r\n const childNode = buildNodeWithSN(childN, {\r\n doc,\r\n mirror,\r\n skipChild: false,\r\n hackCss,\r\n afterAppend,\r\n cache,\r\n });\r\n if (!childNode) {\r\n console.warn('Failed to rebuild', childN);\r\n continue;\r\n }\r\n if (childN.isShadow && isElement(node) && node.shadowRoot) {\r\n node.shadowRoot.appendChild(childNode);\r\n }\r\n else if (n.type === NodeType.Document &&\r\n childN.type == NodeType.Element) {\r\n const htmlElement = childNode;\r\n let body = null;\r\n htmlElement.childNodes.forEach((child) => {\r\n if (child.nodeName === 'BODY')\r\n body = child;\r\n });\r\n if (body) {\r\n htmlElement.removeChild(body);\r\n node.appendChild(childNode);\r\n htmlElement.appendChild(body);\r\n }\r\n else {\r\n node.appendChild(childNode);\r\n }\r\n }\r\n else {\r\n node.appendChild(childNode);\r\n }\r\n if (afterAppend) {\r\n afterAppend(childNode, childN.id);\r\n }\r\n }\r\n }\r\n return node;\r\n}\r\nfunction visit(mirror, onVisit) {\r\n function walk(node) {\r\n onVisit(node);\r\n }\r\n for (const id of mirror.getIds()) {\r\n if (mirror.has(id)) {\r\n walk(mirror.getNode(id));\r\n }\r\n }\r\n}\r\nfunction handleScroll(node, mirror) {\r\n const n = mirror.getMeta(node);\r\n if ((n === null || n === void 0 ? void 0 : n.type) !== NodeType.Element) {\r\n return;\r\n }\r\n const el = node;\r\n for (const name in n.attributes) {\r\n if (!(Object.prototype.hasOwnProperty.call(n.attributes, name) &&\r\n name.startsWith('rr_'))) {\r\n continue;\r\n }\r\n const value = n.attributes[name];\r\n if (name === 'rr_scrollLeft') {\r\n el.scrollLeft = value;\r\n }\r\n if (name === 'rr_scrollTop') {\r\n el.scrollTop = value;\r\n }\r\n }\r\n}\r\nfunction rebuild(n, options) {\r\n const { doc, onVisit, hackCss = true, afterAppend, cache, mirror = new Mirror(), } = options;\r\n const node = buildNodeWithSN(n, {\r\n doc,\r\n mirror,\r\n skipChild: false,\r\n hackCss,\r\n afterAppend,\r\n cache,\r\n });\r\n visit(mirror, (visitedNode) => {\r\n if (onVisit) {\r\n onVisit(visitedNode);\r\n }\r\n handleScroll(visitedNode, mirror);\r\n });\r\n return node;\r\n}\n\nexport { IGNORED_NODE, Mirror, NodeType, adaptCssForReplay, buildNodeWithSN, classMatchesRegex, createCache, createMirror, escapeImportStatement, extractFileExtension, fixSafariColons, genId, getInputType, ignoreAttribute, is2DCanvasBlank, isCSSImportRule, isCSSStyleRule, isElement, isNativeShadowDom, isNodeMetaEqual, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, snapshot, stringifyRule, stringifyStylesheet, toLowerCase, transformAttribute };\n", "import { classMatchesRegex, IGNORED_NODE, isShadowRoot } from '../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nfunction on(type, fn, target = document) {\r\n const options = { capture: true, passive: true };\r\n target.addEventListener(type, fn, options);\r\n return () => target.removeEventListener(type, fn, options);\r\n}\r\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\r\n '\\r\\n' +\r\n 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\r\n '\\r\\n' +\r\n 'or you can use record.mirror to access the mirror instance during recording.';\r\nlet _mirror = {\r\n map: {},\r\n getId() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return -1;\r\n },\r\n getNode() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return null;\r\n },\r\n removeNodeFromMap() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n },\r\n has() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n return false;\r\n },\r\n reset() {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n },\r\n};\r\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\r\n _mirror = new Proxy(_mirror, {\r\n get(target, prop, receiver) {\r\n if (prop === 'map') {\r\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\r\n }\r\n return Reflect.get(target, prop, receiver);\r\n },\r\n });\r\n}\r\nfunction throttle(func, wait, options = {}) {\r\n let timeout = null;\r\n let previous = 0;\r\n return function (...args) {\r\n const now = Date.now();\r\n if (!previous && options.leading === false) {\r\n previous = now;\r\n }\r\n const remaining = wait - (now - previous);\r\n const context = this;\r\n if (remaining <= 0 || remaining > wait) {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n timeout = null;\r\n }\r\n previous = now;\r\n func.apply(context, args);\r\n }\r\n else if (!timeout && options.trailing !== false) {\r\n timeout = setTimeout(() => {\r\n previous = options.leading === false ? 0 : Date.now();\r\n timeout = null;\r\n func.apply(context, args);\r\n }, remaining);\r\n }\r\n };\r\n}\r\nfunction hookSetter(target, key, d, isRevoked, win = window) {\r\n const original = win.Object.getOwnPropertyDescriptor(target, key);\r\n win.Object.defineProperty(target, key, isRevoked\r\n ? d\r\n : {\r\n set(value) {\r\n setTimeout(() => {\r\n d.set.call(this, value);\r\n }, 0);\r\n if (original && original.set) {\r\n original.set.call(this, value);\r\n }\r\n },\r\n });\r\n return () => hookSetter(target, key, original || {}, true);\r\n}\r\nfunction patch(source, name, replacement) {\r\n try {\r\n if (!(name in source)) {\r\n return () => {\r\n };\r\n }\r\n const original = source[name];\r\n const wrapped = replacement(original);\r\n if (typeof wrapped === 'function') {\r\n wrapped.prototype = wrapped.prototype || {};\r\n Object.defineProperties(wrapped, {\r\n __rrweb_original__: {\r\n enumerable: false,\r\n value: original,\r\n },\r\n });\r\n }\r\n source[name] = wrapped;\r\n return () => {\r\n source[name] = original;\r\n };\r\n }\r\n catch (_a) {\r\n return () => {\r\n };\r\n }\r\n}\r\nlet nowTimestamp = Date.now;\r\nif (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {\r\n nowTimestamp = () => new Date().getTime();\r\n}\r\nfunction getWindowScroll(win) {\r\n var _a, _b, _c, _d, _e, _f;\r\n const doc = win.document;\r\n return {\r\n left: doc.scrollingElement\r\n ? doc.scrollingElement.scrollLeft\r\n : win.pageXOffset !== undefined\r\n ? win.pageXOffset\r\n : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollLeft) ||\r\n ((_b = (_a = doc === null || doc === void 0 ? void 0 : doc.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||\r\n ((_c = doc === null || doc === void 0 ? void 0 : doc.body) === null || _c === void 0 ? void 0 : _c.scrollLeft) ||\r\n 0,\r\n top: doc.scrollingElement\r\n ? doc.scrollingElement.scrollTop\r\n : win.pageYOffset !== undefined\r\n ? win.pageYOffset\r\n : (doc === null || doc === void 0 ? void 0 : doc.documentElement.scrollTop) ||\r\n ((_e = (_d = doc === null || doc === void 0 ? void 0 : doc.body) === null || _d === void 0 ? void 0 : _d.parentElement) === null || _e === void 0 ? void 0 : _e.scrollTop) ||\r\n ((_f = doc === null || doc === void 0 ? void 0 : doc.body) === null || _f === void 0 ? void 0 : _f.scrollTop) ||\r\n 0,\r\n };\r\n}\r\nfunction getWindowHeight() {\r\n return (window.innerHeight ||\r\n (document.documentElement && document.documentElement.clientHeight) ||\r\n (document.body && document.body.clientHeight));\r\n}\r\nfunction getWindowWidth() {\r\n return (window.innerWidth ||\r\n (document.documentElement && document.documentElement.clientWidth) ||\r\n (document.body && document.body.clientWidth));\r\n}\r\nfunction closestElementOfNode(node) {\r\n if (!node) {\r\n return null;\r\n }\r\n const el = node.nodeType === node.ELEMENT_NODE\r\n ? node\r\n : node.parentElement;\r\n return el;\r\n}\r\nfunction isBlocked(node, blockClass, blockSelector, checkAncestors) {\r\n if (!node) {\r\n return false;\r\n }\r\n const el = closestElementOfNode(node);\r\n if (!el) {\r\n return false;\r\n }\r\n try {\r\n if (typeof blockClass === 'string') {\r\n if (el.classList.contains(blockClass))\r\n return true;\r\n if (checkAncestors && el.closest('.' + blockClass) !== null)\r\n return true;\r\n }\r\n else {\r\n if (classMatchesRegex(el, blockClass, checkAncestors))\r\n return true;\r\n }\r\n }\r\n catch (e) {\r\n }\r\n if (blockSelector) {\r\n if (el.matches(blockSelector))\r\n return true;\r\n if (checkAncestors && el.closest(blockSelector) !== null)\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction isSerialized(n, mirror) {\r\n return mirror.getId(n) !== -1;\r\n}\r\nfunction isIgnored(n, mirror) {\r\n return mirror.getId(n) === IGNORED_NODE;\r\n}\r\nfunction isAncestorRemoved(target, mirror) {\r\n if (isShadowRoot(target)) {\r\n return false;\r\n }\r\n const id = mirror.getId(target);\r\n if (!mirror.has(id)) {\r\n return true;\r\n }\r\n if (target.parentNode &&\r\n target.parentNode.nodeType === target.DOCUMENT_NODE) {\r\n return false;\r\n }\r\n if (!target.parentNode) {\r\n return true;\r\n }\r\n return isAncestorRemoved(target.parentNode, mirror);\r\n}\r\nfunction legacy_isTouchEvent(event) {\r\n return Boolean(event.changedTouches);\r\n}\r\nfunction polyfill(win = window) {\r\n if ('NodeList' in win && !win.NodeList.prototype.forEach) {\r\n win.NodeList.prototype.forEach = Array.prototype\r\n .forEach;\r\n }\r\n if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\r\n win.DOMTokenList.prototype.forEach = Array.prototype\r\n .forEach;\r\n }\r\n if (!Node.prototype.contains) {\r\n Node.prototype.contains = (...args) => {\r\n let node = args[0];\r\n if (!(0 in args)) {\r\n throw new TypeError('1 argument is required');\r\n }\r\n do {\r\n if (this === node) {\r\n return true;\r\n }\r\n } while ((node = node && node.parentNode));\r\n return false;\r\n };\r\n }\r\n}\r\nfunction queueToResolveTrees(queue) {\r\n const queueNodeMap = {};\r\n const putIntoMap = (m, parent) => {\r\n const nodeInTree = {\r\n value: m,\r\n parent,\r\n children: [],\r\n };\r\n queueNodeMap[m.node.id] = nodeInTree;\r\n return nodeInTree;\r\n };\r\n const queueNodeTrees = [];\r\n for (const mutation of queue) {\r\n const { nextId, parentId } = mutation;\r\n if (nextId && nextId in queueNodeMap) {\r\n const nextInTree = queueNodeMap[nextId];\r\n if (nextInTree.parent) {\r\n const idx = nextInTree.parent.children.indexOf(nextInTree);\r\n nextInTree.parent.children.splice(idx, 0, putIntoMap(mutation, nextInTree.parent));\r\n }\r\n else {\r\n const idx = queueNodeTrees.indexOf(nextInTree);\r\n queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\r\n }\r\n continue;\r\n }\r\n if (parentId in queueNodeMap) {\r\n const parentInTree = queueNodeMap[parentId];\r\n parentInTree.children.push(putIntoMap(mutation, parentInTree));\r\n continue;\r\n }\r\n queueNodeTrees.push(putIntoMap(mutation, null));\r\n }\r\n return queueNodeTrees;\r\n}\r\nfunction iterateResolveTree(tree, cb) {\r\n cb(tree.value);\r\n for (let i = tree.children.length - 1; i >= 0; i--) {\r\n iterateResolveTree(tree.children[i], cb);\r\n }\r\n}\r\nfunction isSerializedIframe(n, mirror) {\r\n return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n));\r\n}\r\nfunction isSerializedStylesheet(n, mirror) {\r\n return Boolean(n.nodeName === 'LINK' &&\r\n n.nodeType === n.ELEMENT_NODE &&\r\n n.getAttribute &&\r\n n.getAttribute('rel') === 'stylesheet' &&\r\n mirror.getMeta(n));\r\n}\r\nfunction getBaseDimension(node, rootIframe) {\r\n var _a, _b;\r\n const frameElement = (_b = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.frameElement;\r\n if (!frameElement || frameElement === rootIframe) {\r\n return {\r\n x: 0,\r\n y: 0,\r\n relativeScale: 1,\r\n absoluteScale: 1,\r\n };\r\n }\r\n const frameDimension = frameElement.getBoundingClientRect();\r\n const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\r\n const relativeScale = frameDimension.height / frameElement.clientHeight;\r\n return {\r\n x: frameDimension.x * frameBaseDimension.relativeScale +\r\n frameBaseDimension.x,\r\n y: frameDimension.y * frameBaseDimension.relativeScale +\r\n frameBaseDimension.y,\r\n relativeScale,\r\n absoluteScale: frameBaseDimension.absoluteScale * relativeScale,\r\n };\r\n}\r\nfunction hasShadowRoot(n) {\r\n return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);\r\n}\r\nfunction getNestedRule(rules, position) {\r\n const rule = rules[position[0]];\r\n if (position.length === 1) {\r\n return rule;\r\n }\r\n else {\r\n return getNestedRule(rule.cssRules[position[1]].cssRules, position.slice(2));\r\n }\r\n}\r\nfunction getPositionsAndIndex(nestedIndex) {\r\n const positions = [...nestedIndex];\r\n const index = positions.pop();\r\n return { positions, index };\r\n}\r\nfunction uniqueTextMutations(mutations) {\r\n const idSet = new Set();\r\n const uniqueMutations = [];\r\n for (let i = mutations.length; i--;) {\r\n const mutation = mutations[i];\r\n if (!idSet.has(mutation.id)) {\r\n uniqueMutations.push(mutation);\r\n idSet.add(mutation.id);\r\n }\r\n }\r\n return uniqueMutations;\r\n}\r\nclass StyleSheetMirror {\r\n constructor() {\r\n this.id = 1;\r\n this.styleIDMap = new WeakMap();\r\n this.idStyleMap = new Map();\r\n }\r\n getId(stylesheet) {\r\n var _a;\r\n return (_a = this.styleIDMap.get(stylesheet)) !== null && _a !== void 0 ? _a : -1;\r\n }\r\n has(stylesheet) {\r\n return this.styleIDMap.has(stylesheet);\r\n }\r\n add(stylesheet, id) {\r\n if (this.has(stylesheet))\r\n return this.getId(stylesheet);\r\n let newId;\r\n if (id === undefined) {\r\n newId = this.id++;\r\n }\r\n else\r\n newId = id;\r\n this.styleIDMap.set(stylesheet, newId);\r\n this.idStyleMap.set(newId, stylesheet);\r\n return newId;\r\n }\r\n getStyle(id) {\r\n return this.idStyleMap.get(id) || null;\r\n }\r\n reset() {\r\n this.styleIDMap = new WeakMap();\r\n this.idStyleMap = new Map();\r\n this.id = 1;\r\n }\r\n generateId() {\r\n return this.id++;\r\n }\r\n}\r\nfunction getShadowHost(n) {\r\n var _a, _b;\r\n let shadowHost = null;\r\n if (((_b = (_a = n.getRootNode) === null || _a === void 0 ? void 0 : _a.call(n)) === null || _b === void 0 ? void 0 : _b.nodeType) === Node.DOCUMENT_FRAGMENT_NODE &&\r\n n.getRootNode().host)\r\n shadowHost = n.getRootNode().host;\r\n return shadowHost;\r\n}\r\nfunction getRootShadowHost(n) {\r\n let rootShadowHost = n;\r\n let shadowHost;\r\n while ((shadowHost = getShadowHost(rootShadowHost)))\r\n rootShadowHost = shadowHost;\r\n return rootShadowHost;\r\n}\r\nfunction shadowHostInDom(n) {\r\n const doc = n.ownerDocument;\r\n if (!doc)\r\n return false;\r\n const shadowHost = getRootShadowHost(n);\r\n return doc.contains(shadowHost);\r\n}\r\nfunction inDom(n) {\r\n const doc = n.ownerDocument;\r\n if (!doc)\r\n return false;\r\n return doc.contains(n) || shadowHostInDom(n);\r\n}\n\nexport { StyleSheetMirror, _mirror, closestElementOfNode, getBaseDimension, getNestedRule, getPositionsAndIndex, getRootShadowHost, getShadowHost, getWindowHeight, getWindowScroll, getWindowWidth, hasShadowRoot, hookSetter, inDom, isAncestorRemoved, isBlocked, isIgnored, isSerialized, isSerializedIframe, isSerializedStylesheet, iterateResolveTree, legacy_isTouchEvent, nowTimestamp, on, patch, polyfill, queueToResolveTrees, shadowHostInDom, throttle, uniqueTextMutations };\n", "var EventType = /* @__PURE__ */ ((EventType2) => {\n EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n return IncrementalSource2;\n})(IncrementalSource || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n return PointerTypes2;\n})(PointerTypes || {});\nvar CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {\n CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n return CanvasContext2;\n})(CanvasContext || {});\nvar ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {\n ReplayerEvents2[\"Start\"] = \"start\";\n ReplayerEvents2[\"Pause\"] = \"pause\";\n ReplayerEvents2[\"Resume\"] = \"resume\";\n ReplayerEvents2[\"Resize\"] = \"resize\";\n ReplayerEvents2[\"Finish\"] = \"finish\";\n ReplayerEvents2[\"FullsnapshotRebuilded\"] = \"fullsnapshot-rebuilded\";\n ReplayerEvents2[\"LoadStylesheetStart\"] = \"load-stylesheet-start\";\n ReplayerEvents2[\"LoadStylesheetEnd\"] = \"load-stylesheet-end\";\n ReplayerEvents2[\"SkipStart\"] = \"skip-start\";\n ReplayerEvents2[\"SkipEnd\"] = \"skip-end\";\n ReplayerEvents2[\"MouseInteraction\"] = \"mouse-interaction\";\n ReplayerEvents2[\"EventCast\"] = \"event-cast\";\n ReplayerEvents2[\"CustomEvent\"] = \"custom-event\";\n ReplayerEvents2[\"Flush\"] = \"flush\";\n ReplayerEvents2[\"StateChange\"] = \"state-change\";\n ReplayerEvents2[\"PlayBack\"] = \"play-back\";\n ReplayerEvents2[\"Destroy\"] = \"destroy\";\n return ReplayerEvents2;\n})(ReplayerEvents || {});\n\nexport { CanvasContext, EventType, IncrementalSource, MouseInteractions, PointerTypes, ReplayerEvents };\n", "import { isShadowRoot, isNativeShadowDom, getInputType, maskInputValue, ignoreAttribute, transformAttribute, toLowerCase, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { isIgnored, isBlocked, isSerialized, isAncestorRemoved, closestElementOfNode, hasShadowRoot, inDom, getShadowHost, isSerializedIframe, isSerializedStylesheet } from '../utils.js';\n\nfunction isNodeInLinkedList(n) {\r\n return '__ln' in n;\r\n}\r\nclass DoubleLinkedList {\r\n constructor() {\r\n this.length = 0;\r\n this.head = null;\r\n this.tail = null;\r\n }\r\n get(position) {\r\n if (position >= this.length) {\r\n throw new Error('Position outside of list range');\r\n }\r\n let current = this.head;\r\n for (let index = 0; index < position; index++) {\r\n current = (current === null || current === void 0 ? void 0 : current.next) || null;\r\n }\r\n return current;\r\n }\r\n addNode(n) {\r\n const node = {\r\n value: n,\r\n previous: null,\r\n next: null,\r\n };\r\n n.__ln = node;\r\n if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\r\n const current = n.previousSibling.__ln.next;\r\n node.next = current;\r\n node.previous = n.previousSibling.__ln;\r\n n.previousSibling.__ln.next = node;\r\n if (current) {\r\n current.previous = node;\r\n }\r\n }\r\n else if (n.nextSibling &&\r\n isNodeInLinkedList(n.nextSibling) &&\r\n n.nextSibling.__ln.previous) {\r\n const current = n.nextSibling.__ln.previous;\r\n node.previous = current;\r\n node.next = n.nextSibling.__ln;\r\n n.nextSibling.__ln.previous = node;\r\n if (current) {\r\n current.next = node;\r\n }\r\n }\r\n else {\r\n if (this.head) {\r\n this.head.previous = node;\r\n }\r\n node.next = this.head;\r\n this.head = node;\r\n }\r\n if (node.next === null) {\r\n this.tail = node;\r\n }\r\n this.length++;\r\n }\r\n removeNode(n) {\r\n const current = n.__ln;\r\n if (!this.head) {\r\n return;\r\n }\r\n if (!current.previous) {\r\n this.head = current.next;\r\n if (this.head) {\r\n this.head.previous = null;\r\n }\r\n else {\r\n this.tail = null;\r\n }\r\n }\r\n else {\r\n current.previous.next = current.next;\r\n if (current.next) {\r\n current.next.previous = current.previous;\r\n }\r\n else {\r\n this.tail = current.previous;\r\n }\r\n }\r\n if (n.__ln) {\r\n delete n.__ln;\r\n }\r\n this.length--;\r\n }\r\n}\r\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\r\nclass MutationBuffer {\r\n constructor() {\r\n this.frozen = false;\r\n this.locked = false;\r\n this.texts = [];\r\n this.attributes = [];\r\n this.attributeMap = new WeakMap();\r\n this.removes = [];\r\n this.mapRemoves = [];\r\n this.movedMap = {};\r\n this.addedSet = new Set();\r\n this.movedSet = new Set();\r\n this.droppedSet = new Set();\r\n this.processMutations = (mutations) => {\r\n mutations.forEach(this.processMutation);\r\n this.emit();\r\n };\r\n this.emit = () => {\r\n if (this.frozen || this.locked) {\r\n return;\r\n }\r\n const adds = [];\r\n const addedIds = new Set();\r\n const addList = new DoubleLinkedList();\r\n const getNextId = (n) => {\r\n let ns = n;\r\n let nextId = IGNORED_NODE;\r\n while (nextId === IGNORED_NODE) {\r\n ns = ns && ns.nextSibling;\r\n nextId = ns && this.mirror.getId(ns);\r\n }\r\n return nextId;\r\n };\r\n const pushAdd = (n) => {\r\n if (!n.parentNode ||\r\n !inDom(n) ||\r\n n.parentNode.tagName === 'TEXTAREA') {\r\n return;\r\n }\r\n const parentId = isShadowRoot(n.parentNode)\r\n ? this.mirror.getId(getShadowHost(n))\r\n : this.mirror.getId(n.parentNode);\r\n const nextId = getNextId(n);\r\n if (parentId === -1 || nextId === -1) {\r\n return addList.addNode(n);\r\n }\r\n const sn = serializeNodeWithId(n, {\r\n doc: this.doc,\r\n mirror: this.mirror,\r\n blockClass: this.blockClass,\r\n blockSelector: this.blockSelector,\r\n maskTextClass: this.maskTextClass,\r\n maskTextSelector: this.maskTextSelector,\r\n skipChild: true,\r\n newlyAddedElement: true,\r\n inlineStylesheet: this.inlineStylesheet,\r\n maskInputOptions: this.maskInputOptions,\r\n maskTextFn: this.maskTextFn,\r\n maskInputFn: this.maskInputFn,\r\n slimDOMOptions: this.slimDOMOptions,\r\n dataURLOptions: this.dataURLOptions,\r\n recordCanvas: this.recordCanvas,\r\n inlineImages: this.inlineImages,\r\n onSerialize: (currentN) => {\r\n if (isSerializedIframe(currentN, this.mirror)) {\r\n this.iframeManager.addIframe(currentN);\r\n }\r\n if (isSerializedStylesheet(currentN, this.mirror)) {\r\n this.stylesheetManager.trackLinkElement(currentN);\r\n }\r\n if (hasShadowRoot(n)) {\r\n this.shadowDomManager.addShadowRoot(n.shadowRoot, this.doc);\r\n }\r\n },\r\n onIframeLoad: (iframe, childSn) => {\r\n this.iframeManager.attachIframe(iframe, childSn);\r\n this.shadowDomManager.observeAttachShadow(iframe);\r\n },\r\n onStylesheetLoad: (link, childSn) => {\r\n this.stylesheetManager.attachLinkElement(link, childSn);\r\n },\r\n });\r\n if (sn) {\r\n adds.push({\r\n parentId,\r\n nextId,\r\n node: sn,\r\n });\r\n addedIds.add(sn.id);\r\n }\r\n };\r\n while (this.mapRemoves.length) {\r\n this.mirror.removeNodeFromMap(this.mapRemoves.shift());\r\n }\r\n for (const n of this.movedSet) {\r\n if (isParentRemoved(this.removes, n, this.mirror) &&\r\n !this.movedSet.has(n.parentNode)) {\r\n continue;\r\n }\r\n pushAdd(n);\r\n }\r\n for (const n of this.addedSet) {\r\n if (!isAncestorInSet(this.droppedSet, n) &&\r\n !isParentRemoved(this.removes, n, this.mirror)) {\r\n pushAdd(n);\r\n }\r\n else if (isAncestorInSet(this.movedSet, n)) {\r\n pushAdd(n);\r\n }\r\n else {\r\n this.droppedSet.add(n);\r\n }\r\n }\r\n let candidate = null;\r\n while (addList.length) {\r\n let node = null;\r\n if (candidate) {\r\n const parentId = this.mirror.getId(candidate.value.parentNode);\r\n const nextId = getNextId(candidate.value);\r\n if (parentId !== -1 && nextId !== -1) {\r\n node = candidate;\r\n }\r\n }\r\n if (!node) {\r\n let tailNode = addList.tail;\r\n while (tailNode) {\r\n const _node = tailNode;\r\n tailNode = tailNode.previous;\r\n if (_node) {\r\n const parentId = this.mirror.getId(_node.value.parentNode);\r\n const nextId = getNextId(_node.value);\r\n if (nextId === -1)\r\n continue;\r\n else if (parentId !== -1) {\r\n node = _node;\r\n break;\r\n }\r\n else {\r\n const unhandledNode = _node.value;\r\n if (unhandledNode.parentNode &&\r\n unhandledNode.parentNode.nodeType ===\r\n Node.DOCUMENT_FRAGMENT_NODE) {\r\n const shadowHost = unhandledNode.parentNode\r\n .host;\r\n const parentId = this.mirror.getId(shadowHost);\r\n if (parentId !== -1) {\r\n node = _node;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!node) {\r\n while (addList.head) {\r\n addList.removeNode(addList.head.value);\r\n }\r\n break;\r\n }\r\n candidate = node.previous;\r\n addList.removeNode(node.value);\r\n pushAdd(node.value);\r\n }\r\n const payload = {\r\n texts: this.texts\r\n .map((text) => {\r\n const n = text.node;\r\n if (n.parentNode.tagName === 'TEXTAREA') {\r\n this.genTextAreaValueMutation(n.parentNode);\r\n }\r\n return {\r\n id: this.mirror.getId(n),\r\n value: text.value,\r\n };\r\n })\r\n .filter((text) => !addedIds.has(text.id))\r\n .filter((text) => this.mirror.has(text.id)),\r\n attributes: this.attributes\r\n .map((attribute) => {\r\n const { attributes } = attribute;\r\n if (typeof attributes.style === 'string') {\r\n const diffAsStr = JSON.stringify(attribute.styleDiff);\r\n const unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\r\n if (diffAsStr.length < attributes.style.length) {\r\n if ((diffAsStr + unchangedAsStr).split('var(').length ===\r\n attributes.style.split('var(').length) {\r\n attributes.style = attribute.styleDiff;\r\n }\r\n }\r\n }\r\n return {\r\n id: this.mirror.getId(attribute.node),\r\n attributes: attributes,\r\n };\r\n })\r\n .filter((attribute) => !addedIds.has(attribute.id))\r\n .filter((attribute) => this.mirror.has(attribute.id)),\r\n removes: this.removes,\r\n adds,\r\n };\r\n if (!payload.texts.length &&\r\n !payload.attributes.length &&\r\n !payload.removes.length &&\r\n !payload.adds.length) {\r\n return;\r\n }\r\n this.texts = [];\r\n this.attributes = [];\r\n this.attributeMap = new WeakMap();\r\n this.removes = [];\r\n this.addedSet = new Set();\r\n this.movedSet = new Set();\r\n this.droppedSet = new Set();\r\n this.movedMap = {};\r\n this.mutationCb(payload);\r\n };\r\n this.genTextAreaValueMutation = (textarea) => {\r\n let item = this.attributeMap.get(textarea);\r\n if (!item) {\r\n item = {\r\n node: textarea,\r\n attributes: {},\r\n styleDiff: {},\r\n _unchangedStyles: {},\r\n };\r\n this.attributes.push(item);\r\n this.attributeMap.set(textarea, item);\r\n }\r\n item.attributes.value = Array.from(textarea.childNodes, (cn) => cn.textContent || '').join('');\r\n };\r\n this.processMutation = (m) => {\r\n if (isIgnored(m.target, this.mirror)) {\r\n return;\r\n }\r\n switch (m.type) {\r\n case 'characterData': {\r\n const value = m.target.textContent;\r\n if (!isBlocked(m.target, this.blockClass, this.blockSelector, false) &&\r\n value !== m.oldValue) {\r\n this.texts.push({\r\n value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, true) && value\r\n ? this.maskTextFn\r\n ? this.maskTextFn(value, closestElementOfNode(m.target))\r\n : value.replace(/[\\S]/g, '*')\r\n : value,\r\n node: m.target,\r\n });\r\n }\r\n break;\r\n }\r\n case 'attributes': {\r\n const target = m.target;\r\n let attributeName = m.attributeName;\r\n let value = m.target.getAttribute(attributeName);\r\n if (attributeName === 'value') {\r\n const type = getInputType(target);\r\n value = maskInputValue({\r\n element: target,\r\n maskInputOptions: this.maskInputOptions,\r\n tagName: target.tagName,\r\n type,\r\n value,\r\n maskInputFn: this.maskInputFn,\r\n });\r\n }\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, false) ||\r\n value === m.oldValue) {\r\n return;\r\n }\r\n let item = this.attributeMap.get(m.target);\r\n if (target.tagName === 'IFRAME' &&\r\n attributeName === 'src' &&\r\n !this.keepIframeSrcFn(value)) {\r\n if (!target.contentDocument) {\r\n attributeName = 'rr_src';\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n if (!item) {\r\n item = {\r\n node: m.target,\r\n attributes: {},\r\n styleDiff: {},\r\n _unchangedStyles: {},\r\n };\r\n this.attributes.push(item);\r\n this.attributeMap.set(m.target, item);\r\n }\r\n if (attributeName === 'type' &&\r\n target.tagName === 'INPUT' &&\r\n (m.oldValue || '').toLowerCase() === 'password') {\r\n target.setAttribute('data-rr-is-password', 'true');\r\n }\r\n if (!ignoreAttribute(target.tagName, attributeName)) {\r\n item.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target.tagName), toLowerCase(attributeName), value);\r\n if (attributeName === 'style') {\r\n if (!this.unattachedDoc) {\r\n try {\r\n this.unattachedDoc =\r\n document.implementation.createHTMLDocument();\r\n }\r\n catch (e) {\r\n this.unattachedDoc = this.doc;\r\n }\r\n }\r\n const old = this.unattachedDoc.createElement('span');\r\n if (m.oldValue) {\r\n old.setAttribute('style', m.oldValue);\r\n }\r\n for (const pname of Array.from(target.style)) {\r\n const newValue = target.style.getPropertyValue(pname);\r\n const newPriority = target.style.getPropertyPriority(pname);\r\n if (newValue !== old.style.getPropertyValue(pname) ||\r\n newPriority !== old.style.getPropertyPriority(pname)) {\r\n if (newPriority === '') {\r\n item.styleDiff[pname] = newValue;\r\n }\r\n else {\r\n item.styleDiff[pname] = [newValue, newPriority];\r\n }\r\n }\r\n else {\r\n item._unchangedStyles[pname] = [newValue, newPriority];\r\n }\r\n }\r\n for (const pname of Array.from(old.style)) {\r\n if (target.style.getPropertyValue(pname) === '') {\r\n item.styleDiff[pname] = false;\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case 'childList': {\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, true))\r\n return;\r\n if (m.target.tagName === 'TEXTAREA') {\r\n this.genTextAreaValueMutation(m.target);\r\n return;\r\n }\r\n m.addedNodes.forEach((n) => this.genAdds(n, m.target));\r\n m.removedNodes.forEach((n) => {\r\n const nodeId = this.mirror.getId(n);\r\n const parentId = isShadowRoot(m.target)\r\n ? this.mirror.getId(m.target.host)\r\n : this.mirror.getId(m.target);\r\n if (isBlocked(m.target, this.blockClass, this.blockSelector, false) ||\r\n isIgnored(n, this.mirror) ||\r\n !isSerialized(n, this.mirror)) {\r\n return;\r\n }\r\n if (this.addedSet.has(n)) {\r\n deepDelete(this.addedSet, n);\r\n this.droppedSet.add(n);\r\n }\r\n else if (this.addedSet.has(m.target) && nodeId === -1) ;\r\n else if (isAncestorRemoved(m.target, this.mirror)) ;\r\n else if (this.movedSet.has(n) &&\r\n this.movedMap[moveKey(nodeId, parentId)]) {\r\n deepDelete(this.movedSet, n);\r\n }\r\n else {\r\n this.removes.push({\r\n parentId,\r\n id: nodeId,\r\n isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target)\r\n ? true\r\n : undefined,\r\n });\r\n }\r\n this.mapRemoves.push(n);\r\n });\r\n break;\r\n }\r\n }\r\n };\r\n this.genAdds = (n, target) => {\r\n if (this.processedNodeManager.inOtherBuffer(n, this))\r\n return;\r\n if (this.addedSet.has(n) || this.movedSet.has(n))\r\n return;\r\n if (this.mirror.hasNode(n)) {\r\n if (isIgnored(n, this.mirror)) {\r\n return;\r\n }\r\n this.movedSet.add(n);\r\n let targetId = null;\r\n if (target && this.mirror.hasNode(target)) {\r\n targetId = this.mirror.getId(target);\r\n }\r\n if (targetId && targetId !== -1) {\r\n this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;\r\n }\r\n }\r\n else {\r\n this.addedSet.add(n);\r\n this.droppedSet.delete(n);\r\n }\r\n if (!isBlocked(n, this.blockClass, this.blockSelector, false)) {\r\n n.childNodes.forEach((childN) => this.genAdds(childN));\r\n if (hasShadowRoot(n)) {\r\n n.shadowRoot.childNodes.forEach((childN) => {\r\n this.processedNodeManager.add(childN, this);\r\n this.genAdds(childN, n);\r\n });\r\n }\r\n }\r\n };\r\n }\r\n init(options) {\r\n [\r\n 'mutationCb',\r\n 'blockClass',\r\n 'blockSelector',\r\n 'maskTextClass',\r\n 'maskTextSelector',\r\n 'inlineStylesheet',\r\n 'maskInputOptions',\r\n 'maskTextFn',\r\n 'maskInputFn',\r\n 'keepIframeSrcFn',\r\n 'recordCanvas',\r\n 'inlineImages',\r\n 'slimDOMOptions',\r\n 'dataURLOptions',\r\n 'doc',\r\n 'mirror',\r\n 'iframeManager',\r\n 'stylesheetManager',\r\n 'shadowDomManager',\r\n 'canvasManager',\r\n 'processedNodeManager',\r\n ].forEach((key) => {\r\n this[key] = options[key];\r\n });\r\n }\r\n freeze() {\r\n this.frozen = true;\r\n this.canvasManager.freeze();\r\n }\r\n unfreeze() {\r\n this.frozen = false;\r\n this.canvasManager.unfreeze();\r\n this.emit();\r\n }\r\n isFrozen() {\r\n return this.frozen;\r\n }\r\n lock() {\r\n this.locked = true;\r\n this.canvasManager.lock();\r\n }\r\n unlock() {\r\n this.locked = false;\r\n this.canvasManager.unlock();\r\n this.emit();\r\n }\r\n reset() {\r\n this.shadowDomManager.reset();\r\n this.canvasManager.reset();\r\n }\r\n}\r\nfunction deepDelete(addsSet, n) {\r\n addsSet.delete(n);\r\n n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\r\n}\r\nfunction isParentRemoved(removes, n, mirror) {\r\n if (removes.length === 0)\r\n return false;\r\n return _isParentRemoved(removes, n, mirror);\r\n}\r\nfunction _isParentRemoved(removes, n, mirror) {\r\n const { parentNode } = n;\r\n if (!parentNode) {\r\n return false;\r\n }\r\n const parentId = mirror.getId(parentNode);\r\n if (removes.some((r) => r.id === parentId)) {\r\n return true;\r\n }\r\n return _isParentRemoved(removes, parentNode, mirror);\r\n}\r\nfunction isAncestorInSet(set, n) {\r\n if (set.size === 0)\r\n return false;\r\n return _isAncestorInSet(set, n);\r\n}\r\nfunction _isAncestorInSet(set, n) {\r\n const { parentNode } = n;\r\n if (!parentNode) {\r\n return false;\r\n }\r\n if (set.has(parentNode)) {\r\n return true;\r\n }\r\n return _isAncestorInSet(set, parentNode);\r\n}\n\nexport { MutationBuffer as default };\n", "let errorHandler;\r\nfunction registerErrorHandler(handler) {\r\n errorHandler = handler;\r\n}\r\nfunction unregisterErrorHandler() {\r\n errorHandler = undefined;\r\n}\r\nconst callbackWrapper = (cb) => {\r\n if (!errorHandler) {\r\n return cb;\r\n }\r\n const rrwebWrapped = ((...rest) => {\r\n try {\r\n return cb(...rest);\r\n }\r\n catch (error) {\r\n if (errorHandler && errorHandler(error) === true) {\r\n return;\r\n }\r\n throw error;\r\n }\r\n });\r\n return rrwebWrapped;\r\n};\n\nexport { callbackWrapper, registerErrorHandler, unregisterErrorHandler };\n", "import { toLowerCase, getInputType, maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { on, throttle, isBlocked, getWindowScroll, getWindowHeight, getWindowWidth, hookSetter, patch, legacy_isTouchEvent, nowTimestamp } from '../utils.js';\nimport { MouseInteractions, IncrementalSource, PointerTypes } from '../../../types/dist/types.js';\nimport MutationBuffer from './mutation.js';\nimport { callbackWrapper } from './error-handler.js';\n\nconst mutationBuffers = [];\r\nfunction getEventTarget(event) {\r\n try {\r\n if ('composedPath' in event) {\r\n const path = event.composedPath();\r\n if (path.length) {\r\n return path[0];\r\n }\r\n }\r\n else if ('path' in event && event.path.length) {\r\n return event.path[0];\r\n }\r\n }\r\n catch (_a) {\r\n }\r\n return event && event.target;\r\n}\r\nfunction initMutationObserver(options, rootEl) {\r\n var _a, _b;\r\n const mutationBuffer = new MutationBuffer();\r\n mutationBuffers.push(mutationBuffer);\r\n mutationBuffer.init(options);\r\n let mutationObserverCtor = window.MutationObserver ||\r\n window.__rrMutationObserver;\r\n const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');\r\n if (angularZoneSymbol &&\r\n window[angularZoneSymbol]) {\r\n mutationObserverCtor = window[angularZoneSymbol];\r\n }\r\n const observer = new mutationObserverCtor(callbackWrapper(mutationBuffer.processMutations.bind(mutationBuffer)));\r\n observer.observe(rootEl, {\r\n attributes: true,\r\n attributeOldValue: true,\r\n characterData: true,\r\n characterDataOldValue: true,\r\n childList: true,\r\n subtree: true,\r\n });\r\n return observer;\r\n}\r\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\r\n if (sampling.mousemove === false) {\r\n return () => {\r\n };\r\n }\r\n const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\r\n const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\r\n ? sampling.mousemoveCallback\r\n : 500;\r\n let positions = [];\r\n let timeBaseline;\r\n const wrappedCb = throttle(callbackWrapper((source) => {\r\n const totalOffset = Date.now() - timeBaseline;\r\n mousemoveCb(positions.map((p) => {\r\n p.timeOffset -= totalOffset;\r\n return p;\r\n }), source);\r\n positions = [];\r\n timeBaseline = null;\r\n }), callbackThreshold);\r\n const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n const target = getEventTarget(evt);\r\n const { clientX, clientY } = legacy_isTouchEvent(evt)\r\n ? evt.changedTouches[0]\r\n : evt;\r\n if (!timeBaseline) {\r\n timeBaseline = nowTimestamp();\r\n }\r\n positions.push({\r\n x: clientX,\r\n y: clientY,\r\n id: mirror.getId(target),\r\n timeOffset: nowTimestamp() - timeBaseline,\r\n });\r\n wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\r\n ? IncrementalSource.Drag\r\n : evt instanceof MouseEvent\r\n ? IncrementalSource.MouseMove\r\n : IncrementalSource.TouchMove);\r\n }), threshold, {\r\n trailing: false,\r\n }));\r\n const handlers = [\r\n on('mousemove', updatePosition, doc),\r\n on('touchmove', updatePosition, doc),\r\n on('drag', updatePosition, doc),\r\n ];\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, sampling, }) {\r\n if (sampling.mouseInteraction === false) {\r\n return () => {\r\n };\r\n }\r\n const disableMap = sampling.mouseInteraction === true ||\r\n sampling.mouseInteraction === undefined\r\n ? {}\r\n : sampling.mouseInteraction;\r\n const handlers = [];\r\n let currentPointerType = null;\r\n const getHandler = (eventKey) => {\r\n return (event) => {\r\n const target = getEventTarget(event);\r\n if (isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n let pointerType = null;\r\n let thisEventKey = eventKey;\r\n if ('pointerType' in event) {\r\n switch (event.pointerType) {\r\n case 'mouse':\r\n pointerType = PointerTypes.Mouse;\r\n break;\r\n case 'touch':\r\n pointerType = PointerTypes.Touch;\r\n break;\r\n case 'pen':\r\n pointerType = PointerTypes.Pen;\r\n break;\r\n }\r\n if (pointerType === PointerTypes.Touch) {\r\n if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\r\n thisEventKey = 'TouchStart';\r\n }\r\n else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\r\n thisEventKey = 'TouchEnd';\r\n }\r\n }\r\n else if (pointerType === PointerTypes.Pen) ;\r\n }\r\n else if (legacy_isTouchEvent(event)) {\r\n pointerType = PointerTypes.Touch;\r\n }\r\n if (pointerType !== null) {\r\n currentPointerType = pointerType;\r\n if ((thisEventKey.startsWith('Touch') &&\r\n pointerType === PointerTypes.Touch) ||\r\n (thisEventKey.startsWith('Mouse') &&\r\n pointerType === PointerTypes.Mouse)) {\r\n pointerType = null;\r\n }\r\n }\r\n else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\r\n pointerType = currentPointerType;\r\n currentPointerType = null;\r\n }\r\n const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\r\n if (!e) {\r\n return;\r\n }\r\n const id = mirror.getId(target);\r\n const { clientX, clientY } = e;\r\n callbackWrapper(mouseInteractionCb)(Object.assign({ type: MouseInteractions[thisEventKey], id, x: clientX, y: clientY }, (pointerType !== null && { pointerType })));\r\n };\r\n };\r\n Object.keys(MouseInteractions)\r\n .filter((key) => Number.isNaN(Number(key)) &&\r\n !key.endsWith('_Departed') &&\r\n disableMap[key] !== false)\r\n .forEach((eventKey) => {\r\n let eventName = toLowerCase(eventKey);\r\n const handler = getHandler(eventKey);\r\n if (window.PointerEvent) {\r\n switch (MouseInteractions[eventKey]) {\r\n case MouseInteractions.MouseDown:\r\n case MouseInteractions.MouseUp:\r\n eventName = eventName.replace('mouse', 'pointer');\r\n break;\r\n case MouseInteractions.TouchStart:\r\n case MouseInteractions.TouchEnd:\r\n return;\r\n }\r\n }\r\n handlers.push(on(eventName, handler, doc));\r\n });\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, sampling, }) {\r\n const updatePosition = callbackWrapper(throttle(callbackWrapper((evt) => {\r\n const target = getEventTarget(evt);\r\n if (!target ||\r\n isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n const id = mirror.getId(target);\r\n if (target === doc && doc.defaultView) {\r\n const scrollLeftTop = getWindowScroll(doc.defaultView);\r\n scrollCb({\r\n id,\r\n x: scrollLeftTop.left,\r\n y: scrollLeftTop.top,\r\n });\r\n }\r\n else {\r\n scrollCb({\r\n id,\r\n x: target.scrollLeft,\r\n y: target.scrollTop,\r\n });\r\n }\r\n }), sampling.scroll || 100));\r\n return on('scroll', updatePosition, doc);\r\n}\r\nfunction initViewportResizeObserver({ viewportResizeCb }, { win }) {\r\n let lastH = -1;\r\n let lastW = -1;\r\n const updateDimension = callbackWrapper(throttle(callbackWrapper(() => {\r\n const height = getWindowHeight();\r\n const width = getWindowWidth();\r\n if (lastH !== height || lastW !== width) {\r\n viewportResizeCb({\r\n width: Number(width),\r\n height: Number(height),\r\n });\r\n lastH = height;\r\n lastW = width;\r\n }\r\n }), 200));\r\n return on('resize', updateDimension, win);\r\n}\r\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\r\nconst lastInputValueMap = new WeakMap();\r\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, }) {\r\n function eventHandler(event) {\r\n let target = getEventTarget(event);\r\n const userTriggered = event.isTrusted;\r\n const tagName = target && target.tagName;\r\n if (target && tagName === 'OPTION') {\r\n target = target.parentElement;\r\n }\r\n if (!target ||\r\n !tagName ||\r\n INPUT_TAGS.indexOf(tagName) < 0 ||\r\n isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n if (target.classList.contains(ignoreClass) ||\r\n (ignoreSelector && target.matches(ignoreSelector))) {\r\n return;\r\n }\r\n let text = target.value;\r\n let isChecked = false;\r\n const type = getInputType(target) || '';\r\n if (type === 'radio' || type === 'checkbox') {\r\n isChecked = target.checked;\r\n }\r\n else if (maskInputOptions[tagName.toLowerCase()] ||\r\n maskInputOptions[type]) {\r\n text = maskInputValue({\r\n element: target,\r\n maskInputOptions,\r\n tagName,\r\n type,\r\n value: text,\r\n maskInputFn,\r\n });\r\n }\r\n cbWithDedup(target, userTriggeredOnInput\r\n ? { text, isChecked, userTriggered }\r\n : { text, isChecked });\r\n const name = target.name;\r\n if (type === 'radio' && name && isChecked) {\r\n doc\r\n .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\r\n .forEach((el) => {\r\n if (el !== target) {\r\n const text = el.value;\r\n cbWithDedup(el, userTriggeredOnInput\r\n ? { text, isChecked: !isChecked, userTriggered: false }\r\n : { text, isChecked: !isChecked });\r\n }\r\n });\r\n }\r\n }\r\n function cbWithDedup(target, v) {\r\n const lastInputValue = lastInputValueMap.get(target);\r\n if (!lastInputValue ||\r\n lastInputValue.text !== v.text ||\r\n lastInputValue.isChecked !== v.isChecked) {\r\n lastInputValueMap.set(target, v);\r\n const id = mirror.getId(target);\r\n callbackWrapper(inputCb)(Object.assign(Object.assign({}, v), { id }));\r\n }\r\n }\r\n const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\r\n const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\r\n const currentWindow = doc.defaultView;\r\n if (!currentWindow) {\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n }\r\n const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value');\r\n const hookProperties = [\r\n [currentWindow.HTMLInputElement.prototype, 'value'],\r\n [currentWindow.HTMLInputElement.prototype, 'checked'],\r\n [currentWindow.HTMLSelectElement.prototype, 'value'],\r\n [currentWindow.HTMLTextAreaElement.prototype, 'value'],\r\n [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'],\r\n [currentWindow.HTMLOptionElement.prototype, 'selected'],\r\n ];\r\n if (propertyDescriptor && propertyDescriptor.set) {\r\n handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\r\n set() {\r\n callbackWrapper(eventHandler)({\r\n target: this,\r\n isTrusted: false,\r\n });\r\n },\r\n }, false, currentWindow)));\r\n }\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction getNestedCSSRulePositions(rule) {\r\n const positions = [];\r\n function recurse(childRule, pos) {\r\n if ((hasNestedCSSRule('CSSGroupingRule') &&\r\n childRule.parentRule instanceof CSSGroupingRule) ||\r\n (hasNestedCSSRule('CSSMediaRule') &&\r\n childRule.parentRule instanceof CSSMediaRule) ||\r\n (hasNestedCSSRule('CSSSupportsRule') &&\r\n childRule.parentRule instanceof CSSSupportsRule) ||\r\n (hasNestedCSSRule('CSSConditionRule') &&\r\n childRule.parentRule instanceof CSSConditionRule)) {\r\n const rules = Array.from(childRule.parentRule.cssRules);\r\n const index = rules.indexOf(childRule);\r\n pos.unshift(index);\r\n }\r\n else if (childRule.parentStyleSheet) {\r\n const rules = Array.from(childRule.parentStyleSheet.cssRules);\r\n const index = rules.indexOf(childRule);\r\n pos.unshift(index);\r\n }\r\n return pos;\r\n }\r\n return recurse(rule, positions);\r\n}\r\nfunction getIdAndStyleId(sheet, mirror, styleMirror) {\r\n let id, styleId;\r\n if (!sheet)\r\n return {};\r\n if (sheet.ownerNode)\r\n id = mirror.getId(sheet.ownerNode);\r\n else\r\n styleId = styleMirror.getId(sheet);\r\n return {\r\n styleId,\r\n id,\r\n };\r\n}\r\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror, stylesheetManager }, { win }) {\r\n if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\r\n return () => {\r\n };\r\n }\r\n const insertRule = win.CSSStyleSheet.prototype.insertRule;\r\n win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [rule, index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n adds: [{ rule, index }],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\r\n win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n removes: [{ index }],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n let replace;\r\n if (win.CSSStyleSheet.prototype.replace) {\r\n replace = win.CSSStyleSheet.prototype.replace;\r\n win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [text] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n replace: text,\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n }\r\n let replaceSync;\r\n if (win.CSSStyleSheet.prototype.replaceSync) {\r\n replaceSync = win.CSSStyleSheet.prototype.replaceSync;\r\n win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [text] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n replaceSync: text,\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n }\r\n const supportedNestedCSSRuleTypes = {};\r\n if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\r\n supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\r\n }\r\n else {\r\n if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\r\n supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\r\n }\r\n if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\r\n supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\r\n }\r\n if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\r\n supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\r\n }\r\n }\r\n const unmodifiedFunctions = {};\r\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n unmodifiedFunctions[typeKey] = {\r\n insertRule: type.prototype.insertRule,\r\n deleteRule: type.prototype.deleteRule,\r\n };\r\n type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [rule, index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n adds: [\r\n {\r\n rule,\r\n index: [\r\n ...getNestedCSSRulePositions(thisArg),\r\n index || 0,\r\n ],\r\n },\r\n ],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n const [index] = argumentsList;\r\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleSheetRuleCb({\r\n id,\r\n styleId,\r\n removes: [\r\n { index: [...getNestedCSSRulePositions(thisArg), index] },\r\n ],\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n });\r\n return callbackWrapper(() => {\r\n win.CSSStyleSheet.prototype.insertRule = insertRule;\r\n win.CSSStyleSheet.prototype.deleteRule = deleteRule;\r\n replace && (win.CSSStyleSheet.prototype.replace = replace);\r\n replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\r\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\r\n type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\r\n type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\r\n });\r\n });\r\n}\r\nfunction initAdoptedStyleSheetObserver({ mirror, stylesheetManager, }, host) {\r\n var _a, _b, _c;\r\n let hostId = null;\r\n if (host.nodeName === '#document')\r\n hostId = mirror.getId(host);\r\n else\r\n hostId = mirror.getId(host.host);\r\n const patchTarget = host.nodeName === '#document'\r\n ? (_a = host.defaultView) === null || _a === void 0 ? void 0 : _a.Document\r\n : (_c = (_b = host.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) === null || _c === void 0 ? void 0 : _c.ShadowRoot;\r\n const originalPropertyDescriptor = (patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype)\r\n ? Object.getOwnPropertyDescriptor(patchTarget === null || patchTarget === void 0 ? void 0 : patchTarget.prototype, 'adoptedStyleSheets')\r\n : undefined;\r\n if (hostId === null ||\r\n hostId === -1 ||\r\n !patchTarget ||\r\n !originalPropertyDescriptor)\r\n return () => {\r\n };\r\n Object.defineProperty(host, 'adoptedStyleSheets', {\r\n configurable: originalPropertyDescriptor.configurable,\r\n enumerable: originalPropertyDescriptor.enumerable,\r\n get() {\r\n var _a;\r\n return (_a = originalPropertyDescriptor.get) === null || _a === void 0 ? void 0 : _a.call(this);\r\n },\r\n set(sheets) {\r\n var _a;\r\n const result = (_a = originalPropertyDescriptor.set) === null || _a === void 0 ? void 0 : _a.call(this, sheets);\r\n if (hostId !== null && hostId !== -1) {\r\n try {\r\n stylesheetManager.adoptStyleSheets(sheets, hostId);\r\n }\r\n catch (e) {\r\n }\r\n }\r\n return result;\r\n },\r\n });\r\n return callbackWrapper(() => {\r\n Object.defineProperty(host, 'adoptedStyleSheets', {\r\n configurable: originalPropertyDescriptor.configurable,\r\n enumerable: originalPropertyDescriptor.enumerable,\r\n get: originalPropertyDescriptor.get,\r\n set: originalPropertyDescriptor.set,\r\n });\r\n });\r\n}\r\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror, ignoreCSSAttributes, stylesheetManager, }, { win }) {\r\n const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\r\n win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n var _a;\r\n const [property, value, priority] = argumentsList;\r\n if (ignoreCSSAttributes.has(property)) {\r\n return setProperty.apply(thisArg, [property, value, priority]);\r\n }\r\n const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleDeclarationCb({\r\n id,\r\n styleId,\r\n set: {\r\n property,\r\n value,\r\n priority,\r\n },\r\n index: getNestedCSSRulePositions(thisArg.parentRule),\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\r\n win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\r\n apply: callbackWrapper((target, thisArg, argumentsList) => {\r\n var _a;\r\n const [property] = argumentsList;\r\n if (ignoreCSSAttributes.has(property)) {\r\n return removeProperty.apply(thisArg, [property]);\r\n }\r\n const { id, styleId } = getIdAndStyleId((_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet, mirror, stylesheetManager.styleMirror);\r\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\r\n styleDeclarationCb({\r\n id,\r\n styleId,\r\n remove: {\r\n property,\r\n },\r\n index: getNestedCSSRulePositions(thisArg.parentRule),\r\n });\r\n }\r\n return target.apply(thisArg, argumentsList);\r\n }),\r\n });\r\n return callbackWrapper(() => {\r\n win.CSSStyleDeclaration.prototype.setProperty = setProperty;\r\n win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\r\n });\r\n}\r\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, mirror, sampling, doc, }) {\r\n const handler = callbackWrapper((type) => throttle(callbackWrapper((event) => {\r\n const target = getEventTarget(event);\r\n if (!target ||\r\n isBlocked(target, blockClass, blockSelector, true)) {\r\n return;\r\n }\r\n const { currentTime, volume, muted, playbackRate } = target;\r\n mediaInteractionCb({\r\n type,\r\n id: mirror.getId(target),\r\n currentTime,\r\n volume,\r\n muted,\r\n playbackRate,\r\n });\r\n }), sampling.media || 500));\r\n const handlers = [\r\n on('play', handler(0), doc),\r\n on('pause', handler(1), doc),\r\n on('seeked', handler(2), doc),\r\n on('volumechange', handler(3), doc),\r\n on('ratechange', handler(4), doc),\r\n ];\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initFontObserver({ fontCb, doc }) {\r\n const win = doc.defaultView;\r\n if (!win) {\r\n return () => {\r\n };\r\n }\r\n const handlers = [];\r\n const fontMap = new WeakMap();\r\n const originalFontFace = win.FontFace;\r\n win.FontFace = function FontFace(family, source, descriptors) {\r\n const fontFace = new originalFontFace(family, source, descriptors);\r\n fontMap.set(fontFace, {\r\n family,\r\n buffer: typeof source !== 'string',\r\n descriptors,\r\n fontSource: typeof source === 'string'\r\n ? source\r\n : JSON.stringify(Array.from(new Uint8Array(source))),\r\n });\r\n return fontFace;\r\n };\r\n const restoreHandler = patch(doc.fonts, 'add', function (original) {\r\n return function (fontFace) {\r\n setTimeout(callbackWrapper(() => {\r\n const p = fontMap.get(fontFace);\r\n if (p) {\r\n fontCb(p);\r\n fontMap.delete(fontFace);\r\n }\r\n }), 0);\r\n return original.apply(this, [fontFace]);\r\n };\r\n });\r\n handlers.push(() => {\r\n win.FontFace = originalFontFace;\r\n });\r\n handlers.push(restoreHandler);\r\n return callbackWrapper(() => {\r\n handlers.forEach((h) => h());\r\n });\r\n}\r\nfunction initSelectionObserver(param) {\r\n const { doc, mirror, blockClass, blockSelector, selectionCb } = param;\r\n let collapsed = true;\r\n const updateSelection = callbackWrapper(() => {\r\n const selection = doc.getSelection();\r\n if (!selection || (collapsed && (selection === null || selection === void 0 ? void 0 : selection.isCollapsed)))\r\n return;\r\n collapsed = selection.isCollapsed || false;\r\n const ranges = [];\r\n const count = selection.rangeCount || 0;\r\n for (let i = 0; i < count; i++) {\r\n const range = selection.getRangeAt(i);\r\n const { startContainer, startOffset, endContainer, endOffset } = range;\r\n const blocked = isBlocked(startContainer, blockClass, blockSelector, true) ||\r\n isBlocked(endContainer, blockClass, blockSelector, true);\r\n if (blocked)\r\n continue;\r\n ranges.push({\r\n start: mirror.getId(startContainer),\r\n startOffset,\r\n end: mirror.getId(endContainer),\r\n endOffset,\r\n });\r\n }\r\n selectionCb({ ranges });\r\n });\r\n updateSelection();\r\n return on('selectionchange', updateSelection);\r\n}\r\nfunction initCustomElementObserver({ doc, customElementCb, }) {\r\n const win = doc.defaultView;\r\n if (!win || !win.customElements)\r\n return () => { };\r\n const restoreHandler = patch(win.customElements, 'define', function (original) {\r\n return function (name, constructor, options) {\r\n try {\r\n customElementCb({\r\n define: {\r\n name,\r\n },\r\n });\r\n }\r\n catch (e) {\r\n console.warn(`Custom element callback failed for ${name}`);\r\n }\r\n return original.apply(this, [name, constructor, options]);\r\n };\r\n });\r\n return restoreHandler;\r\n}\r\nfunction mergeHooks(o, hooks) {\r\n const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, selectionCb, customElementCb, } = o;\r\n o.mutationCb = (...p) => {\r\n if (hooks.mutation) {\r\n hooks.mutation(...p);\r\n }\r\n mutationCb(...p);\r\n };\r\n o.mousemoveCb = (...p) => {\r\n if (hooks.mousemove) {\r\n hooks.mousemove(...p);\r\n }\r\n mousemoveCb(...p);\r\n };\r\n o.mouseInteractionCb = (...p) => {\r\n if (hooks.mouseInteraction) {\r\n hooks.mouseInteraction(...p);\r\n }\r\n mouseInteractionCb(...p);\r\n };\r\n o.scrollCb = (...p) => {\r\n if (hooks.scroll) {\r\n hooks.scroll(...p);\r\n }\r\n scrollCb(...p);\r\n };\r\n o.viewportResizeCb = (...p) => {\r\n if (hooks.viewportResize) {\r\n hooks.viewportResize(...p);\r\n }\r\n viewportResizeCb(...p);\r\n };\r\n o.inputCb = (...p) => {\r\n if (hooks.input) {\r\n hooks.input(...p);\r\n }\r\n inputCb(...p);\r\n };\r\n o.mediaInteractionCb = (...p) => {\r\n if (hooks.mediaInteaction) {\r\n hooks.mediaInteaction(...p);\r\n }\r\n mediaInteractionCb(...p);\r\n };\r\n o.styleSheetRuleCb = (...p) => {\r\n if (hooks.styleSheetRule) {\r\n hooks.styleSheetRule(...p);\r\n }\r\n styleSheetRuleCb(...p);\r\n };\r\n o.styleDeclarationCb = (...p) => {\r\n if (hooks.styleDeclaration) {\r\n hooks.styleDeclaration(...p);\r\n }\r\n styleDeclarationCb(...p);\r\n };\r\n o.canvasMutationCb = (...p) => {\r\n if (hooks.canvasMutation) {\r\n hooks.canvasMutation(...p);\r\n }\r\n canvasMutationCb(...p);\r\n };\r\n o.fontCb = (...p) => {\r\n if (hooks.font) {\r\n hooks.font(...p);\r\n }\r\n fontCb(...p);\r\n };\r\n o.selectionCb = (...p) => {\r\n if (hooks.selection) {\r\n hooks.selection(...p);\r\n }\r\n selectionCb(...p);\r\n };\r\n o.customElementCb = (...c) => {\r\n if (hooks.customElement) {\r\n hooks.customElement(...c);\r\n }\r\n customElementCb(...c);\r\n };\r\n}\r\nfunction initObservers(o, hooks = {}) {\r\n const currentWindow = o.doc.defaultView;\r\n if (!currentWindow) {\r\n return () => {\r\n };\r\n }\r\n mergeHooks(o, hooks);\r\n let mutationObserver;\r\n if (o.recordDOM) {\r\n mutationObserver = initMutationObserver(o, o.doc);\r\n }\r\n const mousemoveHandler = initMoveObserver(o);\r\n const mouseInteractionHandler = initMouseInteractionObserver(o);\r\n const scrollHandler = initScrollObserver(o);\r\n const viewportResizeHandler = initViewportResizeObserver(o, {\r\n win: currentWindow,\r\n });\r\n const inputHandler = initInputObserver(o);\r\n const mediaInteractionHandler = initMediaInteractionObserver(o);\r\n let styleSheetObserver = () => { };\r\n let adoptedStyleSheetObserver = () => { };\r\n let styleDeclarationObserver = () => { };\r\n let fontObserver = () => { };\r\n if (o.recordDOM) {\r\n styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\r\n adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\r\n styleDeclarationObserver = initStyleDeclarationObserver(o, {\r\n win: currentWindow,\r\n });\r\n if (o.collectFonts) {\r\n fontObserver = initFontObserver(o);\r\n }\r\n }\r\n const selectionObserver = initSelectionObserver(o);\r\n const customElementObserver = initCustomElementObserver(o);\r\n const pluginHandlers = [];\r\n for (const plugin of o.plugins) {\r\n pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\r\n }\r\n return callbackWrapper(() => {\r\n mutationBuffers.forEach((b) => b.reset());\r\n mutationObserver === null || mutationObserver === void 0 ? void 0 : mutationObserver.disconnect();\r\n mousemoveHandler();\r\n mouseInteractionHandler();\r\n scrollHandler();\r\n viewportResizeHandler();\r\n inputHandler();\r\n mediaInteractionHandler();\r\n styleSheetObserver();\r\n adoptedStyleSheetObserver();\r\n styleDeclarationObserver();\r\n fontObserver();\r\n selectionObserver();\r\n customElementObserver();\r\n pluginHandlers.forEach((h) => h());\r\n });\r\n}\r\nfunction hasNestedCSSRule(prop) {\r\n return typeof window[prop] !== 'undefined';\r\n}\r\nfunction canMonkeyPatchNestedCSSRule(prop) {\r\n return Boolean(typeof window[prop] !== 'undefined' &&\r\n window[prop].prototype &&\r\n 'insertRule' in window[prop].prototype &&\r\n 'deleteRule' in window[prop].prototype);\r\n}\n\nexport { INPUT_TAGS, initAdoptedStyleSheetObserver, initMutationObserver, initObservers, initScrollObserver, mutationBuffers };\n", "class CrossOriginIframeMirror {\r\n constructor(generateIdFn) {\r\n this.generateIdFn = generateIdFn;\r\n this.iframeIdToRemoteIdMap = new WeakMap();\r\n this.iframeRemoteIdToIdMap = new WeakMap();\r\n }\r\n getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\r\n const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\r\n const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\r\n let id = idToRemoteIdMap.get(remoteId);\r\n if (!id) {\r\n id = this.generateIdFn();\r\n idToRemoteIdMap.set(remoteId, id);\r\n remoteIdToIdMap.set(id, remoteId);\r\n }\r\n return id;\r\n }\r\n getIds(iframe, remoteId) {\r\n const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\r\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n return remoteId.map((id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap));\r\n }\r\n getRemoteId(iframe, id, map) {\r\n const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\r\n if (typeof id !== 'number')\r\n return id;\r\n const remoteId = remoteIdToIdMap.get(id);\r\n if (!remoteId)\r\n return -1;\r\n return remoteId;\r\n }\r\n getRemoteIds(iframe, ids) {\r\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\r\n return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap));\r\n }\r\n reset(iframe) {\r\n if (!iframe) {\r\n this.iframeIdToRemoteIdMap = new WeakMap();\r\n this.iframeRemoteIdToIdMap = new WeakMap();\r\n return;\r\n }\r\n this.iframeIdToRemoteIdMap.delete(iframe);\r\n this.iframeRemoteIdToIdMap.delete(iframe);\r\n }\r\n getIdToRemoteIdMap(iframe) {\r\n let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\r\n if (!idToRemoteIdMap) {\r\n idToRemoteIdMap = new Map();\r\n this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\r\n }\r\n return idToRemoteIdMap;\r\n }\r\n getRemoteIdToIdMap(iframe) {\r\n let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\r\n if (!remoteIdToIdMap) {\r\n remoteIdToIdMap = new Map();\r\n this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\r\n }\r\n return remoteIdToIdMap;\r\n }\r\n}\n\nexport { CrossOriginIframeMirror as default };\n", "import { genId, NodeType } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport CrossOriginIframeMirror from './cross-origin-iframe-mirror.js';\nimport { EventType, IncrementalSource } from '../../../types/dist/types.js';\n\nclass IframeManager {\r\n constructor(options) {\r\n this.iframes = new WeakMap();\r\n this.crossOriginIframeMap = new WeakMap();\r\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\r\n this.crossOriginIframeRootIdMap = new WeakMap();\r\n this.mutationCb = options.mutationCb;\r\n this.wrappedEmit = options.wrappedEmit;\r\n this.stylesheetManager = options.stylesheetManager;\r\n this.recordCrossOriginIframes = options.recordCrossOriginIframes;\r\n this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror));\r\n this.mirror = options.mirror;\r\n if (this.recordCrossOriginIframes) {\r\n window.addEventListener('message', this.handleMessage.bind(this));\r\n }\r\n }\r\n addIframe(iframeEl) {\r\n this.iframes.set(iframeEl, true);\r\n if (iframeEl.contentWindow)\r\n this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\r\n }\r\n addLoadListener(cb) {\r\n this.loadListener = cb;\r\n }\r\n attachIframe(iframeEl, childSn) {\r\n var _a;\r\n this.mutationCb({\r\n adds: [\r\n {\r\n parentId: this.mirror.getId(iframeEl),\r\n nextId: null,\r\n node: childSn,\r\n },\r\n ],\r\n removes: [],\r\n texts: [],\r\n attributes: [],\r\n isAttachIframe: true,\r\n });\r\n (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);\r\n if (iframeEl.contentDocument &&\r\n iframeEl.contentDocument.adoptedStyleSheets &&\r\n iframeEl.contentDocument.adoptedStyleSheets.length > 0)\r\n this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument));\r\n }\r\n handleMessage(message) {\r\n const crossOriginMessageEvent = message;\r\n if (crossOriginMessageEvent.data.type !== 'rrweb' ||\r\n crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)\r\n return;\r\n const iframeSourceWindow = message.source;\r\n if (!iframeSourceWindow)\r\n return;\r\n const iframeEl = this.crossOriginIframeMap.get(message.source);\r\n if (!iframeEl)\r\n return;\r\n const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event);\r\n if (transformedEvent)\r\n this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout);\r\n }\r\n transformCrossOriginEvent(iframeEl, e) {\r\n var _a;\r\n switch (e.type) {\r\n case EventType.FullSnapshot: {\r\n this.crossOriginIframeMirror.reset(iframeEl);\r\n this.crossOriginIframeStyleMirror.reset(iframeEl);\r\n this.replaceIdOnNode(e.data.node, iframeEl);\r\n const rootId = e.data.node.id;\r\n this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\r\n this.patchRootIdOnNode(e.data.node, rootId);\r\n return {\r\n timestamp: e.timestamp,\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source: IncrementalSource.Mutation,\r\n adds: [\r\n {\r\n parentId: this.mirror.getId(iframeEl),\r\n nextId: null,\r\n node: e.data.node,\r\n },\r\n ],\r\n removes: [],\r\n texts: [],\r\n attributes: [],\r\n isAttachIframe: true,\r\n },\r\n };\r\n }\r\n case EventType.Meta:\r\n case EventType.Load:\r\n case EventType.DomContentLoaded: {\r\n return false;\r\n }\r\n case EventType.Plugin: {\r\n return e;\r\n }\r\n case EventType.Custom: {\r\n this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']);\r\n return e;\r\n }\r\n case EventType.IncrementalSnapshot: {\r\n switch (e.data.source) {\r\n case IncrementalSource.Mutation: {\r\n e.data.adds.forEach((n) => {\r\n this.replaceIds(n, iframeEl, [\r\n 'parentId',\r\n 'nextId',\r\n 'previousId',\r\n ]);\r\n this.replaceIdOnNode(n.node, iframeEl);\r\n const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\r\n rootId && this.patchRootIdOnNode(n.node, rootId);\r\n });\r\n e.data.removes.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['parentId', 'id']);\r\n });\r\n e.data.attributes.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['id']);\r\n });\r\n e.data.texts.forEach((n) => {\r\n this.replaceIds(n, iframeEl, ['id']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource.Drag:\r\n case IncrementalSource.TouchMove:\r\n case IncrementalSource.MouseMove: {\r\n e.data.positions.forEach((p) => {\r\n this.replaceIds(p, iframeEl, ['id']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource.ViewportResize: {\r\n return false;\r\n }\r\n case IncrementalSource.MediaInteraction:\r\n case IncrementalSource.MouseInteraction:\r\n case IncrementalSource.Scroll:\r\n case IncrementalSource.CanvasMutation:\r\n case IncrementalSource.Input: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n return e;\r\n }\r\n case IncrementalSource.StyleSheetRule:\r\n case IncrementalSource.StyleDeclaration: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n this.replaceStyleIds(e.data, iframeEl, ['styleId']);\r\n return e;\r\n }\r\n case IncrementalSource.Font: {\r\n return e;\r\n }\r\n case IncrementalSource.Selection: {\r\n e.data.ranges.forEach((range) => {\r\n this.replaceIds(range, iframeEl, ['start', 'end']);\r\n });\r\n return e;\r\n }\r\n case IncrementalSource.AdoptedStyleSheet: {\r\n this.replaceIds(e.data, iframeEl, ['id']);\r\n this.replaceStyleIds(e.data, iframeEl, ['styleIds']);\r\n (_a = e.data.styles) === null || _a === void 0 ? void 0 : _a.forEach((style) => {\r\n this.replaceStyleIds(style, iframeEl, ['styleId']);\r\n });\r\n return e;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n replace(iframeMirror, obj, iframeEl, keys) {\r\n for (const key of keys) {\r\n if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number')\r\n continue;\r\n if (Array.isArray(obj[key])) {\r\n obj[key] = iframeMirror.getIds(iframeEl, obj[key]);\r\n }\r\n else {\r\n obj[key] = iframeMirror.getId(iframeEl, obj[key]);\r\n }\r\n }\r\n return obj;\r\n }\r\n replaceIds(obj, iframeEl, keys) {\r\n return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\r\n }\r\n replaceStyleIds(obj, iframeEl, keys) {\r\n return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\r\n }\r\n replaceIdOnNode(node, iframeEl) {\r\n this.replaceIds(node, iframeEl, ['id', 'rootId']);\r\n if ('childNodes' in node) {\r\n node.childNodes.forEach((child) => {\r\n this.replaceIdOnNode(child, iframeEl);\r\n });\r\n }\r\n }\r\n patchRootIdOnNode(node, rootId) {\r\n if (node.type !== NodeType.Document && !node.rootId)\r\n node.rootId = rootId;\r\n if ('childNodes' in node) {\r\n node.childNodes.forEach((child) => {\r\n this.patchRootIdOnNode(child, rootId);\r\n });\r\n }\r\n }\r\n}\n\nexport { IframeManager };\n", "import { initMutationObserver, initScrollObserver, initAdoptedStyleSheetObserver } from './observer.js';\nimport { patch, inDom } from '../utils.js';\nimport { isNativeShadowDom } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nclass ShadowDomManager {\r\n constructor(options) {\r\n this.shadowDoms = new WeakSet();\r\n this.restoreHandlers = [];\r\n this.mutationCb = options.mutationCb;\r\n this.scrollCb = options.scrollCb;\r\n this.bypassOptions = options.bypassOptions;\r\n this.mirror = options.mirror;\r\n this.init();\r\n }\r\n init() {\r\n this.reset();\r\n this.patchAttachShadow(Element, document);\r\n }\r\n addShadowRoot(shadowRoot, doc) {\r\n if (!isNativeShadowDom(shadowRoot))\r\n return;\r\n if (this.shadowDoms.has(shadowRoot))\r\n return;\r\n this.shadowDoms.add(shadowRoot);\r\n const observer = initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);\r\n this.restoreHandlers.push(() => observer.disconnect());\r\n this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror })));\r\n setTimeout(() => {\r\n if (shadowRoot.adoptedStyleSheets &&\r\n shadowRoot.adoptedStyleSheets.length > 0)\r\n this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host));\r\n this.restoreHandlers.push(initAdoptedStyleSheetObserver({\r\n mirror: this.mirror,\r\n stylesheetManager: this.bypassOptions.stylesheetManager,\r\n }, shadowRoot));\r\n }, 0);\r\n }\r\n observeAttachShadow(iframeElement) {\r\n if (!iframeElement.contentWindow || !iframeElement.contentDocument)\r\n return;\r\n this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument);\r\n }\r\n patchAttachShadow(element, doc) {\r\n const manager = this;\r\n this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) {\r\n return function (option) {\r\n const shadowRoot = original.call(this, option);\r\n if (this.shadowRoot && inDom(this))\r\n manager.addShadowRoot(this.shadowRoot, doc);\r\n return shadowRoot;\r\n };\r\n }));\r\n }\r\n reset() {\r\n this.restoreHandlers.forEach((handler) => {\r\n try {\r\n handler();\r\n }\r\n catch (e) {\r\n }\r\n });\r\n this.restoreHandlers = [];\r\n this.shadowDoms = new WeakSet();\r\n }\r\n}\n\nexport { ShadowDomManager };\n", "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\n\nexport { __awaiter, __rest };\n", "/*\n * base64-arraybuffer 1.0.1 \n * Copyright (c) 2021 Niklas von Hertzen \n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nvar decode = function (base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n\nexport { decode, encode };\n", "import { encode } from './../../../../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';\n\nconst canvasVarMap = new Map();\r\nfunction variableListFor(ctx, ctor) {\r\n let contextMap = canvasVarMap.get(ctx);\r\n if (!contextMap) {\r\n contextMap = new Map();\r\n canvasVarMap.set(ctx, contextMap);\r\n }\r\n if (!contextMap.has(ctor)) {\r\n contextMap.set(ctor, []);\r\n }\r\n return contextMap.get(ctor);\r\n}\r\nconst saveWebGLVar = (value, win, ctx) => {\r\n if (!value ||\r\n !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))\r\n return;\r\n const name = value.constructor.name;\r\n const list = variableListFor(ctx, name);\r\n let index = list.indexOf(value);\r\n if (index === -1) {\r\n index = list.length;\r\n list.push(value);\r\n }\r\n return index;\r\n};\r\nfunction serializeArg(value, win, ctx) {\r\n if (value instanceof Array) {\r\n return value.map((arg) => serializeArg(arg, win, ctx));\r\n }\r\n else if (value === null) {\r\n return value;\r\n }\r\n else if (value instanceof Float32Array ||\r\n value instanceof Float64Array ||\r\n value instanceof Int32Array ||\r\n value instanceof Uint32Array ||\r\n value instanceof Uint8Array ||\r\n value instanceof Uint16Array ||\r\n value instanceof Int16Array ||\r\n value instanceof Int8Array ||\r\n value instanceof Uint8ClampedArray) {\r\n const name = value.constructor.name;\r\n return {\r\n rr_type: name,\r\n args: [Object.values(value)],\r\n };\r\n }\r\n else if (value instanceof ArrayBuffer) {\r\n const name = value.constructor.name;\r\n const base64 = encode(value);\r\n return {\r\n rr_type: name,\r\n base64,\r\n };\r\n }\r\n else if (value instanceof DataView) {\r\n const name = value.constructor.name;\r\n return {\r\n rr_type: name,\r\n args: [\r\n serializeArg(value.buffer, win, ctx),\r\n value.byteOffset,\r\n value.byteLength,\r\n ],\r\n };\r\n }\r\n else if (value instanceof HTMLImageElement) {\r\n const name = value.constructor.name;\r\n const { src } = value;\r\n return {\r\n rr_type: name,\r\n src,\r\n };\r\n }\r\n else if (value instanceof HTMLCanvasElement) {\r\n const name = 'HTMLImageElement';\r\n const src = value.toDataURL();\r\n return {\r\n rr_type: name,\r\n src,\r\n };\r\n }\r\n else if (value instanceof ImageData) {\r\n const name = value.constructor.name;\r\n return {\r\n rr_type: name,\r\n args: [serializeArg(value.data, win, ctx), value.width, value.height],\r\n };\r\n }\r\n else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {\r\n const name = value.constructor.name;\r\n const index = saveWebGLVar(value, win, ctx);\r\n return {\r\n rr_type: name,\r\n index: index,\r\n };\r\n }\r\n return value;\r\n}\r\nconst serializeArgs = (args, win, ctx) => {\r\n return args.map((arg) => serializeArg(arg, win, ctx));\r\n};\r\nconst isInstanceOfWebGLObject = (value, win) => {\r\n const webGLConstructorNames = [\r\n 'WebGLActiveInfo',\r\n 'WebGLBuffer',\r\n 'WebGLFramebuffer',\r\n 'WebGLProgram',\r\n 'WebGLRenderbuffer',\r\n 'WebGLShader',\r\n 'WebGLShaderPrecisionFormat',\r\n 'WebGLTexture',\r\n 'WebGLUniformLocation',\r\n 'WebGLVertexArrayObject',\r\n 'WebGLVertexArrayObjectOES',\r\n ];\r\n const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');\r\n return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));\r\n};\n\nexport { isInstanceOfWebGLObject, saveWebGLVar, serializeArg, serializeArgs, variableListFor };\n", "import { CanvasContext } from '../../../../../types/dist/types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\nimport { serializeArgs } from './serialize-args.js';\n\nfunction initCanvas2DMutationObserver(cb, win, blockClass, blockSelector) {\r\n const handlers = [];\r\n const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);\r\n for (const prop of props2D) {\r\n try {\r\n if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {\r\n continue;\r\n }\r\n const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {\r\n return function (...args) {\r\n if (!isBlocked(this.canvas, blockClass, blockSelector, true)) {\r\n setTimeout(() => {\r\n const recordArgs = serializeArgs(args, win, this);\r\n cb(this.canvas, {\r\n type: CanvasContext['2D'],\r\n property: prop,\r\n args: recordArgs,\r\n });\r\n }, 0);\r\n }\r\n return original.apply(this, args);\r\n };\r\n });\r\n handlers.push(restoreHandler);\r\n }\r\n catch (_a) {\r\n const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {\r\n set(v) {\r\n cb(this.canvas, {\r\n type: CanvasContext['2D'],\r\n property: prop,\r\n args: [v],\r\n setter: true,\r\n });\r\n },\r\n });\r\n handlers.push(hookHandler);\r\n }\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n}\n\nexport { initCanvas2DMutationObserver as default };\n", "import { patch, isBlocked } from '../../../utils.js';\n\nfunction getNormalizedContextName(contextType) {\r\n return contextType === 'experimental-webgl' ? 'webgl' : contextType;\r\n}\r\nfunction initCanvasContextObserver(win, blockClass, blockSelector, setPreserveDrawingBufferToTrue) {\r\n const handlers = [];\r\n try {\r\n const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {\r\n return function (contextType, ...args) {\r\n if (!isBlocked(this, blockClass, blockSelector, true)) {\r\n const ctxName = getNormalizedContextName(contextType);\r\n if (!('__context' in this))\r\n this.__context = ctxName;\r\n if (setPreserveDrawingBufferToTrue &&\r\n ['webgl', 'webgl2'].includes(ctxName)) {\r\n if (args[0] && typeof args[0] === 'object') {\r\n const contextAttributes = args[0];\r\n if (!contextAttributes.preserveDrawingBuffer) {\r\n contextAttributes.preserveDrawingBuffer = true;\r\n }\r\n }\r\n else {\r\n args.splice(0, 1, {\r\n preserveDrawingBuffer: true,\r\n });\r\n }\r\n }\r\n }\r\n return original.apply(this, [contextType, ...args]);\r\n };\r\n });\r\n handlers.push(restoreHandler);\r\n }\r\n catch (_a) {\r\n console.error('failed to patch HTMLCanvasElement.prototype.getContext');\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n}\n\nexport { initCanvasContextObserver as default };\n", "import { CanvasContext } from '../../../../../types/dist/types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\nimport { saveWebGLVar, serializeArgs } from './serialize-args.js';\n\nfunction patchGLPrototype(prototype, type, cb, blockClass, blockSelector, mirror, win) {\r\n const handlers = [];\r\n const props = Object.getOwnPropertyNames(prototype);\r\n for (const prop of props) {\r\n if ([\r\n 'isContextLost',\r\n 'canvas',\r\n 'drawingBufferWidth',\r\n 'drawingBufferHeight',\r\n ].includes(prop)) {\r\n continue;\r\n }\r\n try {\r\n if (typeof prototype[prop] !== 'function') {\r\n continue;\r\n }\r\n const restoreHandler = patch(prototype, prop, function (original) {\r\n return function (...args) {\r\n const result = original.apply(this, args);\r\n saveWebGLVar(result, win, this);\r\n if ('tagName' in this.canvas &&\r\n !isBlocked(this.canvas, blockClass, blockSelector, true)) {\r\n const recordArgs = serializeArgs(args, win, this);\r\n const mutation = {\r\n type,\r\n property: prop,\r\n args: recordArgs,\r\n };\r\n cb(this.canvas, mutation);\r\n }\r\n return result;\r\n };\r\n });\r\n handlers.push(restoreHandler);\r\n }\r\n catch (_a) {\r\n const hookHandler = hookSetter(prototype, prop, {\r\n set(v) {\r\n cb(this.canvas, {\r\n type,\r\n property: prop,\r\n args: [v],\r\n setter: true,\r\n });\r\n },\r\n });\r\n handlers.push(hookHandler);\r\n }\r\n }\r\n return handlers;\r\n}\r\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, mirror) {\r\n const handlers = [];\r\n handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, mirror, win));\r\n if (typeof win.WebGL2RenderingContext !== 'undefined') {\r\n handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, mirror, win));\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n };\r\n}\n\nexport { initCanvasWebGLMutationObserver as default };\n", "function funcToSource(fn, sourcemapArg) {\n var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;\n var source = fn.toString();\n var lines = source.split('\\n');\n lines.pop();\n lines.shift();\n var blankPrefixLength = lines[0].search(/\\S/);\n var regex = /(['\"])__worker_loader_strict__(['\"])/g;\n for (var i = 0, n = lines.length; i < n; ++i) {\n lines[i] = lines[i].substring(blankPrefixLength).replace(regex, '$1use strict$2') + '\\n';\n }\n if (sourcemap) {\n lines.push('\\/\\/# sourceMappingURL=' + sourcemap + '\\n');\n }\n return lines;\n}\n\nexport { funcToSource };\n", "import { funcToSource } from './_rollup-plugin-web-worker-loader__helper__funcToSource.js';\n\nfunction createURL(fn, sourcemapArg) {\n var lines = funcToSource(fn, sourcemapArg);\n var blob = new Blob(lines, { type: 'application/javascript' });\n return URL.createObjectURL(blob);\n}\n\nfunction createInlineWorkerFactory(fn, sourcemapArg) {\n var url;\n return function WorkerFactory(options) {\n url = url || createURL(fn, sourcemapArg);\n return new Worker(url, options);\n };\n}\n\nexport { createInlineWorkerFactory };\n", "import { createInlineWorkerFactory } from './_rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js';\n\nvar WorkerFactory = createInlineWorkerFactory(/* rollup-plugin-web-worker-loader */function () {\n(function () {\n '__worker_loader_strict__';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\n\n /*\n * base64-arraybuffer 1.0.1 \n * Copyright (c) 2021 Niklas von Hertzen \n * Released under MIT License\n */\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n };\n\n const lastBlobMap = new Map();\r\n const transparentBlobMap = new Map();\r\n function getTransparentBlobFor(width, height, dataURLOptions) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const id = `${width}-${height}`;\r\n if ('OffscreenCanvas' in globalThis) {\r\n if (transparentBlobMap.has(id))\r\n return transparentBlobMap.get(id);\r\n const offscreen = new OffscreenCanvas(width, height);\r\n offscreen.getContext('2d');\r\n const blob = yield offscreen.convertToBlob(dataURLOptions);\r\n const arrayBuffer = yield blob.arrayBuffer();\r\n const base64 = encode(arrayBuffer);\r\n transparentBlobMap.set(id, base64);\r\n return base64;\r\n }\r\n else {\r\n return '';\r\n }\r\n });\r\n }\r\n const worker = self;\r\n worker.onmessage = function (e) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if ('OffscreenCanvas' in globalThis) {\r\n const { id, bitmap, width, height, dataURLOptions } = e.data;\r\n const transparentBase64 = getTransparentBlobFor(width, height, dataURLOptions);\r\n const offscreen = new OffscreenCanvas(width, height);\r\n const ctx = offscreen.getContext('2d');\r\n ctx.drawImage(bitmap, 0, 0);\r\n bitmap.close();\r\n const blob = yield offscreen.convertToBlob(dataURLOptions);\r\n const type = blob.type;\r\n const arrayBuffer = yield blob.arrayBuffer();\r\n const base64 = encode(arrayBuffer);\r\n if (!lastBlobMap.has(id) && (yield transparentBase64) === base64) {\r\n lastBlobMap.set(id, base64);\r\n return worker.postMessage({ id });\r\n }\r\n if (lastBlobMap.get(id) === base64)\r\n return worker.postMessage({ id });\r\n worker.postMessage({\r\n id,\r\n type,\r\n base64,\r\n width,\r\n height,\r\n });\r\n lastBlobMap.set(id, base64);\r\n }\r\n else {\r\n return worker.postMessage({ id: e.data.id });\r\n }\r\n });\r\n };\n\n})();\n}, null);\n/* eslint-enable */\n\nexport { WorkerFactory as default };\n", "import { __rest, __awaiter } from './../../../../../../ext/tslib/tslib.es6.js';\nimport { isBlocked } from '../../../utils.js';\nimport { CanvasContext } from '../../../../../types/dist/types.js';\nimport initCanvas2DMutationObserver from './2d.js';\nimport initCanvasContextObserver from './canvas.js';\nimport initCanvasWebGLMutationObserver from './webgl.js';\nimport WorkerFactory from '../../../../../../_virtual/image-bitmap-data-url-worker.js';\n\nclass CanvasManager {\r\n reset() {\r\n this.pendingCanvasMutations.clear();\r\n this.resetObservers && this.resetObservers();\r\n }\r\n freeze() {\r\n this.frozen = true;\r\n }\r\n unfreeze() {\r\n this.frozen = false;\r\n }\r\n lock() {\r\n this.locked = true;\r\n }\r\n unlock() {\r\n this.locked = false;\r\n }\r\n constructor(options) {\r\n this.pendingCanvasMutations = new Map();\r\n this.rafStamps = { latestId: 0, invokeId: null };\r\n this.frozen = false;\r\n this.locked = false;\r\n this.processMutation = (target, mutation) => {\r\n const newFrame = this.rafStamps.invokeId &&\r\n this.rafStamps.latestId !== this.rafStamps.invokeId;\r\n if (newFrame || !this.rafStamps.invokeId)\r\n this.rafStamps.invokeId = this.rafStamps.latestId;\r\n if (!this.pendingCanvasMutations.has(target)) {\r\n this.pendingCanvasMutations.set(target, []);\r\n }\r\n this.pendingCanvasMutations.get(target).push(mutation);\r\n };\r\n const { sampling = 'all', win, blockClass, blockSelector, recordCanvas, dataURLOptions, } = options;\r\n this.mutationCb = options.mutationCb;\r\n this.mirror = options.mirror;\r\n if (recordCanvas && sampling === 'all')\r\n this.initCanvasMutationObserver(win, blockClass, blockSelector);\r\n if (recordCanvas && typeof sampling === 'number')\r\n this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, {\r\n dataURLOptions,\r\n });\r\n }\r\n initCanvasFPSObserver(fps, win, blockClass, blockSelector, options) {\r\n const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, true);\r\n const snapshotInProgressMap = new Map();\r\n const worker = new WorkerFactory();\r\n worker.onmessage = (e) => {\r\n const { id } = e.data;\r\n snapshotInProgressMap.set(id, false);\r\n if (!('base64' in e.data))\r\n return;\r\n const { base64, type, width, height } = e.data;\r\n this.mutationCb({\r\n id,\r\n type: CanvasContext['2D'],\r\n commands: [\r\n {\r\n property: 'clearRect',\r\n args: [0, 0, width, height],\r\n },\r\n {\r\n property: 'drawImage',\r\n args: [\r\n {\r\n rr_type: 'ImageBitmap',\r\n args: [\r\n {\r\n rr_type: 'Blob',\r\n data: [{ rr_type: 'ArrayBuffer', base64 }],\r\n type,\r\n },\r\n ],\r\n },\r\n 0,\r\n 0,\r\n ],\r\n },\r\n ],\r\n });\r\n };\r\n const timeBetweenSnapshots = 1000 / fps;\r\n let lastSnapshotTime = 0;\r\n let rafId;\r\n const getCanvas = () => {\r\n const matchedCanvas = [];\r\n win.document.querySelectorAll('canvas').forEach((canvas) => {\r\n if (!isBlocked(canvas, blockClass, blockSelector, true)) {\r\n matchedCanvas.push(canvas);\r\n }\r\n });\r\n return matchedCanvas;\r\n };\r\n const takeCanvasSnapshots = (timestamp) => {\r\n if (lastSnapshotTime &&\r\n timestamp - lastSnapshotTime < timeBetweenSnapshots) {\r\n rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n return;\r\n }\r\n lastSnapshotTime = timestamp;\r\n getCanvas()\r\n .forEach((canvas) => __awaiter(this, void 0, void 0, function* () {\r\n var _a;\r\n const id = this.mirror.getId(canvas);\r\n if (snapshotInProgressMap.get(id))\r\n return;\r\n snapshotInProgressMap.set(id, true);\r\n if (['webgl', 'webgl2'].includes(canvas.__context)) {\r\n const context = canvas.getContext(canvas.__context);\r\n if (((_a = context === null || context === void 0 ? void 0 : context.getContextAttributes()) === null || _a === void 0 ? void 0 : _a.preserveDrawingBuffer) === false) {\r\n context.clear(context.COLOR_BUFFER_BIT);\r\n }\r\n }\r\n const bitmap = yield createImageBitmap(canvas);\r\n worker.postMessage({\r\n id,\r\n bitmap,\r\n width: canvas.width,\r\n height: canvas.height,\r\n dataURLOptions: options.dataURLOptions,\r\n }, [bitmap]);\r\n }));\r\n rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n };\r\n rafId = requestAnimationFrame(takeCanvasSnapshots);\r\n this.resetObservers = () => {\r\n canvasContextReset();\r\n cancelAnimationFrame(rafId);\r\n };\r\n }\r\n initCanvasMutationObserver(win, blockClass, blockSelector) {\r\n this.startRAFTimestamping();\r\n this.startPendingCanvasMutationFlusher();\r\n const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, false);\r\n const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector);\r\n const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, this.mirror);\r\n this.resetObservers = () => {\r\n canvasContextReset();\r\n canvas2DReset();\r\n canvasWebGL1and2Reset();\r\n };\r\n }\r\n startPendingCanvasMutationFlusher() {\r\n requestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n }\r\n startRAFTimestamping() {\r\n const setLatestRAFTimestamp = (timestamp) => {\r\n this.rafStamps.latestId = timestamp;\r\n requestAnimationFrame(setLatestRAFTimestamp);\r\n };\r\n requestAnimationFrame(setLatestRAFTimestamp);\r\n }\r\n flushPendingCanvasMutations() {\r\n this.pendingCanvasMutations.forEach((values, canvas) => {\r\n const id = this.mirror.getId(canvas);\r\n this.flushPendingCanvasMutationFor(canvas, id);\r\n });\r\n requestAnimationFrame(() => this.flushPendingCanvasMutations());\r\n }\r\n flushPendingCanvasMutationFor(canvas, id) {\r\n if (this.frozen || this.locked) {\r\n return;\r\n }\r\n const valuesWithType = this.pendingCanvasMutations.get(canvas);\r\n if (!valuesWithType || id === -1)\r\n return;\r\n const values = valuesWithType.map((value) => {\r\n const rest = __rest(value, [\"type\"]);\r\n return rest;\r\n });\r\n const { type } = valuesWithType[0];\r\n this.mutationCb({ id, type, commands: values });\r\n this.pendingCanvasMutations.delete(canvas);\r\n }\r\n}\n\nexport { CanvasManager };\n", "import { stringifyRule } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { StyleSheetMirror } from '../utils.js';\n\nclass StylesheetManager {\r\n constructor(options) {\r\n this.trackedLinkElements = new WeakSet();\r\n this.styleMirror = new StyleSheetMirror();\r\n this.mutationCb = options.mutationCb;\r\n this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\r\n }\r\n attachLinkElement(linkEl, childSn) {\r\n if ('_cssText' in childSn.attributes)\r\n this.mutationCb({\r\n adds: [],\r\n removes: [],\r\n texts: [],\r\n attributes: [\r\n {\r\n id: childSn.id,\r\n attributes: childSn\r\n .attributes,\r\n },\r\n ],\r\n });\r\n this.trackLinkElement(linkEl);\r\n }\r\n trackLinkElement(linkEl) {\r\n if (this.trackedLinkElements.has(linkEl))\r\n return;\r\n this.trackedLinkElements.add(linkEl);\r\n this.trackStylesheetInLinkElement(linkEl);\r\n }\r\n adoptStyleSheets(sheets, hostId) {\r\n if (sheets.length === 0)\r\n return;\r\n const adoptedStyleSheetData = {\r\n id: hostId,\r\n styleIds: [],\r\n };\r\n const styles = [];\r\n for (const sheet of sheets) {\r\n let styleId;\r\n if (!this.styleMirror.has(sheet)) {\r\n styleId = this.styleMirror.add(sheet);\r\n styles.push({\r\n styleId,\r\n rules: Array.from(sheet.rules || CSSRule, (r, index) => ({\r\n rule: stringifyRule(r),\r\n index,\r\n })),\r\n });\r\n }\r\n else\r\n styleId = this.styleMirror.getId(sheet);\r\n adoptedStyleSheetData.styleIds.push(styleId);\r\n }\r\n if (styles.length > 0)\r\n adoptedStyleSheetData.styles = styles;\r\n this.adoptedStyleSheetCb(adoptedStyleSheetData);\r\n }\r\n reset() {\r\n this.styleMirror.reset();\r\n this.trackedLinkElements = new WeakSet();\r\n }\r\n trackStylesheetInLinkElement(linkEl) {\r\n }\r\n}\n\nexport { StylesheetManager };\n", "class ProcessedNodeManager {\r\n constructor() {\r\n this.nodeMap = new WeakMap();\r\n this.loop = true;\r\n this.periodicallyClear();\r\n }\r\n periodicallyClear() {\r\n requestAnimationFrame(() => {\r\n this.clear();\r\n if (this.loop)\r\n this.periodicallyClear();\r\n });\r\n }\r\n inOtherBuffer(node, thisBuffer) {\r\n const buffers = this.nodeMap.get(node);\r\n return (buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer));\r\n }\r\n add(node, buffer) {\r\n this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer));\r\n }\r\n clear() {\r\n this.nodeMap = new WeakMap();\r\n }\r\n destroy() {\r\n this.loop = false;\r\n }\r\n}\n\nexport { ProcessedNodeManager as default };\n", "import { createMirror, snapshot } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { initObservers, mutationBuffers } from './observer.js';\nimport { polyfill, nowTimestamp, on, getWindowWidth, getWindowHeight, getWindowScroll, isSerializedIframe, isSerializedStylesheet, hasShadowRoot } from '../utils.js';\nimport { EventType, IncrementalSource } from '../../../types/dist/types.js';\nimport { IframeManager } from './iframe-manager.js';\nimport { ShadowDomManager } from './shadow-dom-manager.js';\nimport { CanvasManager } from './observers/canvas/canvas-manager.js';\nimport { StylesheetManager } from './stylesheet-manager.js';\nimport ProcessedNodeManager from './processed-node-manager.js';\nimport { callbackWrapper, unregisterErrorHandler, registerErrorHandler } from './error-handler.js';\n\nfunction wrapEvent(e) {\r\n return Object.assign(Object.assign({}, e), { timestamp: nowTimestamp() });\r\n}\r\nlet wrappedEmit;\r\nlet takeFullSnapshot;\r\nlet canvasManager;\r\nlet recording = false;\r\nconst mirror = createMirror();\r\nfunction record(options = {}) {\r\n const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordDOM = true, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'\r\n ? options.recordAfter\r\n : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, } = options;\r\n registerErrorHandler(errorHandler);\r\n const inEmittingFrame = recordCrossOriginIframes\r\n ? window.parent === window\r\n : true;\r\n let passEmitsToParent = false;\r\n if (!inEmittingFrame) {\r\n try {\r\n if (window.parent.document) {\r\n passEmitsToParent = false;\r\n }\r\n }\r\n catch (e) {\r\n passEmitsToParent = true;\r\n }\r\n }\r\n if (inEmittingFrame && !emit) {\r\n throw new Error('emit function is required');\r\n }\r\n if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\r\n sampling.mousemove = mousemoveWait;\r\n }\r\n mirror.reset();\r\n const maskInputOptions = maskAllInputs === true\r\n ? {\r\n color: true,\r\n date: true,\r\n 'datetime-local': true,\r\n email: true,\r\n month: true,\r\n number: true,\r\n range: true,\r\n search: true,\r\n tel: true,\r\n text: true,\r\n time: true,\r\n url: true,\r\n week: true,\r\n textarea: true,\r\n select: true,\r\n password: true,\r\n }\r\n : _maskInputOptions !== undefined\r\n ? _maskInputOptions\r\n : { password: true };\r\n const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\r\n ? {\r\n script: true,\r\n comment: true,\r\n headFavicon: true,\r\n headWhitespace: true,\r\n headMetaSocial: true,\r\n headMetaRobots: true,\r\n headMetaHttpEquiv: true,\r\n headMetaVerification: true,\r\n headMetaAuthorship: _slimDOMOptions === 'all',\r\n headMetaDescKeywords: _slimDOMOptions === 'all',\r\n }\r\n : _slimDOMOptions\r\n ? _slimDOMOptions\r\n : {};\r\n polyfill();\r\n let lastFullSnapshotEvent;\r\n let incrementalSnapshotCount = 0;\r\n const eventProcessor = (e) => {\r\n for (const plugin of plugins || []) {\r\n if (plugin.eventProcessor) {\r\n e = plugin.eventProcessor(e);\r\n }\r\n }\r\n if (packFn &&\r\n !passEmitsToParent) {\r\n e = packFn(e);\r\n }\r\n return e;\r\n };\r\n wrappedEmit = (e, isCheckout) => {\r\n var _a;\r\n if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&\r\n e.type !== EventType.FullSnapshot &&\r\n !(e.type === EventType.IncrementalSnapshot &&\r\n e.data.source === IncrementalSource.Mutation)) {\r\n mutationBuffers.forEach((buf) => buf.unfreeze());\r\n }\r\n if (inEmittingFrame) {\r\n emit === null || emit === void 0 ? void 0 : emit(eventProcessor(e), isCheckout);\r\n }\r\n else if (passEmitsToParent) {\r\n const message = {\r\n type: 'rrweb',\r\n event: eventProcessor(e),\r\n origin: window.location.origin,\r\n isCheckout,\r\n };\r\n window.parent.postMessage(message, '*');\r\n }\r\n if (e.type === EventType.FullSnapshot) {\r\n lastFullSnapshotEvent = e;\r\n incrementalSnapshotCount = 0;\r\n }\r\n else if (e.type === EventType.IncrementalSnapshot) {\r\n if (e.data.source === IncrementalSource.Mutation &&\r\n e.data.isAttachIframe) {\r\n return;\r\n }\r\n incrementalSnapshotCount++;\r\n const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\r\n const exceedTime = checkoutEveryNms &&\r\n e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\r\n if (exceedCount || exceedTime) {\r\n takeFullSnapshot(true);\r\n }\r\n }\r\n };\r\n const wrappedMutationEmit = (m) => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.Mutation }, m),\r\n }));\r\n };\r\n const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.Scroll }, p),\r\n }));\r\n const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.CanvasMutation }, p),\r\n }));\r\n const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.AdoptedStyleSheet }, a),\r\n }));\r\n const stylesheetManager = new StylesheetManager({\r\n mutationCb: wrappedMutationEmit,\r\n adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit,\r\n });\r\n const iframeManager = new IframeManager({\r\n mirror,\r\n mutationCb: wrappedMutationEmit,\r\n stylesheetManager: stylesheetManager,\r\n recordCrossOriginIframes,\r\n wrappedEmit,\r\n });\r\n for (const plugin of plugins || []) {\r\n if (plugin.getMirror)\r\n plugin.getMirror({\r\n nodeMirror: mirror,\r\n crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\r\n crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror,\r\n });\r\n }\r\n const processedNodeManager = new ProcessedNodeManager();\r\n canvasManager = new CanvasManager({\r\n recordCanvas,\r\n mutationCb: wrappedCanvasMutationEmit,\r\n win: window,\r\n blockClass,\r\n blockSelector,\r\n mirror,\r\n sampling: sampling.canvas,\r\n dataURLOptions,\r\n });\r\n const shadowDomManager = new ShadowDomManager({\r\n mutationCb: wrappedMutationEmit,\r\n scrollCb: wrappedScrollEmit,\r\n bypassOptions: {\r\n blockClass,\r\n blockSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n inlineStylesheet,\r\n maskInputOptions,\r\n dataURLOptions,\r\n maskTextFn,\r\n maskInputFn,\r\n recordCanvas,\r\n inlineImages,\r\n sampling,\r\n slimDOMOptions,\r\n iframeManager,\r\n stylesheetManager,\r\n canvasManager,\r\n keepIframeSrcFn,\r\n processedNodeManager,\r\n },\r\n mirror,\r\n });\r\n takeFullSnapshot = (isCheckout = false) => {\r\n if (!recordDOM) {\r\n return;\r\n }\r\n wrappedEmit(wrapEvent({\r\n type: EventType.Meta,\r\n data: {\r\n href: window.location.href,\r\n width: getWindowWidth(),\r\n height: getWindowHeight(),\r\n },\r\n }), isCheckout);\r\n stylesheetManager.reset();\r\n shadowDomManager.init();\r\n mutationBuffers.forEach((buf) => buf.lock());\r\n const node = snapshot(document, {\r\n mirror,\r\n blockClass,\r\n blockSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n inlineStylesheet,\r\n maskAllInputs: maskInputOptions,\r\n maskTextFn,\r\n slimDOM: slimDOMOptions,\r\n dataURLOptions,\r\n recordCanvas,\r\n inlineImages,\r\n onSerialize: (n) => {\r\n if (isSerializedIframe(n, mirror)) {\r\n iframeManager.addIframe(n);\r\n }\r\n if (isSerializedStylesheet(n, mirror)) {\r\n stylesheetManager.trackLinkElement(n);\r\n }\r\n if (hasShadowRoot(n)) {\r\n shadowDomManager.addShadowRoot(n.shadowRoot, document);\r\n }\r\n },\r\n onIframeLoad: (iframe, childSn) => {\r\n iframeManager.attachIframe(iframe, childSn);\r\n shadowDomManager.observeAttachShadow(iframe);\r\n },\r\n onStylesheetLoad: (linkEl, childSn) => {\r\n stylesheetManager.attachLinkElement(linkEl, childSn);\r\n },\r\n keepIframeSrcFn,\r\n });\r\n if (!node) {\r\n return console.warn('Failed to snapshot the document');\r\n }\r\n wrappedEmit(wrapEvent({\r\n type: EventType.FullSnapshot,\r\n data: {\r\n node,\r\n initialOffset: getWindowScroll(window),\r\n },\r\n }), isCheckout);\r\n mutationBuffers.forEach((buf) => buf.unlock());\r\n if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\r\n stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document));\r\n };\r\n try {\r\n const handlers = [];\r\n const observe = (doc) => {\r\n var _a;\r\n return callbackWrapper(initObservers)({\r\n mutationCb: wrappedMutationEmit,\r\n mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: {\r\n source,\r\n positions,\r\n },\r\n })),\r\n mouseInteractionCb: (d) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.MouseInteraction }, d),\r\n })),\r\n scrollCb: wrappedScrollEmit,\r\n viewportResizeCb: (d) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.ViewportResize }, d),\r\n })),\r\n inputCb: (v) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.Input }, v),\r\n })),\r\n mediaInteractionCb: (p) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.MediaInteraction }, p),\r\n })),\r\n styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r),\r\n })),\r\n styleDeclarationCb: (r) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r),\r\n })),\r\n canvasMutationCb: wrappedCanvasMutationEmit,\r\n fontCb: (p) => wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.Font }, p),\r\n })),\r\n selectionCb: (p) => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.Selection }, p),\r\n }));\r\n },\r\n customElementCb: (c) => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType.IncrementalSnapshot,\r\n data: Object.assign({ source: IncrementalSource.CustomElement }, c),\r\n }));\r\n },\r\n blockClass,\r\n ignoreClass,\r\n ignoreSelector,\r\n maskTextClass,\r\n maskTextSelector,\r\n maskInputOptions,\r\n inlineStylesheet,\r\n sampling,\r\n recordDOM,\r\n recordCanvas,\r\n inlineImages,\r\n userTriggeredOnInput,\r\n collectFonts,\r\n doc,\r\n maskInputFn,\r\n maskTextFn,\r\n keepIframeSrcFn,\r\n blockSelector,\r\n slimDOMOptions,\r\n dataURLOptions,\r\n mirror,\r\n iframeManager,\r\n stylesheetManager,\r\n shadowDomManager,\r\n processedNodeManager,\r\n canvasManager,\r\n ignoreCSSAttributes,\r\n plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({\r\n observer: p.observer,\r\n options: p.options,\r\n callback: (payload) => wrappedEmit(wrapEvent({\r\n type: EventType.Plugin,\r\n data: {\r\n plugin: p.name,\r\n payload,\r\n },\r\n })),\r\n }))) || [],\r\n }, hooks);\r\n };\r\n iframeManager.addLoadListener((iframeEl) => {\r\n try {\r\n handlers.push(observe(iframeEl.contentDocument));\r\n }\r\n catch (error) {\r\n console.warn(error);\r\n }\r\n });\r\n const init = () => {\r\n takeFullSnapshot();\r\n handlers.push(observe(document));\r\n recording = true;\r\n };\r\n if (document.readyState === 'interactive' ||\r\n document.readyState === 'complete') {\r\n init();\r\n }\r\n else {\r\n handlers.push(on('DOMContentLoaded', () => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType.DomContentLoaded,\r\n data: {},\r\n }));\r\n if (recordAfter === 'DOMContentLoaded')\r\n init();\r\n }));\r\n handlers.push(on('load', () => {\r\n wrappedEmit(wrapEvent({\r\n type: EventType.Load,\r\n data: {},\r\n }));\r\n if (recordAfter === 'load')\r\n init();\r\n }, window));\r\n }\r\n return () => {\r\n handlers.forEach((h) => h());\r\n processedNodeManager.destroy();\r\n recording = false;\r\n unregisterErrorHandler();\r\n };\r\n }\r\n catch (error) {\r\n console.warn(error);\r\n }\r\n}\r\nrecord.addCustomEvent = (tag, payload) => {\r\n if (!recording) {\r\n throw new Error('please add custom event after start recording');\r\n }\r\n wrappedEmit(wrapEvent({\r\n type: EventType.Custom,\r\n data: {\r\n tag,\r\n payload,\r\n },\r\n }));\r\n};\r\nrecord.freezePage = () => {\r\n mutationBuffers.forEach((buf) => buf.freeze());\r\n};\r\nrecord.takeFullSnapshot = (isCheckout) => {\r\n if (!recording) {\r\n throw new Error('please take full snapshot after start recording');\r\n }\r\n takeFullSnapshot(isCheckout);\r\n};\r\nrecord.mirror = mirror;\n\nexport { record as default };\n", "var NodeType$1;\r\n(function (NodeType) {\r\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\r\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\r\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\r\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\r\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\r\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\r\n})(NodeType$1 || (NodeType$1 = {}));\nclass Mirror$1 {\r\n constructor() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n getId(n) {\r\n var _a;\r\n if (!n)\r\n return -1;\r\n const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\r\n return id !== null && id !== void 0 ? id : -1;\r\n }\r\n getNode(id) {\r\n return this.idNodeMap.get(id) || null;\r\n }\r\n getIds() {\r\n return Array.from(this.idNodeMap.keys());\r\n }\r\n getMeta(n) {\r\n return this.nodeMetaMap.get(n) || null;\r\n }\r\n removeNodeFromMap(n) {\r\n const id = this.getId(n);\r\n this.idNodeMap.delete(id);\r\n if (n.childNodes) {\r\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n }\r\n }\r\n has(id) {\r\n return this.idNodeMap.has(id);\r\n }\r\n hasNode(node) {\r\n return this.nodeMetaMap.has(node);\r\n }\r\n add(n, meta) {\r\n const id = meta.id;\r\n this.idNodeMap.set(id, n);\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n replace(id, n) {\r\n const oldNode = this.getNode(id);\r\n if (oldNode) {\r\n const meta = this.nodeMetaMap.get(oldNode);\r\n if (meta)\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n this.idNodeMap.set(id, n);\r\n }\r\n reset() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n}\r\nfunction createMirror$1() {\r\n return new Mirror$1();\r\n}\n\nfunction parseCSSText(cssText) {\r\n const res = {};\r\n const listDelimiter = /;(?![^(]*\\))/g;\r\n const propertyDelimiter = /:(.+)/;\r\n const comment = /\\/\\*.*?\\*\\//g;\r\n cssText\r\n .replace(comment, '')\r\n .split(listDelimiter)\r\n .forEach(function (item) {\r\n if (item) {\r\n const tmp = item.split(propertyDelimiter);\r\n tmp.length > 1 && (res[camelize(tmp[0].trim())] = tmp[1].trim());\r\n }\r\n });\r\n return res;\r\n}\r\nfunction toCSSText(style) {\r\n const properties = [];\r\n for (const name in style) {\r\n const value = style[name];\r\n if (typeof value !== 'string')\r\n continue;\r\n const normalizedName = hyphenate(name);\r\n properties.push(`${normalizedName}: ${value};`);\r\n }\r\n return properties.join(' ');\r\n}\r\nconst camelizeRE = /-([a-z])/g;\r\nconst CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;\r\nconst camelize = (str) => {\r\n if (CUSTOM_PROPERTY_REGEX.test(str))\r\n return str;\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\r\n};\r\nconst hyphenateRE = /\\B([A-Z])/g;\r\nconst hyphenate = (str) => {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase();\r\n};\n\nclass BaseRRNode {\r\n constructor(..._args) {\r\n this.parentElement = null;\r\n this.parentNode = null;\r\n this.firstChild = null;\r\n this.lastChild = null;\r\n this.previousSibling = null;\r\n this.nextSibling = null;\r\n this.ELEMENT_NODE = NodeType.ELEMENT_NODE;\r\n this.TEXT_NODE = NodeType.TEXT_NODE;\r\n }\r\n get childNodes() {\r\n const childNodes = [];\r\n let childIterator = this.firstChild;\r\n while (childIterator) {\r\n childNodes.push(childIterator);\r\n childIterator = childIterator.nextSibling;\r\n }\r\n return childNodes;\r\n }\r\n contains(node) {\r\n if (!(node instanceof BaseRRNode))\r\n return false;\r\n else if (node.ownerDocument !== this.ownerDocument)\r\n return false;\r\n else if (node === this)\r\n return true;\r\n while (node.parentNode) {\r\n if (node.parentNode === this)\r\n return true;\r\n node = node.parentNode;\r\n }\r\n return false;\r\n }\r\n appendChild(_newChild) {\r\n throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`);\r\n }\r\n insertBefore(_newChild, _refChild) {\r\n throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`);\r\n }\r\n removeChild(_node) {\r\n throw new Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`);\r\n }\r\n toString() {\r\n return 'RRNode';\r\n }\r\n}\r\nfunction BaseRRDocumentImpl(RRNodeClass) {\r\n return class BaseRRDocument extends RRNodeClass {\r\n constructor(...args) {\r\n super(args);\r\n this.nodeType = NodeType.DOCUMENT_NODE;\r\n this.nodeName = '#document';\r\n this.compatMode = 'CSS1Compat';\r\n this.RRNodeType = NodeType$1.Document;\r\n this.textContent = null;\r\n this.ownerDocument = this;\r\n }\r\n get documentElement() {\r\n return (this.childNodes.find((node) => node.RRNodeType === NodeType$1.Element &&\r\n node.tagName === 'HTML') || null);\r\n }\r\n get body() {\r\n var _a;\r\n return (((_a = this.documentElement) === null || _a === void 0 ? void 0 : _a.childNodes.find((node) => node.RRNodeType === NodeType$1.Element &&\r\n node.tagName === 'BODY')) || null);\r\n }\r\n get head() {\r\n var _a;\r\n return (((_a = this.documentElement) === null || _a === void 0 ? void 0 : _a.childNodes.find((node) => node.RRNodeType === NodeType$1.Element &&\r\n node.tagName === 'HEAD')) || null);\r\n }\r\n get implementation() {\r\n return this;\r\n }\r\n get firstElementChild() {\r\n return this.documentElement;\r\n }\r\n appendChild(newChild) {\r\n const nodeType = newChild.RRNodeType;\r\n if (nodeType === NodeType$1.Element ||\r\n nodeType === NodeType$1.DocumentType) {\r\n if (this.childNodes.some((s) => s.RRNodeType === nodeType)) {\r\n throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${nodeType === NodeType$1.Element ? 'RRElement' : 'RRDoctype'} on RRDocument allowed.`);\r\n }\r\n }\r\n const child = appendChild(this, newChild);\r\n child.parentElement = null;\r\n return child;\r\n }\r\n insertBefore(newChild, refChild) {\r\n const nodeType = newChild.RRNodeType;\r\n if (nodeType === NodeType$1.Element ||\r\n nodeType === NodeType$1.DocumentType) {\r\n if (this.childNodes.some((s) => s.RRNodeType === nodeType)) {\r\n throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${nodeType === NodeType$1.Element ? 'RRElement' : 'RRDoctype'} on RRDocument allowed.`);\r\n }\r\n }\r\n const child = insertBefore(this, newChild, refChild);\r\n child.parentElement = null;\r\n return child;\r\n }\r\n removeChild(node) {\r\n return removeChild(this, node);\r\n }\r\n open() {\r\n this.firstChild = null;\r\n this.lastChild = null;\r\n }\r\n close() {\r\n }\r\n write(content) {\r\n let publicId;\r\n if (content ===\r\n '')\r\n publicId = '-//W3C//DTD XHTML 1.0 Transitional//EN';\r\n else if (content ===\r\n '')\r\n publicId = '-//W3C//DTD HTML 4.0 Transitional//EN';\r\n if (publicId) {\r\n const doctype = this.createDocumentType('html', publicId, '');\r\n this.open();\r\n this.appendChild(doctype);\r\n }\r\n }\r\n createDocument(_namespace, _qualifiedName, _doctype) {\r\n return new BaseRRDocument();\r\n }\r\n createDocumentType(qualifiedName, publicId, systemId) {\r\n const doctype = new (BaseRRDocumentTypeImpl(BaseRRNode))(qualifiedName, publicId, systemId);\r\n doctype.ownerDocument = this;\r\n return doctype;\r\n }\r\n createElement(tagName) {\r\n const element = new (BaseRRElementImpl(BaseRRNode))(tagName);\r\n element.ownerDocument = this;\r\n return element;\r\n }\r\n createElementNS(_namespaceURI, qualifiedName) {\r\n return this.createElement(qualifiedName);\r\n }\r\n createTextNode(data) {\r\n const text = new (BaseRRTextImpl(BaseRRNode))(data);\r\n text.ownerDocument = this;\r\n return text;\r\n }\r\n createComment(data) {\r\n const comment = new (BaseRRCommentImpl(BaseRRNode))(data);\r\n comment.ownerDocument = this;\r\n return comment;\r\n }\r\n createCDATASection(data) {\r\n const CDATASection = new (BaseRRCDATASectionImpl(BaseRRNode))(data);\r\n CDATASection.ownerDocument = this;\r\n return CDATASection;\r\n }\r\n toString() {\r\n return 'RRDocument';\r\n }\r\n };\r\n}\r\nfunction BaseRRDocumentTypeImpl(RRNodeClass) {\r\n return class BaseRRDocumentType extends RRNodeClass {\r\n constructor(qualifiedName, publicId, systemId) {\r\n super();\r\n this.nodeType = NodeType.DOCUMENT_TYPE_NODE;\r\n this.RRNodeType = NodeType$1.DocumentType;\r\n this.name = qualifiedName;\r\n this.publicId = publicId;\r\n this.systemId = systemId;\r\n this.nodeName = qualifiedName;\r\n this.textContent = null;\r\n }\r\n toString() {\r\n return 'RRDocumentType';\r\n }\r\n };\r\n}\r\nfunction BaseRRElementImpl(RRNodeClass) {\r\n return class BaseRRElement extends RRNodeClass {\r\n constructor(tagName) {\r\n super();\r\n this.nodeType = NodeType.ELEMENT_NODE;\r\n this.RRNodeType = NodeType$1.Element;\r\n this.attributes = {};\r\n this.shadowRoot = null;\r\n this.tagName = tagName.toUpperCase();\r\n this.nodeName = tagName.toUpperCase();\r\n }\r\n get textContent() {\r\n let result = '';\r\n this.childNodes.forEach((node) => (result += node.textContent));\r\n return result;\r\n }\r\n set textContent(textContent) {\r\n this.firstChild = null;\r\n this.lastChild = null;\r\n this.appendChild(this.ownerDocument.createTextNode(textContent));\r\n }\r\n get classList() {\r\n return new ClassList(this.attributes.class, (newClassName) => {\r\n this.attributes.class = newClassName;\r\n });\r\n }\r\n get id() {\r\n return this.attributes.id || '';\r\n }\r\n get className() {\r\n return this.attributes.class || '';\r\n }\r\n get style() {\r\n const style = (this.attributes.style ? parseCSSText(this.attributes.style) : {});\r\n const hyphenateRE = /\\B([A-Z])/g;\r\n style.setProperty = (name, value, priority) => {\r\n if (hyphenateRE.test(name))\r\n return;\r\n const normalizedName = camelize(name);\r\n if (!value)\r\n delete style[normalizedName];\r\n else\r\n style[normalizedName] = value;\r\n if (priority === 'important')\r\n style[normalizedName] += ' !important';\r\n this.attributes.style = toCSSText(style);\r\n };\r\n style.removeProperty = (name) => {\r\n if (hyphenateRE.test(name))\r\n return '';\r\n const normalizedName = camelize(name);\r\n const value = style[normalizedName] || '';\r\n delete style[normalizedName];\r\n this.attributes.style = toCSSText(style);\r\n return value;\r\n };\r\n return style;\r\n }\r\n getAttribute(name) {\r\n return this.attributes[name] || null;\r\n }\r\n setAttribute(name, attribute) {\r\n this.attributes[name] = attribute;\r\n }\r\n setAttributeNS(_namespace, qualifiedName, value) {\r\n this.setAttribute(qualifiedName, value);\r\n }\r\n removeAttribute(name) {\r\n delete this.attributes[name];\r\n }\r\n appendChild(newChild) {\r\n return appendChild(this, newChild);\r\n }\r\n insertBefore(newChild, refChild) {\r\n return insertBefore(this, newChild, refChild);\r\n }\r\n removeChild(node) {\r\n return removeChild(this, node);\r\n }\r\n attachShadow(_init) {\r\n const shadowRoot = this.ownerDocument.createElement('SHADOWROOT');\r\n this.shadowRoot = shadowRoot;\r\n return shadowRoot;\r\n }\r\n dispatchEvent(_event) {\r\n return true;\r\n }\r\n toString() {\r\n let attributeString = '';\r\n for (const attribute in this.attributes) {\r\n attributeString += `${attribute}=\"${this.attributes[attribute]}\" `;\r\n }\r\n return `${this.tagName} ${attributeString}`;\r\n }\r\n };\r\n}\r\nfunction BaseRRMediaElementImpl(RRElementClass) {\r\n return class BaseRRMediaElement extends RRElementClass {\r\n attachShadow(_init) {\r\n throw new Error(`RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow`);\r\n }\r\n play() {\r\n this.paused = false;\r\n }\r\n pause() {\r\n this.paused = true;\r\n }\r\n };\r\n}\r\nfunction BaseRRTextImpl(RRNodeClass) {\r\n return class BaseRRText extends RRNodeClass {\r\n constructor(data) {\r\n super();\r\n this.nodeType = NodeType.TEXT_NODE;\r\n this.nodeName = '#text';\r\n this.RRNodeType = NodeType$1.Text;\r\n this.data = data;\r\n }\r\n get textContent() {\r\n return this.data;\r\n }\r\n set textContent(textContent) {\r\n this.data = textContent;\r\n }\r\n toString() {\r\n return `RRText text=${JSON.stringify(this.data)}`;\r\n }\r\n };\r\n}\r\nfunction BaseRRCommentImpl(RRNodeClass) {\r\n return class BaseRRComment extends RRNodeClass {\r\n constructor(data) {\r\n super();\r\n this.nodeType = NodeType.COMMENT_NODE;\r\n this.nodeName = '#comment';\r\n this.RRNodeType = NodeType$1.Comment;\r\n this.data = data;\r\n }\r\n get textContent() {\r\n return this.data;\r\n }\r\n set textContent(textContent) {\r\n this.data = textContent;\r\n }\r\n toString() {\r\n return `RRComment text=${JSON.stringify(this.data)}`;\r\n }\r\n };\r\n}\r\nfunction BaseRRCDATASectionImpl(RRNodeClass) {\r\n return class BaseRRCDATASection extends RRNodeClass {\r\n constructor(data) {\r\n super();\r\n this.nodeName = '#cdata-section';\r\n this.nodeType = NodeType.CDATA_SECTION_NODE;\r\n this.RRNodeType = NodeType$1.CDATA;\r\n this.data = data;\r\n }\r\n get textContent() {\r\n return this.data;\r\n }\r\n set textContent(textContent) {\r\n this.data = textContent;\r\n }\r\n toString() {\r\n return `RRCDATASection data=${JSON.stringify(this.data)}`;\r\n }\r\n };\r\n}\r\nclass ClassList {\r\n constructor(classText, onChange) {\r\n this.classes = [];\r\n this.add = (...classNames) => {\r\n for (const item of classNames) {\r\n const className = String(item);\r\n if (this.classes.indexOf(className) >= 0)\r\n continue;\r\n this.classes.push(className);\r\n }\r\n this.onChange && this.onChange(this.classes.join(' '));\r\n };\r\n this.remove = (...classNames) => {\r\n this.classes = this.classes.filter((item) => classNames.indexOf(item) === -1);\r\n this.onChange && this.onChange(this.classes.join(' '));\r\n };\r\n if (classText) {\r\n const classes = classText.trim().split(/\\s+/);\r\n this.classes.push(...classes);\r\n }\r\n this.onChange = onChange;\r\n }\r\n}\r\nfunction appendChild(parent, newChild) {\r\n if (newChild.parentNode)\r\n newChild.parentNode.removeChild(newChild);\r\n if (parent.lastChild) {\r\n parent.lastChild.nextSibling = newChild;\r\n newChild.previousSibling = parent.lastChild;\r\n }\r\n else {\r\n parent.firstChild = newChild;\r\n newChild.previousSibling = null;\r\n }\r\n parent.lastChild = newChild;\r\n newChild.nextSibling = null;\r\n newChild.parentNode = parent;\r\n newChild.parentElement = parent;\r\n newChild.ownerDocument = parent.ownerDocument;\r\n return newChild;\r\n}\r\nfunction insertBefore(parent, newChild, refChild) {\r\n if (!refChild)\r\n return appendChild(parent, newChild);\r\n if (refChild.parentNode !== parent)\r\n throw new Error(\"Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.\");\r\n if (newChild === refChild)\r\n return newChild;\r\n if (newChild.parentNode)\r\n newChild.parentNode.removeChild(newChild);\r\n newChild.previousSibling = refChild.previousSibling;\r\n refChild.previousSibling = newChild;\r\n newChild.nextSibling = refChild;\r\n if (newChild.previousSibling)\r\n newChild.previousSibling.nextSibling = newChild;\r\n else\r\n parent.firstChild = newChild;\r\n newChild.parentElement = parent;\r\n newChild.parentNode = parent;\r\n newChild.ownerDocument = parent.ownerDocument;\r\n return newChild;\r\n}\r\nfunction removeChild(parent, child) {\r\n if (child.parentNode !== parent)\r\n throw new Error(\"Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.\");\r\n if (child.previousSibling)\r\n child.previousSibling.nextSibling = child.nextSibling;\r\n else\r\n parent.firstChild = child.nextSibling;\r\n if (child.nextSibling)\r\n child.nextSibling.previousSibling = child.previousSibling;\r\n else\r\n parent.lastChild = child.previousSibling;\r\n child.previousSibling = null;\r\n child.nextSibling = null;\r\n child.parentElement = null;\r\n child.parentNode = null;\r\n return child;\r\n}\r\nvar NodeType;\r\n(function (NodeType) {\r\n NodeType[NodeType[\"PLACEHOLDER\"] = 0] = \"PLACEHOLDER\";\r\n NodeType[NodeType[\"ELEMENT_NODE\"] = 1] = \"ELEMENT_NODE\";\r\n NodeType[NodeType[\"ATTRIBUTE_NODE\"] = 2] = \"ATTRIBUTE_NODE\";\r\n NodeType[NodeType[\"TEXT_NODE\"] = 3] = \"TEXT_NODE\";\r\n NodeType[NodeType[\"CDATA_SECTION_NODE\"] = 4] = \"CDATA_SECTION_NODE\";\r\n NodeType[NodeType[\"ENTITY_REFERENCE_NODE\"] = 5] = \"ENTITY_REFERENCE_NODE\";\r\n NodeType[NodeType[\"ENTITY_NODE\"] = 6] = \"ENTITY_NODE\";\r\n NodeType[NodeType[\"PROCESSING_INSTRUCTION_NODE\"] = 7] = \"PROCESSING_INSTRUCTION_NODE\";\r\n NodeType[NodeType[\"COMMENT_NODE\"] = 8] = \"COMMENT_NODE\";\r\n NodeType[NodeType[\"DOCUMENT_NODE\"] = 9] = \"DOCUMENT_NODE\";\r\n NodeType[NodeType[\"DOCUMENT_TYPE_NODE\"] = 10] = \"DOCUMENT_TYPE_NODE\";\r\n NodeType[NodeType[\"DOCUMENT_FRAGMENT_NODE\"] = 11] = \"DOCUMENT_FRAGMENT_NODE\";\r\n})(NodeType || (NodeType = {}));\n\nconst NAMESPACES = {\r\n svg: 'http://www.w3.org/2000/svg',\r\n 'xlink:href': 'http://www.w3.org/1999/xlink',\r\n xmlns: 'http://www.w3.org/2000/xmlns/',\r\n};\r\nconst SVGTagMap = {\r\n altglyph: 'altGlyph',\r\n altglyphdef: 'altGlyphDef',\r\n altglyphitem: 'altGlyphItem',\r\n animatecolor: 'animateColor',\r\n animatemotion: 'animateMotion',\r\n animatetransform: 'animateTransform',\r\n clippath: 'clipPath',\r\n feblend: 'feBlend',\r\n fecolormatrix: 'feColorMatrix',\r\n fecomponenttransfer: 'feComponentTransfer',\r\n fecomposite: 'feComposite',\r\n feconvolvematrix: 'feConvolveMatrix',\r\n fediffuselighting: 'feDiffuseLighting',\r\n fedisplacementmap: 'feDisplacementMap',\r\n fedistantlight: 'feDistantLight',\r\n fedropshadow: 'feDropShadow',\r\n feflood: 'feFlood',\r\n fefunca: 'feFuncA',\r\n fefuncb: 'feFuncB',\r\n fefuncg: 'feFuncG',\r\n fefuncr: 'feFuncR',\r\n fegaussianblur: 'feGaussianBlur',\r\n feimage: 'feImage',\r\n femerge: 'feMerge',\r\n femergenode: 'feMergeNode',\r\n femorphology: 'feMorphology',\r\n feoffset: 'feOffset',\r\n fepointlight: 'fePointLight',\r\n fespecularlighting: 'feSpecularLighting',\r\n fespotlight: 'feSpotLight',\r\n fetile: 'feTile',\r\n feturbulence: 'feTurbulence',\r\n foreignobject: 'foreignObject',\r\n glyphref: 'glyphRef',\r\n lineargradient: 'linearGradient',\r\n radialgradient: 'radialGradient',\r\n};\r\nlet createdNodeSet = null;\r\nfunction diff(oldTree, newTree, replayer, rrnodeMirror = newTree.mirror ||\r\n newTree.ownerDocument.mirror) {\r\n oldTree = diffBeforeUpdatingChildren(oldTree, newTree, replayer, rrnodeMirror);\r\n diffChildren(oldTree, newTree, replayer, rrnodeMirror);\r\n diffAfterUpdatingChildren(oldTree, newTree, replayer);\r\n}\r\nfunction diffBeforeUpdatingChildren(oldTree, newTree, replayer, rrnodeMirror) {\r\n var _a;\r\n if (replayer.afterAppend && !createdNodeSet) {\r\n createdNodeSet = new WeakSet();\r\n setTimeout(() => {\r\n createdNodeSet = null;\r\n }, 0);\r\n }\r\n if (!sameNodeType(oldTree, newTree)) {\r\n const calibratedOldTree = createOrGetNode(newTree, replayer.mirror, rrnodeMirror);\r\n (_a = oldTree.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(calibratedOldTree, oldTree);\r\n oldTree = calibratedOldTree;\r\n }\r\n switch (newTree.RRNodeType) {\r\n case NodeType$1.Document: {\r\n if (!nodeMatching(oldTree, newTree, replayer.mirror, rrnodeMirror)) {\r\n const newMeta = rrnodeMirror.getMeta(newTree);\r\n if (newMeta) {\r\n replayer.mirror.removeNodeFromMap(oldTree);\r\n oldTree.close();\r\n oldTree.open();\r\n replayer.mirror.add(oldTree, newMeta);\r\n createdNodeSet === null || createdNodeSet === void 0 ? void 0 : createdNodeSet.add(oldTree);\r\n }\r\n }\r\n break;\r\n }\r\n case NodeType$1.Element: {\r\n const oldElement = oldTree;\r\n const newRRElement = newTree;\r\n switch (newRRElement.tagName) {\r\n case 'IFRAME': {\r\n const oldContentDocument = oldTree\r\n .contentDocument;\r\n if (!oldContentDocument)\r\n break;\r\n diff(oldContentDocument, newTree.contentDocument, replayer, rrnodeMirror);\r\n break;\r\n }\r\n }\r\n if (newRRElement.shadowRoot) {\r\n if (!oldElement.shadowRoot)\r\n oldElement.attachShadow({ mode: 'open' });\r\n diffChildren(oldElement.shadowRoot, newRRElement.shadowRoot, replayer, rrnodeMirror);\r\n }\r\n diffProps(oldElement, newRRElement, rrnodeMirror);\r\n break;\r\n }\r\n }\r\n return oldTree;\r\n}\r\nfunction diffAfterUpdatingChildren(oldTree, newTree, replayer) {\r\n var _a;\r\n switch (newTree.RRNodeType) {\r\n case NodeType$1.Document: {\r\n const scrollData = newTree.scrollData;\r\n scrollData && replayer.applyScroll(scrollData, true);\r\n break;\r\n }\r\n case NodeType$1.Element: {\r\n const oldElement = oldTree;\r\n const newRRElement = newTree;\r\n newRRElement.scrollData &&\r\n replayer.applyScroll(newRRElement.scrollData, true);\r\n newRRElement.inputData && replayer.applyInput(newRRElement.inputData);\r\n switch (newRRElement.tagName) {\r\n case 'AUDIO':\r\n case 'VIDEO': {\r\n const oldMediaElement = oldTree;\r\n const newMediaRRElement = newRRElement;\r\n if (newMediaRRElement.paused !== undefined)\r\n newMediaRRElement.paused\r\n ? void oldMediaElement.pause()\r\n : void oldMediaElement.play();\r\n if (newMediaRRElement.muted !== undefined)\r\n oldMediaElement.muted = newMediaRRElement.muted;\r\n if (newMediaRRElement.volume !== undefined)\r\n oldMediaElement.volume = newMediaRRElement.volume;\r\n if (newMediaRRElement.currentTime !== undefined)\r\n oldMediaElement.currentTime = newMediaRRElement.currentTime;\r\n if (newMediaRRElement.playbackRate !== undefined)\r\n oldMediaElement.playbackRate = newMediaRRElement.playbackRate;\r\n break;\r\n }\r\n case 'CANVAS': {\r\n const rrCanvasElement = newTree;\r\n if (rrCanvasElement.rr_dataURL !== null) {\r\n const image = document.createElement('img');\r\n image.onload = () => {\r\n const ctx = oldElement.getContext('2d');\r\n if (ctx) {\r\n ctx.drawImage(image, 0, 0, image.width, image.height);\r\n }\r\n };\r\n image.src = rrCanvasElement.rr_dataURL;\r\n }\r\n rrCanvasElement.canvasMutations.forEach((canvasMutation) => replayer.applyCanvas(canvasMutation.event, canvasMutation.mutation, oldTree));\r\n break;\r\n }\r\n case 'STYLE': {\r\n const styleSheet = oldElement.sheet;\r\n styleSheet &&\r\n newTree.rules.forEach((data) => replayer.applyStyleSheetMutation(data, styleSheet));\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n case NodeType$1.Text:\r\n case NodeType$1.Comment:\r\n case NodeType$1.CDATA: {\r\n if (oldTree.textContent !==\r\n newTree.data)\r\n oldTree.textContent = newTree.data;\r\n break;\r\n }\r\n }\r\n if (createdNodeSet === null || createdNodeSet === void 0 ? void 0 : createdNodeSet.has(oldTree)) {\r\n createdNodeSet.delete(oldTree);\r\n (_a = replayer.afterAppend) === null || _a === void 0 ? void 0 : _a.call(replayer, oldTree, replayer.mirror.getId(oldTree));\r\n }\r\n}\r\nfunction diffProps(oldTree, newTree, rrnodeMirror) {\r\n const oldAttributes = oldTree.attributes;\r\n const newAttributes = newTree.attributes;\r\n for (const name in newAttributes) {\r\n const newValue = newAttributes[name];\r\n const sn = rrnodeMirror.getMeta(newTree);\r\n if ((sn === null || sn === void 0 ? void 0 : sn.isSVG) && NAMESPACES[name])\r\n oldTree.setAttributeNS(NAMESPACES[name], name, newValue);\r\n else if (newTree.tagName === 'CANVAS' && name === 'rr_dataURL') {\r\n const image = document.createElement('img');\r\n image.src = newValue;\r\n image.onload = () => {\r\n const ctx = oldTree.getContext('2d');\r\n if (ctx) {\r\n ctx.drawImage(image, 0, 0, image.width, image.height);\r\n }\r\n };\r\n }\r\n else if (newTree.tagName === 'IFRAME' && name === 'srcdoc')\r\n continue;\r\n else\r\n oldTree.setAttribute(name, newValue);\r\n }\r\n for (const { name } of Array.from(oldAttributes))\r\n if (!(name in newAttributes))\r\n oldTree.removeAttribute(name);\r\n newTree.scrollLeft && (oldTree.scrollLeft = newTree.scrollLeft);\r\n newTree.scrollTop && (oldTree.scrollTop = newTree.scrollTop);\r\n}\r\nfunction diffChildren(oldTree, newTree, replayer, rrnodeMirror) {\r\n const oldChildren = Array.from(oldTree.childNodes);\r\n const newChildren = newTree.childNodes;\r\n if (oldChildren.length === 0 && newChildren.length === 0)\r\n return;\r\n let oldStartIndex = 0, oldEndIndex = oldChildren.length - 1, newStartIndex = 0, newEndIndex = newChildren.length - 1;\r\n let oldStartNode = oldChildren[oldStartIndex], oldEndNode = oldChildren[oldEndIndex], newStartNode = newChildren[newStartIndex], newEndNode = newChildren[newEndIndex];\r\n let oldIdToIndex = undefined, indexInOld = undefined;\r\n while (oldStartIndex <= oldEndIndex && newStartIndex <= newEndIndex) {\r\n if (oldStartNode === undefined) {\r\n oldStartNode = oldChildren[++oldStartIndex];\r\n }\r\n else if (oldEndNode === undefined) {\r\n oldEndNode = oldChildren[--oldEndIndex];\r\n }\r\n else if (nodeMatching(oldStartNode, newStartNode, replayer.mirror, rrnodeMirror)) {\r\n oldStartNode = oldChildren[++oldStartIndex];\r\n newStartNode = newChildren[++newStartIndex];\r\n }\r\n else if (nodeMatching(oldEndNode, newEndNode, replayer.mirror, rrnodeMirror)) {\r\n oldEndNode = oldChildren[--oldEndIndex];\r\n newEndNode = newChildren[--newEndIndex];\r\n }\r\n else if (nodeMatching(oldStartNode, newEndNode, replayer.mirror, rrnodeMirror)) {\r\n try {\r\n oldTree.insertBefore(oldStartNode, oldEndNode.nextSibling);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n oldStartNode = oldChildren[++oldStartIndex];\r\n newEndNode = newChildren[--newEndIndex];\r\n }\r\n else if (nodeMatching(oldEndNode, newStartNode, replayer.mirror, rrnodeMirror)) {\r\n try {\r\n oldTree.insertBefore(oldEndNode, oldStartNode);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n oldEndNode = oldChildren[--oldEndIndex];\r\n newStartNode = newChildren[++newStartIndex];\r\n }\r\n else {\r\n if (!oldIdToIndex) {\r\n oldIdToIndex = {};\r\n for (let i = oldStartIndex; i <= oldEndIndex; i++) {\r\n const oldChild = oldChildren[i];\r\n if (oldChild && replayer.mirror.hasNode(oldChild))\r\n oldIdToIndex[replayer.mirror.getId(oldChild)] = i;\r\n }\r\n }\r\n indexInOld = oldIdToIndex[rrnodeMirror.getId(newStartNode)];\r\n const nodeToMove = oldChildren[indexInOld];\r\n if (indexInOld !== undefined &&\r\n nodeToMove &&\r\n nodeMatching(nodeToMove, newStartNode, replayer.mirror, rrnodeMirror)) {\r\n try {\r\n oldTree.insertBefore(nodeToMove, oldStartNode);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n oldChildren[indexInOld] = undefined;\r\n }\r\n else {\r\n const newNode = createOrGetNode(newStartNode, replayer.mirror, rrnodeMirror);\r\n if (oldTree.nodeName === '#document' &&\r\n oldStartNode &&\r\n ((newNode.nodeType === newNode.DOCUMENT_TYPE_NODE &&\r\n oldStartNode.nodeType === oldStartNode.DOCUMENT_TYPE_NODE) ||\r\n (newNode.nodeType === newNode.ELEMENT_NODE &&\r\n oldStartNode.nodeType === oldStartNode.ELEMENT_NODE))) {\r\n oldTree.removeChild(oldStartNode);\r\n replayer.mirror.removeNodeFromMap(oldStartNode);\r\n oldStartNode = oldChildren[++oldStartIndex];\r\n }\r\n try {\r\n oldTree.insertBefore(newNode, oldStartNode || null);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n }\r\n newStartNode = newChildren[++newStartIndex];\r\n }\r\n }\r\n if (oldStartIndex > oldEndIndex) {\r\n const referenceRRNode = newChildren[newEndIndex + 1];\r\n let referenceNode = null;\r\n if (referenceRRNode)\r\n referenceNode = replayer.mirror.getNode(rrnodeMirror.getId(referenceRRNode));\r\n for (; newStartIndex <= newEndIndex; ++newStartIndex) {\r\n const newNode = createOrGetNode(newChildren[newStartIndex], replayer.mirror, rrnodeMirror);\r\n try {\r\n oldTree.insertBefore(newNode, referenceNode);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n }\r\n }\r\n else if (newStartIndex > newEndIndex) {\r\n for (; oldStartIndex <= oldEndIndex; oldStartIndex++) {\r\n const node = oldChildren[oldStartIndex];\r\n if (!node || node.parentNode !== oldTree)\r\n continue;\r\n try {\r\n oldTree.removeChild(node);\r\n replayer.mirror.removeNodeFromMap(node);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n }\r\n }\r\n let oldChild = oldTree.firstChild;\r\n let newChild = newTree.firstChild;\r\n while (oldChild !== null && newChild !== null) {\r\n diff(oldChild, newChild, replayer, rrnodeMirror);\r\n oldChild = oldChild.nextSibling;\r\n newChild = newChild.nextSibling;\r\n }\r\n}\r\nfunction createOrGetNode(rrNode, domMirror, rrnodeMirror) {\r\n const nodeId = rrnodeMirror.getId(rrNode);\r\n const sn = rrnodeMirror.getMeta(rrNode);\r\n let node = null;\r\n if (nodeId > -1)\r\n node = domMirror.getNode(nodeId);\r\n if (node !== null && sameNodeType(node, rrNode))\r\n return node;\r\n switch (rrNode.RRNodeType) {\r\n case NodeType$1.Document:\r\n node = new Document();\r\n break;\r\n case NodeType$1.DocumentType:\r\n node = document.implementation.createDocumentType(rrNode.name, rrNode.publicId, rrNode.systemId);\r\n break;\r\n case NodeType$1.Element: {\r\n let tagName = rrNode.tagName.toLowerCase();\r\n tagName = SVGTagMap[tagName] || tagName;\r\n if (sn && 'isSVG' in sn && (sn === null || sn === void 0 ? void 0 : sn.isSVG)) {\r\n node = document.createElementNS(NAMESPACES['svg'], tagName);\r\n }\r\n else\r\n node = document.createElement(rrNode.tagName);\r\n break;\r\n }\r\n case NodeType$1.Text:\r\n node = document.createTextNode(rrNode.data);\r\n break;\r\n case NodeType$1.Comment:\r\n node = document.createComment(rrNode.data);\r\n break;\r\n case NodeType$1.CDATA:\r\n node = document.createCDATASection(rrNode.data);\r\n break;\r\n }\r\n if (sn)\r\n domMirror.add(node, Object.assign({}, sn));\r\n try {\r\n createdNodeSet === null || createdNodeSet === void 0 ? void 0 : createdNodeSet.add(node);\r\n }\r\n catch (e) {\r\n }\r\n return node;\r\n}\r\nfunction sameNodeType(node1, node2) {\r\n if (node1.nodeType !== node2.nodeType)\r\n return false;\r\n return (node1.nodeType !== node1.ELEMENT_NODE ||\r\n node1.tagName.toUpperCase() ===\r\n node2.tagName);\r\n}\r\nfunction nodeMatching(node1, node2, domMirror, rrdomMirror) {\r\n const node1Id = domMirror.getId(node1);\r\n const node2Id = rrdomMirror.getId(node2);\r\n if (node1Id === -1 || node1Id !== node2Id)\r\n return false;\r\n return sameNodeType(node1, node2);\r\n}\n\nclass RRDocument extends BaseRRDocumentImpl(BaseRRNode) {\r\n get unserializedId() {\r\n return this._unserializedId--;\r\n }\r\n constructor(mirror) {\r\n super();\r\n this.UNSERIALIZED_STARTING_ID = -2;\r\n this._unserializedId = this.UNSERIALIZED_STARTING_ID;\r\n this.mirror = createMirror();\r\n this.scrollData = null;\r\n if (mirror) {\r\n this.mirror = mirror;\r\n }\r\n }\r\n createDocument(_namespace, _qualifiedName, _doctype) {\r\n return new RRDocument();\r\n }\r\n createDocumentType(qualifiedName, publicId, systemId) {\r\n const documentTypeNode = new RRDocumentType(qualifiedName, publicId, systemId);\r\n documentTypeNode.ownerDocument = this;\r\n return documentTypeNode;\r\n }\r\n createElement(tagName) {\r\n const upperTagName = tagName.toUpperCase();\r\n let element;\r\n switch (upperTagName) {\r\n case 'AUDIO':\r\n case 'VIDEO':\r\n element = new RRMediaElement(upperTagName);\r\n break;\r\n case 'IFRAME':\r\n element = new RRIFrameElement(upperTagName, this.mirror);\r\n break;\r\n case 'CANVAS':\r\n element = new RRCanvasElement(upperTagName);\r\n break;\r\n case 'STYLE':\r\n element = new RRStyleElement(upperTagName);\r\n break;\r\n default:\r\n element = new RRElement(upperTagName);\r\n break;\r\n }\r\n element.ownerDocument = this;\r\n return element;\r\n }\r\n createComment(data) {\r\n const commentNode = new RRComment(data);\r\n commentNode.ownerDocument = this;\r\n return commentNode;\r\n }\r\n createCDATASection(data) {\r\n const sectionNode = new RRCDATASection(data);\r\n sectionNode.ownerDocument = this;\r\n return sectionNode;\r\n }\r\n createTextNode(data) {\r\n const textNode = new RRText(data);\r\n textNode.ownerDocument = this;\r\n return textNode;\r\n }\r\n destroyTree() {\r\n this.firstChild = null;\r\n this.lastChild = null;\r\n this.mirror.reset();\r\n }\r\n open() {\r\n super.open();\r\n this._unserializedId = this.UNSERIALIZED_STARTING_ID;\r\n }\r\n}\r\nconst RRDocumentType = BaseRRDocumentTypeImpl(BaseRRNode);\r\nclass RRElement extends BaseRRElementImpl(BaseRRNode) {\r\n constructor() {\r\n super(...arguments);\r\n this.inputData = null;\r\n this.scrollData = null;\r\n }\r\n}\r\nclass RRMediaElement extends BaseRRMediaElementImpl(RRElement) {\r\n}\r\nclass RRCanvasElement extends RRElement {\r\n constructor() {\r\n super(...arguments);\r\n this.rr_dataURL = null;\r\n this.canvasMutations = [];\r\n }\r\n getContext() {\r\n return null;\r\n }\r\n}\r\nclass RRStyleElement extends RRElement {\r\n constructor() {\r\n super(...arguments);\r\n this.rules = [];\r\n }\r\n}\r\nclass RRIFrameElement extends RRElement {\r\n constructor(upperTagName, mirror) {\r\n super(upperTagName);\r\n this.contentDocument = new RRDocument();\r\n this.contentDocument.mirror = mirror;\r\n }\r\n}\r\nconst RRText = BaseRRTextImpl(BaseRRNode);\r\nconst RRComment = BaseRRCommentImpl(BaseRRNode);\r\nconst RRCDATASection = BaseRRCDATASectionImpl(BaseRRNode);\r\nfunction getValidTagName(element) {\r\n if (element instanceof HTMLFormElement) {\r\n return 'FORM';\r\n }\r\n return element.tagName.toUpperCase();\r\n}\r\nfunction buildFromNode(node, rrdom, domMirror, parentRRNode) {\r\n let rrNode;\r\n switch (node.nodeType) {\r\n case NodeType.DOCUMENT_NODE:\r\n if (parentRRNode && parentRRNode.nodeName === 'IFRAME')\r\n rrNode = parentRRNode.contentDocument;\r\n else {\r\n rrNode = rrdom;\r\n rrNode.compatMode = node.compatMode;\r\n }\r\n break;\r\n case NodeType.DOCUMENT_TYPE_NODE: {\r\n const documentType = node;\r\n rrNode = rrdom.createDocumentType(documentType.name, documentType.publicId, documentType.systemId);\r\n break;\r\n }\r\n case NodeType.ELEMENT_NODE: {\r\n const elementNode = node;\r\n const tagName = getValidTagName(elementNode);\r\n rrNode = rrdom.createElement(tagName);\r\n const rrElement = rrNode;\r\n for (const { name, value } of Array.from(elementNode.attributes)) {\r\n rrElement.attributes[name] = value;\r\n }\r\n elementNode.scrollLeft && (rrElement.scrollLeft = elementNode.scrollLeft);\r\n elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);\r\n break;\r\n }\r\n case NodeType.TEXT_NODE:\r\n rrNode = rrdom.createTextNode(node.textContent || '');\r\n break;\r\n case NodeType.CDATA_SECTION_NODE:\r\n rrNode = rrdom.createCDATASection(node.data);\r\n break;\r\n case NodeType.COMMENT_NODE:\r\n rrNode = rrdom.createComment(node.textContent || '');\r\n break;\r\n case NodeType.DOCUMENT_FRAGMENT_NODE:\r\n rrNode = parentRRNode.attachShadow({ mode: 'open' });\r\n break;\r\n default:\r\n return null;\r\n }\r\n let sn = domMirror.getMeta(node);\r\n if (rrdom instanceof RRDocument) {\r\n if (!sn) {\r\n sn = getDefaultSN(rrNode, rrdom.unserializedId);\r\n domMirror.add(node, sn);\r\n }\r\n rrdom.mirror.add(rrNode, Object.assign({}, sn));\r\n }\r\n return rrNode;\r\n}\r\nfunction buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument()) {\r\n function walk(node, parentRRNode) {\r\n const rrNode = buildFromNode(node, rrdom, domMirror, parentRRNode);\r\n if (rrNode === null)\r\n return;\r\n if ((parentRRNode === null || parentRRNode === void 0 ? void 0 : parentRRNode.nodeName) !== 'IFRAME' &&\r\n node.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE) {\r\n parentRRNode === null || parentRRNode === void 0 ? void 0 : parentRRNode.appendChild(rrNode);\r\n rrNode.parentNode = parentRRNode;\r\n rrNode.parentElement = parentRRNode;\r\n }\r\n if (node.nodeName === 'IFRAME') {\r\n const iframeDoc = node.contentDocument;\r\n iframeDoc && walk(iframeDoc, rrNode);\r\n }\r\n else if (node.nodeType === NodeType.DOCUMENT_NODE ||\r\n node.nodeType === NodeType.ELEMENT_NODE ||\r\n node.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {\r\n if (node.nodeType === NodeType.ELEMENT_NODE &&\r\n node.shadowRoot)\r\n walk(node.shadowRoot, rrNode);\r\n node.childNodes.forEach((childNode) => walk(childNode, rrNode));\r\n }\r\n }\r\n walk(dom, null);\r\n return rrdom;\r\n}\r\nfunction createMirror() {\r\n return new Mirror();\r\n}\r\nclass Mirror {\r\n constructor() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n getId(n) {\r\n var _a;\r\n if (!n)\r\n return -1;\r\n const id = (_a = this.getMeta(n)) === null || _a === void 0 ? void 0 : _a.id;\r\n return id !== null && id !== void 0 ? id : -1;\r\n }\r\n getNode(id) {\r\n return this.idNodeMap.get(id) || null;\r\n }\r\n getIds() {\r\n return Array.from(this.idNodeMap.keys());\r\n }\r\n getMeta(n) {\r\n return this.nodeMetaMap.get(n) || null;\r\n }\r\n removeNodeFromMap(n) {\r\n const id = this.getId(n);\r\n this.idNodeMap.delete(id);\r\n if (n.childNodes) {\r\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\r\n }\r\n }\r\n has(id) {\r\n return this.idNodeMap.has(id);\r\n }\r\n hasNode(node) {\r\n return this.nodeMetaMap.has(node);\r\n }\r\n add(n, meta) {\r\n const id = meta.id;\r\n this.idNodeMap.set(id, n);\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n replace(id, n) {\r\n const oldNode = this.getNode(id);\r\n if (oldNode) {\r\n const meta = this.nodeMetaMap.get(oldNode);\r\n if (meta)\r\n this.nodeMetaMap.set(n, meta);\r\n }\r\n this.idNodeMap.set(id, n);\r\n }\r\n reset() {\r\n this.idNodeMap = new Map();\r\n this.nodeMetaMap = new WeakMap();\r\n }\r\n}\r\nfunction getDefaultSN(node, id) {\r\n switch (node.RRNodeType) {\r\n case NodeType$1.Document:\r\n return {\r\n id,\r\n type: node.RRNodeType,\r\n childNodes: [],\r\n };\r\n case NodeType$1.DocumentType: {\r\n const doctype = node;\r\n return {\r\n id,\r\n type: node.RRNodeType,\r\n name: doctype.name,\r\n publicId: doctype.publicId,\r\n systemId: doctype.systemId,\r\n };\r\n }\r\n case NodeType$1.Element:\r\n return {\r\n id,\r\n type: node.RRNodeType,\r\n tagName: node.tagName.toLowerCase(),\r\n attributes: {},\r\n childNodes: [],\r\n };\r\n case NodeType$1.Text:\r\n return {\r\n id,\r\n type: node.RRNodeType,\r\n textContent: node.textContent || '',\r\n };\r\n case NodeType$1.Comment:\r\n return {\r\n id,\r\n type: node.RRNodeType,\r\n textContent: node.textContent || '',\r\n };\r\n case NodeType$1.CDATA:\r\n return {\r\n id,\r\n type: node.RRNodeType,\r\n textContent: '',\r\n };\r\n }\r\n}\n\nexport { BaseRRCDATASectionImpl, BaseRRCommentImpl, BaseRRDocumentImpl, BaseRRDocumentTypeImpl, BaseRRElementImpl, BaseRRMediaElementImpl, BaseRRNode, BaseRRTextImpl, ClassList, Mirror, NodeType, RRCDATASection, RRCanvasElement, RRComment, RRDocument, RRDocumentType, RRElement, RRIFrameElement, RRMediaElement, BaseRRNode as RRNode, RRStyleElement, RRText, buildFromDom, buildFromNode, createMirror, createOrGetNode, diff, getDefaultSN };\n", "import record from './record/index.js';\nexport { default as record } from './record/index.js';\nimport '../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport '../../rrdom/es/rrdom.js';\nimport * as utils from './utils.js';\nexport { utils };\nexport { _mirror as mirror } from './utils.js';\nimport './../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';\n\nconst { addCustomEvent } = record;\r\nconst { freezePage } = record;\n\nexport { addCustomEvent, freezePage };\n", "// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\n// see fleb note\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new u32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return [b, r];\n};\nvar _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i)\n ++l[cd[i] - 1];\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 0; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >>> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i)\n co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) >> 0;\n return ((d[o] | (d[o + 1] << 8)) >>> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) >> 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >>> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p / 8) >> 0) + (p & 7 && 1); };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);\n n.set(v.subarray(s, e));\n return n;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, buf, st) {\n // source length\n var sl = dat.length;\n // have to estimate size\n var noBuf = !buf || st;\n // no state\n var noSt = !st || st.i;\n if (!st)\n st = {};\n // Assumes roughly 33% compression ratio average\n if (!buf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n st.f = final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n throw 'unexpected EOF';\n break;\n }\n // ensure size\n if (noBuf)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n if (!noSt && pos + tl * (clb + 7) > tbts)\n break;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >>> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n throw 'invalid block type';\n if (pos > tbts)\n throw 'unexpected EOF';\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17;\n if (noBuf)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var mxa = lbt + dbt + 18;\n while (noSt || pos + mxa < tbts) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;\n pos += c & 15;\n if (pos > tbts)\n throw 'unexpected EOF';\n if (!c)\n throw 'invalid length/literal';\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;\n if (!d)\n throw 'invalid distance';\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;\n }\n if (pos > tbts)\n throw 'unexpected EOF';\n if (noBuf)\n cbuf(bt + 131072);\n var end = bt + add;\n for (; bt < end; bt += 4) {\n buf[bt] = buf[bt - dt];\n buf[bt + 1] = buf[bt + 1 - dt];\n buf[bt + 2] = buf[bt + 2 - dt];\n buf[bt + 3] = buf[bt + 3 - dt];\n }\n bt = end;\n }\n }\n st.l = lm, st.p = pos, st.b = bt;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n return bt == buf.length ? buf : slc(buf, 0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) >> 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) >> 0;\n d[o] |= v;\n d[o + 1] |= v >>> 8;\n d[o + 2] |= v >>> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return [new u8(0), 0];\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return [v, 1];\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return [new u8(tr), mbt];\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return [cl.subarray(0, cli), s];\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >>> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];\n var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];\n var _c = lc(dlt), lclt = _c[0], nlc = _c[1];\n var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n lcfreq[lclt[i] & 31]++;\n for (var i = 0; i < lcdt.length; ++i)\n lcfreq[lcdt[i] & 31]++;\n var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);\n if (flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n if (syms[i] > 255) {\n var len = (syms[i] >>> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];\n var dst = syms[i] & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, lst) {\n var s = dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.floor(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var pos = 0;\n if (!lvl || s < 8) {\n for (var i = 0; i <= s; i += 65535) {\n // end\n var e = i + 65535;\n if (e < s) {\n // write full block\n pos = wfblk(w, pos, dat.subarray(i, e));\n }\n else {\n // write final block\n w[i] = lst;\n pos = wfblk(w, pos, dat.subarray(i, s));\n }\n }\n }\n else {\n var opt = deo[lvl - 1];\n var n = opt >>> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = new u16(32768), head = new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new u32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx bitpos\n var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;\n for (; i < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768\n var imod = i & 32767;\n // previous index with this value\n var pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && rem > 423) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = (i - dif + j + 32768) & 32767;\n var pti = prev[ti];\n var cd = (ti - pti + 32768) & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += (imod - pimod + 32768) & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one Uint32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n // this is the easiest way to avoid needing to maintain state\n if (!lst)\n pos = wfblk(w, pos, et);\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// Alder32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 5552, l);\n for (; i < e; ++i)\n n += d[i], m += n;\n n %= 65521, m %= 65521;\n }\n a = n, b = m;\n },\n d: function () { return ((a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8)) + ((a & 255) << 23) * 2; }\n };\n};\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);\n};\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);\n};\n// zlib valid\nvar zlv = function (d) {\n if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n throw 'invalid zlib data';\n if (d[1] & 32)\n throw 'invalid zlib data: preset dictionaries not supported';\n};\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nfunction zlibSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.\n * @returns The decompressed version of the data\n */\nfunction unzlibSync(data, out) {\n return inflt((zlv(data), data.subarray(2, -4)), out);\n}\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nfunction strToU8(str, latin1) {\n var l = str.length;\n if (!latin1 && typeof TextEncoder != 'undefined')\n return new TextEncoder().encode(str);\n var ar = new u8(str.length + (str.length >>> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >>> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >>> 18)), w(128 | ((c >>> 12) & 63)), w(128 | ((c >>> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >>> 12)), w(128 | ((c >>> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nfunction strFromU8(dat, latin1) {\n var r = '';\n if (!latin1 && typeof TextDecoder != 'undefined')\n return new TextDecoder().decode(dat);\n for (var i = 0; i < dat.length;) {\n var c = dat[i++];\n if (c < 128 || latin1)\n r += String.fromCharCode(c);\n else if (c < 224)\n r += String.fromCharCode((c & 31) << 6 | (dat[i++] & 63));\n else if (c < 240)\n r += String.fromCharCode((c & 15) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63));\n else\n c = ((c & 15) << 18 | (dat[i++] & 63) << 12 | (dat[i++] & 63) << 6 | (dat[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n return r;\n}\n\nexport { strFromU8, strToU8, unzlibSync, zlibSync };\n", "const MARK = 'v1';\n\nexport { MARK };\n", "import { strFromU8, zlibSync, strToU8 } from './../../../../ext/fflate/esm/browser.js';\nimport { MARK } from './base.js';\n\nconst pack = (event) => {\r\n const _e = Object.assign(Object.assign({}, event), { v: MARK });\r\n return strFromU8(zlibSync(strToU8(JSON.stringify(_e))), true);\r\n};\n\nexport { pack };\n", "import { strFromU8, unzlibSync, strToU8 } from './../../../../ext/fflate/esm/browser.js';\nimport { MARK } from './base.js';\n\nconst unpack = (raw) => {\r\n if (typeof raw !== 'string') {\r\n return raw;\r\n }\r\n try {\r\n const e = JSON.parse(raw);\r\n if (e.timestamp) {\r\n return e;\r\n }\r\n }\r\n catch (error) {\r\n }\r\n try {\r\n const e = JSON.parse(strFromU8(unzlibSync(strToU8(raw, true))));\r\n if (e.v === MARK) {\r\n return e;\r\n }\r\n throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${MARK}.`);\r\n }\r\n catch (error) {\r\n console.error(error);\r\n throw new Error('Unknown data format.');\r\n }\r\n};\n\nexport { unpack };\n", "class StackFrame {\r\n constructor(obj) {\r\n this.fileName = obj.fileName || '';\r\n this.functionName = obj.functionName || '';\r\n this.lineNumber = obj.lineNumber;\r\n this.columnNumber = obj.columnNumber;\r\n }\r\n toString() {\r\n const lineNumber = this.lineNumber || '';\r\n const columnNumber = this.columnNumber || '';\r\n if (this.functionName)\r\n return `${this.functionName} (${this.fileName}:${lineNumber}:${columnNumber})`;\r\n return `${this.fileName}:${lineNumber}:${columnNumber}`;\r\n }\r\n}\r\nconst FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\r\nconst CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\r\nconst SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\r\nconst ErrorStackParser = {\r\n parse: function (error) {\r\n if (!error) {\r\n return [];\r\n }\r\n if (typeof error.stacktrace !== 'undefined' ||\r\n typeof error['opera#sourceloc'] !== 'undefined') {\r\n return this.parseOpera(error);\r\n }\r\n else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\r\n return this.parseV8OrIE(error);\r\n }\r\n else if (error.stack) {\r\n return this.parseFFOrSafari(error);\r\n }\r\n else {\r\n console.warn('[console-record-plugin]: Failed to parse error object:', error);\r\n return [];\r\n }\r\n },\r\n extractLocation: function (urlLike) {\r\n if (urlLike.indexOf(':') === -1) {\r\n return [urlLike];\r\n }\r\n const regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\r\n const parts = regExp.exec(urlLike.replace(/[()]/g, ''));\r\n if (!parts)\r\n throw new Error(`Cannot parse given url: ${urlLike}`);\r\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\r\n },\r\n parseV8OrIE: function (error) {\r\n const filtered = error.stack.split('\\n').filter(function (line) {\r\n return !!line.match(CHROME_IE_STACK_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n if (line.indexOf('(eval ') > -1) {\r\n line = line\r\n .replace(/eval code/g, 'eval')\r\n .replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\r\n }\r\n let sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\r\n const location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\r\n sanitizedLine = location\r\n ? sanitizedLine.replace(location[0], '')\r\n : sanitizedLine;\r\n const tokens = sanitizedLine.split(/\\s+/).slice(1);\r\n const locationParts = this.extractLocation(location ? location[1] : tokens.pop());\r\n const functionName = tokens.join(' ') || undefined;\r\n const fileName = ['eval', ''].indexOf(locationParts[0]) > -1\r\n ? undefined\r\n : locationParts[0];\r\n return new StackFrame({\r\n functionName,\r\n fileName,\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n });\r\n }, this);\r\n },\r\n parseFFOrSafari: function (error) {\r\n const filtered = error.stack.split('\\n').filter(function (line) {\r\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\r\n }, this);\r\n return filtered.map(function (line) {\r\n if (line.indexOf(' > eval') > -1) {\r\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\r\n }\r\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\r\n return new StackFrame({\r\n functionName: line,\r\n });\r\n }\r\n else {\r\n const functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\r\n const matches = line.match(functionNameRegex);\r\n const functionName = matches && matches[1] ? matches[1] : undefined;\r\n const locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\r\n return new StackFrame({\r\n functionName,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n });\r\n }\r\n }, this);\r\n },\r\n parseOpera: function (e) {\r\n if (!e.stacktrace ||\r\n (e.message.indexOf('\\n') > -1 &&\r\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\r\n return this.parseOpera9(e);\r\n }\r\n else if (!e.stack) {\r\n return this.parseOpera10(e);\r\n }\r\n else {\r\n return this.parseOpera11(e);\r\n }\r\n },\r\n parseOpera9: function (e) {\r\n const lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\r\n const lines = e.message.split('\\n');\r\n const result = [];\r\n for (let i = 2, len = lines.length; i < len; i += 2) {\r\n const match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n fileName: match[2],\r\n lineNumber: parseFloat(match[1]),\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n parseOpera10: function (e) {\r\n const lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\r\n const lines = e.stacktrace.split('\\n');\r\n const result = [];\r\n for (let i = 0, len = lines.length; i < len; i += 2) {\r\n const match = lineRE.exec(lines[i]);\r\n if (match) {\r\n result.push(new StackFrame({\r\n functionName: match[3] || undefined,\r\n fileName: match[2],\r\n lineNumber: parseFloat(match[1]),\r\n }));\r\n }\r\n }\r\n return result;\r\n },\r\n parseOpera11: function (error) {\r\n const filtered = error.stack.split('\\n').filter(function (line) {\r\n return (!!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\r\n !line.match(/^Error created at/));\r\n }, this);\r\n return filtered.map(function (line) {\r\n const tokens = line.split('@');\r\n const locationParts = this.extractLocation(tokens.pop());\r\n const functionCall = tokens.shift() || '';\r\n const functionName = functionCall\r\n .replace(//, '$2')\r\n .replace(/\\([^)]*\\)/g, '') || undefined;\r\n return new StackFrame({\r\n functionName,\r\n fileName: locationParts[0],\r\n lineNumber: locationParts[1],\r\n columnNumber: locationParts[2],\r\n });\r\n }, this);\r\n },\r\n};\n\nexport { ErrorStackParser, StackFrame };\n", "function pathToSelector(node) {\r\n if (!node || !node.outerHTML) {\r\n return '';\r\n }\r\n let path = '';\r\n while (node.parentElement) {\r\n let name = node.localName;\r\n if (!name) {\r\n break;\r\n }\r\n name = name.toLowerCase();\r\n const parent = node.parentElement;\r\n const domSiblings = [];\r\n if (parent.children && parent.children.length > 0) {\r\n for (let i = 0; i < parent.children.length; i++) {\r\n const sibling = parent.children[i];\r\n if (sibling.localName && sibling.localName.toLowerCase) {\r\n if (sibling.localName.toLowerCase() === name) {\r\n domSiblings.push(sibling);\r\n }\r\n }\r\n }\r\n }\r\n if (domSiblings.length > 1) {\r\n name += `:eq(${domSiblings.indexOf(node)})`;\r\n }\r\n path = name + (path ? '>' + path : '');\r\n node = parent;\r\n }\r\n return path;\r\n}\r\nfunction isObject(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Object]';\r\n}\r\nfunction isObjTooDeep(obj, limit) {\r\n if (limit === 0) {\r\n return true;\r\n }\r\n const keys = Object.keys(obj);\r\n for (const key of keys) {\r\n if (isObject(obj[key]) &&\r\n isObjTooDeep(obj[key], limit - 1)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction stringify(obj, stringifyOptions) {\r\n const options = {\r\n numOfKeysLimit: 50,\r\n depthOfLimit: 4,\r\n };\r\n Object.assign(options, stringifyOptions);\r\n const stack = [];\r\n const keys = [];\r\n return JSON.stringify(obj, function (key, value) {\r\n if (stack.length > 0) {\r\n const thisPos = stack.indexOf(this);\r\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\r\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\r\n if (~stack.indexOf(value)) {\r\n if (stack[0] === value) {\r\n value = '[Circular ~]';\r\n }\r\n else {\r\n value =\r\n '[Circular ~.' +\r\n keys.slice(0, stack.indexOf(value)).join('.') +\r\n ']';\r\n }\r\n }\r\n }\r\n else {\r\n stack.push(value);\r\n }\r\n if (value === null)\r\n return value;\r\n if (value === undefined)\r\n return 'undefined';\r\n if (shouldIgnore(value)) {\r\n return toString(value);\r\n }\r\n if (typeof value === 'bigint') {\r\n return value.toString() + 'n';\r\n }\r\n if (value instanceof Event) {\r\n const eventResult = {};\r\n for (const eventKey in value) {\r\n const eventValue = value[eventKey];\r\n if (Array.isArray(eventValue)) {\r\n eventResult[eventKey] = pathToSelector((eventValue.length ? eventValue[0] : null));\r\n }\r\n else {\r\n eventResult[eventKey] = eventValue;\r\n }\r\n }\r\n return eventResult;\r\n }\r\n else if (value instanceof Node) {\r\n if (value instanceof HTMLElement) {\r\n return value ? value.outerHTML : '';\r\n }\r\n return value.nodeName;\r\n }\r\n else if (value instanceof Error) {\r\n return value.stack\r\n ? value.stack + '\\nEnd of stack for Error object'\r\n : value.name + ': ' + value.message;\r\n }\r\n return value;\r\n });\r\n function shouldIgnore(_obj) {\r\n if (isObject(_obj) && Object.keys(_obj).length > options.numOfKeysLimit) {\r\n return true;\r\n }\r\n if (typeof _obj === 'function') {\r\n return true;\r\n }\r\n if (isObject(_obj) &&\r\n isObjTooDeep(_obj, options.depthOfLimit)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n function toString(_obj) {\r\n let str = _obj.toString();\r\n if (options.stringLengthLimit && str.length > options.stringLengthLimit) {\r\n str = `${str.slice(0, options.stringLengthLimit)}...`;\r\n }\r\n return str;\r\n }\r\n}\n\nexport { stringify };\n", "import { patch } from '../../../utils.js';\nimport { ErrorStackParser } from './error-stack-parser.js';\nimport { stringify } from './stringify.js';\n\nconst defaultLogOptions = {\r\n level: [\r\n 'assert',\r\n 'clear',\r\n 'count',\r\n 'countReset',\r\n 'debug',\r\n 'dir',\r\n 'dirxml',\r\n 'error',\r\n 'group',\r\n 'groupCollapsed',\r\n 'groupEnd',\r\n 'info',\r\n 'log',\r\n 'table',\r\n 'time',\r\n 'timeEnd',\r\n 'timeLog',\r\n 'trace',\r\n 'warn',\r\n ],\r\n lengthThreshold: 1000,\r\n logger: 'console',\r\n};\r\nfunction initLogObserver(cb, win, options) {\r\n const logOptions = (options ? Object.assign({}, defaultLogOptions, options) : defaultLogOptions);\r\n const loggerType = logOptions.logger;\r\n if (!loggerType) {\r\n return () => {\r\n };\r\n }\r\n let logger;\r\n if (typeof loggerType === 'string') {\r\n logger = win[loggerType];\r\n }\r\n else {\r\n logger = loggerType;\r\n }\r\n let logCount = 0;\r\n let inStack = false;\r\n const cancelHandlers = [];\r\n if (logOptions.level.includes('error')) {\r\n const errorHandler = (event) => {\r\n const message = event.message, error = event.error;\r\n const trace = ErrorStackParser.parse(error).map((stackFrame) => stackFrame.toString());\r\n const payload = [stringify(message, logOptions.stringifyOptions)];\r\n cb({\r\n level: 'error',\r\n trace,\r\n payload,\r\n });\r\n };\r\n win.addEventListener('error', errorHandler);\r\n cancelHandlers.push(() => {\r\n win.removeEventListener('error', errorHandler);\r\n });\r\n const unhandledrejectionHandler = (event) => {\r\n let error;\r\n let payload;\r\n if (event.reason instanceof Error) {\r\n error = event.reason;\r\n payload = [\r\n stringify(`Uncaught (in promise) ${error.name}: ${error.message}`, logOptions.stringifyOptions),\r\n ];\r\n }\r\n else {\r\n error = new Error();\r\n payload = [\r\n stringify('Uncaught (in promise)', logOptions.stringifyOptions),\r\n stringify(event.reason, logOptions.stringifyOptions),\r\n ];\r\n }\r\n const trace = ErrorStackParser.parse(error).map((stackFrame) => stackFrame.toString());\r\n cb({\r\n level: 'error',\r\n trace,\r\n payload,\r\n });\r\n };\r\n win.addEventListener('unhandledrejection', unhandledrejectionHandler);\r\n cancelHandlers.push(() => {\r\n win.removeEventListener('unhandledrejection', unhandledrejectionHandler);\r\n });\r\n }\r\n for (const levelType of logOptions.level) {\r\n cancelHandlers.push(replace(logger, levelType));\r\n }\r\n return () => {\r\n cancelHandlers.forEach((h) => h());\r\n };\r\n function replace(_logger, level) {\r\n if (!_logger[level]) {\r\n return () => {\r\n };\r\n }\r\n return patch(_logger, level, (original) => {\r\n return (...args) => {\r\n original.apply(this, args);\r\n if (inStack) {\r\n return;\r\n }\r\n inStack = true;\r\n try {\r\n const trace = ErrorStackParser.parse(new Error())\r\n .map((stackFrame) => stackFrame.toString())\r\n .splice(1);\r\n const payload = args.map((s) => stringify(s, logOptions.stringifyOptions));\r\n logCount++;\r\n if (logCount < logOptions.lengthThreshold) {\r\n cb({\r\n level,\r\n trace,\r\n payload,\r\n });\r\n }\r\n else if (logCount === logOptions.lengthThreshold) {\r\n cb({\r\n level: 'warn',\r\n trace: [],\r\n payload: [\r\n stringify('The number of log records reached the threshold.'),\r\n ],\r\n });\r\n }\r\n }\r\n catch (error) {\r\n original('rrweb logger error:', error, ...args);\r\n }\r\n finally {\r\n inStack = false;\r\n }\r\n };\r\n });\r\n }\r\n}\r\nconst PLUGIN_NAME = 'rrweb/console@1';\r\nconst getRecordConsolePlugin = (options) => ({\r\n name: PLUGIN_NAME,\r\n observer: initLogObserver,\r\n options: options,\r\n});\n\nexport { PLUGIN_NAME, getRecordConsolePlugin };\n", "import { PLUGIN_NAME } from '../record/index.js';\nimport { EventType, IncrementalSource } from '../../../../../types/dist/types.js';\n\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\r\nconst defaultLogConfig = {\r\n level: [\r\n 'assert',\r\n 'clear',\r\n 'count',\r\n 'countReset',\r\n 'debug',\r\n 'dir',\r\n 'dirxml',\r\n 'error',\r\n 'group',\r\n 'groupCollapsed',\r\n 'groupEnd',\r\n 'info',\r\n 'log',\r\n 'table',\r\n 'time',\r\n 'timeEnd',\r\n 'timeLog',\r\n 'trace',\r\n 'warn',\r\n ],\r\n replayLogger: undefined,\r\n};\r\nclass LogReplayPlugin {\r\n constructor(config) {\r\n this.config = Object.assign(defaultLogConfig, config);\r\n }\r\n getConsoleLogger() {\r\n const replayLogger = {};\r\n for (const level of this.config.level) {\r\n if (level === 'trace') {\r\n replayLogger[level] = (data) => {\r\n const logger = console.log[ORIGINAL_ATTRIBUTE_NAME]\r\n ? console.log[ORIGINAL_ATTRIBUTE_NAME]\r\n : console.log;\r\n logger(...data.payload.map((s) => JSON.parse(s)), this.formatMessage(data));\r\n };\r\n }\r\n else {\r\n replayLogger[level] = (data) => {\r\n const logger = console[level][ORIGINAL_ATTRIBUTE_NAME]\r\n ? console[level][ORIGINAL_ATTRIBUTE_NAME]\r\n : console[level];\r\n logger(...data.payload.map((s) => JSON.parse(s)), this.formatMessage(data));\r\n };\r\n }\r\n }\r\n return replayLogger;\r\n }\r\n formatMessage(data) {\r\n if (data.trace.length === 0) {\r\n return '';\r\n }\r\n const stackPrefix = '\\n\\tat ';\r\n let result = stackPrefix;\r\n result += data.trace.join(stackPrefix);\r\n return result;\r\n }\r\n}\r\nconst getReplayConsolePlugin = (options) => {\r\n const replayLogger = (options === null || options === void 0 ? void 0 : options.replayLogger) || new LogReplayPlugin(options).getConsoleLogger();\r\n return {\r\n handler(event, _isSync, context) {\r\n let logData = null;\r\n if (event.type === EventType.IncrementalSnapshot &&\r\n event.data.source === IncrementalSource.Log) {\r\n logData = event.data;\r\n }\r\n else if (event.type === EventType.Plugin &&\r\n event.data.plugin === PLUGIN_NAME) {\r\n logData = event.data.payload;\r\n }\r\n if (logData) {\r\n try {\r\n if (typeof replayLogger[logData.level] === 'function') {\r\n replayLogger[logData.level](logData);\r\n }\r\n }\r\n catch (error) {\r\n if (context.replayer.config.showWarning) {\r\n console.warn(error);\r\n }\r\n }\r\n }\r\n },\r\n };\r\n};\n\nexport { getReplayConsolePlugin };\n", "import { __awaiter } from './../../../../../ext/tslib/tslib.es6.js';\nimport { decode } from './../../../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';\n\nconst webGLVarMap = new Map();\r\nfunction variableListFor(ctx, ctor) {\r\n let contextMap = webGLVarMap.get(ctx);\r\n if (!contextMap) {\r\n contextMap = new Map();\r\n webGLVarMap.set(ctx, contextMap);\r\n }\r\n if (!contextMap.has(ctor)) {\r\n contextMap.set(ctor, []);\r\n }\r\n return contextMap.get(ctor);\r\n}\r\nfunction deserializeArg(imageMap, ctx, preload) {\r\n return (arg) => __awaiter(this, void 0, void 0, function* () {\r\n if (arg && typeof arg === 'object' && 'rr_type' in arg) {\r\n if (preload)\r\n preload.isUnchanged = false;\r\n if (arg.rr_type === 'ImageBitmap' && 'args' in arg) {\r\n const args = yield deserializeArg(imageMap, ctx, preload)(arg.args);\r\n return yield createImageBitmap.apply(null, args);\r\n }\r\n else if ('index' in arg) {\r\n if (preload || ctx === null)\r\n return arg;\r\n const { rr_type: name, index } = arg;\r\n return variableListFor(ctx, name)[index];\r\n }\r\n else if ('args' in arg) {\r\n const { rr_type: name, args } = arg;\r\n const ctor = window[name];\r\n return new ctor(...(yield Promise.all(args.map(deserializeArg(imageMap, ctx, preload)))));\r\n }\r\n else if ('base64' in arg) {\r\n return decode(arg.base64);\r\n }\r\n else if ('src' in arg) {\r\n const image = imageMap.get(arg.src);\r\n if (image) {\r\n return image;\r\n }\r\n else {\r\n const image = new Image();\r\n image.src = arg.src;\r\n imageMap.set(arg.src, image);\r\n return image;\r\n }\r\n }\r\n else if ('data' in arg && arg.rr_type === 'Blob') {\r\n const blobContents = yield Promise.all(arg.data.map(deserializeArg(imageMap, ctx, preload)));\r\n const blob = new Blob(blobContents, {\r\n type: arg.type,\r\n });\r\n return blob;\r\n }\r\n }\r\n else if (Array.isArray(arg)) {\r\n const result = yield Promise.all(arg.map(deserializeArg(imageMap, ctx, preload)));\r\n return result;\r\n }\r\n return arg;\r\n });\r\n}\n\nexport { deserializeArg, variableListFor };\n", "import { __awaiter } from './../../../../../ext/tslib/tslib.es6.js';\nimport { CanvasContext } from '../../../../types/dist/types.js';\nimport { deserializeArg, variableListFor } from './deserialize-args.js';\n\nfunction getContext(target, type) {\r\n try {\r\n if (type === CanvasContext.WebGL) {\r\n return (target.getContext('webgl') || target.getContext('experimental-webgl'));\r\n }\r\n return target.getContext('webgl2');\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n}\r\nconst WebGLVariableConstructorsNames = [\r\n 'WebGLActiveInfo',\r\n 'WebGLBuffer',\r\n 'WebGLFramebuffer',\r\n 'WebGLProgram',\r\n 'WebGLRenderbuffer',\r\n 'WebGLShader',\r\n 'WebGLShaderPrecisionFormat',\r\n 'WebGLTexture',\r\n 'WebGLUniformLocation',\r\n 'WebGLVertexArrayObject',\r\n];\r\nfunction saveToWebGLVarMap(ctx, result) {\r\n if (!(result === null || result === void 0 ? void 0 : result.constructor))\r\n return;\r\n const { name } = result.constructor;\r\n if (!WebGLVariableConstructorsNames.includes(name))\r\n return;\r\n const variables = variableListFor(ctx, name);\r\n if (!variables.includes(result))\r\n variables.push(result);\r\n}\r\nfunction webglMutation({ mutation, target, type, imageMap, errorHandler, }) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n try {\r\n const ctx = getContext(target, type);\r\n if (!ctx)\r\n return;\r\n if (mutation.setter) {\r\n ctx[mutation.property] = mutation.args[0];\r\n return;\r\n }\r\n const original = ctx[mutation.property];\r\n const args = yield Promise.all(mutation.args.map(deserializeArg(imageMap, ctx)));\r\n const result = original.apply(ctx, args);\r\n saveToWebGLVarMap(ctx, result);\r\n const debugMode = false;\r\n if (debugMode) ;\r\n }\r\n catch (error) {\r\n errorHandler(mutation, error);\r\n }\r\n });\r\n}\n\nexport { webglMutation as default };\n", "import { __awaiter } from './../../../../../ext/tslib/tslib.es6.js';\nimport { deserializeArg } from './deserialize-args.js';\n\nfunction canvasMutation({ event, mutations, target, imageMap, errorHandler, }) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const ctx = target.getContext('2d');\r\n if (!ctx) {\r\n errorHandler(mutations[0], new Error('Canvas context is null'));\r\n return;\r\n }\r\n const mutationArgsPromises = mutations.map((mutation) => __awaiter(this, void 0, void 0, function* () {\r\n return Promise.all(mutation.args.map(deserializeArg(imageMap, ctx)));\r\n }));\r\n const args = yield Promise.all(mutationArgsPromises);\r\n args.forEach((args, index) => {\r\n const mutation = mutations[index];\r\n try {\r\n if (mutation.setter) {\r\n ctx[mutation.property] =\r\n mutation.args[0];\r\n return;\r\n }\r\n const original = ctx[mutation.property];\r\n if (mutation.property === 'drawImage' &&\r\n typeof mutation.args[0] === 'string') {\r\n imageMap.get(event);\r\n original.apply(ctx, mutation.args);\r\n }\r\n else {\r\n original.apply(ctx, args);\r\n }\r\n }\r\n catch (error) {\r\n errorHandler(mutation, error);\r\n }\r\n return;\r\n });\r\n });\r\n}\n\nexport { canvasMutation as default };\n", "import { __awaiter } from './../../../../../ext/tslib/tslib.es6.js';\nimport { CanvasContext } from '../../../../types/dist/types.js';\nimport webglMutation from './webgl.js';\nimport canvasMutation$1 from './2d.js';\n\nfunction canvasMutation({ event, mutation, target, imageMap, canvasEventMap, errorHandler, }) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n try {\r\n const precomputedMutation = canvasEventMap.get(event) || mutation;\r\n const commands = 'commands' in precomputedMutation\r\n ? precomputedMutation.commands\r\n : [precomputedMutation];\r\n if ([CanvasContext.WebGL, CanvasContext.WebGL2].includes(mutation.type)) {\r\n for (let i = 0; i < commands.length; i++) {\r\n const command = commands[i];\r\n yield webglMutation({\r\n mutation: command,\r\n type: mutation.type,\r\n target,\r\n imageMap,\r\n errorHandler,\r\n });\r\n }\r\n return;\r\n }\r\n yield canvasMutation$1({\r\n event,\r\n mutations: commands,\r\n target,\r\n imageMap,\r\n errorHandler,\r\n });\r\n }\r\n catch (error) {\r\n errorHandler(mutation, error);\r\n }\r\n });\r\n}\n\nexport { canvasMutation as default };\n", "function mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get(\"*\"))&&i.slice().map(function(n){n(t,e);});}}}\n\nexport { mitt as default };\n", "function polyfill(w = window, d = document) {\r\n if ('scrollBehavior' in d.documentElement.style &&\r\n w.__forceSmoothScrollPolyfill__ !== true) {\r\n return;\r\n }\r\n const Element = w.HTMLElement || w.Element;\r\n const SCROLL_TIME = 468;\r\n const original = {\r\n scroll: w.scroll || w.scrollTo,\r\n scrollBy: w.scrollBy,\r\n elementScroll: Element.prototype.scroll || scrollElement,\r\n scrollIntoView: Element.prototype.scrollIntoView,\r\n };\r\n const now = w.performance && w.performance.now\r\n ? w.performance.now.bind(w.performance)\r\n : Date.now;\r\n function isMicrosoftBrowser(userAgent) {\r\n const userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\r\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\r\n }\r\n const ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\r\n function scrollElement(x, y) {\r\n this.scrollLeft = x;\r\n this.scrollTop = y;\r\n }\r\n function ease(k) {\r\n return 0.5 * (1 - Math.cos(Math.PI * k));\r\n }\r\n function shouldBailOut(firstArg) {\r\n if (firstArg === null ||\r\n typeof firstArg !== 'object' ||\r\n firstArg.behavior === undefined ||\r\n firstArg.behavior === 'auto' ||\r\n firstArg.behavior === 'instant') {\r\n return true;\r\n }\r\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\r\n return false;\r\n }\r\n throw new TypeError('behavior member of ScrollOptions ' +\r\n firstArg.behavior +\r\n ' is not a valid value for enumeration ScrollBehavior.');\r\n }\r\n function hasScrollableSpace(el, axis) {\r\n if (axis === 'Y') {\r\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\r\n }\r\n if (axis === 'X') {\r\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\r\n }\r\n }\r\n function canOverflow(el, axis) {\r\n const overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\r\n return overflowValue === 'auto' || overflowValue === 'scroll';\r\n }\r\n function isScrollable(el) {\r\n const isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\r\n const isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\r\n return isScrollableY || isScrollableX;\r\n }\r\n function findScrollableParent(el) {\r\n while (el !== d.body && isScrollable(el) === false) {\r\n el = el.parentNode || el.host;\r\n }\r\n return el;\r\n }\r\n function step(context) {\r\n const time = now();\r\n let value;\r\n let currentX;\r\n let currentY;\r\n let elapsed = (time - context.startTime) / SCROLL_TIME;\r\n elapsed = elapsed > 1 ? 1 : elapsed;\r\n value = ease(elapsed);\r\n currentX = context.startX + (context.x - context.startX) * value;\r\n currentY = context.startY + (context.y - context.startY) * value;\r\n context.method.call(context.scrollable, currentX, currentY);\r\n if (currentX !== context.x || currentY !== context.y) {\r\n w.requestAnimationFrame(step.bind(w, context));\r\n }\r\n }\r\n function smoothScroll(el, x, y) {\r\n let scrollable;\r\n let startX;\r\n let startY;\r\n let method;\r\n const startTime = now();\r\n if (el === d.body) {\r\n scrollable = w;\r\n startX = w.scrollX || w.pageXOffset;\r\n startY = w.scrollY || w.pageYOffset;\r\n method = original.scroll;\r\n }\r\n else {\r\n scrollable = el;\r\n startX = el.scrollLeft;\r\n startY = el.scrollTop;\r\n method = scrollElement;\r\n }\r\n step({\r\n scrollable: scrollable,\r\n method: method,\r\n startTime: startTime,\r\n startX: startX,\r\n startY: startY,\r\n x: x,\r\n y: y,\r\n });\r\n }\r\n w.scroll = w.scrollTo = function () {\r\n if (arguments[0] === undefined) {\r\n return;\r\n }\r\n if (shouldBailOut(arguments[0]) === true) {\r\n original.scroll.call(w, arguments[0].left !== undefined\r\n ? arguments[0].left\r\n : typeof arguments[0] !== 'object'\r\n ? arguments[0]\r\n : w.scrollX || w.pageXOffset, arguments[0].top !== undefined\r\n ? arguments[0].top\r\n : arguments[1] !== undefined\r\n ? arguments[1]\r\n : w.scrollY || w.pageYOffset);\r\n return;\r\n }\r\n smoothScroll.call(w, d.body, arguments[0].left !== undefined\r\n ? ~~arguments[0].left\r\n : w.scrollX || w.pageXOffset, arguments[0].top !== undefined\r\n ? ~~arguments[0].top\r\n : w.scrollY || w.pageYOffset);\r\n };\r\n w.scrollBy = function () {\r\n if (arguments[0] === undefined) {\r\n return;\r\n }\r\n if (shouldBailOut(arguments[0])) {\r\n original.scrollBy.call(w, arguments[0].left !== undefined\r\n ? arguments[0].left\r\n : typeof arguments[0] !== 'object'\r\n ? arguments[0]\r\n : 0, arguments[0].top !== undefined\r\n ? arguments[0].top\r\n : arguments[1] !== undefined\r\n ? arguments[1]\r\n : 0);\r\n return;\r\n }\r\n smoothScroll.call(w, d.body, ~~arguments[0].left + (w.scrollX || w.pageXOffset), ~~arguments[0].top + (w.scrollY || w.pageYOffset));\r\n };\r\n Element.prototype.scroll = Element.prototype.scrollTo = function () {\r\n if (arguments[0] === undefined) {\r\n return;\r\n }\r\n if (shouldBailOut(arguments[0]) === true) {\r\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\r\n throw new SyntaxError('Value could not be converted');\r\n }\r\n original.elementScroll.call(this, arguments[0].left !== undefined\r\n ? ~~arguments[0].left\r\n : typeof arguments[0] !== 'object'\r\n ? ~~arguments[0]\r\n : this.scrollLeft, arguments[0].top !== undefined\r\n ? ~~arguments[0].top\r\n : arguments[1] !== undefined\r\n ? ~~arguments[1]\r\n : this.scrollTop);\r\n return;\r\n }\r\n const left = arguments[0].left;\r\n const top = arguments[0].top;\r\n smoothScroll.call(this, this, typeof left === 'undefined' ? this.scrollLeft : ~~left, typeof top === 'undefined' ? this.scrollTop : ~~top);\r\n };\r\n Element.prototype.scrollBy = function () {\r\n if (arguments[0] === undefined) {\r\n return;\r\n }\r\n if (shouldBailOut(arguments[0]) === true) {\r\n original.elementScroll.call(this, arguments[0].left !== undefined\r\n ? ~~arguments[0].left + this.scrollLeft\r\n : ~~arguments[0] + this.scrollLeft, arguments[0].top !== undefined\r\n ? ~~arguments[0].top + this.scrollTop\r\n : ~~arguments[1] + this.scrollTop);\r\n return;\r\n }\r\n this.scroll({\r\n left: ~~arguments[0].left + this.scrollLeft,\r\n top: ~~arguments[0].top + this.scrollTop,\r\n behavior: arguments[0].behavior,\r\n });\r\n };\r\n Element.prototype.scrollIntoView = function () {\r\n if (shouldBailOut(arguments[0]) === true) {\r\n original.scrollIntoView.call(this, arguments[0] === undefined ? true : arguments[0]);\r\n return;\r\n }\r\n const scrollableParent = findScrollableParent(this);\r\n const parentRects = scrollableParent.getBoundingClientRect();\r\n const clientRects = this.getBoundingClientRect();\r\n if (scrollableParent !== d.body) {\r\n smoothScroll.call(this, scrollableParent, scrollableParent.scrollLeft + clientRects.left - parentRects.left, scrollableParent.scrollTop + clientRects.top - parentRects.top);\r\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\r\n w.scrollBy({\r\n left: parentRects.left,\r\n top: parentRects.top,\r\n behavior: 'smooth',\r\n });\r\n }\r\n }\r\n else {\r\n w.scrollBy({\r\n left: clientRects.left,\r\n top: clientRects.top,\r\n behavior: 'smooth',\r\n });\r\n }\r\n };\r\n}\n\nexport { polyfill };\n", "import { EventType, IncrementalSource } from '../../../types/dist/types.js';\n\nclass Timer {\r\n constructor(actions = [], config) {\r\n this.timeOffset = 0;\r\n this.raf = null;\r\n this.actions = actions;\r\n this.speed = config.speed;\r\n }\r\n addAction(action) {\r\n const rafWasActive = this.raf === true;\r\n if (!this.actions.length ||\r\n this.actions[this.actions.length - 1].delay <= action.delay) {\r\n this.actions.push(action);\r\n }\r\n else {\r\n const index = this.findActionIndex(action);\r\n this.actions.splice(index, 0, action);\r\n }\r\n if (rafWasActive) {\r\n this.raf = requestAnimationFrame(this.rafCheck.bind(this));\r\n }\r\n }\r\n start() {\r\n this.timeOffset = 0;\r\n this.lastTimestamp = performance.now();\r\n this.raf = requestAnimationFrame(this.rafCheck.bind(this));\r\n }\r\n rafCheck() {\r\n const time = performance.now();\r\n this.timeOffset += (time - this.lastTimestamp) * this.speed;\r\n this.lastTimestamp = time;\r\n while (this.actions.length) {\r\n const action = this.actions[0];\r\n if (this.timeOffset >= action.delay) {\r\n this.actions.shift();\r\n action.doAction();\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (this.actions.length > 0) {\r\n this.raf = requestAnimationFrame(this.rafCheck.bind(this));\r\n }\r\n else {\r\n this.raf = true;\r\n }\r\n }\r\n clear() {\r\n if (this.raf) {\r\n if (this.raf !== true) {\r\n cancelAnimationFrame(this.raf);\r\n }\r\n this.raf = null;\r\n }\r\n this.actions.length = 0;\r\n }\r\n setSpeed(speed) {\r\n this.speed = speed;\r\n }\r\n isActive() {\r\n return this.raf !== null;\r\n }\r\n findActionIndex(action) {\r\n let start = 0;\r\n let end = this.actions.length - 1;\r\n while (start <= end) {\r\n const mid = Math.floor((start + end) / 2);\r\n if (this.actions[mid].delay < action.delay) {\r\n start = mid + 1;\r\n }\r\n else if (this.actions[mid].delay > action.delay) {\r\n end = mid - 1;\r\n }\r\n else {\r\n return mid + 1;\r\n }\r\n }\r\n return start;\r\n }\r\n}\r\nfunction addDelay(event, baselineTime) {\r\n if (event.type === EventType.IncrementalSnapshot &&\r\n event.data.source === IncrementalSource.MouseMove &&\r\n event.data.positions &&\r\n event.data.positions.length) {\r\n const firstOffset = event.data.positions[0].timeOffset;\r\n const firstTimestamp = event.timestamp + firstOffset;\r\n event.delay = firstTimestamp - baselineTime;\r\n return firstTimestamp - baselineTime;\r\n }\r\n event.delay = event.timestamp - baselineTime;\r\n return event.delay;\r\n}\n\nexport { Timer, addDelay };\n", "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nfunction t(t,n){var e=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value);}catch(t){o={error:t};}finally{try{r&&!r.done&&(e=i.return)&&e.call(i);}finally{if(o)throw o.error}}return a}var n;!function(t){t[t.NotStarted=0]=\"NotStarted\",t[t.Running=1]=\"Running\",t[t.Stopped=2]=\"Stopped\";}(n||(n={}));var e={type:\"xstate.init\"};function r(t){return void 0===t?[]:[].concat(t)}function o(t){return {type:\"xstate.assign\",assignment:t}}function i(t,n){return \"string\"==typeof(t=\"string\"==typeof t&&n&&n[t]?n[t]:t)?{type:t}:\"function\"==typeof t?{type:t.name,exec:t}:t}function a(t){return function(n){return t===n}}function u(t){return \"string\"==typeof t?{type:t}:t}function c(t,n){return {value:t,context:n,actions:[],changed:!1,matches:a(t)}}function f(t,n,e){var r=n,o=!1;return [t.filter((function(t){if(\"xstate.assign\"===t.type){o=!0;var n=Object.assign({},r);return \"function\"==typeof t.assignment?n=t.assignment(r,e):Object.keys(t.assignment).forEach((function(o){n[o]=\"function\"==typeof t.assignment[o]?t.assignment[o](r,e):t.assignment[o];})),r=n,!1}return !0})),r,o]}function s(n,o){void 0===o&&(o={});var s=t(f(r(n.states[n.initial].entry).map((function(t){return i(t,o.actions)})),n.context,e),2),l=s[0],v=s[1],y={config:n,_options:o,initialState:{value:n.initial,actions:l,context:v,matches:a(n.initial)},transition:function(e,o){var s,l,v=\"string\"==typeof e?{value:e,context:n.context}:e,p=v.value,g=v.context,d=u(o),x=n.states[p];if(x.on){var m=r(x.on[d.type]);try{for(var h=function(t){var n=\"function\"==typeof Symbol&&Symbol.iterator,e=n&&t[n],r=0;if(e)return e.call(t);if(t&&\"number\"==typeof t.length)return {next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}(m),b=h.next();!b.done;b=h.next()){var S=b.value;if(void 0===S)return c(p,g);var w=\"string\"==typeof S?{target:S}:S,j=w.target,E=w.actions,R=void 0===E?[]:E,N=w.cond,O=void 0===N?function(){return !0}:N,_=void 0===j,k=null!=j?j:p,T=n.states[k];if(O(g,d)){var q=t(f((_?r(R):[].concat(x.exit,R,T.entry).filter((function(t){return t}))).map((function(t){return i(t,y._options.actions)})),g,d),3),z=q[0],A=q[1],B=q[2],C=null!=j?j:p;return {value:C,context:A,actions:z,changed:j!==p||z.length>0||B,matches:a(C)}}}}catch(t){s={error:t};}finally{try{b&&!b.done&&(l=h.return)&&l.call(h);}finally{if(s)throw s.error}}}return c(p,g)}};return y}var l=function(t,n){return t.actions.forEach((function(e){var r=e.exec;return r&&r(t.context,n)}))};function v(t){var r=t.initialState,o=n.NotStarted,i=new Set,c={_machine:t,send:function(e){o===n.Running&&(r=t.transition(r,e),l(r,u(e)),i.forEach((function(t){return t(r)})));},subscribe:function(t){return i.add(t),t(r),{unsubscribe:function(){return i.delete(t)}}},start:function(i){if(i){var u=\"object\"==typeof i?i:{context:t.config.context,value:i};r={value:u.value,actions:[],context:u.context,matches:a(u.value)};}return o=n.Running,l(r,e),c},stop:function(){return o=n.Stopped,i.clear(),c},get state(){return r},get status(){return o}};return c}\n\nexport { n as InterpreterStatus, o as assign, s as createMachine, v as interpret };\n", "import { interpret as v, createMachine as s, assign as o } from './../../../../ext/@xstate/fsm/es/index.js';\nimport { EventType, IncrementalSource, ReplayerEvents } from '../../../types/dist/types.js';\nimport { addDelay } from './timer.js';\n\nfunction discardPriorSnapshots(events, baselineTime) {\r\n for (let idx = events.length - 1; idx >= 0; idx--) {\r\n const event = events[idx];\r\n if (event.type === EventType.Meta) {\r\n if (event.timestamp <= baselineTime) {\r\n return events.slice(idx);\r\n }\r\n }\r\n }\r\n return events;\r\n}\r\nfunction createPlayerService(context, { getCastFn, applyEventsSynchronously, emitter }) {\r\n const playerMachine = s({\r\n id: 'player',\r\n context,\r\n initial: 'paused',\r\n states: {\r\n playing: {\r\n on: {\r\n PAUSE: {\r\n target: 'paused',\r\n actions: ['pause'],\r\n },\r\n CAST_EVENT: {\r\n target: 'playing',\r\n actions: 'castEvent',\r\n },\r\n END: {\r\n target: 'paused',\r\n actions: ['resetLastPlayedEvent', 'pause'],\r\n },\r\n ADD_EVENT: {\r\n target: 'playing',\r\n actions: ['addEvent'],\r\n },\r\n },\r\n },\r\n paused: {\r\n on: {\r\n PLAY: {\r\n target: 'playing',\r\n actions: ['recordTimeOffset', 'play'],\r\n },\r\n CAST_EVENT: {\r\n target: 'paused',\r\n actions: 'castEvent',\r\n },\r\n TO_LIVE: {\r\n target: 'live',\r\n actions: ['startLive'],\r\n },\r\n ADD_EVENT: {\r\n target: 'paused',\r\n actions: ['addEvent'],\r\n },\r\n },\r\n },\r\n live: {\r\n on: {\r\n ADD_EVENT: {\r\n target: 'live',\r\n actions: ['addEvent'],\r\n },\r\n CAST_EVENT: {\r\n target: 'live',\r\n actions: ['castEvent'],\r\n },\r\n },\r\n },\r\n },\r\n }, {\r\n actions: {\r\n castEvent: o({\r\n lastPlayedEvent: (ctx, event) => {\r\n if (event.type === 'CAST_EVENT') {\r\n return event.payload.event;\r\n }\r\n return ctx.lastPlayedEvent;\r\n },\r\n }),\r\n recordTimeOffset: o((ctx, event) => {\r\n let timeOffset = ctx.timeOffset;\r\n if ('payload' in event && 'timeOffset' in event.payload) {\r\n timeOffset = event.payload.timeOffset;\r\n }\r\n return Object.assign(Object.assign({}, ctx), { timeOffset, baselineTime: ctx.events[0].timestamp + timeOffset });\r\n }),\r\n play(ctx) {\r\n var _a;\r\n const { timer, events, baselineTime, lastPlayedEvent } = ctx;\r\n timer.clear();\r\n for (const event of events) {\r\n addDelay(event, baselineTime);\r\n }\r\n const neededEvents = discardPriorSnapshots(events, baselineTime);\r\n let lastPlayedTimestamp = lastPlayedEvent === null || lastPlayedEvent === void 0 ? void 0 : lastPlayedEvent.timestamp;\r\n if ((lastPlayedEvent === null || lastPlayedEvent === void 0 ? void 0 : lastPlayedEvent.type) === EventType.IncrementalSnapshot &&\r\n lastPlayedEvent.data.source === IncrementalSource.MouseMove) {\r\n lastPlayedTimestamp =\r\n lastPlayedEvent.timestamp +\r\n ((_a = lastPlayedEvent.data.positions[0]) === null || _a === void 0 ? void 0 : _a.timeOffset);\r\n }\r\n if (baselineTime < (lastPlayedTimestamp || 0)) {\r\n emitter.emit(ReplayerEvents.PlayBack);\r\n }\r\n const syncEvents = new Array();\r\n for (const event of neededEvents) {\r\n if (lastPlayedTimestamp &&\r\n lastPlayedTimestamp < baselineTime &&\r\n (event.timestamp <= lastPlayedTimestamp ||\r\n event === lastPlayedEvent)) {\r\n continue;\r\n }\r\n if (event.timestamp < baselineTime) {\r\n syncEvents.push(event);\r\n }\r\n else {\r\n const castFn = getCastFn(event, false);\r\n timer.addAction({\r\n doAction: () => {\r\n castFn();\r\n },\r\n delay: event.delay,\r\n });\r\n }\r\n }\r\n applyEventsSynchronously(syncEvents);\r\n emitter.emit(ReplayerEvents.Flush);\r\n timer.start();\r\n },\r\n pause(ctx) {\r\n ctx.timer.clear();\r\n },\r\n resetLastPlayedEvent: o((ctx) => {\r\n return Object.assign(Object.assign({}, ctx), { lastPlayedEvent: null });\r\n }),\r\n startLive: o({\r\n baselineTime: (ctx, event) => {\r\n ctx.timer.start();\r\n if (event.type === 'TO_LIVE' && event.payload.baselineTime) {\r\n return event.payload.baselineTime;\r\n }\r\n return Date.now();\r\n },\r\n }),\r\n addEvent: o((ctx, machineEvent) => {\r\n const { baselineTime, timer, events } = ctx;\r\n if (machineEvent.type === 'ADD_EVENT') {\r\n const { event } = machineEvent.payload;\r\n addDelay(event, baselineTime);\r\n let end = events.length - 1;\r\n if (!events[end] || events[end].timestamp <= event.timestamp) {\r\n events.push(event);\r\n }\r\n else {\r\n let insertionIndex = -1;\r\n let start = 0;\r\n while (start <= end) {\r\n const mid = Math.floor((start + end) / 2);\r\n if (events[mid].timestamp <= event.timestamp) {\r\n start = mid + 1;\r\n }\r\n else {\r\n end = mid - 1;\r\n }\r\n }\r\n if (insertionIndex === -1) {\r\n insertionIndex = start;\r\n }\r\n events.splice(insertionIndex, 0, event);\r\n }\r\n const isSync = event.timestamp < baselineTime;\r\n const castFn = getCastFn(event, isSync);\r\n if (isSync) {\r\n castFn();\r\n }\r\n else if (timer.isActive()) {\r\n timer.addAction({\r\n doAction: () => {\r\n castFn();\r\n },\r\n delay: event.delay,\r\n });\r\n }\r\n }\r\n return Object.assign(Object.assign({}, ctx), { events });\r\n }),\r\n },\r\n });\r\n return v(playerMachine);\r\n}\r\nfunction createSpeedService(context) {\r\n const speedMachine = s({\r\n id: 'speed',\r\n context,\r\n initial: 'normal',\r\n states: {\r\n normal: {\r\n on: {\r\n FAST_FORWARD: {\r\n target: 'skipping',\r\n actions: ['recordSpeed', 'setSpeed'],\r\n },\r\n SET_SPEED: {\r\n target: 'normal',\r\n actions: ['setSpeed'],\r\n },\r\n },\r\n },\r\n skipping: {\r\n on: {\r\n BACK_TO_NORMAL: {\r\n target: 'normal',\r\n actions: ['restoreSpeed'],\r\n },\r\n SET_SPEED: {\r\n target: 'normal',\r\n actions: ['setSpeed'],\r\n },\r\n },\r\n },\r\n },\r\n }, {\r\n actions: {\r\n setSpeed: (ctx, event) => {\r\n if ('payload' in event) {\r\n ctx.timer.setSpeed(event.payload.speed);\r\n }\r\n },\r\n recordSpeed: o({\r\n normalSpeed: (ctx) => ctx.timer.speed,\r\n }),\r\n restoreSpeed: (ctx) => {\r\n ctx.timer.setSpeed(ctx.normalSpeed);\r\n },\r\n },\r\n });\r\n return v(speedMachine);\r\n}\n\nexport { createPlayerService, createSpeedService, discardPriorSnapshots };\n", "const rules = (blockClass) => [\r\n `.${blockClass} { background: currentColor }`,\r\n 'noscript { display: none !important; }',\r\n];\n\nexport { rules as default };\n", "import { __awaiter } from './../../../../ext/tslib/tslib.es6.js';\nimport { createCache, createMirror, rebuild, buildNodeWithSN, toLowerCase, NodeType } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { RRDocument, diff, createOrGetNode, getDefaultSN, buildFromDom, buildFromNode } from '../../../rrdom/es/rrdom.js';\nimport * as mitt$1 from './../../../../ext/mitt/dist/mitt.mjs.js';\nimport mitt$2 from './../../../../ext/mitt/dist/mitt.mjs.js';\nimport { polyfill } from './smoothscroll.js';\nimport { Timer } from './timer.js';\nimport { createPlayerService, createSpeedService } from './machine.js';\nimport { EventType, ReplayerEvents, IncrementalSource, MouseInteractions } from '../../../types/dist/types.js';\nimport { StyleSheetMirror, polyfill as polyfill$1, isSerializedIframe, hasShadowRoot, queueToResolveTrees, iterateResolveTree, uniqueTextMutations, getPositionsAndIndex, getNestedRule, getBaseDimension } from '../utils.js';\nimport rules from './styles/inject-style.js';\nimport canvasMutation from './canvas/index.js';\nimport { deserializeArg } from './canvas/deserialize-args.js';\n\nconst SKIP_TIME_THRESHOLD = 10 * 1000;\r\nconst SKIP_TIME_INTERVAL = 5 * 1000;\r\nconst mitt = mitt$2 || mitt$1;\r\nconst REPLAY_CONSOLE_PREFIX = '[replayer]';\r\nconst defaultMouseTailConfig = {\r\n duration: 500,\r\n lineCap: 'round',\r\n lineWidth: 3,\r\n strokeStyle: 'red',\r\n};\r\nfunction indicatesTouchDevice(e) {\r\n return (e.type == EventType.IncrementalSnapshot &&\r\n (e.data.source == IncrementalSource.TouchMove ||\r\n (e.data.source == IncrementalSource.MouseInteraction &&\r\n e.data.type == MouseInteractions.TouchStart)));\r\n}\r\nclass Replayer {\r\n get timer() {\r\n return this.service.state.context.timer;\r\n }\r\n constructor(events, config) {\r\n this.usingVirtualDom = false;\r\n this.virtualDom = new RRDocument();\r\n this.mouseTail = null;\r\n this.tailPositions = [];\r\n this.emitter = mitt();\r\n this.legacy_missingNodeRetryMap = {};\r\n this.cache = createCache();\r\n this.imageMap = new Map();\r\n this.canvasEventMap = new Map();\r\n this.mirror = createMirror();\r\n this.styleMirror = new StyleSheetMirror();\r\n this.firstFullSnapshot = null;\r\n this.newDocumentQueue = [];\r\n this.mousePos = null;\r\n this.touchActive = null;\r\n this.lastMouseDownEvent = null;\r\n this.lastSelectionData = null;\r\n this.constructedStyleMutations = [];\r\n this.adoptedStyleSheets = [];\r\n this.handleResize = (dimension) => {\r\n this.iframe.style.display = 'inherit';\r\n for (const el of [this.mouseTail, this.iframe]) {\r\n if (!el) {\r\n continue;\r\n }\r\n el.setAttribute('width', String(dimension.width));\r\n el.setAttribute('height', String(dimension.height));\r\n }\r\n };\r\n this.applyEventsSynchronously = (events) => {\r\n for (const event of events) {\r\n switch (event.type) {\r\n case EventType.DomContentLoaded:\r\n case EventType.Load:\r\n case EventType.Custom:\r\n continue;\r\n case EventType.FullSnapshot:\r\n case EventType.Meta:\r\n case EventType.Plugin:\r\n case EventType.IncrementalSnapshot:\r\n break;\r\n }\r\n const castFn = this.getCastFn(event, true);\r\n castFn();\r\n }\r\n };\r\n this.getCastFn = (event, isSync = false) => {\r\n let castFn;\r\n switch (event.type) {\r\n case EventType.DomContentLoaded:\r\n case EventType.Load:\r\n break;\r\n case EventType.Custom:\r\n castFn = () => {\r\n this.emitter.emit(ReplayerEvents.CustomEvent, event);\r\n };\r\n break;\r\n case EventType.Meta:\r\n castFn = () => this.emitter.emit(ReplayerEvents.Resize, {\r\n width: event.data.width,\r\n height: event.data.height,\r\n });\r\n break;\r\n case EventType.FullSnapshot:\r\n castFn = () => {\r\n var _a;\r\n if (this.firstFullSnapshot) {\r\n if (this.firstFullSnapshot === event) {\r\n this.firstFullSnapshot = true;\r\n return;\r\n }\r\n }\r\n else {\r\n this.firstFullSnapshot = true;\r\n }\r\n this.rebuildFullSnapshot(event, isSync);\r\n (_a = this.iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.scrollTo(event.data.initialOffset);\r\n this.styleMirror.reset();\r\n };\r\n break;\r\n case EventType.IncrementalSnapshot:\r\n castFn = () => {\r\n this.applyIncremental(event, isSync);\r\n if (isSync) {\r\n return;\r\n }\r\n if (event === this.nextUserInteractionEvent) {\r\n this.nextUserInteractionEvent = null;\r\n this.backToNormal();\r\n }\r\n if (this.config.skipInactive && !this.nextUserInteractionEvent) {\r\n for (const _event of this.service.state.context.events) {\r\n if (_event.timestamp <= event.timestamp) {\r\n continue;\r\n }\r\n if (this.isUserInteraction(_event)) {\r\n if (_event.delay - event.delay >\r\n SKIP_TIME_THRESHOLD *\r\n this.speedService.state.context.timer.speed) {\r\n this.nextUserInteractionEvent = _event;\r\n }\r\n break;\r\n }\r\n }\r\n if (this.nextUserInteractionEvent) {\r\n const skipTime = this.nextUserInteractionEvent.delay - event.delay;\r\n const payload = {\r\n speed: Math.min(Math.round(skipTime / SKIP_TIME_INTERVAL), this.config.maxSpeed),\r\n };\r\n this.speedService.send({ type: 'FAST_FORWARD', payload });\r\n this.emitter.emit(ReplayerEvents.SkipStart, payload);\r\n }\r\n }\r\n };\r\n break;\r\n }\r\n const wrappedCastFn = () => {\r\n if (castFn) {\r\n castFn();\r\n }\r\n for (const plugin of this.config.plugins || []) {\r\n if (plugin.handler)\r\n plugin.handler(event, isSync, { replayer: this });\r\n }\r\n this.service.send({ type: 'CAST_EVENT', payload: { event } });\r\n const last_index = this.service.state.context.events.length - 1;\r\n if (!this.config.liveMode &&\r\n event === this.service.state.context.events[last_index]) {\r\n const finish = () => {\r\n if (last_index < this.service.state.context.events.length - 1) {\r\n return;\r\n }\r\n this.backToNormal();\r\n this.service.send('END');\r\n this.emitter.emit(ReplayerEvents.Finish);\r\n };\r\n let finish_buffer = 50;\r\n if (event.type === EventType.IncrementalSnapshot &&\r\n event.data.source === IncrementalSource.MouseMove &&\r\n event.data.positions.length) {\r\n finish_buffer += Math.max(0, -event.data.positions[0].timeOffset);\r\n }\r\n setTimeout(finish, finish_buffer);\r\n }\r\n this.emitter.emit(ReplayerEvents.EventCast, event);\r\n };\r\n return wrappedCastFn;\r\n };\r\n if (!(config === null || config === void 0 ? void 0 : config.liveMode) && events.length < 2) {\r\n throw new Error('Replayer need at least 2 events.');\r\n }\r\n const defaultConfig = {\r\n speed: 1,\r\n maxSpeed: 360,\r\n root: document.body,\r\n loadTimeout: 0,\r\n skipInactive: false,\r\n showWarning: true,\r\n showDebug: false,\r\n blockClass: 'rr-block',\r\n liveMode: false,\r\n insertStyleRules: [],\r\n triggerFocus: true,\r\n UNSAFE_replayCanvas: false,\r\n pauseAnimation: true,\r\n mouseTail: defaultMouseTailConfig,\r\n useVirtualDom: true,\r\n logger: console,\r\n };\r\n this.config = Object.assign({}, defaultConfig, config);\r\n this.handleResize = this.handleResize.bind(this);\r\n this.getCastFn = this.getCastFn.bind(this);\r\n this.applyEventsSynchronously = this.applyEventsSynchronously.bind(this);\r\n this.emitter.on(ReplayerEvents.Resize, this.handleResize);\r\n this.setupDom();\r\n for (const plugin of this.config.plugins || []) {\r\n if (plugin.getMirror)\r\n plugin.getMirror({ nodeMirror: this.mirror });\r\n }\r\n this.emitter.on(ReplayerEvents.Flush, () => {\r\n if (this.usingVirtualDom) {\r\n const replayerHandler = {\r\n mirror: this.mirror,\r\n applyCanvas: (canvasEvent, canvasMutationData, target) => {\r\n void canvasMutation({\r\n event: canvasEvent,\r\n mutation: canvasMutationData,\r\n target,\r\n imageMap: this.imageMap,\r\n canvasEventMap: this.canvasEventMap,\r\n errorHandler: this.warnCanvasMutationFailed.bind(this),\r\n });\r\n },\r\n applyInput: this.applyInput.bind(this),\r\n applyScroll: this.applyScroll.bind(this),\r\n applyStyleSheetMutation: (data, styleSheet) => {\r\n if (data.source === IncrementalSource.StyleSheetRule)\r\n this.applyStyleSheetRule(data, styleSheet);\r\n else if (data.source === IncrementalSource.StyleDeclaration)\r\n this.applyStyleDeclaration(data, styleSheet);\r\n },\r\n afterAppend: (node, id) => {\r\n for (const plugin of this.config.plugins || []) {\r\n if (plugin.onBuild)\r\n plugin.onBuild(node, { id, replayer: this });\r\n }\r\n },\r\n };\r\n if (this.iframe.contentDocument)\r\n try {\r\n diff(this.iframe.contentDocument, this.virtualDom, replayerHandler, this.virtualDom.mirror);\r\n }\r\n catch (e) {\r\n console.warn(e);\r\n }\r\n this.virtualDom.destroyTree();\r\n this.usingVirtualDom = false;\r\n if (Object.keys(this.legacy_missingNodeRetryMap).length) {\r\n for (const key in this.legacy_missingNodeRetryMap) {\r\n try {\r\n const value = this.legacy_missingNodeRetryMap[key];\r\n const realNode = createOrGetNode(value.node, this.mirror, this.virtualDom.mirror);\r\n diff(realNode, value.node, replayerHandler, this.virtualDom.mirror);\r\n value.node = realNode;\r\n }\r\n catch (error) {\r\n this.warn(error);\r\n }\r\n }\r\n }\r\n this.constructedStyleMutations.forEach((data) => {\r\n this.applyStyleSheetMutation(data);\r\n });\r\n this.constructedStyleMutations = [];\r\n this.adoptedStyleSheets.forEach((data) => {\r\n this.applyAdoptedStyleSheet(data);\r\n });\r\n this.adoptedStyleSheets = [];\r\n }\r\n if (this.mousePos) {\r\n this.moveAndHover(this.mousePos.x, this.mousePos.y, this.mousePos.id, true, this.mousePos.debugData);\r\n this.mousePos = null;\r\n }\r\n if (this.touchActive === true) {\r\n this.mouse.classList.add('touch-active');\r\n }\r\n else if (this.touchActive === false) {\r\n this.mouse.classList.remove('touch-active');\r\n }\r\n this.touchActive = null;\r\n if (this.lastMouseDownEvent) {\r\n const [target, event] = this.lastMouseDownEvent;\r\n target.dispatchEvent(event);\r\n }\r\n this.lastMouseDownEvent = null;\r\n if (this.lastSelectionData) {\r\n this.applySelection(this.lastSelectionData);\r\n this.lastSelectionData = null;\r\n }\r\n });\r\n this.emitter.on(ReplayerEvents.PlayBack, () => {\r\n this.firstFullSnapshot = null;\r\n this.mirror.reset();\r\n this.styleMirror.reset();\r\n });\r\n const timer = new Timer([], {\r\n speed: this.config.speed,\r\n });\r\n this.service = createPlayerService({\r\n events: events\r\n .map((e) => {\r\n if (config && config.unpackFn) {\r\n return config.unpackFn(e);\r\n }\r\n return e;\r\n })\r\n .sort((a1, a2) => a1.timestamp - a2.timestamp),\r\n timer,\r\n timeOffset: 0,\r\n baselineTime: 0,\r\n lastPlayedEvent: null,\r\n }, {\r\n getCastFn: this.getCastFn,\r\n applyEventsSynchronously: this.applyEventsSynchronously,\r\n emitter: this.emitter,\r\n });\r\n this.service.start();\r\n this.service.subscribe((state) => {\r\n this.emitter.emit(ReplayerEvents.StateChange, {\r\n player: state,\r\n });\r\n });\r\n this.speedService = createSpeedService({\r\n normalSpeed: -1,\r\n timer,\r\n });\r\n this.speedService.start();\r\n this.speedService.subscribe((state) => {\r\n this.emitter.emit(ReplayerEvents.StateChange, {\r\n speed: state,\r\n });\r\n });\r\n const firstMeta = this.service.state.context.events.find((e) => e.type === EventType.Meta);\r\n const firstFullsnapshot = this.service.state.context.events.find((e) => e.type === EventType.FullSnapshot);\r\n if (firstMeta) {\r\n const { width, height } = firstMeta.data;\r\n setTimeout(() => {\r\n this.emitter.emit(ReplayerEvents.Resize, {\r\n width,\r\n height,\r\n });\r\n }, 0);\r\n }\r\n if (firstFullsnapshot) {\r\n setTimeout(() => {\r\n var _a;\r\n if (this.firstFullSnapshot) {\r\n return;\r\n }\r\n this.firstFullSnapshot = firstFullsnapshot;\r\n this.rebuildFullSnapshot(firstFullsnapshot);\r\n (_a = this.iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.scrollTo(firstFullsnapshot.data.initialOffset);\r\n }, 1);\r\n }\r\n if (this.service.state.context.events.find(indicatesTouchDevice)) {\r\n this.mouse.classList.add('touch-device');\r\n }\r\n }\r\n on(event, handler) {\r\n this.emitter.on(event, handler);\r\n return this;\r\n }\r\n off(event, handler) {\r\n this.emitter.off(event, handler);\r\n return this;\r\n }\r\n setConfig(config) {\r\n Object.keys(config).forEach((key) => {\r\n config[key];\r\n this.config[key] = config[key];\r\n });\r\n if (!this.config.skipInactive) {\r\n this.backToNormal();\r\n }\r\n if (typeof config.speed !== 'undefined') {\r\n this.speedService.send({\r\n type: 'SET_SPEED',\r\n payload: {\r\n speed: config.speed,\r\n },\r\n });\r\n }\r\n if (typeof config.mouseTail !== 'undefined') {\r\n if (config.mouseTail === false) {\r\n if (this.mouseTail) {\r\n this.mouseTail.style.display = 'none';\r\n }\r\n }\r\n else {\r\n if (!this.mouseTail) {\r\n this.mouseTail = document.createElement('canvas');\r\n this.mouseTail.width = Number.parseFloat(this.iframe.width);\r\n this.mouseTail.height = Number.parseFloat(this.iframe.height);\r\n this.mouseTail.classList.add('replayer-mouse-tail');\r\n this.wrapper.insertBefore(this.mouseTail, this.iframe);\r\n }\r\n this.mouseTail.style.display = 'inherit';\r\n }\r\n }\r\n }\r\n getMetaData() {\r\n const firstEvent = this.service.state.context.events[0];\r\n const lastEvent = this.service.state.context.events[this.service.state.context.events.length - 1];\r\n return {\r\n startTime: firstEvent.timestamp,\r\n endTime: lastEvent.timestamp,\r\n totalTime: lastEvent.timestamp - firstEvent.timestamp,\r\n };\r\n }\r\n getCurrentTime() {\r\n return this.timer.timeOffset + this.getTimeOffset();\r\n }\r\n getTimeOffset() {\r\n const { baselineTime, events } = this.service.state.context;\r\n return baselineTime - events[0].timestamp;\r\n }\r\n getMirror() {\r\n return this.mirror;\r\n }\r\n play(timeOffset = 0) {\r\n var _a, _b;\r\n if (this.service.state.matches('paused')) {\r\n this.service.send({ type: 'PLAY', payload: { timeOffset } });\r\n }\r\n else {\r\n this.service.send({ type: 'PAUSE' });\r\n this.service.send({ type: 'PLAY', payload: { timeOffset } });\r\n }\r\n (_b = (_a = this.iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('html')[0]) === null || _b === void 0 ? void 0 : _b.classList.remove('rrweb-paused');\r\n this.emitter.emit(ReplayerEvents.Start);\r\n }\r\n pause(timeOffset) {\r\n var _a, _b;\r\n if (timeOffset === undefined && this.service.state.matches('playing')) {\r\n this.service.send({ type: 'PAUSE' });\r\n }\r\n if (typeof timeOffset === 'number') {\r\n this.play(timeOffset);\r\n this.service.send({ type: 'PAUSE' });\r\n }\r\n (_b = (_a = this.iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('html')[0]) === null || _b === void 0 ? void 0 : _b.classList.add('rrweb-paused');\r\n this.emitter.emit(ReplayerEvents.Pause);\r\n }\r\n resume(timeOffset = 0) {\r\n this.warn(`The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface.`);\r\n this.play(timeOffset);\r\n this.emitter.emit(ReplayerEvents.Resume);\r\n }\r\n destroy() {\r\n this.pause();\r\n this.config.root.removeChild(this.wrapper);\r\n this.emitter.emit(ReplayerEvents.Destroy);\r\n }\r\n startLive(baselineTime) {\r\n this.service.send({ type: 'TO_LIVE', payload: { baselineTime } });\r\n }\r\n addEvent(rawEvent) {\r\n const event = this.config.unpackFn\r\n ? this.config.unpackFn(rawEvent)\r\n : rawEvent;\r\n if (indicatesTouchDevice(event)) {\r\n this.mouse.classList.add('touch-device');\r\n }\r\n void Promise.resolve().then(() => this.service.send({ type: 'ADD_EVENT', payload: { event } }));\r\n }\r\n enableInteract() {\r\n this.iframe.setAttribute('scrolling', 'auto');\r\n this.iframe.style.pointerEvents = 'auto';\r\n }\r\n disableInteract() {\r\n this.iframe.setAttribute('scrolling', 'no');\r\n this.iframe.style.pointerEvents = 'none';\r\n }\r\n resetCache() {\r\n this.cache = createCache();\r\n }\r\n setupDom() {\r\n this.wrapper = document.createElement('div');\r\n this.wrapper.classList.add('replayer-wrapper');\r\n this.config.root.appendChild(this.wrapper);\r\n this.mouse = document.createElement('div');\r\n this.mouse.classList.add('replayer-mouse');\r\n this.wrapper.appendChild(this.mouse);\r\n if (this.config.mouseTail !== false) {\r\n this.mouseTail = document.createElement('canvas');\r\n this.mouseTail.classList.add('replayer-mouse-tail');\r\n this.mouseTail.style.display = 'inherit';\r\n this.wrapper.appendChild(this.mouseTail);\r\n }\r\n this.iframe = document.createElement('iframe');\r\n const attributes = ['allow-same-origin'];\r\n if (this.config.UNSAFE_replayCanvas) {\r\n attributes.push('allow-scripts');\r\n }\r\n this.iframe.style.display = 'none';\r\n this.iframe.setAttribute('sandbox', attributes.join(' '));\r\n this.disableInteract();\r\n this.wrapper.appendChild(this.iframe);\r\n if (this.iframe.contentWindow && this.iframe.contentDocument) {\r\n polyfill(this.iframe.contentWindow, this.iframe.contentDocument);\r\n polyfill$1(this.iframe.contentWindow);\r\n }\r\n }\r\n rebuildFullSnapshot(event, isSync = false) {\r\n if (!this.iframe.contentDocument) {\r\n return this.warn('Looks like your replayer has been destroyed.');\r\n }\r\n if (Object.keys(this.legacy_missingNodeRetryMap).length) {\r\n this.warn('Found unresolved missing node map', this.legacy_missingNodeRetryMap);\r\n }\r\n this.legacy_missingNodeRetryMap = {};\r\n const collected = [];\r\n const afterAppend = (builtNode, id) => {\r\n this.collectIframeAndAttachDocument(collected, builtNode);\r\n for (const plugin of this.config.plugins || []) {\r\n if (plugin.onBuild)\r\n plugin.onBuild(builtNode, {\r\n id,\r\n replayer: this,\r\n });\r\n }\r\n };\r\n if (this.usingVirtualDom) {\r\n this.virtualDom.destroyTree();\r\n this.usingVirtualDom = false;\r\n }\r\n this.mirror.reset();\r\n rebuild(event.data.node, {\r\n doc: this.iframe.contentDocument,\r\n afterAppend,\r\n cache: this.cache,\r\n mirror: this.mirror,\r\n });\r\n afterAppend(this.iframe.contentDocument, event.data.node.id);\r\n for (const { mutationInQueue, builtNode } of collected) {\r\n this.attachDocumentToIframe(mutationInQueue, builtNode);\r\n this.newDocumentQueue = this.newDocumentQueue.filter((m) => m !== mutationInQueue);\r\n }\r\n const { documentElement, head } = this.iframe.contentDocument;\r\n this.insertStyleRules(documentElement, head);\r\n if (!this.service.state.matches('playing')) {\r\n this.iframe.contentDocument\r\n .getElementsByTagName('html')[0]\r\n .classList.add('rrweb-paused');\r\n }\r\n this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded, event);\r\n if (!isSync) {\r\n this.waitForStylesheetLoad();\r\n }\r\n if (this.config.UNSAFE_replayCanvas) {\r\n void this.preloadAllImages();\r\n }\r\n }\r\n insertStyleRules(documentElement, head) {\r\n var _a;\r\n const injectStylesRules = rules(this.config.blockClass).concat(this.config.insertStyleRules);\r\n if (this.config.pauseAnimation) {\r\n injectStylesRules.push('html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }');\r\n }\r\n if (this.usingVirtualDom) {\r\n const styleEl = this.virtualDom.createElement('style');\r\n this.virtualDom.mirror.add(styleEl, getDefaultSN(styleEl, this.virtualDom.unserializedId));\r\n documentElement.insertBefore(styleEl, head);\r\n styleEl.rules.push({\r\n source: IncrementalSource.StyleSheetRule,\r\n adds: injectStylesRules.map((cssText, index) => ({\r\n rule: cssText,\r\n index,\r\n })),\r\n });\r\n }\r\n else {\r\n const styleEl = document.createElement('style');\r\n documentElement.insertBefore(styleEl, head);\r\n for (let idx = 0; idx < injectStylesRules.length; idx++) {\r\n (_a = styleEl.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(injectStylesRules[idx], idx);\r\n }\r\n }\r\n }\r\n attachDocumentToIframe(mutation, iframeEl) {\r\n const mirror = this.usingVirtualDom\r\n ? this.virtualDom.mirror\r\n : this.mirror;\r\n const collected = [];\r\n const afterAppend = (builtNode, id) => {\r\n this.collectIframeAndAttachDocument(collected, builtNode);\r\n const sn = mirror.getMeta(builtNode);\r\n if ((sn === null || sn === void 0 ? void 0 : sn.type) === NodeType.Element &&\r\n (sn === null || sn === void 0 ? void 0 : sn.tagName.toUpperCase()) === 'HTML') {\r\n const { documentElement, head } = iframeEl.contentDocument;\r\n this.insertStyleRules(documentElement, head);\r\n }\r\n if (this.usingVirtualDom)\r\n return;\r\n for (const plugin of this.config.plugins || []) {\r\n if (plugin.onBuild)\r\n plugin.onBuild(builtNode, {\r\n id,\r\n replayer: this,\r\n });\r\n }\r\n };\r\n buildNodeWithSN(mutation.node, {\r\n doc: iframeEl.contentDocument,\r\n mirror: mirror,\r\n hackCss: true,\r\n skipChild: false,\r\n afterAppend,\r\n cache: this.cache,\r\n });\r\n afterAppend(iframeEl.contentDocument, mutation.node.id);\r\n for (const { mutationInQueue, builtNode } of collected) {\r\n this.attachDocumentToIframe(mutationInQueue, builtNode);\r\n this.newDocumentQueue = this.newDocumentQueue.filter((m) => m !== mutationInQueue);\r\n }\r\n }\r\n collectIframeAndAttachDocument(collected, builtNode) {\r\n if (isSerializedIframe(builtNode, this.mirror)) {\r\n const mutationInQueue = this.newDocumentQueue.find((m) => m.parentId === this.mirror.getId(builtNode));\r\n if (mutationInQueue) {\r\n collected.push({\r\n mutationInQueue,\r\n builtNode: builtNode,\r\n });\r\n }\r\n }\r\n }\r\n waitForStylesheetLoad() {\r\n var _a;\r\n const head = (_a = this.iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.head;\r\n if (head) {\r\n const unloadSheets = new Set();\r\n let timer;\r\n let beforeLoadState = this.service.state;\r\n const stateHandler = () => {\r\n beforeLoadState = this.service.state;\r\n };\r\n this.emitter.on(ReplayerEvents.Start, stateHandler);\r\n this.emitter.on(ReplayerEvents.Pause, stateHandler);\r\n const unsubscribe = () => {\r\n this.emitter.off(ReplayerEvents.Start, stateHandler);\r\n this.emitter.off(ReplayerEvents.Pause, stateHandler);\r\n };\r\n head\r\n .querySelectorAll('link[rel=\"stylesheet\"]')\r\n .forEach((css) => {\r\n if (!css.sheet) {\r\n unloadSheets.add(css);\r\n css.addEventListener('load', () => {\r\n unloadSheets.delete(css);\r\n if (unloadSheets.size === 0 && timer !== -1) {\r\n if (beforeLoadState.matches('playing')) {\r\n this.play(this.getCurrentTime());\r\n }\r\n this.emitter.emit(ReplayerEvents.LoadStylesheetEnd);\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n unsubscribe();\r\n }\r\n });\r\n }\r\n });\r\n if (unloadSheets.size > 0) {\r\n this.service.send({ type: 'PAUSE' });\r\n this.emitter.emit(ReplayerEvents.LoadStylesheetStart);\r\n timer = setTimeout(() => {\r\n if (beforeLoadState.matches('playing')) {\r\n this.play(this.getCurrentTime());\r\n }\r\n timer = -1;\r\n unsubscribe();\r\n }, this.config.loadTimeout);\r\n }\r\n }\r\n }\r\n preloadAllImages() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n this.service.state;\r\n const stateHandler = () => {\r\n this.service.state;\r\n };\r\n this.emitter.on(ReplayerEvents.Start, stateHandler);\r\n this.emitter.on(ReplayerEvents.Pause, stateHandler);\r\n const promises = [];\r\n for (const event of this.service.state.context.events) {\r\n if (event.type === EventType.IncrementalSnapshot &&\r\n event.data.source === IncrementalSource.CanvasMutation) {\r\n promises.push(this.deserializeAndPreloadCanvasEvents(event.data, event));\r\n const commands = 'commands' in event.data ? event.data.commands : [event.data];\r\n commands.forEach((c) => {\r\n this.preloadImages(c, event);\r\n });\r\n }\r\n }\r\n return Promise.all(promises);\r\n });\r\n }\r\n preloadImages(data, event) {\r\n if (data.property === 'drawImage' &&\r\n typeof data.args[0] === 'string' &&\r\n !this.imageMap.has(event)) {\r\n const canvas = document.createElement('canvas');\r\n const ctx = canvas.getContext('2d');\r\n const imgd = ctx === null || ctx === void 0 ? void 0 : ctx.createImageData(canvas.width, canvas.height);\r\n imgd === null || imgd === void 0 ? void 0 : imgd.data;\r\n JSON.parse(data.args[0]);\r\n ctx === null || ctx === void 0 ? void 0 : ctx.putImageData(imgd, 0, 0);\r\n }\r\n }\r\n deserializeAndPreloadCanvasEvents(data, event) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!this.canvasEventMap.has(event)) {\r\n const status = {\r\n isUnchanged: true,\r\n };\r\n if ('commands' in data) {\r\n const commands = yield Promise.all(data.commands.map((c) => __awaiter(this, void 0, void 0, function* () {\r\n const args = yield Promise.all(c.args.map(deserializeArg(this.imageMap, null, status)));\r\n return Object.assign(Object.assign({}, c), { args });\r\n })));\r\n if (status.isUnchanged === false)\r\n this.canvasEventMap.set(event, Object.assign(Object.assign({}, data), { commands }));\r\n }\r\n else {\r\n const args = yield Promise.all(data.args.map(deserializeArg(this.imageMap, null, status)));\r\n if (status.isUnchanged === false)\r\n this.canvasEventMap.set(event, Object.assign(Object.assign({}, data), { args }));\r\n }\r\n }\r\n });\r\n }\r\n applyIncremental(e, isSync) {\r\n var _a, _b, _c;\r\n const { data: d } = e;\r\n switch (d.source) {\r\n case IncrementalSource.Mutation: {\r\n try {\r\n this.applyMutation(d, isSync);\r\n }\r\n catch (error) {\r\n this.warn(`Exception in mutation ${error.message || error}`, d);\r\n }\r\n break;\r\n }\r\n case IncrementalSource.Drag:\r\n case IncrementalSource.TouchMove:\r\n case IncrementalSource.MouseMove:\r\n if (isSync) {\r\n const lastPosition = d.positions[d.positions.length - 1];\r\n this.mousePos = {\r\n x: lastPosition.x,\r\n y: lastPosition.y,\r\n id: lastPosition.id,\r\n debugData: d,\r\n };\r\n }\r\n else {\r\n d.positions.forEach((p) => {\r\n const action = {\r\n doAction: () => {\r\n this.moveAndHover(p.x, p.y, p.id, isSync, d);\r\n },\r\n delay: p.timeOffset +\r\n e.timestamp -\r\n this.service.state.context.baselineTime,\r\n };\r\n this.timer.addAction(action);\r\n });\r\n this.timer.addAction({\r\n doAction() {\r\n },\r\n delay: e.delay - ((_a = d.positions[0]) === null || _a === void 0 ? void 0 : _a.timeOffset),\r\n });\r\n }\r\n break;\r\n case IncrementalSource.MouseInteraction: {\r\n if (d.id === -1) {\r\n break;\r\n }\r\n const event = new Event(toLowerCase(MouseInteractions[d.type]));\r\n const target = this.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n this.emitter.emit(ReplayerEvents.MouseInteraction, {\r\n type: d.type,\r\n target,\r\n });\r\n const { triggerFocus } = this.config;\r\n switch (d.type) {\r\n case MouseInteractions.Blur:\r\n if ('blur' in target) {\r\n target.blur();\r\n }\r\n break;\r\n case MouseInteractions.Focus:\r\n if (triggerFocus && target.focus) {\r\n target.focus({\r\n preventScroll: true,\r\n });\r\n }\r\n break;\r\n case MouseInteractions.Click:\r\n case MouseInteractions.TouchStart:\r\n case MouseInteractions.TouchEnd:\r\n case MouseInteractions.MouseDown:\r\n case MouseInteractions.MouseUp:\r\n if (isSync) {\r\n if (d.type === MouseInteractions.TouchStart) {\r\n this.touchActive = true;\r\n }\r\n else if (d.type === MouseInteractions.TouchEnd) {\r\n this.touchActive = false;\r\n }\r\n if (d.type === MouseInteractions.MouseDown) {\r\n this.lastMouseDownEvent = [target, event];\r\n }\r\n else if (d.type === MouseInteractions.MouseUp) {\r\n this.lastMouseDownEvent = null;\r\n }\r\n this.mousePos = {\r\n x: d.x || 0,\r\n y: d.y || 0,\r\n id: d.id,\r\n debugData: d,\r\n };\r\n }\r\n else {\r\n if (d.type === MouseInteractions.TouchStart) {\r\n this.tailPositions.length = 0;\r\n }\r\n this.moveAndHover(d.x || 0, d.y || 0, d.id, isSync, d);\r\n if (d.type === MouseInteractions.Click) {\r\n this.mouse.classList.remove('active');\r\n void this.mouse.offsetWidth;\r\n this.mouse.classList.add('active');\r\n }\r\n else if (d.type === MouseInteractions.TouchStart) {\r\n void this.mouse.offsetWidth;\r\n this.mouse.classList.add('touch-active');\r\n }\r\n else if (d.type === MouseInteractions.TouchEnd) {\r\n this.mouse.classList.remove('touch-active');\r\n }\r\n else {\r\n target.dispatchEvent(event);\r\n }\r\n }\r\n break;\r\n case MouseInteractions.TouchCancel:\r\n if (isSync) {\r\n this.touchActive = false;\r\n }\r\n else {\r\n this.mouse.classList.remove('touch-active');\r\n }\r\n break;\r\n default:\r\n target.dispatchEvent(event);\r\n }\r\n break;\r\n }\r\n case IncrementalSource.Scroll: {\r\n if (d.id === -1) {\r\n break;\r\n }\r\n if (this.usingVirtualDom) {\r\n const target = this.virtualDom.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n target.scrollData = d;\r\n break;\r\n }\r\n this.applyScroll(d, isSync);\r\n break;\r\n }\r\n case IncrementalSource.ViewportResize:\r\n this.emitter.emit(ReplayerEvents.Resize, {\r\n width: d.width,\r\n height: d.height,\r\n });\r\n break;\r\n case IncrementalSource.Input: {\r\n if (d.id === -1) {\r\n break;\r\n }\r\n if (this.usingVirtualDom) {\r\n const target = this.virtualDom.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n target.inputData = d;\r\n break;\r\n }\r\n this.applyInput(d);\r\n break;\r\n }\r\n case IncrementalSource.MediaInteraction: {\r\n const target = this.usingVirtualDom\r\n ? this.virtualDom.mirror.getNode(d.id)\r\n : this.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n const mediaEl = target;\r\n try {\r\n if (d.currentTime !== undefined) {\r\n mediaEl.currentTime = d.currentTime;\r\n }\r\n if (d.volume !== undefined) {\r\n mediaEl.volume = d.volume;\r\n }\r\n if (d.muted !== undefined) {\r\n mediaEl.muted = d.muted;\r\n }\r\n if (d.type === 1) {\r\n mediaEl.pause();\r\n }\r\n if (d.type === 0) {\r\n void mediaEl.play();\r\n }\r\n if (d.type === 4) {\r\n mediaEl.playbackRate = d.playbackRate;\r\n }\r\n }\r\n catch (error) {\r\n this.warn(`Failed to replay media interactions: ${error.message || error}`);\r\n }\r\n break;\r\n }\r\n case IncrementalSource.StyleSheetRule:\r\n case IncrementalSource.StyleDeclaration: {\r\n if (this.usingVirtualDom) {\r\n if (d.styleId)\r\n this.constructedStyleMutations.push(d);\r\n else if (d.id)\r\n (_b = this.virtualDom.mirror.getNode(d.id)) === null || _b === void 0 ? void 0 : _b.rules.push(d);\r\n }\r\n else\r\n this.applyStyleSheetMutation(d);\r\n break;\r\n }\r\n case IncrementalSource.CanvasMutation: {\r\n if (!this.config.UNSAFE_replayCanvas) {\r\n return;\r\n }\r\n if (this.usingVirtualDom) {\r\n const target = this.virtualDom.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n target.canvasMutations.push({\r\n event: e,\r\n mutation: d,\r\n });\r\n }\r\n else {\r\n const target = this.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n void canvasMutation({\r\n event: e,\r\n mutation: d,\r\n target: target,\r\n imageMap: this.imageMap,\r\n canvasEventMap: this.canvasEventMap,\r\n errorHandler: this.warnCanvasMutationFailed.bind(this),\r\n });\r\n }\r\n break;\r\n }\r\n case IncrementalSource.Font: {\r\n try {\r\n const fontFace = new FontFace(d.family, d.buffer\r\n ? new Uint8Array(JSON.parse(d.fontSource))\r\n : d.fontSource, d.descriptors);\r\n (_c = this.iframe.contentDocument) === null || _c === void 0 ? void 0 : _c.fonts.add(fontFace);\r\n }\r\n catch (error) {\r\n this.warn(error);\r\n }\r\n break;\r\n }\r\n case IncrementalSource.Selection: {\r\n if (isSync) {\r\n this.lastSelectionData = d;\r\n break;\r\n }\r\n this.applySelection(d);\r\n break;\r\n }\r\n case IncrementalSource.AdoptedStyleSheet: {\r\n if (this.usingVirtualDom)\r\n this.adoptedStyleSheets.push(d);\r\n else\r\n this.applyAdoptedStyleSheet(d);\r\n break;\r\n }\r\n }\r\n }\r\n applyMutation(d, isSync) {\r\n if (this.config.useVirtualDom && !this.usingVirtualDom && isSync) {\r\n this.usingVirtualDom = true;\r\n buildFromDom(this.iframe.contentDocument, this.mirror, this.virtualDom);\r\n if (Object.keys(this.legacy_missingNodeRetryMap).length) {\r\n for (const key in this.legacy_missingNodeRetryMap) {\r\n try {\r\n const value = this.legacy_missingNodeRetryMap[key];\r\n const virtualNode = buildFromNode(value.node, this.virtualDom, this.mirror);\r\n if (virtualNode)\r\n value.node = virtualNode;\r\n }\r\n catch (error) {\r\n this.warn(error);\r\n }\r\n }\r\n }\r\n }\r\n const mirror = this.usingVirtualDom ? this.virtualDom.mirror : this.mirror;\r\n d.removes = d.removes.filter((mutation) => {\r\n if (!mirror.getNode(mutation.id)) {\r\n this.warnNodeNotFound(d, mutation.id);\r\n return false;\r\n }\r\n return true;\r\n });\r\n d.removes.forEach((mutation) => {\r\n var _a;\r\n const target = mirror.getNode(mutation.id);\r\n if (!target) {\r\n return;\r\n }\r\n let parent = mirror.getNode(mutation.parentId);\r\n if (!parent) {\r\n return this.warnNodeNotFound(d, mutation.parentId);\r\n }\r\n if (mutation.isShadow && hasShadowRoot(parent)) {\r\n parent = parent.shadowRoot;\r\n }\r\n mirror.removeNodeFromMap(target);\r\n if (parent)\r\n try {\r\n parent.removeChild(target);\r\n if (this.usingVirtualDom &&\r\n target.nodeName === '#text' &&\r\n parent.nodeName === 'STYLE' &&\r\n ((_a = parent.rules) === null || _a === void 0 ? void 0 : _a.length) > 0)\r\n parent.rules = [];\r\n }\r\n catch (error) {\r\n if (error instanceof DOMException) {\r\n this.warn('parent could not remove child in mutation', parent, target, d);\r\n }\r\n else {\r\n throw error;\r\n }\r\n }\r\n });\r\n const legacy_missingNodeMap = Object.assign({}, this.legacy_missingNodeRetryMap);\r\n const queue = [];\r\n const nextNotInDOM = (mutation) => {\r\n let next = null;\r\n if (mutation.nextId) {\r\n next = mirror.getNode(mutation.nextId);\r\n }\r\n if (mutation.nextId !== null &&\r\n mutation.nextId !== undefined &&\r\n mutation.nextId !== -1 &&\r\n !next) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n const appendNode = (mutation) => {\r\n var _a, _b;\r\n if (!this.iframe.contentDocument) {\r\n return this.warn('Looks like your replayer has been destroyed.');\r\n }\r\n let parent = mirror.getNode(mutation.parentId);\r\n if (!parent) {\r\n if (mutation.node.type === NodeType.Document) {\r\n return this.newDocumentQueue.push(mutation);\r\n }\r\n return queue.push(mutation);\r\n }\r\n if (mutation.node.isShadow) {\r\n if (!hasShadowRoot(parent)) {\r\n parent.attachShadow({ mode: 'open' });\r\n parent = parent.shadowRoot;\r\n }\r\n else\r\n parent = parent.shadowRoot;\r\n }\r\n let previous = null;\r\n let next = null;\r\n if (mutation.previousId) {\r\n previous = mirror.getNode(mutation.previousId);\r\n }\r\n if (mutation.nextId) {\r\n next = mirror.getNode(mutation.nextId);\r\n }\r\n if (nextNotInDOM(mutation)) {\r\n return queue.push(mutation);\r\n }\r\n if (mutation.node.rootId && !mirror.getNode(mutation.node.rootId)) {\r\n return;\r\n }\r\n const targetDoc = mutation.node.rootId\r\n ? mirror.getNode(mutation.node.rootId)\r\n : this.usingVirtualDom\r\n ? this.virtualDom\r\n : this.iframe.contentDocument;\r\n if (isSerializedIframe(parent, mirror)) {\r\n this.attachDocumentToIframe(mutation, parent);\r\n return;\r\n }\r\n const afterAppend = (node, id) => {\r\n if (this.usingVirtualDom)\r\n return;\r\n for (const plugin of this.config.plugins || []) {\r\n if (plugin.onBuild)\r\n plugin.onBuild(node, { id, replayer: this });\r\n }\r\n };\r\n const target = buildNodeWithSN(mutation.node, {\r\n doc: targetDoc,\r\n mirror: mirror,\r\n skipChild: true,\r\n hackCss: true,\r\n cache: this.cache,\r\n afterAppend,\r\n });\r\n if (mutation.previousId === -1 || mutation.nextId === -1) {\r\n legacy_missingNodeMap[mutation.node.id] = {\r\n node: target,\r\n mutation,\r\n };\r\n return;\r\n }\r\n const parentSn = mirror.getMeta(parent);\r\n if (parentSn &&\r\n parentSn.type === NodeType.Element &&\r\n parentSn.tagName === 'textarea' &&\r\n mutation.node.type === NodeType.Text) {\r\n const childNodeArray = Array.isArray(parent.childNodes)\r\n ? parent.childNodes\r\n : Array.from(parent.childNodes);\r\n for (const c of childNodeArray) {\r\n if (c.nodeType === parent.TEXT_NODE) {\r\n parent.removeChild(c);\r\n }\r\n }\r\n }\r\n else if ((parentSn === null || parentSn === void 0 ? void 0 : parentSn.type) === NodeType.Document) {\r\n const parentDoc = parent;\r\n if (mutation.node.type === NodeType.DocumentType &&\r\n ((_a = parentDoc.childNodes[0]) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.DOCUMENT_TYPE_NODE)\r\n parentDoc.removeChild(parentDoc.childNodes[0]);\r\n if (target.nodeName === 'HTML' && parentDoc.documentElement)\r\n parentDoc.removeChild(parentDoc.documentElement);\r\n }\r\n if (previous && previous.nextSibling && previous.nextSibling.parentNode) {\r\n parent.insertBefore(target, previous.nextSibling);\r\n }\r\n else if (next && next.parentNode) {\r\n parent.contains(next)\r\n ? parent.insertBefore(target, next)\r\n : parent.insertBefore(target, null);\r\n }\r\n else {\r\n parent.appendChild(target);\r\n }\r\n afterAppend(target, mutation.node.id);\r\n if (this.usingVirtualDom &&\r\n target.nodeName === '#text' &&\r\n parent.nodeName === 'STYLE' &&\r\n ((_b = parent.rules) === null || _b === void 0 ? void 0 : _b.length) > 0)\r\n parent.rules = [];\r\n if (isSerializedIframe(target, this.mirror)) {\r\n const targetId = this.mirror.getId(target);\r\n const mutationInQueue = this.newDocumentQueue.find((m) => m.parentId === targetId);\r\n if (mutationInQueue) {\r\n this.attachDocumentToIframe(mutationInQueue, target);\r\n this.newDocumentQueue = this.newDocumentQueue.filter((m) => m !== mutationInQueue);\r\n }\r\n }\r\n if (mutation.previousId || mutation.nextId) {\r\n this.legacy_resolveMissingNode(legacy_missingNodeMap, parent, target, mutation);\r\n }\r\n };\r\n d.adds.forEach((mutation) => {\r\n appendNode(mutation);\r\n });\r\n const startTime = Date.now();\r\n while (queue.length) {\r\n const resolveTrees = queueToResolveTrees(queue);\r\n queue.length = 0;\r\n if (Date.now() - startTime > 500) {\r\n this.warn('Timeout in the loop, please check the resolve tree data:', resolveTrees);\r\n break;\r\n }\r\n for (const tree of resolveTrees) {\r\n const parent = mirror.getNode(tree.value.parentId);\r\n if (!parent) {\r\n this.debug('Drop resolve tree since there is no parent for the root node.', tree);\r\n }\r\n else {\r\n iterateResolveTree(tree, (mutation) => {\r\n appendNode(mutation);\r\n });\r\n }\r\n }\r\n }\r\n if (Object.keys(legacy_missingNodeMap).length) {\r\n Object.assign(this.legacy_missingNodeRetryMap, legacy_missingNodeMap);\r\n }\r\n uniqueTextMutations(d.texts).forEach((mutation) => {\r\n var _a;\r\n const target = mirror.getNode(mutation.id);\r\n if (!target) {\r\n if (d.removes.find((r) => r.id === mutation.id)) {\r\n return;\r\n }\r\n return this.warnNodeNotFound(d, mutation.id);\r\n }\r\n target.textContent = mutation.value;\r\n if (this.usingVirtualDom) {\r\n const parent = target.parentNode;\r\n if (((_a = parent === null || parent === void 0 ? void 0 : parent.rules) === null || _a === void 0 ? void 0 : _a.length) > 0)\r\n parent.rules = [];\r\n }\r\n });\r\n d.attributes.forEach((mutation) => {\r\n var _a;\r\n const target = mirror.getNode(mutation.id);\r\n if (!target) {\r\n if (d.removes.find((r) => r.id === mutation.id)) {\r\n return;\r\n }\r\n return this.warnNodeNotFound(d, mutation.id);\r\n }\r\n for (const attributeName in mutation.attributes) {\r\n if (typeof attributeName === 'string') {\r\n const value = mutation.attributes[attributeName];\r\n if (value === null) {\r\n target.removeAttribute(attributeName);\r\n }\r\n else if (typeof value === 'string') {\r\n try {\r\n if (attributeName === '_cssText' &&\r\n (target.nodeName === 'LINK' || target.nodeName === 'STYLE')) {\r\n try {\r\n const newSn = mirror.getMeta(target);\r\n Object.assign(newSn.attributes, mutation.attributes);\r\n const newNode = buildNodeWithSN(newSn, {\r\n doc: target.ownerDocument,\r\n mirror: mirror,\r\n skipChild: true,\r\n hackCss: true,\r\n cache: this.cache,\r\n });\r\n const siblingNode = target.nextSibling;\r\n const parentNode = target.parentNode;\r\n if (newNode && parentNode) {\r\n parentNode.removeChild(target);\r\n parentNode.insertBefore(newNode, siblingNode);\r\n mirror.replace(mutation.id, newNode);\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n }\r\n }\r\n if (attributeName === 'value' && target.nodeName === 'TEXTAREA') {\r\n const textarea = target;\r\n textarea.childNodes.forEach((c) => textarea.removeChild(c));\r\n const tn = (_a = target.ownerDocument) === null || _a === void 0 ? void 0 : _a.createTextNode(value);\r\n if (tn) {\r\n textarea.appendChild(tn);\r\n }\r\n }\r\n else {\r\n target.setAttribute(attributeName, value);\r\n }\r\n }\r\n catch (error) {\r\n this.warn('An error occurred may due to the checkout feature.', error);\r\n }\r\n }\r\n else if (attributeName === 'style') {\r\n const styleValues = value;\r\n const targetEl = target;\r\n for (const s in styleValues) {\r\n if (styleValues[s] === false) {\r\n targetEl.style.removeProperty(s);\r\n }\r\n else if (styleValues[s] instanceof Array) {\r\n const svp = styleValues[s];\r\n targetEl.style.setProperty(s, svp[0], svp[1]);\r\n }\r\n else {\r\n const svs = styleValues[s];\r\n targetEl.style.setProperty(s, svs);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n applyScroll(d, isSync) {\r\n var _a, _b;\r\n const target = this.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n const sn = this.mirror.getMeta(target);\r\n if (target === this.iframe.contentDocument) {\r\n (_a = this.iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.scrollTo({\r\n top: d.y,\r\n left: d.x,\r\n behavior: isSync ? 'auto' : 'smooth',\r\n });\r\n }\r\n else if ((sn === null || sn === void 0 ? void 0 : sn.type) === NodeType.Document) {\r\n (_b = target.defaultView) === null || _b === void 0 ? void 0 : _b.scrollTo({\r\n top: d.y,\r\n left: d.x,\r\n behavior: isSync ? 'auto' : 'smooth',\r\n });\r\n }\r\n else {\r\n try {\r\n target.scrollTo({\r\n top: d.y,\r\n left: d.x,\r\n behavior: isSync ? 'auto' : 'smooth',\r\n });\r\n }\r\n catch (error) {\r\n }\r\n }\r\n }\r\n applyInput(d) {\r\n const target = this.mirror.getNode(d.id);\r\n if (!target) {\r\n return this.debugNodeNotFound(d, d.id);\r\n }\r\n try {\r\n target.checked = d.isChecked;\r\n target.value = d.text;\r\n }\r\n catch (error) {\r\n }\r\n }\r\n applySelection(d) {\r\n try {\r\n const selectionSet = new Set();\r\n const ranges = d.ranges.map(({ start, startOffset, end, endOffset }) => {\r\n const startContainer = this.mirror.getNode(start);\r\n const endContainer = this.mirror.getNode(end);\r\n if (!startContainer || !endContainer)\r\n return;\r\n const result = new Range();\r\n result.setStart(startContainer, startOffset);\r\n result.setEnd(endContainer, endOffset);\r\n const doc = startContainer.ownerDocument;\r\n const selection = doc === null || doc === void 0 ? void 0 : doc.getSelection();\r\n selection && selectionSet.add(selection);\r\n return {\r\n range: result,\r\n selection,\r\n };\r\n });\r\n selectionSet.forEach((s) => s.removeAllRanges());\r\n ranges.forEach((r) => { var _a; return r && ((_a = r.selection) === null || _a === void 0 ? void 0 : _a.addRange(r.range)); });\r\n }\r\n catch (error) {\r\n }\r\n }\r\n applyStyleSheetMutation(data) {\r\n var _a;\r\n let styleSheet = null;\r\n if (data.styleId)\r\n styleSheet = this.styleMirror.getStyle(data.styleId);\r\n else if (data.id)\r\n styleSheet =\r\n ((_a = this.mirror.getNode(data.id)) === null || _a === void 0 ? void 0 : _a.sheet) || null;\r\n if (!styleSheet)\r\n return;\r\n if (data.source === IncrementalSource.StyleSheetRule)\r\n this.applyStyleSheetRule(data, styleSheet);\r\n else if (data.source === IncrementalSource.StyleDeclaration)\r\n this.applyStyleDeclaration(data, styleSheet);\r\n }\r\n applyStyleSheetRule(data, styleSheet) {\r\n var _a, _b, _c, _d;\r\n (_a = data.adds) === null || _a === void 0 ? void 0 : _a.forEach(({ rule, index: nestedIndex }) => {\r\n try {\r\n if (Array.isArray(nestedIndex)) {\r\n const { positions, index } = getPositionsAndIndex(nestedIndex);\r\n const nestedRule = getNestedRule(styleSheet.cssRules, positions);\r\n nestedRule.insertRule(rule, index);\r\n }\r\n else {\r\n const index = nestedIndex === undefined\r\n ? undefined\r\n : Math.min(nestedIndex, styleSheet.cssRules.length);\r\n styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.insertRule(rule, index);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n });\r\n (_b = data.removes) === null || _b === void 0 ? void 0 : _b.forEach(({ index: nestedIndex }) => {\r\n try {\r\n if (Array.isArray(nestedIndex)) {\r\n const { positions, index } = getPositionsAndIndex(nestedIndex);\r\n const nestedRule = getNestedRule(styleSheet.cssRules, positions);\r\n nestedRule.deleteRule(index || 0);\r\n }\r\n else {\r\n styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.deleteRule(nestedIndex);\r\n }\r\n }\r\n catch (e) {\r\n }\r\n });\r\n if (data.replace)\r\n try {\r\n void ((_c = styleSheet.replace) === null || _c === void 0 ? void 0 : _c.call(styleSheet, data.replace));\r\n }\r\n catch (e) {\r\n }\r\n if (data.replaceSync)\r\n try {\r\n (_d = styleSheet.replaceSync) === null || _d === void 0 ? void 0 : _d.call(styleSheet, data.replaceSync);\r\n }\r\n catch (e) {\r\n }\r\n }\r\n applyStyleDeclaration(data, styleSheet) {\r\n if (data.set) {\r\n const rule = getNestedRule(styleSheet.rules, data.index);\r\n rule.style.setProperty(data.set.property, data.set.value, data.set.priority);\r\n }\r\n if (data.remove) {\r\n const rule = getNestedRule(styleSheet.rules, data.index);\r\n rule.style.removeProperty(data.remove.property);\r\n }\r\n }\r\n applyAdoptedStyleSheet(data) {\r\n var _a;\r\n const targetHost = this.mirror.getNode(data.id);\r\n if (!targetHost)\r\n return;\r\n (_a = data.styles) === null || _a === void 0 ? void 0 : _a.forEach((style) => {\r\n var _a;\r\n let newStyleSheet = null;\r\n let hostWindow = null;\r\n if (hasShadowRoot(targetHost))\r\n hostWindow = ((_a = targetHost.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) || null;\r\n else if (targetHost.nodeName === '#document')\r\n hostWindow = targetHost.defaultView;\r\n if (!hostWindow)\r\n return;\r\n try {\r\n newStyleSheet = new hostWindow.CSSStyleSheet();\r\n this.styleMirror.add(newStyleSheet, style.styleId);\r\n this.applyStyleSheetRule({\r\n source: IncrementalSource.StyleSheetRule,\r\n adds: style.rules,\r\n }, newStyleSheet);\r\n }\r\n catch (e) {\r\n }\r\n });\r\n const MAX_RETRY_TIME = 10;\r\n let count = 0;\r\n const adoptStyleSheets = (targetHost, styleIds) => {\r\n const stylesToAdopt = styleIds\r\n .map((styleId) => this.styleMirror.getStyle(styleId))\r\n .filter((style) => style !== null);\r\n if (hasShadowRoot(targetHost))\r\n targetHost.shadowRoot.adoptedStyleSheets =\r\n stylesToAdopt;\r\n else if (targetHost.nodeName === '#document')\r\n targetHost.adoptedStyleSheets = stylesToAdopt;\r\n if (stylesToAdopt.length !== styleIds.length && count < MAX_RETRY_TIME) {\r\n setTimeout(() => adoptStyleSheets(targetHost, styleIds), 0 + 100 * count);\r\n count++;\r\n }\r\n };\r\n adoptStyleSheets(targetHost, data.styleIds);\r\n }\r\n legacy_resolveMissingNode(map, parent, target, targetMutation) {\r\n const { previousId, nextId } = targetMutation;\r\n const previousInMap = previousId && map[previousId];\r\n const nextInMap = nextId && map[nextId];\r\n if (previousInMap) {\r\n const { node, mutation } = previousInMap;\r\n parent.insertBefore(node, target);\r\n delete map[mutation.node.id];\r\n delete this.legacy_missingNodeRetryMap[mutation.node.id];\r\n if (mutation.previousId || mutation.nextId) {\r\n this.legacy_resolveMissingNode(map, parent, node, mutation);\r\n }\r\n }\r\n if (nextInMap) {\r\n const { node, mutation } = nextInMap;\r\n parent.insertBefore(node, target.nextSibling);\r\n delete map[mutation.node.id];\r\n delete this.legacy_missingNodeRetryMap[mutation.node.id];\r\n if (mutation.previousId || mutation.nextId) {\r\n this.legacy_resolveMissingNode(map, parent, node, mutation);\r\n }\r\n }\r\n }\r\n moveAndHover(x, y, id, isSync, debugData) {\r\n const target = this.mirror.getNode(id);\r\n if (!target) {\r\n return this.debugNodeNotFound(debugData, id);\r\n }\r\n const base = getBaseDimension(target, this.iframe);\r\n const _x = x * base.absoluteScale + base.x;\r\n const _y = y * base.absoluteScale + base.y;\r\n this.mouse.style.left = `${_x}px`;\r\n this.mouse.style.top = `${_y}px`;\r\n if (!isSync) {\r\n this.drawMouseTail({ x: _x, y: _y });\r\n }\r\n this.hoverElements(target);\r\n }\r\n drawMouseTail(position) {\r\n if (!this.mouseTail) {\r\n return;\r\n }\r\n const { lineCap, lineWidth, strokeStyle, duration } = this.config.mouseTail === true\r\n ? defaultMouseTailConfig\r\n : Object.assign({}, defaultMouseTailConfig, this.config.mouseTail);\r\n const draw = () => {\r\n if (!this.mouseTail) {\r\n return;\r\n }\r\n const ctx = this.mouseTail.getContext('2d');\r\n if (!ctx || !this.tailPositions.length) {\r\n return;\r\n }\r\n ctx.clearRect(0, 0, this.mouseTail.width, this.mouseTail.height);\r\n ctx.beginPath();\r\n ctx.lineWidth = lineWidth;\r\n ctx.lineCap = lineCap;\r\n ctx.strokeStyle = strokeStyle;\r\n ctx.moveTo(this.tailPositions[0].x, this.tailPositions[0].y);\r\n this.tailPositions.forEach((p) => ctx.lineTo(p.x, p.y));\r\n ctx.stroke();\r\n };\r\n this.tailPositions.push(position);\r\n draw();\r\n setTimeout(() => {\r\n this.tailPositions = this.tailPositions.filter((p) => p !== position);\r\n draw();\r\n }, duration / this.speedService.state.context.timer.speed);\r\n }\r\n hoverElements(el) {\r\n var _a;\r\n (_a = (this.lastHoveredRootNode || this.iframe.contentDocument)) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.\\\\:hover').forEach((hoveredEl) => {\r\n hoveredEl.classList.remove(':hover');\r\n });\r\n this.lastHoveredRootNode = el.getRootNode();\r\n let currentEl = el;\r\n while (currentEl) {\r\n if (currentEl.classList) {\r\n currentEl.classList.add(':hover');\r\n }\r\n currentEl = currentEl.parentElement;\r\n }\r\n }\r\n isUserInteraction(event) {\r\n if (event.type !== EventType.IncrementalSnapshot) {\r\n return false;\r\n }\r\n return (event.data.source > IncrementalSource.Mutation &&\r\n event.data.source <= IncrementalSource.Input);\r\n }\r\n backToNormal() {\r\n this.nextUserInteractionEvent = null;\r\n if (this.speedService.state.matches('normal')) {\r\n return;\r\n }\r\n this.speedService.send({ type: 'BACK_TO_NORMAL' });\r\n this.emitter.emit(ReplayerEvents.SkipEnd, {\r\n speed: this.speedService.state.context.normalSpeed,\r\n });\r\n }\r\n warnNodeNotFound(d, id) {\r\n this.warn(`Node with id '${id}' not found. `, d);\r\n }\r\n warnCanvasMutationFailed(d, error) {\r\n this.warn(`Has error on canvas update`, error, 'canvas mutation:', d);\r\n }\r\n debugNodeNotFound(d, id) {\r\n this.debug(`Node with id '${id}' not found. `, d);\r\n }\r\n warn(...args) {\r\n if (!this.config.showWarning) {\r\n return;\r\n }\r\n this.config.logger.warn(REPLAY_CONSOLE_PREFIX, ...args);\r\n }\r\n debug(...args) {\r\n if (!this.config.showDebug) {\r\n return;\r\n }\r\n this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);\r\n }\r\n}\n\nexport { Replayer };\n", "export { addCustomEvent, freezePage } from '../index.js';\nexport { pack } from '../packer/pack.js';\nexport { unpack } from '../packer/unpack.js';\nexport { PLUGIN_NAME, getRecordConsolePlugin } from '../plugins/console/record/index.js';\nexport { getReplayConsolePlugin } from '../plugins/console/replay/index.js';\nexport { default as record } from '../record/index.js';\nexport { default as canvasMutation } from '../replay/canvas/index.js';\nexport { EventType, IncrementalSource, MouseInteractions, ReplayerEvents } from '../../../types/dist/types.js';\nexport { Replayer } from '../replay/index.js';\nimport * as utils from '../utils.js';\nexport { utils };\nexport { _mirror as mirror } from '../utils.js';\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SessionReplayClient = void 0;\nconst rrweb = require(\"rrweb\");\nconst client_core_1 = require(\"@statsig/client-core\");\nconst TIMEOUT_MS = 1000 * 60 * 60 * 4; // 4 hours\nclass SessionReplayClient {\n constructor() {\n this._startTimestamp = null;\n this._endTimestamp = null;\n this._clickCount = 0;\n }\n record(callback, config, stopCallback) {\n if ((0, client_core_1._getDocumentSafe)() == null) {\n return;\n }\n // Always reset session id and tracking fields for a new recording\n this._startTimestamp = null;\n this._endTimestamp = null;\n this._clickCount = 0;\n this._stopCallback = stopCallback;\n if (this._stopFn) {\n return;\n }\n const emit = (event) => {\n var _a, _b;\n // Reset start only for the first event\n (_a = this._startTimestamp) !== null && _a !== void 0 ? _a : (this._startTimestamp = event.timestamp);\n // Always keep a running end timestamp\n this._endTimestamp = event.timestamp;\n // Count clicks only for events representing a click\n if (_isClickEvent(event)) {\n this._clickCount++;\n }\n callback(event, {\n startTime: this._startTimestamp,\n endTime: this._endTimestamp,\n clickCount: this._clickCount,\n });\n if (this._endTimestamp - this._startTimestamp > TIMEOUT_MS) {\n (_b = this._stopFn) === null || _b === void 0 ? void 0 : _b.call(this);\n if (this._stopCallback) {\n this._stopCallback();\n }\n }\n };\n this._stopFn = _minifiedAwareRecord(emit, config);\n }\n stop() {\n if (this._stopFn) {\n this._stopFn();\n this._stopFn = undefined;\n }\n }\n isRecording() {\n return this._stopFn != null;\n }\n}\nexports.SessionReplayClient = SessionReplayClient;\n/**\n * We do a simple concat of rrweb during minification.\n * This function ensures we handle both \"npm\" and \"