@dev-wrapp/80918ac8127ba 0.0.105 → 0.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! app name: app-p80918ac8127ba.js | version: 0.0.106 | build date: 2026-01-16T01:00:31.538Z */
2
+ "use strict";(self.webpackChunk_wrapp_wrapper=self.webpackChunk_wrapp_wrapper||[]).push([["plugin-cwv"],{"./src/plugins/cwv/browserDetect.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ detectBrowserEngine: () => (/* binding */ detectBrowserEngine),\n/* harmony export */ isChromium: () => (/* binding */ isChromium),\n/* harmony export */ resetBrowserEngineCache: () => (/* binding */ resetBrowserEngineCache)\n/* harmony export */ });\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ \"./src/plugins/cwv/types.ts\");\n// file: wrapper/src/plugins/cwv/browserDetect.ts\n/**\n * Browser Engine Detection\n *\n * Detects browser engine using feature detection for CWV capability assessment.\n * Feature detection is more reliable than user-agent parsing since:\n * - User-agents can be spoofed or truncated\n * - Feature detection reflects actual browser capabilities\n *\n * This runs once per page and offloads processing from ETL to client.\n */\n\nlet cachedEngine = null;\n/**\n * Detect the browser engine using feature detection.\n * Results are cached for the page lifecycle.\n *\n * Detection strategy:\n * - Chromium: Chrome, Edge, Opera, Brave (chrome.runtime exists)\n * - WebKit: Safari (webkit prefixed APIs, no chrome)\n * - Gecko: Firefox (Moz prefixed APIs)\n */\nfunction detectBrowserEngine() {\n if (cachedEngine !== null) {\n return cachedEngine;\n }\n if (typeof window === 'undefined') {\n cachedEngine = _types__WEBPACK_IMPORTED_MODULE_0__.BrowserEngine.Unknown;\n return cachedEngine;\n }\n // Chromium-based browsers (Chrome, Edge, Opera, Brave)\n // Check for chrome.runtime which is present in all Chromium browsers\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chrome = window.chrome;\n if (chrome?.runtime !== undefined) {\n cachedEngine = _types__WEBPACK_IMPORTED_MODULE_0__.BrowserEngine.Chromium;\n return cachedEngine;\n }\n // WebKit (Safari)\n // Safari has webkit-prefixed APIs but no chrome object\n if ('webkitRequestAnimationFrame' in window || 'webkitURL' in window) {\n cachedEngine = _types__WEBPACK_IMPORTED_MODULE_0__.BrowserEngine.WebKit;\n return cachedEngine;\n }\n // Gecko (Firefox)\n // Firefox uses Moz-prefixed CSS properties\n const style = document.documentElement?.style;\n if (style && 'MozAppearance' in style) {\n cachedEngine = _types__WEBPACK_IMPORTED_MODULE_0__.BrowserEngine.Gecko;\n return cachedEngine;\n }\n cachedEngine = _types__WEBPACK_IMPORTED_MODULE_0__.BrowserEngine.Unknown;\n return cachedEngine;\n}\n/**\n * Check if the current browser is Chromium-based.\n * Chromium browsers have full CWV support and align with CrUX data.\n */\nfunction isChromium() {\n return detectBrowserEngine() === _types__WEBPACK_IMPORTED_MODULE_0__.BrowserEngine.Chromium;\n}\n/**\n * Reset cached engine (for testing).\n */\nfunction resetBrowserEngineCache() {\n cachedEngine = null;\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/browserDetect.ts?")},"./src/plugins/cwv/collectionHealth.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getCollectionHealthSummary: () => (/* binding */ getCollectionHealthSummary),\n/* harmony export */ initCollectionHealth: () => (/* binding */ initCollectionHealth),\n/* harmony export */ recordMetricCollected: () => (/* binding */ recordMetricCollected),\n/* harmony export */ resetCollectionHealth: () => (/* binding */ resetCollectionHealth)\n/* harmony export */ });\n/* harmony import */ var _browserDetect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browserDetect */ \"./src/plugins/cwv/browserDetect.ts\");\n// file: wrapper/src/plugins/cwv/collectionHealth.ts\n\n// Internal state\nconst metricsCollected = {\n lcp: 0, // can be > 1 as larger paints are found\n cls: 0, // can be many (each layout shift)\n inp: 0, // can be many (each interaction)\n // fcp/ttfb excluded - they fire at most once\n};\n/**\n * Initialize collection health tracking.\n * Call this when CWV collection starts.\n */\nfunction initCollectionHealth() {\n metricsCollected.lcp = 0;\n metricsCollected.cls = 0;\n metricsCollected.inp = 0;\n}\n/**\n * Record that a metric was collected.\n */\nfunction recordMetricCollected(metricName) {\n if (metricName === 'FCP' || metricName === 'TTFB') {\n return; // fire at most once, count is redundant\n }\n const key = metricName.toLowerCase();\n metricsCollected[key]++;\n}\n/**\n * Check which PerformanceObserver entry types are supported.\n */\nfunction checkObserverSupport() {\n if (typeof PerformanceObserver === 'undefined') {\n return {\n lcp: false,\n cls: false,\n inp: false,\n fcp: false,\n ttfb: false,\n };\n }\n const supported = PerformanceObserver.supportedEntryTypes || [];\n return {\n lcp: supported.includes('largest-contentful-paint'),\n cls: supported.includes('layout-shift'),\n inp: supported.includes('event'),\n fcp: supported.includes('paint'),\n ttfb: supported.includes('navigation'),\n };\n}\n/**\n * Get the collection health summary for telemetry.\n */\nfunction getCollectionHealthSummary() {\n return {\n browserEngine: (0,_browserDetect__WEBPACK_IMPORTED_MODULE_0__.detectBrowserEngine)(),\n observersSupported: checkObserverSupport(),\n metricsCollected: { ...metricsCollected },\n };\n}\n/**\n * Reset collection health state (for testing or SPA navigation).\n */\nfunction resetCollectionHealth() {\n metricsCollected.lcp = 0;\n metricsCollected.cls = 0;\n metricsCollected.inp = 0;\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/collectionHealth.ts?")},"./src/plugins/cwv/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ init: () => (/* binding */ init),\n/* harmony export */ reset: () => (/* binding */ reset)\n/* harmony export */ });\n/* harmony import */ var _events_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../events/emitter */ "./src/events/emitter.ts");\n/* harmony import */ var _events_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../events/types */ "./src/events/types.ts");\n/* harmony import */ var _phaseTimings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./phaseTimings */ "./src/plugins/cwv/phaseTimings.ts");\n/* harmony import */ var _slotMetrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./slotMetrics */ "./src/plugins/cwv/slotMetrics.ts");\n/* harmony import */ var _webVitals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webVitals */ "./src/plugins/cwv/webVitals.ts");\n/* harmony import */ var _telemetry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./telemetry */ "./src/plugins/cwv/telemetry.ts");\n/* harmony import */ var _collectionHealth__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./collectionHealth */ "./src/plugins/cwv/collectionHealth.ts");\n// file: wrapper/src/plugins/cwv/index.ts\n/**\n * CWV Plugin\n *\n * Core Web Vitals tracking plugin for the wrapper.\n * Subscribes to core lifecycle events to track performance metrics.\n *\n * This plugin is OPTIONAL - it\'s only loaded when CWV is enabled in config.\n * Core wrapper has NO knowledge of this module.\n *\n * Features:\n * - Phase timing tracking (bootstrap lifecycle)\n * - Slot insertion timing (for CLS attribution)\n * - web-vitals integration (LCP, CLS, INP, FCP, TTFB)\n * - Wrapper phase correlation (did wrapper impact LCP?)\n *\n * Usage:\n * @example\n * // In bootstrap.ts (conditional load)\n * if (config.cwv?.enabled) {\n * const cwv = await import(\'./plugins/cwv\');\n * cwv.init(config.cwv);\n * }\n */\n\n\n\n\n\n\n\nlet initialized = false;\n/**\n * Initialize the CWV plugin.\n * Subscribes to core events - core has NO knowledge of this module.\n *\n * @param config - Plugin configuration from pl.cwv (validated at build time)\n */\nfunction init(config) {\n if (initialized) {\n console.warn(\'[cwv] Plugin already initialized\');\n return;\n }\n // Apply sampling - skip initialization entirely if not sampled\n if (config.s < 1.0 && Math.random() > config.s) {\n console.debug(`[cwv] Skipped - not sampled (rate: ${config.s})`);\n return;\n }\n // Initialize collection health tracking first\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_6__.initCollectionHealth)();\n // Initialize web-vitals collection (LCP, CLS, INP, FCP, TTFB)\n // Must be called early to capture all metrics\n (0,_webVitals__WEBPACK_IMPORTED_MODULE_4__.initWebVitals)({ reportAllChanges: true });\n // Initialize telemetry reporting (sends on page unload)\n (0,_telemetry__WEBPACK_IMPORTED_MODULE_5__.initTelemetry)();\n // Subscribe to bootstrap start to initialize phase timings\n (0,_events_emitter__WEBPACK_IMPORTED_MODULE_0__.once)(\'wrapp:bootstrap:start\', ({ pageViewId }) => {\n (0,_phaseTimings__WEBPACK_IMPORTED_MODULE_2__.initPhaseTimings)(pageViewId);\n });\n // Subscribe to phase events to record timings\n (0,_events_emitter__WEBPACK_IMPORTED_MODULE_0__.on)(\'wrapp:phase\', ({ phase }) => {\n (0,_phaseTimings__WEBPACK_IMPORTED_MODULE_2__.recordPhaseTime)(phase);\n // Mark wrapper ready for LCP correlation\n if (phase === _events_types__WEBPACK_IMPORTED_MODULE_1__.BootstrapPhase.WrapperReady) {\n (0,_webVitals__WEBPACK_IMPORTED_MODULE_4__.markWrapperReady)();\n }\n });\n // Subscribe to slot insertion to record insertion times\n (0,_events_emitter__WEBPACK_IMPORTED_MODULE_0__.on)(\'wrapp:slot:inserted\', ({ divId }) => {\n (0,_slotMetrics__WEBPACK_IMPORTED_MODULE_3__.recordSlotInsert)(divId);\n });\n // Subscribe to slot destruction to clean up\n (0,_events_emitter__WEBPACK_IMPORTED_MODULE_0__.on)(\'wrapp:slot:destroyed\', ({ divId }) => {\n (0,_slotMetrics__WEBPACK_IMPORTED_MODULE_3__.clearSlotCWVEntry)(divId);\n });\n initialized = true;\n}\n/**\n * Reset the plugin state.\n * Useful for SPA navigation or testing.\n */\nfunction reset() {\n (0,_phaseTimings__WEBPACK_IMPORTED_MODULE_2__.clearPhaseTimings)();\n (0,_slotMetrics__WEBPACK_IMPORTED_MODULE_3__.clearAllSlotCWVEntries)();\n (0,_webVitals__WEBPACK_IMPORTED_MODULE_4__.clearWebVitals)();\n (0,_telemetry__WEBPACK_IMPORTED_MODULE_5__.resetTelemetry)();\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_6__.resetCollectionHealth)();\n initialized = false;\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/index.ts?')},"./src/plugins/cwv/phaseTimings.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clearPhaseTimings: () => (/* binding */ clearPhaseTimings),\n/* harmony export */ getCurrentPageViewId: () => (/* binding */ getCurrentPageViewId),\n/* harmony export */ getPhaseDuration: () => (/* binding */ getPhaseDuration),\n/* harmony export */ getPhaseTime: () => (/* binding */ getPhaseTime),\n/* harmony export */ getPhaseTimingSummary: () => (/* binding */ getPhaseTimingSummary),\n/* harmony export */ getPhaseTimingsMap: () => (/* binding */ getPhaseTimingsMap),\n/* harmony export */ hasAllPhases: () => (/* binding */ hasAllPhases),\n/* harmony export */ initPhaseTimings: () => (/* binding */ initPhaseTimings),\n/* harmony export */ recordPhaseTime: () => (/* binding */ recordPhaseTime)\n/* harmony export */ });\n/* harmony import */ var _events_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../events/types */ \"./src/events/types.ts\");\n// file: wrapper/src/plugins/cwv/phaseTimings.ts\n/**\n * Phase Timing Module (CWV Plugin)\n *\n * Tracks wrapper bootstrap lifecycle phases for CWV attribution.\n * Records timestamps at key points during initialization to understand\n * the timing impact of different operations on page performance.\n *\n * This module subscribes to 'wrapp:phase' events from the core wrapper.\n * The core wrapper emits these events - this plugin just records them.\n *\n * Design decisions:\n * - Module-level singleton for simplicity and bundle size\n * - Uses performance.now() for high-resolution timestamps\n * - Phase values are short codes from BootstrapPhase enum (e.g., 'WR' for WrapperReady)\n * - Records both absolute timestamp and relative duration\n */\n\n// Module-level state - one timing map per page view\nconst phaseTimings = new Map();\nlet pageViewIdRef = null;\nlet startTimestamp = null;\n/**\n * Initialize phase timing for a new page view.\n * Called when 'wrapp:bootstrap:start' event is received.\n *\n * @param id - Unique identifier for this page view\n */\nfunction initPhaseTimings(id) {\n // Clear any previous timings\n phaseTimings.clear();\n pageViewIdRef = id;\n startTimestamp = performance.now();\n}\n/**\n * Record a phase timing entry.\n * Called when 'wrapp:phase' event is received.\n * Idempotent - subsequent calls for the same phase are ignored.\n *\n * @param phase - The bootstrap phase being recorded (string name)\n */\nfunction recordPhaseTime(phase) {\n if (phaseTimings.has(phase)) {\n // Already recorded - don't overwrite\n return;\n }\n const entry = {\n phase,\n timestamp: performance.now(),\n wallTime: Date.now(),\n };\n phaseTimings.set(phase, entry);\n}\n/**\n * Get the timing entry for a specific phase.\n *\n * @param phase - The phase to retrieve\n * @returns The timing entry or undefined if not recorded\n */\nfunction getPhaseTime(phase) {\n return phaseTimings.get(phase);\n}\n/**\n * Get the duration between two phases.\n *\n * @param startPhase - The starting phase\n * @param endPhase - The ending phase\n * @returns Duration in milliseconds, or null if either phase not recorded\n */\nfunction getPhaseDuration(startPhase, endPhase) {\n const start = phaseTimings.get(startPhase);\n const end = phaseTimings.get(endPhase);\n if (!start || !end) {\n return null;\n }\n return end.timestamp - start.timestamp;\n}\n/**\n * Get all recorded phase timings as a summary.\n *\n * @returns Summary object with all phases and total duration\n */\nfunction getPhaseTimingSummary() {\n const phases = Array.from(phaseTimings.values())\n .sort((a, b) => a.timestamp - b.timestamp);\n // Calculate total duration if we have both start and WrapperReady\n let totalDuration = null;\n const wrapperReady = phaseTimings.get(_events_types__WEBPACK_IMPORTED_MODULE_0__.BootstrapPhase.WrapperReady);\n if (startTimestamp !== null && wrapperReady) {\n totalDuration = wrapperReady.timestamp - startTimestamp;\n }\n return {\n pageViewId: pageViewIdRef || 'unknown',\n phases,\n totalDuration,\n };\n}\n/**\n * Get all phase timings as a plain object for logging.\n * Maps phase names to timestamps.\n *\n * @returns Object with phase names as keys and timestamps as values\n */\nfunction getPhaseTimingsMap() {\n const result = {};\n phaseTimings.forEach((entry, phase) => {\n result[phase] = entry.timestamp;\n });\n return result;\n}\n/**\n * Check if all required phases have been recorded.\n * Useful for validation before sending telemetry.\n *\n * @param requiredPhases - Array of phase names that must be present\n * @returns true if all required phases are recorded\n */\nfunction hasAllPhases(requiredPhases) {\n return requiredPhases.every(phase => phaseTimings.has(phase));\n}\n/**\n * Clear all phase timings.\n * Useful for testing or SPA navigation.\n */\nfunction clearPhaseTimings() {\n phaseTimings.clear();\n pageViewIdRef = null;\n startTimestamp = null;\n}\n/**\n * Get the current page view ID.\n *\n * @returns The page view ID or null if not initialized\n */\nfunction getCurrentPageViewId() {\n return pageViewIdRef;\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/phaseTimings.ts?")},"./src/plugins/cwv/slotMetrics.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clearAllSlotCWVEntries: () => (/* binding */ clearAllSlotCWVEntries),\n/* harmony export */ clearSlotCWVEntry: () => (/* binding */ clearSlotCWVEntry),\n/* harmony export */ getAllSlotCWVEntries: () => (/* binding */ getAllSlotCWVEntries),\n/* harmony export */ getSlotCWVEntry: () => (/* binding */ getSlotCWVEntry),\n/* harmony export */ getSlotInsertTime: () => (/* binding */ getSlotInsertTime),\n/* harmony export */ getSlotMetricsSummary: () => (/* binding */ getSlotMetricsSummary),\n/* harmony export */ recordSlotInsert: () => (/* binding */ recordSlotInsert)\n/* harmony export */ });\n/* harmony import */ var _auctionState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../auctionState */ \"./src/auctionState.ts\");\n// file: wrapper/src/cwv/slotMetrics.ts\n/**\n * Slot-Level CWV Metrics\n *\n * Tracks Core Web Vitals data per ad slot, separate from auction state.\n * Used for CLS/LCP/INP attribution to identify which slots impact performance.\n *\n * Design decisions:\n * - Separate from adSlotAuctionMap (different concerns: metrics vs auction state)\n * - Keyed by div ID internally (for correlation with DOM events)\n * - Telemetry uses slot ID for business reporting\n * - Module-level singleton for simplicity (matches phaseTimings.ts pattern)\n */\n\n// Module-level state - one metrics map per page view\nconst slotCWVMap = new Map();\n/**\n * Record slot insertion for CWV tracking.\n * Called when a slot DOM element is created.\n *\n * @param divId - The slot's DOM element ID (same key used in adSlotAuctionMap)\n */\nfunction recordSlotInsert(divId) {\n // Don't overwrite existing entry (e.g., on refresh, element isn't recreated)\n if (slotCWVMap.has(divId)) {\n return;\n }\n slotCWVMap.set(divId, {\n insertTime: performance.now(),\n });\n}\n/**\n * Get CWV metrics entry for a slot.\n *\n * @param divId - The slot's DOM element ID\n * @returns The CWV entry or undefined if not recorded\n */\nfunction getSlotCWVEntry(divId) {\n return slotCWVMap.get(divId);\n}\n/**\n * Get insert time for a slot.\n * Convenience function for quick timestamp lookup.\n *\n * @param divId - The slot's DOM element ID\n * @returns The insertion timestamp or undefined if not recorded\n */\nfunction getSlotInsertTime(divId) {\n return slotCWVMap.get(divId)?.insertTime;\n}\n/**\n * Get all slot CWV entries.\n * Useful for aggregating page-level CWV metrics.\n *\n * @returns Map of all slot CWV entries\n */\nfunction getAllSlotCWVEntries() {\n return new Map(slotCWVMap);\n}\n/**\n * Clear CWV entry for a specific slot.\n * Called when a slot is removed from the page (e.g., dynamic slot deletion).\n *\n * @param divId - The slot's DOM element ID\n */\nfunction clearSlotCWVEntry(divId) {\n slotCWVMap.delete(divId);\n}\n/**\n * Clear all slot CWV entries.\n * Useful for SPA navigation or testing.\n */\nfunction clearAllSlotCWVEntries() {\n slotCWVMap.clear();\n}\n/**\n * Get summary of all slot metrics for telemetry.\n *\n * @returns Array of slot metrics summaries\n */\nfunction getSlotMetricsSummary() {\n const summaries = [];\n for (const [divId, entry] of slotCWVMap.entries()) {\n const auctionEntry = (0,_auctionState__WEBPACK_IMPORTED_MODULE_0__.getAuctionEntry)(divId);\n const slotId = auctionEntry?.adSlot?.i /*slotId*/;\n if (slotId) {\n summaries.push({\n slotId: slotId,\n insertTime: entry.insertTime,\n });\n }\n }\n return summaries;\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/slotMetrics.ts?")},"./src/plugins/cwv/telemetry.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ flushTelemetry: () => (/* binding */ flushTelemetry),\n/* harmony export */ initTelemetry: () => (/* binding */ initTelemetry),\n/* harmony export */ resetTelemetry: () => (/* binding */ resetTelemetry),\n/* harmony export */ wasTelemetrySent: () => (/* binding */ wasTelemetrySent)\n/* harmony export */ });\n/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.ts");\n/* harmony import */ var _phaseTimings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./phaseTimings */ "./src/plugins/cwv/phaseTimings.ts");\n/* harmony import */ var _slotMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./slotMetrics */ "./src/plugins/cwv/slotMetrics.ts");\n/* harmony import */ var _webVitals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./webVitals */ "./src/plugins/cwv/webVitals.ts");\n/* harmony import */ var _collectionHealth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./collectionHealth */ "./src/plugins/cwv/collectionHealth.ts");\n// file: wrapper/src/plugins/cwv/telemetry.ts\n/**\n * CWV Telemetry Module\n *\n * Handles sending Core Web Vitals telemetry to the backend logger.\n * Sends telemetry on page unload to capture the most complete metrics.\n *\n * CWV metrics fire at different times:\n * - TTFB: Very early (navigation start)\n * - FCP: Early (first paint)\n * - LCP: Medium (largest paint, finalized on interaction or visibility change)\n * - CLS: Continuous (layout shifts throughout page lifecycle)\n * - INP: On interaction (may never fire if user doesn\'t interact)\n *\n * By sending on page unload, we capture the most complete picture.\n */\n\n\n\n\n\nconst CWV_TELEMETRY_ENDPOINT = \'/cwv/telemetry\';\nlet telemetryInitialized = false;\nlet telemetrySent = false;\n/**\n * Build the telemetry payload from collected metrics.\n */\nfunction buildTelemetryPayload() {\n const pageViewId = (0,_phaseTimings__WEBPACK_IMPORTED_MODULE_1__.getCurrentPageViewId)();\n if (!pageViewId) {\n return null;\n }\n const webVitals = (0,_webVitals__WEBPACK_IMPORTED_MODULE_3__.getWebVitalsSummary)();\n const phaseTimings = (0,_phaseTimings__WEBPACK_IMPORTED_MODULE_1__.getPhaseTimingsMap)();\n const slotMetrics = (0,_slotMetrics__WEBPACK_IMPORTED_MODULE_2__.getSlotMetricsSummary)();\n return {\n pageViewId,\n timestamp: Date.now(),\n lcp: webVitals.lcp,\n cls: webVitals.cls,\n inp: webVitals.inp,\n fcp: webVitals.fcp,\n ttfb: webVitals.ttfb,\n phaseTimings: Object.keys(phaseTimings).length > 0 ? phaseTimings : undefined,\n slotMetrics: slotMetrics.length > 0\n ? slotMetrics.map(s => ({ slotId: s.slotId, insertTime: s.insertTime }))\n : undefined,\n collectionHealth: (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_4__.getCollectionHealthSummary)(),\n };\n}\n/**\n * Send CWV telemetry to the backend.\n * Only sends once per page view to avoid duplicates.\n */\nfunction sendTelemetry() {\n if (telemetrySent) {\n return;\n }\n const payload = buildTelemetryPayload();\n if (!payload) {\n return;\n }\n // Only send if we have at least one metric\n const hasMetrics = payload.lcp || payload.cls || payload.inp || payload.fcp || payload.ttfb;\n if (!hasMetrics) {\n return;\n }\n telemetrySent = true;\n (0,_logger__WEBPACK_IMPORTED_MODULE_0__.logEvent)(CWV_TELEMETRY_ENDPOINT, payload);\n}\n/**\n * Initialize CWV telemetry reporting.\n * Registers with the logger to send telemetry before queue flush.\n *\n * @param window - Window object (defaults to globalThis.window)\n */\nfunction initTelemetry(window = globalThis.window) {\n if (telemetryInitialized) {\n return;\n }\n // Register pre-flush callback so telemetry is queued before logger flushes\n (0,_logger__WEBPACK_IMPORTED_MODULE_0__.registerPreFlushCallback)(sendTelemetry);\n // Also send on visibilitychange to hidden (covers mobile tab switching)\n window.document.addEventListener(\'visibilitychange\', () => {\n if (window.document.visibilityState === \'hidden\') {\n sendTelemetry();\n }\n });\n telemetryInitialized = true;\n}\n/**\n * Manually send telemetry and flush the log queue.\n * Use for SPA navigation or testing to ensure delivery.\n * Note: Telemetry can only be sent once per page view.\n */\nfunction flushTelemetry() {\n sendTelemetry();\n (0,_logger__WEBPACK_IMPORTED_MODULE_0__.flushQue)();\n}\n/**\n * Reset telemetry state.\n * Useful for SPA navigation or testing.\n */\nfunction resetTelemetry() {\n telemetrySent = false;\n}\n/**\n * Check if telemetry has been sent.\n */\nfunction wasTelemetrySent() {\n return telemetrySent;\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/telemetry.ts?')},"./src/plugins/cwv/types.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BrowserEngine: () => (/* binding */ BrowserEngine)\n/* harmony export */ });\n// file: wrapper/src/plugins/cwv/types.ts\n/**\n * Browser engine for CWV capability detection.\n *\n * Different browser engines have varying support for CWV metrics:\n * - Chromium: Full support (LCP, CLS, INP, FCP, TTFB)\n * - WebKit: Partial support (CLS, FCP, TTFB) - no LCP/INP\n * - Gecko: Partial support (CLS, FCP, TTFB) - no LCP/INP\n *\n * Used for:\n * - Determining which metrics to collect\n * - Applying sampling rates for non-Chromium browsers\n */\nvar BrowserEngine;\n(function (BrowserEngine) {\n BrowserEngine["Chromium"] = "CR";\n BrowserEngine["WebKit"] = "WK";\n BrowserEngine["Gecko"] = "GK";\n BrowserEngine["Unknown"] = "UN";\n})(BrowserEngine || (BrowserEngine = {}));\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/types.ts?')},"./src/plugins/cwv/webVitals.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clearWebVitals: () => (/* binding */ clearWebVitals),\n/* harmony export */ getAllMetrics: () => (/* binding */ getAllMetrics),\n/* harmony export */ getMetric: () => (/* binding */ getMetric),\n/* harmony export */ getWebVitalsScores: () => (/* binding */ getWebVitalsScores),\n/* harmony export */ getWebVitalsSummary: () => (/* binding */ getWebVitalsSummary),\n/* harmony export */ initWebVitals: () => (/* binding */ initWebVitals),\n/* harmony export */ markWrapperReady: () => (/* binding */ markWrapperReady),\n/* harmony export */ wasLCPBeforeWrapperReady: () => (/* binding */ wasLCPBeforeWrapperReady)\n/* harmony export */ });\n/* harmony import */ var web_vitals_attribution__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! web-vitals/attribution */ \"../node_modules/web-vitals/dist/web-vitals.attribution.js\");\n/* harmony import */ var _phaseTimings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./phaseTimings */ \"./src/plugins/cwv/phaseTimings.ts\");\n/* harmony import */ var _collectionHealth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./collectionHealth */ \"./src/plugins/cwv/collectionHealth.ts\");\n/* harmony import */ var _events_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../events/types */ \"./src/events/types.ts\");\n/* harmony import */ var _auctionState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../auctionState */ \"./src/auctionState.ts\");\n/* harmony import */ var _types_enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../types/enums */ \"./src/types/enums.ts\");\n// file: wrapper/src/plugins/cwv/webVitals.ts\n/**\n * Web Vitals Integration Module\n *\n * Subscribes to Core Web Vitals metrics using Google's web-vitals library.\n * Stores metrics with wrapper-specific attribution for correlation with\n * bootstrap phases and ad slot activity.\n *\n * Core Web Vitals:\n * - LCP (Largest Contentful Paint) - loading performance\n * - CLS (Cumulative Layout Shift) - visual stability\n * - INP (Interaction to Next Paint) - interactivity\n *\n * Additional metrics:\n * - FCP (First Contentful Paint)\n * - TTFB (Time to First Byte)\n */\n\n\n\n\n\n\n// Module-level state\nconst metrics = new Map();\nlet wrapperReadyTime = null;\n/**\n * Get the current wrapper phase based on recorded phase timings.\n * Returns the most recent phase that has been recorded.\n */\nfunction getCurrentPhase() {\n // Check phases in reverse order (most recent first)\n const phases = [\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.WrapperReady,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.AuctionEnd,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.GptConfigEnd,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.GptConfigStart,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.AuctionStart,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.DomInsertionEnd,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.DomInsertionStart,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.SlotProcessingStart,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.LayoutProcessingStart,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.PrebidConfigEnd,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.PrebidConfigStart,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.DomainValidated,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.ConfigLoaded,\n _events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.BootstrapStart,\n ];\n for (const phase of phases) {\n if ((0,_phaseTimings__WEBPACK_IMPORTED_MODULE_1__.getPhaseTime)(phase)) {\n return phase;\n }\n }\n return undefined;\n}\n/**\n * Check if wrapper is ready (WrapperReady phase recorded).\n */\nfunction isWrapperReady() {\n return (0,_phaseTimings__WEBPACK_IMPORTED_MODULE_1__.hasAllPhases)([_events_types__WEBPACK_IMPORTED_MODULE_3__.BootstrapPhase.WrapperReady]);\n}\n/**\n * Process LCP metric with attribution.\n */\nfunction handleLCP(metric) {\n const attr = metric.attribution;\n const attribution = {\n element: attr.target ?? attr.lcpEntry?.element?.tagName,\n url: attr.url,\n timeToFirstByte: attr.timeToFirstByte,\n resourceLoadDelay: attr.resourceLoadDelay,\n resourceLoadTime: attr.resourceLoadDuration,\n elementRenderDelay: attr.elementRenderDelay,\n };\n const entry = {\n name: 'LCP',\n value: metric.value,\n rating: metric.rating,\n id: metric.id,\n navigationType: metric.navigationType,\n timestamp: performance.now(),\n delta: metric.delta,\n attribution,\n wrapperPhase: getCurrentPhase(),\n beforeWrapperReady: !isWrapperReady(),\n };\n metrics.set('LCP', entry);\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_2__.recordMetricCollected)('LCP');\n}\n/**\n * Attempt to attribute CLS to an ad slot by querying the DOM.\n * Returns slot ID and serve type if the shifted element is inside a [data-wrapp-slot] container.\n *\n * @param targetSelector - CSS selector of the element that caused the largest shift\n * @returns Attribution info or undefined if not attributable to an ad slot\n */\nfunction getSlotAttribution(targetSelector) {\n if (!targetSelector) {\n return undefined;\n }\n // querySelector can throw SyntaxError for invalid selectors\n let element;\n try {\n element = document.querySelector(targetSelector);\n }\n catch {\n return undefined;\n }\n if (!element) {\n return undefined;\n }\n // Check if element or any ancestor has data-wrapp-slot attribute\n const adSlotContainer = element.closest('[data-wrapp-slot]');\n if (!adSlotContainer) {\n return undefined;\n }\n // Get the DOM ID from the attribute (used as key in auctionState)\n const divId = adSlotContainer.getAttribute('data-wrapp-slot');\n if (!divId) {\n return undefined;\n }\n // Look up auction entry to get slot ID and serve type\n const auctionEntry = (0,_auctionState__WEBPACK_IMPORTED_MODULE_4__.getAuctionEntry)(divId);\n const slotId = auctionEntry?.adSlot?.i;\n if (!slotId) {\n return undefined;\n }\n return {\n attributedSlotId: slotId,\n serveType: auctionEntry?.serveType ?? _types_enums__WEBPACK_IMPORTED_MODULE_5__.ServeType.Initial,\n };\n}\n/**\n * Process CLS metric with attribution.\n */\nfunction handleCLS(metric) {\n const attribution = {};\n if (metric.attribution) {\n const attr = metric.attribution;\n attribution.largestShiftTarget = attr.largestShiftTarget;\n attribution.largestShiftTime = attr.largestShiftTime;\n attribution.largestShiftValue = attr.largestShiftValue;\n attribution.loadState = attr.loadState;\n // Attribute CLS to ad slot if shifted element is inside a [data-wrapp-slot] container\n const slotAttribution = getSlotAttribution(attr.largestShiftTarget);\n if (slotAttribution) {\n attribution.attributedSlotId = slotAttribution.attributedSlotId;\n attribution.serveType = slotAttribution.serveType;\n }\n }\n const entry = {\n name: 'CLS',\n value: metric.value,\n rating: metric.rating,\n id: metric.id,\n navigationType: metric.navigationType,\n timestamp: performance.now(),\n delta: metric.delta,\n attribution,\n wrapperPhase: getCurrentPhase(),\n beforeWrapperReady: !isWrapperReady(),\n };\n metrics.set('CLS', entry);\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_2__.recordMetricCollected)('CLS');\n}\n/**\n * Process INP metric with attribution.\n */\nfunction handleINP(metric) {\n const attr = metric.attribution;\n // Build longestScript if available\n let longestScript;\n if (attr.longestScript) {\n const scriptEntry = attr.longestScript.entry;\n longestScript = {\n subpart: attr.longestScript.subpart,\n intersectingDuration: attr.longestScript.intersectingDuration,\n duration: scriptEntry?.duration,\n invoker: scriptEntry?.invoker,\n sourceURL: scriptEntry?.sourceURL,\n sourceFunctionName: scriptEntry?.sourceFunctionName,\n };\n }\n const attribution = {\n eventType: attr.interactionType,\n eventTarget: attr.interactionTarget,\n eventTime: attr.interactionTime,\n inputDelay: attr.inputDelay,\n processingTime: attr.processingDuration,\n presentationDelay: attr.presentationDelay,\n loadState: attr.loadState,\n longestScript,\n totalScriptDuration: attr.totalScriptDuration,\n totalStyleAndLayoutDuration: attr.totalStyleAndLayoutDuration,\n totalPaintDuration: attr.totalPaintDuration,\n };\n const entry = {\n name: 'INP',\n value: metric.value,\n rating: metric.rating,\n id: metric.id,\n navigationType: metric.navigationType,\n timestamp: performance.now(),\n delta: metric.delta,\n attribution,\n wrapperPhase: getCurrentPhase(),\n beforeWrapperReady: !isWrapperReady(),\n };\n metrics.set('INP', entry);\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_2__.recordMetricCollected)('INP');\n}\n/**\n * Process FCP metric with attribution.\n */\nfunction handleFCP(metric) {\n const attr = metric.attribution;\n const attribution = {\n timeToFirstByte: attr.timeToFirstByte,\n firstByteToFCP: attr.firstByteToFCP,\n };\n const entry = {\n name: 'FCP',\n value: metric.value,\n rating: metric.rating,\n id: metric.id,\n navigationType: metric.navigationType,\n timestamp: performance.now(),\n delta: metric.delta,\n attribution,\n wrapperPhase: getCurrentPhase(),\n beforeWrapperReady: !isWrapperReady(),\n };\n metrics.set('FCP', entry);\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_2__.recordMetricCollected)('FCP');\n}\n/**\n * Process TTFB metric with attribution.\n */\nfunction handleTTFB(metric) {\n const attr = metric.attribution;\n const attribution = {\n waitingDuration: attr.waitingDuration,\n cacheDuration: attr.cacheDuration,\n dnsDuration: attr.dnsDuration,\n connectionDuration: attr.connectionDuration,\n requestDuration: attr.requestDuration,\n };\n const entry = {\n name: 'TTFB',\n value: metric.value,\n rating: metric.rating,\n id: metric.id,\n navigationType: metric.navigationType,\n timestamp: performance.now(),\n delta: metric.delta,\n attribution,\n wrapperPhase: getCurrentPhase(),\n beforeWrapperReady: !isWrapperReady(),\n };\n metrics.set('TTFB', entry);\n (0,_collectionHealth__WEBPACK_IMPORTED_MODULE_2__.recordMetricCollected)('TTFB');\n}\n/**\n * Initialize web-vitals metric collection.\n * Subscribes to all Core Web Vitals metrics.\n *\n * @param options - Configuration options\n * @param options.reportAllChanges - Report all CLS/INP changes, not just final (default: true for CLS)\n */\nfunction initWebVitals(options) {\n const reportAllChanges = options?.reportAllChanges ?? true;\n // Core Web Vitals\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_0__.onLCP)(handleLCP);\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_0__.onCLS)(handleCLS, { reportAllChanges });\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_0__.onINP)(handleINP);\n // Additional metrics\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_0__.onFCP)(handleFCP);\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_0__.onTTFB)(handleTTFB);\n}\n/**\n * Get a specific CWV metric.\n *\n * @param name - Metric name (LCP, CLS, INP, FCP, TTFB)\n * @returns The metric entry or undefined if not yet recorded\n */\nfunction getMetric(name) {\n return metrics.get(name);\n}\n/**\n * Get all recorded CWV metrics.\n *\n * @returns Map of all metrics\n */\nfunction getAllMetrics() {\n return new Map(metrics);\n}\n/**\n * Get CWV metrics summary for telemetry.\n *\n * @returns Object with all metrics and their values\n */\nfunction getWebVitalsSummary() {\n return {\n lcp: metrics.get('LCP'),\n cls: metrics.get('CLS'),\n inp: metrics.get('INP'),\n fcp: metrics.get('FCP'),\n ttfb: metrics.get('TTFB'),\n };\n}\n/**\n * Get simplified scores for quick analysis.\n *\n * @returns Object with metric values and ratings\n */\nfunction getWebVitalsScores() {\n const lcp = metrics.get('LCP');\n const cls = metrics.get('CLS');\n const inp = metrics.get('INP');\n return {\n lcp: lcp ? { value: lcp.value, rating: lcp.rating } : undefined,\n cls: cls ? { value: cls.value, rating: cls.rating } : undefined,\n inp: inp ? { value: inp.value, rating: inp.rating } : undefined,\n };\n}\n/**\n * Check if LCP occurred before wrapper was ready.\n * Useful for determining if wrapper impacted LCP.\n *\n * @returns true if LCP happened before WrapperReady phase\n */\nfunction wasLCPBeforeWrapperReady() {\n const lcp = metrics.get('LCP');\n return lcp?.beforeWrapperReady;\n}\n/**\n * Clear all stored metrics.\n * Useful for SPA navigation or testing.\n */\nfunction clearWebVitals() {\n metrics.clear();\n wrapperReadyTime = null;\n}\n/**\n * Mark wrapper as ready (for correlation).\n * Called when WrapperReady phase is recorded.\n */\nfunction markWrapperReady() {\n wrapperReadyTime = performance.now();\n}\n\n\n//# sourceURL=webpack://@wrapp/wrapper/./src/plugins/cwv/webVitals.ts?")}}]);
@@ -0,0 +1,2 @@
1
+ /*! app name: app-p80918ac8127ba.js | version: 0.0.106 | build date: 2026-01-16T01:00:31.538Z */
2
+ "use strict";(self.webpackChunk_wrapp_wrapper=self.webpackChunk_wrapp_wrapper||[]).push([["vendors"],{"../node_modules/web-vitals/dist/web-vitals.attribution.js":(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CLSThresholds: () => (/* binding */ L),\n/* harmony export */ FCPThresholds: () => (/* binding */ E),\n/* harmony export */ INPThresholds: () => (/* binding */ q),\n/* harmony export */ LCPThresholds: () => (/* binding */ H),\n/* harmony export */ TTFBThresholds: () => (/* binding */ U),\n/* harmony export */ onCLS: () => (/* binding */ S),\n/* harmony export */ onFCP: () => (/* binding */ w),\n/* harmony export */ onINP: () => (/* binding */ x),\n/* harmony export */ onLCP: () => (/* binding */ R),\n/* harmony export */ onTTFB: () => (/* binding */ $)\n/* harmony export */ });\nclass t{t;o=0;i=[];u(t){if(t.hadRecentInput)return;const e=this.i[0],n=this.i.at(-1);this.o&&e&&n&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),this.t?.(t)}}const e=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},n=t=>{if("loading"===document.readyState)return"loading";{const n=e();if(n){if(t<n.domInteractive)return"loading";if(0===n.domContentLoadedEventStart||t<n.domContentLoadedEventStart)return"dom-interactive";if(0===n.domComplete||t<n.domComplete)return"dom-content-loaded"}}return"complete"},o=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},i=t=>{let e="";try{for(;9!==t?.nodeType;){const n=t,i=n.id?"#"+n.id:[o(n),...Array.from(n.classList).sort()].join(".");if(e.length+i.length>99)return e||i;if(e=e?i+">"+e:i,n.id)break;t=n.parentNode}}catch{}return e},r=new WeakMap;function s(t,e){return r.get(t)||r.set(t,new e),r.get(t)}let a=-1;const c=()=>a,f=t=>{addEventListener("pageshow",(e=>{e.persisted&&(a=e.timeStamp,t(e))}),!0)},u=(t,e,n,o)=>{let i,r;return s=>{e.value>=0&&(s||o)&&(r=e.value-(i??0),(r||void 0===i)&&(i=e.value,e.delta=r,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,n),t(e)))}},d=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},l=()=>{const t=e();return t?.activationStart??0},h=(t,n=-1)=>{const o=e();let i="navigate";c()>=0?i="back-forward-cache":o&&(document.prerendering||l()>0?i="prerender":document.wasDiscarded?i="restore":o.type&&(i=o.type.replace(/_/g,"-")));return{name:t,value:n,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},m=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const o=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return o.observe({type:t,buffered:!0,...n}),o}}catch{}},p=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let g=-1;const y=new Set,v=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,b=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(const t of y)t();isFinite(g)||(g="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",b,!0))}},M=()=>{if(g<0){const t=l(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0]?.startTime;g=e??v(),addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0),f((()=>{setTimeout((()=>{g=v()}))}))}return{get firstHiddenTime(){return g},onHidden(t){y.add(t)}}},T=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},E=[1800,3e3],D=(t,e={})=>{T((()=>{const n=M();let o,i=h("FCP");const r=m("paint",(t=>{for(const e of t)"first-contentful-paint"===e.name&&(r.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries.push(e),o(!0)))}));r&&(o=u(t,i,E,e.reportAllChanges),f((n=>{i=h("FCP"),o=u(t,i,E,e.reportAllChanges),d((()=>{i.value=performance.now()-n.timeStamp,o(!0)}))})))}))},L=[.1,.25],P=t=>t.find((t=>1===t.node?.nodeType))||t[0],S=(e,o={})=>{const r=s(o=Object.assign({},o),t),a=new WeakMap;r.t=t=>{if(t?.sources?.length){const e=P(t.sources),n=e?.node;if(n){const t=o.generateTarget?.(n)??i(n);a.set(e,t)}}};((e,n={})=>{const o=M();D(p((()=>{let i,r=h("CLS",0);const a=s(n,t),c=t=>{for(const e of t)a.u(e);a.o>r.value&&(r.value=a.o,r.entries=a.i,i())},l=m("layout-shift",c);l&&(i=u(e,r,L,n.reportAllChanges),o.onHidden((()=>{c(l.takeRecords()),i(!0)})),f((()=>{a.o=0,r=h("CLS",0),i=u(e,r,L,n.reportAllChanges),d((()=>i()))})),setTimeout(i))})))})((t=>{const o=(t=>{let e={};if(t.entries.length){const o=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(o?.sources?.length){const t=P(o.sources);t&&(e={largestShiftTarget:a.get(t),largestShiftTime:o.startTime,largestShiftValue:o.value,largestShiftSource:t,largestShiftEntry:o,loadState:n(o.startTime)})}}return Object.assign(t,{attribution:e})})(t);e(o)}),o)},w=(t,o={})=>{D((o=>{const i=(t=>{let o={timeToFirstByte:0,firstByteToFCP:t.value,loadState:n(c())};if(t.entries.length){const i=e(),r=t.entries.at(-1);if(i){const e=i.activationStart||0,s=Math.max(0,i.responseStart-e);o={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:n(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:o})})(o);t(i)}),o)};let _=0,F=1/0,k=0;const B=t=>{for(const e of t)e.interactionId&&(F=Math.min(F,e.interactionId),k=Math.max(k,e.interactionId),_=k?(k-F)/7+1:0)};let C;const O=()=>C?_:performance.interactionCount??0,j=()=>{"interactionCount"in performance||C||(C=m("event",B,{type:"event",buffered:!0,durationThreshold:0}))};let I=0;class A{l=[];h=new Map;m;p;v(){I=O(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((O()-I)/50));return this.l[t]}u(t){if(this.m?.(t),!t.interactionId&&"first-input"!==t.entryType)return;const e=this.l.at(-1);let n=this.h.get(t.interactionId);if(n||this.l.length<10||t.duration>e.T){if(n?t.duration>n.T?(n.entries=[t],n.T=t.duration):t.duration===n.T&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],T:t.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){const t=this.l.splice(10);for(const e of t)this.h.delete(e.id)}this.p?.(n)}}}const W=t=>{const e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=p(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},q=[200,500],x=(t,e={})=>{const o=s(e=Object.assign({},e),A);let r=[],a=[],c=0;const d=new WeakMap,l=new WeakMap;let p=!1;const g=()=>{p||(W(y),p=!0)},y=()=>{const t=o.l.map((t=>d.get(t.entries[0]))),e=a.length-50;a=a.filter(((n,o)=>o>=e||t.includes(n)));const n=new Set;for(const t of a){const e=v(t.startTime,t.processingEnd);for(const t of e)n.add(t)}const i=r.length-1-50;r=r.filter(((t,e)=>t.startTime>c&&e>i||n.has(t))),p=!1};o.m=t=>{const e=t.startTime+t.duration;let n;c=Math.max(c,t.processingEnd);for(let o=a.length-1;o>=0;o--){const i=a[o];if(Math.abs(e-i.renderTime)<=8){n=i,n.startTime=Math.min(t.startTime,n.startTime),n.processingStart=Math.min(t.processingStart,n.processingStart),n.processingEnd=Math.max(t.processingEnd,n.processingEnd),n.entries.push(t);break}}n||(n={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:e,entries:[t]},a.push(n)),(t.interactionId||"first-input"===t.entryType)&&d.set(t,n),g()},o.p=t=>{if(!l.get(t)){const n=t.entries[0].target;if(n){const o=e.generateTarget?.(n)??i(n);l.set(t,o)}}};const v=(t,e)=>{const n=[];for(const o of r)if(!(o.startTime+o.duration<t)){if(o.startTime>e)break;n.push(o)}return n},b=t=>{const e=t.entries[0],i=d.get(e),r=e.processingStart,s=Math.max(e.startTime+e.duration,r),a=Math.min(i.processingEnd,s),c=i.entries.sort(((t,e)=>t.processingStart-e.processingStart)),f=v(e.startTime,a),u=o.h.get(e.interactionId),h={interactionTarget:l.get(u),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:c,longAnimationFrameEntries:f,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:s-a,loadState:n(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};(t=>{if(!t.longAnimationFrameEntries?.length)return;const e=t.interactionTime,n=t.inputDelay,o=t.processingDuration;let i,r,s=0,a=0,c=0,f=0;for(const c of t.longAnimationFrameEntries){a=a+c.startTime+c.duration-c.styleAndLayoutStart;for(const t of c.scripts){const c=t.startTime+t.duration;if(c<e)continue;const u=c-Math.max(e,t.startTime),d=t.duration?u/t.duration*t.forcedStyleAndLayoutDuration:0;s+=u-d,a+=d,u>f&&(r=t.startTime<e+n?"input-delay":t.startTime>=e+n+o?"presentation-delay":"processing-duration",i=t,f=u)}}const u=t.longAnimationFrameEntries.at(-1),d=u?u.startTime+u.duration:0;d>=e+n+o&&(c=t.nextPaintTime-d),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:f}),t.totalScriptDuration=s,t.totalStyleAndLayoutDuration=a,t.totalPaintDuration=c,t.totalUnattributedDuration=t.nextPaintTime-e-s-a-c})(h);return Object.assign(t,{attribution:h})};m("long-animation-frame",(t=>{r=r.concat(t),g()})),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=M();T((()=>{j();let o,i=h("INP");const r=s(e,A),a=t=>{W((()=>{for(const e of t)r.u(e);const e=r.M();e&&e.T!==i.value&&(i.value=e.T,i.entries=e.entries,o())}))},c=m("event",a,{durationThreshold:e.durationThreshold??40});o=u(t,i,q,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{a(c.takeRecords()),o(!0)})),f((()=>{r.v(),i=h("INP"),o=u(t,i,q,e.reportAllChanges)})))}))})((e=>{const n=b(e);t(n)}),e)};class N{m;u(t){this.m?.(t)}}const H=[2500,4e3],R=(t,n={})=>{const o=s(n=Object.assign({},n),N),r=new WeakMap;o.m=t=>{const e=t.element;if(e){const o=n.generateTarget?.(e)??i(e);r.set(t,o)}};((t,e={})=>{T((()=>{const n=M();let o,i=h("LCP");const r=s(e,N),a=t=>{e.reportAllChanges||(t=t.slice(-1));for(const e of t)r.u(e),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries=[e],o())},c=m("largest-contentful-paint",a);if(c){o=u(t,i,H,e.reportAllChanges);const n=p((()=>{a(c.takeRecords()),c.disconnect(),o(!0)})),r=t=>{t.isTrusted&&(W(n),removeEventListener(t.type,r,{capture:!0}))};for(const t of["keydown","click","visibilitychange"])addEventListener(t,r,{capture:!0});f((n=>{i=h("LCP"),o=u(t,i,H,e.reportAllChanges),d((()=>{i.value=performance.now()-n.timeStamp,o(!0)}))}))}}))})((n=>{const o=(t=>{let n={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){const o=e();if(o){const e=o.activationStart||0,i=t.entries.at(-1),s=i.url&&performance.getEntriesByType("resource").filter((t=>t.name===i.url))[0],a=Math.max(0,o.responseStart-e),c=Math.max(a,s?(s.requestStart||s.startTime)-e:0),f=Math.min(t.value,Math.max(c,s?s.responseEnd-e:0));n={target:r.get(i),timeToFirstByte:a,resourceLoadDelay:c-a,resourceLoadDuration:f-c,elementRenderDelay:t.value-f,navigationEntry:o,lcpEntry:i},i.url&&(n.url=i.url),s&&(n.lcpResourceEntry=s)}}return Object.assign(t,{attribution:n})})(n);t(o)}),n)},U=[800,1800],V=t=>{document.prerendering?T((()=>V(t))):"complete"!==document.readyState?addEventListener("load",(()=>V(t)),!0):setTimeout(t)},$=(t,n={})=>{((t,n={})=>{let o=h("TTFB"),i=u(t,o,U,n.reportAllChanges);V((()=>{const r=e();r&&(o.value=Math.max(r.responseStart-l(),0),o.entries=[r],i(!0),f((()=>{o=h("TTFB",0),i=u(t,o,U,n.reportAllChanges),i(!0)})))}))})((e=>{const n=(t=>{let e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){const n=t.entries[0],o=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-o,0),r=Math.max(n.domainLookupStart-o,0),s=Math.max(n.connectStart-o,0),a=Math.max(n.connectEnd-o,0);e={waitingDuration:i,cacheDuration:r-i,dnsDuration:s-r,connectionDuration:a-s,requestDuration:t.value-a,navigationEntry:n}}return Object.assign(t,{attribution:e})})(e);t(n)}),n)};\n\n\n//# sourceURL=webpack://@wrapp/wrapper/../node_modules/web-vitals/dist/web-vitals.attribution.js?')}}]);
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@dev-wrapp/80918ac8127ba","version":"0.0.105","main":"dist/app-p80918ac8127ba.js","scripts":{"build":"webpack"},"files":["dist/*.js"],"author":"Anima <admin@animaadtech.com>","license":"ISC","dependencies":{"uuid":"^11.1.0","xxhash-wasm":"^1.1.0"},"devDependencies":{"css-loader":"^7.1.2","json-loader":"^0.5.7","style-loader":"^4.0.0","terser-webpack-plugin":"^5.3.10","ts-loader":"^9.5.1","typescript":"^5.8.3","webpack":"^5.96.1","webpack-cli":"^5.1.4"},"keywords":[],"description":"open programmatic web app"}
1
+ {"name":"@dev-wrapp/80918ac8127ba","version":"0.0.106","main":"dist/app-p80918ac8127ba.js","scripts":{"build":"webpack"},"files":["dist/*.js"],"author":"Anima <admin@animaadtech.com>","license":"ISC","dependencies":{"uuid":"^11.1.0","xxhash-wasm":"^1.1.0"},"devDependencies":{"css-loader":"^7.1.2","json-loader":"^0.5.7","style-loader":"^4.0.0","terser-webpack-plugin":"^5.3.10","ts-loader":"^9.5.1","typescript":"^5.8.3","webpack":"^5.96.1","webpack-cli":"^5.1.4"},"keywords":[],"description":"open programmatic web app"}