@walkeros/walker.js 0.4.2 → 0.5.0

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/destination.ts","../src/types/index.ts","../src/schemas.ts","../src/index.ts"],"sourcesContent":["import type { Destination } from '@walkeros/core';\nimport type { DataLayer } from './types';\nimport { isObject } from '@walkeros/core';\n\nexport function dataLayerDestination(): Destination.Instance {\n window.dataLayer = window.dataLayer || [];\n const dataLayerPush = (event: unknown) => {\n // Do not process events from dataLayer source\n if (\n isObject(event) &&\n isObject(event.source) &&\n String(event.source.type).includes('dataLayer')\n )\n return;\n\n (window.dataLayer as DataLayer)!.push(event);\n };\n const destination: Destination.Instance = {\n type: 'dataLayer',\n config: {},\n push: (event, context) => {\n dataLayerPush(context.data || event);\n },\n pushBatch: (batch) => {\n dataLayerPush({\n name: 'batch',\n batched_event: batch.key,\n events: batch.data.length ? batch.data : batch.events,\n });\n },\n };\n\n return destination;\n}\n","import type { Collector, Source, WalkerOS } from '@walkeros/core';\nimport type { SourceBrowser } from '@walkeros/web-source-browser';\nimport type { SourceDataLayer } from '@walkeros/web-source-datalayer';\n\ndeclare global {\n interface Window {\n [key: string]: DataLayer;\n }\n}\n\n// Instance interface\nexport interface Instance {\n collector: Collector.Instance;\n elb: SourceBrowser.BrowserPush;\n}\n\n// Configuration interface\nexport interface Config {\n // Collector configuration\n collector?: Collector.InitConfig;\n\n // Browser source configuration\n browser?: Partial<SourceBrowser.Settings>;\n\n // DataLayer configuration\n dataLayer?: boolean | Partial<SourceDataLayer.Settings>;\n\n // Global configuration\n elb?: string; // Name for the global elb function\n name?: string; // Name for the global instance\n run?: boolean; // Auto-run on initialization (default: true)\n}\n\nexport type DataLayer = undefined | Array<unknown>;\n","import type { RJSFSchema } from '@rjsf/utils';\n\nexport const settings: RJSFSchema = {\n type: 'object',\n properties: {\n elb: {\n type: 'string',\n default: 'elb',\n description: 'Global function name for event tracking',\n },\n name: {\n type: 'string',\n default: 'walkerjs',\n description: 'Global instance name',\n },\n run: {\n type: 'boolean',\n default: true,\n description: 'Auto-initialize walker.js on load',\n },\n browser: {\n type: 'object',\n default: {\n run: true,\n session: true,\n scope: 'document.body',\n pageview: true,\n },\n description:\n 'Browser source configuration. Set to false to disable. See browser configuration section below for details.',\n },\n dataLayer: {\n type: 'object',\n default: false,\n description:\n 'DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below.',\n },\n collector: {\n type: 'object',\n default: {},\n description:\n 'Collector configuration including destinations and consent settings. See collector configuration section below.',\n },\n },\n};\n\nexport const browserConfig: RJSFSchema = {\n type: 'object',\n properties: {\n 'browser.run': {\n type: 'boolean',\n default: true,\n description: 'Auto-start DOM tracking',\n },\n 'browser.session': {\n type: 'boolean',\n default: true,\n description: 'Enable session tracking',\n },\n 'browser.scope': {\n type: 'string',\n default: 'document.body',\n description: 'DOM element scope for tracking',\n },\n 'browser.pageview': {\n type: 'boolean',\n default: true,\n description: 'Enable automatic page view events',\n },\n },\n};\n\nexport const dataLayerConfig: RJSFSchema = {\n type: 'object',\n properties: {\n dataLayer: {\n type: 'boolean',\n default: false,\n description: 'Enable dataLayer integration with defaults',\n },\n 'dataLayer.name': {\n type: 'string',\n default: 'dataLayer',\n description: 'DataLayer variable name',\n },\n 'dataLayer.prefix': {\n type: 'string',\n default: 'dataLayer',\n description: 'Event prefix for dataLayer events',\n },\n },\n};\n\nexport const collectorConfig: RJSFSchema = {\n type: 'object',\n properties: {\n 'collector.consent': {\n type: 'object',\n default: { functional: true },\n description: 'Default consent state',\n },\n 'collector.destinations': {\n type: 'object',\n default: {},\n description:\n 'Destination configurations. See destinations documentation for available options.',\n },\n },\n};\n","import type { Config, Instance } from './types';\nimport type { Collector, Elb, WalkerOS } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport { assign, isObject } from '@walkeros/core';\nimport {\n sourceBrowser,\n getAllEvents,\n getEvents,\n getGlobals,\n SourceBrowser,\n} from '@walkeros/web-source-browser';\nimport { sourceDataLayer } from '@walkeros/web-source-datalayer';\nimport { dataLayerDestination } from './destination';\n\n// Re-export types\nexport * as Walkerjs from './types';\n\n// Export schemas\nexport * as schemas from './schemas';\n\nexport { getAllEvents, getEvents, getGlobals };\n\n// Factory function to create walker.js instance\nexport async function createWalkerjs(config: Config = {}): Promise<Instance> {\n // Default configuration\n const defaultConfig: Config = {\n collector: {\n destinations: {\n dataLayer: { code: dataLayerDestination() },\n },\n },\n browser: {\n session: true,\n },\n dataLayer: false,\n elb: 'elb',\n run: true,\n };\n\n const fullConfig = assign(defaultConfig, config);\n\n // Build collector config with sources\n const collectorConfig: Collector.InitConfig = {\n ...fullConfig.collector,\n sources: {\n browser: {\n code: sourceBrowser,\n config: {\n settings: fullConfig.browser,\n },\n env: {\n window: typeof window !== 'undefined' ? window : undefined,\n document: typeof document !== 'undefined' ? document : undefined,\n },\n },\n },\n };\n\n // Add dataLayer source if configured\n if (fullConfig.dataLayer) {\n const dataLayerSettings = isObject(fullConfig.dataLayer)\n ? fullConfig.dataLayer\n : {};\n\n if (collectorConfig.sources) {\n collectorConfig.sources.dataLayer = {\n code: sourceDataLayer,\n config: {\n settings: dataLayerSettings,\n },\n };\n }\n }\n\n const flow = await startFlow<SourceBrowser.BrowserPush>(collectorConfig);\n\n // Set up global variables if configured (only in browser environments)\n if (typeof window !== 'undefined') {\n if (fullConfig.elb) window[fullConfig.elb] = flow.elb;\n if (fullConfig.name) window[fullConfig.name] = flow.collector;\n }\n\n return flow;\n}\n\n// Export factory function as default\nexport default createWalkerjs;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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","names":["collectorConfig","D"]}
1
+ {"version":3,"sources":["../src/destination.ts","../src/types/index.ts","../src/schemas.ts","../src/index.ts"],"sourcesContent":["import type { Destination } from '@walkeros/core';\nimport type { DataLayer } from './types';\nimport { isObject } from '@walkeros/core';\n\nexport function dataLayerDestination(): Destination.Instance {\n window.dataLayer = window.dataLayer || [];\n const dataLayerPush = (event: unknown) => {\n // Do not process events from dataLayer source\n if (\n isObject(event) &&\n isObject(event.source) &&\n String(event.source.type).includes('dataLayer')\n )\n return;\n\n (window.dataLayer as DataLayer)!.push(event);\n };\n const destination: Destination.Instance = {\n type: 'dataLayer',\n config: {},\n push: (event, context) => {\n dataLayerPush(context.data || event);\n },\n pushBatch: (batch) => {\n dataLayerPush({\n name: 'batch',\n batched_event: batch.key,\n events: batch.data.length ? batch.data : batch.events,\n });\n },\n };\n\n return destination;\n}\n","import type { Collector, Source, WalkerOS } from '@walkeros/core';\nimport type { SourceBrowser } from '@walkeros/web-source-browser';\nimport type { SourceDataLayer } from '@walkeros/web-source-datalayer';\n\ndeclare global {\n interface Window {\n [key: string]: DataLayer;\n }\n}\n\n// Instance interface\nexport interface Instance {\n collector: Collector.Instance;\n elb: SourceBrowser.BrowserPush;\n}\n\n// Configuration interface\nexport interface Config {\n // Collector configuration\n collector?: Collector.InitConfig;\n\n // Browser source configuration\n browser?: Partial<SourceBrowser.Settings>;\n\n // DataLayer configuration\n dataLayer?: boolean | Partial<SourceDataLayer.Settings>;\n\n // Global configuration\n elb?: string; // Name for the global elb function\n name?: string; // Name for the global instance\n run?: boolean; // Auto-run on initialization (default: true)\n}\n\nexport type DataLayer = undefined | Array<unknown>;\n","import type { RJSFSchema } from '@rjsf/utils';\n\nexport const settings: RJSFSchema = {\n type: 'object',\n properties: {\n elb: {\n type: 'string',\n default: 'elb',\n description: 'Global function name for event tracking',\n },\n name: {\n type: 'string',\n default: 'walkerjs',\n description: 'Global instance name',\n },\n run: {\n type: 'boolean',\n default: true,\n description: 'Auto-initialize walker.js on load',\n },\n browser: {\n type: 'object',\n default: {\n run: true,\n session: true,\n scope: 'document.body',\n pageview: true,\n },\n description:\n 'Browser source configuration. Set to false to disable. See browser configuration section below for details.',\n },\n dataLayer: {\n type: 'object',\n default: false,\n description:\n 'DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below.',\n },\n collector: {\n type: 'object',\n default: {},\n description:\n 'Collector configuration including destinations and consent settings. See collector configuration section below.',\n },\n },\n};\n\nexport const browserConfig: RJSFSchema = {\n type: 'object',\n properties: {\n 'browser.run': {\n type: 'boolean',\n default: true,\n description: 'Auto-start DOM tracking',\n },\n 'browser.session': {\n type: 'boolean',\n default: true,\n description: 'Enable session tracking',\n },\n 'browser.scope': {\n type: 'string',\n default: 'document.body',\n description: 'DOM element scope for tracking',\n },\n 'browser.pageview': {\n type: 'boolean',\n default: true,\n description: 'Enable automatic page view events',\n },\n },\n};\n\nexport const dataLayerConfig: RJSFSchema = {\n type: 'object',\n properties: {\n dataLayer: {\n type: 'boolean',\n default: false,\n description: 'Enable dataLayer integration with defaults',\n },\n 'dataLayer.name': {\n type: 'string',\n default: 'dataLayer',\n description: 'DataLayer variable name',\n },\n 'dataLayer.prefix': {\n type: 'string',\n default: 'dataLayer',\n description: 'Event prefix for dataLayer events',\n },\n },\n};\n\nexport const collectorConfig: RJSFSchema = {\n type: 'object',\n properties: {\n 'collector.consent': {\n type: 'object',\n default: { functional: true },\n description: 'Default consent state',\n },\n 'collector.destinations': {\n type: 'object',\n default: {},\n description:\n 'Destination configurations. See destinations documentation for available options.',\n },\n },\n};\n","import type { Config, Instance } from './types';\nimport type { Collector, Elb, WalkerOS } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport { assign, isObject } from '@walkeros/core';\nimport {\n sourceBrowser,\n getAllEvents,\n getEvents,\n getGlobals,\n SourceBrowser,\n} from '@walkeros/web-source-browser';\nimport { sourceDataLayer } from '@walkeros/web-source-datalayer';\nimport { dataLayerDestination } from './destination';\n\n// Re-export types\nexport * as Walkerjs from './types';\n\n// Export schemas\nexport * as schemas from './schemas';\n\nexport { getAllEvents, getEvents, getGlobals };\n\n// Factory function to create walker.js instance\nexport async function createWalkerjs(config: Config = {}): Promise<Instance> {\n // Default configuration\n const defaultConfig: Config = {\n collector: {\n destinations: {\n dataLayer: { code: dataLayerDestination() },\n },\n },\n browser: {\n session: true,\n },\n dataLayer: false,\n elb: 'elb',\n run: true,\n };\n\n const fullConfig = assign(defaultConfig, config);\n\n // Build collector config with sources\n const collectorConfig: Collector.InitConfig = {\n ...fullConfig.collector,\n sources: {\n browser: {\n code: sourceBrowser,\n config: {\n settings: fullConfig.browser,\n },\n env: {\n window: typeof window !== 'undefined' ? window : undefined,\n document: typeof document !== 'undefined' ? document : undefined,\n },\n },\n },\n };\n\n // Add dataLayer source if configured\n if (fullConfig.dataLayer) {\n const dataLayerSettings = isObject(fullConfig.dataLayer)\n ? fullConfig.dataLayer\n : {};\n\n if (collectorConfig.sources) {\n collectorConfig.sources.dataLayer = {\n code: sourceDataLayer,\n config: {\n settings: dataLayerSettings,\n },\n };\n }\n }\n\n const flow = await startFlow<SourceBrowser.BrowserPush>(collectorConfig);\n\n // Set up global variables if configured (only in browser environments)\n if (typeof window !== 'undefined') {\n if (fullConfig.elb) window[fullConfig.elb] = flow.elb;\n if (fullConfig.name) window[fullConfig.name] = flow.collector;\n }\n\n return flow;\n}\n\n// Export factory function as default\nexport default createWalkerjs;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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","names":["collectorConfig","D","Q"]}
@@ -0,0 +1,6 @@
1
+ import type { RJSFSchema } from '@rjsf/utils';
2
+ export declare const settings: RJSFSchema;
3
+ export declare const browserConfig: RJSFSchema;
4
+ export declare const dataLayerConfig: RJSFSchema;
5
+ export declare const collectorConfig: RJSFSchema;
6
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,UA0CtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,UAwB3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,UAmB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,UAe7B,CAAC"}
@@ -0,0 +1,101 @@
1
+ export const settings = {
2
+ type: 'object',
3
+ properties: {
4
+ elb: {
5
+ type: 'string',
6
+ default: 'elb',
7
+ description: 'Global function name for event tracking',
8
+ },
9
+ name: {
10
+ type: 'string',
11
+ default: 'walkerjs',
12
+ description: 'Global instance name',
13
+ },
14
+ run: {
15
+ type: 'boolean',
16
+ default: true,
17
+ description: 'Auto-initialize walker.js on load',
18
+ },
19
+ browser: {
20
+ type: 'object',
21
+ default: {
22
+ run: true,
23
+ session: true,
24
+ scope: 'document.body',
25
+ pageview: true,
26
+ },
27
+ description: 'Browser source configuration. Set to false to disable. See browser configuration section below for details.',
28
+ },
29
+ dataLayer: {
30
+ type: 'object',
31
+ default: false,
32
+ description: 'DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below.',
33
+ },
34
+ collector: {
35
+ type: 'object',
36
+ default: {},
37
+ description: 'Collector configuration including destinations and consent settings. See collector configuration section below.',
38
+ },
39
+ },
40
+ };
41
+ export const browserConfig = {
42
+ type: 'object',
43
+ properties: {
44
+ 'browser.run': {
45
+ type: 'boolean',
46
+ default: true,
47
+ description: 'Auto-start DOM tracking',
48
+ },
49
+ 'browser.session': {
50
+ type: 'boolean',
51
+ default: true,
52
+ description: 'Enable session tracking',
53
+ },
54
+ 'browser.scope': {
55
+ type: 'string',
56
+ default: 'document.body',
57
+ description: 'DOM element scope for tracking',
58
+ },
59
+ 'browser.pageview': {
60
+ type: 'boolean',
61
+ default: true,
62
+ description: 'Enable automatic page view events',
63
+ },
64
+ },
65
+ };
66
+ export const dataLayerConfig = {
67
+ type: 'object',
68
+ properties: {
69
+ dataLayer: {
70
+ type: 'boolean',
71
+ default: false,
72
+ description: 'Enable dataLayer integration with defaults',
73
+ },
74
+ 'dataLayer.name': {
75
+ type: 'string',
76
+ default: 'dataLayer',
77
+ description: 'DataLayer variable name',
78
+ },
79
+ 'dataLayer.prefix': {
80
+ type: 'string',
81
+ default: 'dataLayer',
82
+ description: 'Event prefix for dataLayer events',
83
+ },
84
+ },
85
+ };
86
+ export const collectorConfig = {
87
+ type: 'object',
88
+ properties: {
89
+ 'collector.consent': {
90
+ type: 'object',
91
+ default: { functional: true },
92
+ description: 'Default consent state',
93
+ },
94
+ 'collector.destinations': {
95
+ type: 'object',
96
+ default: {},
97
+ description: 'Destination configurations. See destinations documentation for available options.',
98
+ },
99
+ },
100
+ };
101
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAe;IAClC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,yCAAyC;SACvD;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,UAAU;YACnB,WAAW,EAAE,sBAAsB;SACpC;QACD,GAAG,EAAE;YACH,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,mCAAmC;SACjD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,GAAG,EAAE,IAAI;gBACT,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,IAAI;aACf;YACD,WAAW,EACT,6GAA6G;SAChH;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,KAAK;YACd,WAAW,EACT,kIAAkI;SACrI;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EACT,iHAAiH;SACpH;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,yBAAyB;SACvC;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,yBAAyB;SACvC;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,gCAAgC;SAC9C;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,mCAAmC;SACjD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,4CAA4C;SAC1D;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,WAAW;YACpB,WAAW,EAAE,yBAAyB;SACvC;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,WAAW;YACpB,WAAW,EAAE,mCAAmC;SACjD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,mBAAmB,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;YAC7B,WAAW,EAAE,uBAAuB;SACrC;QACD,wBAAwB,EAAE;YACxB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,WAAW,EACT,mFAAmF;SACtF;KACF;CACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { Collector } from '@walkeros/core';
2
+ import type { SourceBrowser } from '@walkeros/web-source-browser';
3
+ import type { SourceDataLayer } from '@walkeros/web-source-datalayer';
4
+ declare global {
5
+ interface Window {
6
+ [key: string]: DataLayer;
7
+ }
8
+ }
9
+ export interface Instance {
10
+ collector: Collector.Instance;
11
+ elb: SourceBrowser.BrowserPush;
12
+ }
13
+ export interface Config {
14
+ collector?: Collector.InitConfig;
15
+ browser?: Partial<SourceBrowser.Settings>;
16
+ dataLayer?: boolean | Partial<SourceDataLayer.Settings>;
17
+ elb?: string;
18
+ name?: string;
19
+ run?: boolean;
20
+ }
21
+ export type DataLayer = undefined | Array<unknown>;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B;CACF;AAGD,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC;IAC9B,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC;CAChC;AAGD,MAAM,WAAW,MAAM;IAErB,SAAS,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC;IAGjC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAG1C,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAGxD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
package/dist/walker.js CHANGED
@@ -1 +1 @@
1
- "use strict";(()=>{var e=Object.defineProperty,t=Object.defineProperty;((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{Level:()=>o});var n,o=((n=o||{})[n.ERROR=0]="ERROR",n[n.INFO=1]="INFO",n[n.DEBUG=2]="DEBUG",n),r={Storage:{Local:"local",Session:"session",Cookie:"cookie"}},i={merge:!0,shallow:!0,extend:!0};function a(e,t={},n={}){n={...i,...n};const o=Object.entries(t).reduce((t,[o,r])=>{const i=e[o];return n.merge&&Array.isArray(i)&&Array.isArray(r)?t[o]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||o in e)&&(t[o]=r),t},{});return n.shallow?{...e,...o}:(Object.assign(e,o),e)}function s(e){return Array.isArray(e)}function c(e){return void 0!==e}function u(e){return"object"==typeof e&&null!==e&&!s(e)&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return"string"==typeof e}function d(e,t=new WeakMap){if("object"!=typeof e||null===e)return e;if(t.has(e))return t.get(e);const n=Object.prototype.toString.call(e);if("[object Object]"===n){const n={};t.set(e,n);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=d(e[o],t));return n}if("[object Array]"===n){const n=[];return t.set(e,n),e.forEach(e=>{n.push(d(e,t))}),n}if("[object Date]"===n)return new Date(e.getTime());if("[object RegExp]"===n){const t=e;return new RegExp(t.source,t.flags)}return e}function f(e,t="",n){const o=t.split(".");let r=e;for(let e=0;e<o.length;e++){const t=o[e];if("*"===t&&s(r)){const t=o.slice(e+1).join("."),i=[];for(const e of r){const o=f(e,t,n);i.push(o)}return i}if(r=r instanceof Object?r[t]:void 0,!r)break}return c(r)?r:n}function g(e,t,n){if(!u(e))return e;const o=d(e),r=t.split(".");let i=o;for(let e=0;e<r.length;e++){const t=r[e];e===r.length-1?i[t]=n:(t in i&&"object"==typeof i[t]&&null!==i[t]||(i[t]={}),i=i[t])}return o}function p(e,t={},n={}){const o={...t,...n},r={};let i=void 0===e;return Object.keys(o).forEach(t=>{o[t]&&(r[t]=!0,e&&e[t]&&(i=!0))}),!!i&&r}function m(e=6){let t="";for(let n=36;t.length<e;)t+=(Math.random()*n|0).toString(n);return t}function y(e){return{message:e.message,name:e.name,stack:e.stack,cause:e.cause}}function b(e,t){let n,o={};return e instanceof Error?(n=e.message,o.error=y(e)):n=e,void 0!==t&&(t instanceof Error?o.error=y(t):"object"==typeof t&&null!==t?(o={...o,...t},"error"in o&&o.error instanceof Error&&(o.error=y(o.error))):o.value=t),{message:n,context:o}}var h=(e,t,n,r)=>{const i=`${o[e]}${r.length>0?` [${r.join(":")}]`:""}`,a=Object.keys(n).length>0;0===e?a?console.error(i,t,n):console.error(i,t):a?console.log(i,t,n):console.log(i,t)};function w(e={}){return v({level:void 0!==e.level?(t=e.level,"string"==typeof t?o[t]:t):0,handler:e.handler,scope:[]});var t}function v(e){const{level:t,handler:n,scope:o}=e,r=(e,r,i)=>{if(e<=t){const t=b(r,i);n?n(e,t.message,t.context,o,h):h(e,t.message,t.context,o)}};return{error:(e,t)=>r(0,e,t),info:(e,t)=>r(1,e,t),debug:(e,t)=>r(2,e,t),throw:(e,t)=>{const r=b(e,t);throw n?n(0,r.message,r.context,o,h):h(0,r.message,r.context,o),new Error(r.message)},scope:e=>v({level:t,handler:n,scope:[...o,e]})}}function k(e){return function(e){return"boolean"==typeof e}(e)||l(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!c(e)||s(e)&&e.every(k)||u(e)&&Object.values(e).every(k)}function E(e){return k(e)?e:void 0}function j(e,t,n){return function(...o){try{return e(...o)}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}}function S(e,t,n){return async function(...o){try{return await e(...o)}catch(e){if(!t)return;return await t(e)}finally{await(null==n?void 0:n())}}}async function O(e,t={},n={}){var o;if(!c(e))return;const r=u(e)&&e.consent||n.consent||(null==(o=n.collector)?void 0:o.consent),i=s(t)?t:[t];for(const t of i){const o=await S(L)(e,t,{...n,consent:r});if(c(o))return o}}async function L(e,t,n={}){const{collector:o,consent:r}=n;return(s(t)?t:[t]).reduce(async(t,i)=>{const a=await t;if(a)return a;const u=l(i)?{key:i}:i;if(!Object.keys(u).length)return;const{condition:d,consent:g,fn:m,key:y,loop:b,map:h,set:w,validate:v,value:k}=u;if(d&&!await S(d)(e,i,o))return;if(g&&!p(g,r))return k;let j=c(k)?k:e;if(m&&(j=await S(m)(e,i,n)),y&&(j=f(e,y,k)),b){const[t,o]=b,r="this"===t?[e]:await O(e,t,n);s(r)&&(j=(await Promise.all(r.map(e=>O(e,o,n)))).filter(c))}else h?j=await Object.entries(h).reduce(async(t,[o,r])=>{const i=await t,a=await O(e,r,n);return c(a)&&(i[o]=a),i},Promise.resolve({})):w&&(j=await Promise.all(w.map(t=>L(e,t,n))));v&&!await S(v)(j)&&(j=void 0);const _=E(j);return c(_)?_:E(k)},Promise.resolve(void 0))}async function _(e,t,n){t.policy&&await Promise.all(Object.entries(t.policy).map(async([t,o])=>{const r=await O(e,o,{collector:n});e=g(e,t,r)}));const{eventMapping:o,mappingKey:r}=await async function(e,t){var n;const[o,r]=(e.name||"").split(" ");if(!t||!o||!r)return{};let i,a="",c=o,u=r;const l=t=>{if(t)return(t=s(t)?t:[t]).find(t=>!t.condition||t.condition(e))};t[c]||(c="*");const d=t[c];return d&&(d[u]||(u="*"),i=l(d[u])),i||(c="*",u="*",i=l(null==(n=t[c])?void 0:n[u])),i&&(a=`${c} ${u}`),{eventMapping:i,mappingKey:a}}(e,t.mapping);(null==o?void 0:o.policy)&&await Promise.all(Object.entries(o.policy).map(async([t,o])=>{const r=await O(e,o,{collector:n});e=g(e,t,r)}));let i=t.data&&await O(e,t.data,{collector:n});if(o){if(o.ignore)return{event:e,data:i,mapping:o,mappingKey:r,ignore:!0};if(o.name&&(e.name=o.name),o.data){const t=o.data&&await O(e,o.data,{collector:n});i=u(i)&&u(t)?a(i,t):t}}return{event:e,data:i,mapping:o,mappingKey:r,ignore:!1}}function x(e){return e?e.trim().replace(/^'|'$/g,"").trim():""}function A(e,t,n){return function(...o){let r;const i="post"+t,a=n["pre"+t],s=n[i];return r=a?a({fn:e},...o):e(...o),s&&(r=s({fn:e,result:r},...o)),r}}function C(e,t){return(e.getAttribute(t)||"").trim()}function $(e){const t={};return function(e,t=";"){if(!e)return[];const n=new RegExp(`(?:[^${t}']+|'[^']*')+`,"ig");return e.match(n)||[]}(e).forEach(e=>{const[n,o]=function(e){const[t,n]=e.split(/:(.+)/,2);return[x(t||""),x(n||"")]}(e);n&&("true"===o?t[n]=!0:"false"===o?t[n]=!1:o&&/^\d+$/.test(o)?t[n]=parseInt(o,10):o&&/^\d+\.\d+$/.test(o)?t[n]=parseFloat(o):t[n]=o||!0)}),t}var q=function(){const e=window;(e.elbLayer=e.elbLayer||[]).push(arguments)};function P(e){const t=getComputedStyle(e);if("none"===t.display)return!1;if("visible"!==t.visibility)return!1;if(t.opacity&&Number(t.opacity)<.1)return!1;let n;const o=window.innerHeight,r=e.getBoundingClientRect(),i=r.height,a=r.y,s=a+i,c={x:r.x+e.offsetWidth/2,y:r.y+e.offsetHeight/2};if(i<=o){if(e.offsetWidth+r.width===0||e.offsetHeight+r.height===0)return!1;if(c.x<0)return!1;if(c.x>(document.documentElement.clientWidth||window.innerWidth))return!1;if(c.y<0)return!1;if(c.y>(document.documentElement.clientHeight||window.innerHeight))return!1;n=document.elementFromPoint(c.x,c.y)}else{const e=o/2;if(a<0&&s<e)return!1;if(s>o&&a>e)return!1;n=document.elementFromPoint(c.x,o/2)}if(n)do{if(n===e)return!0}while(n=n.parentElement);return!1}function R(e,t,n){return!1===n?e:(n||(n=D),n(e,t,D))}var D=(e,t)=>{const n={};return e.id&&(n.session=e.id),e.storage&&e.device&&(n.device=e.device),t?t.command("user",n):q("walker user",n),e.isStart&&(t?t.push({name:"session start",data:e}):q({name:"session start",data:e})),e};function I(e,t=r.Storage.Session){var n;function o(e){try{return JSON.parse(e||"")}catch(t){let n=1,o="";return e&&(n=0,o=e),{e:n,v:o}}}let i,a;switch(t){case r.Storage.Cookie:i=decodeURIComponent((null==(n=document.cookie.split("; ").find(t=>t.startsWith(e+"=")))?void 0:n.split("=")[1])||"");break;case r.Storage.Local:a=o(window.localStorage.getItem(e));break;case r.Storage.Session:a=o(window.sessionStorage.getItem(e))}return a&&(i=a.v,0!=a.e&&a.e<Date.now()&&(function(e,t=r.Storage.Session){switch(t){case r.Storage.Cookie:N(e,"",0,t);break;case r.Storage.Local:window.localStorage.removeItem(e);break;case r.Storage.Session:window.sessionStorage.removeItem(e)}}(e,t),i="")),function(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return e==t&&""!==e?t:String(e)}(i||"")}function N(e,t,n=30,o=r.Storage.Session,i){const a={e:Date.now()+6e4*n,v:String(t)},s=JSON.stringify(a);switch(o){case r.Storage.Cookie:{t="object"==typeof t?JSON.stringify(t):t;let o=`${e}=${encodeURIComponent(t)}; max-age=${60*n}; path=/; SameSite=Lax; secure`;i&&(o+="; domain="+i),document.cookie=o;break}case r.Storage.Local:window.localStorage.setItem(e,s);break;case r.Storage.Session:window.sessionStorage.setItem(e,s)}return I(e,o)}function X(e={}){const t=Date.now(),{length:n=30,deviceKey:o="elbDeviceId",deviceStorage:r="local",deviceAge:i=30,sessionKey:a="elbSessionId",sessionStorage:s="local",pulse:c=!1}=e,u=T(e);let l=!1;const d=j((e,t,n)=>{let o=I(e,n);return o||(o=m(8),N(e,o,1440*t,n)),String(o)})(o,i,r),f=j((e,o)=>{const r=JSON.parse(String(I(e,o)));return c||(r.isNew=!1,u.marketing&&(Object.assign(r,u),l=!0),l||r.updated+6e4*n<t?(delete r.id,delete r.referrer,r.start=t,r.count++,r.runs=1,l=!0):r.runs++),r},()=>{l=!0})(a,s)||{},g={id:m(12),start:t,isNew:!0,count:1,runs:1},p=Object.assign(g,u,f,{device:d},{isStart:l,storage:!0,updated:t},e.data);return N(a,JSON.stringify(p),2*n,s),p}function T(e={}){let t=e.isStart||!1;const n={isStart:t,storage:!1};if(!1===e.isStart)return n;if(!t){const[e]=performance.getEntriesByType("navigation");if("navigate"!==e.type)return n}const o=new URL(e.url||window.location.href),r=e.referrer||document.referrer,i=r&&new URL(r).hostname,s=function(e,t={}){const n="clickId",o={},r={utm_campaign:"campaign",utm_content:"content",utm_medium:"medium",utm_source:"source",utm_term:"term",dclid:n,fbclid:n,gclid:n,msclkid:n,ttclid:n,twclid:n,igshid:n,sclid:n};return Object.entries(a(r,t)).forEach(([t,r])=>{const i=e.searchParams.get(t);i&&(r===n&&(r=t,o[n]=t),o[r]=i)}),o}(o,e.parameters);if(Object.keys(s).length&&(s.marketing||(s.marketing=!0),t=!0),!t){const n=e.domains||[];n.push(o.hostname),t=!n.includes(i)}return t?Object.assign({isStart:t,storage:!1,start:Date.now(),id:m(12),referrer:i},s,e.data):n}var U={Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Session:"session",User:"user",Walker:"walker"};async function W(e,t,n){const{allowed:o,consent:r,globals:i,user:s}=e;if(!o)return G({ok:!1});t&&e.queue.push(t),n||(n=e.destinations);const c=await Promise.all(Object.entries(n||{}).map(async([n,o])=>{let c=(o.queue||[]).map(e=>({...e,consent:r}));if(o.queue=[],t){const e=d(t);c.push(e)}if(!c.length)return{id:n,destination:o,skipped:!0};const u=[],l=c.filter(e=>{const t=p(o.config.consent,r,e.consent);return!t||(e.consent=t,u.push(e),!1)});if(o.queue.concat(l),!u.length)return{id:n,destination:o,queue:c};if(!await S(M)(e,o))return{id:n,destination:o,queue:c};let f=!1;return o.dlq||(o.dlq=[]),await Promise.all(u.map(async t=>(t.globals=a(i,t.globals),t.user=a(s,t.user),await S(B,n=>{const r=o.type||"unknown";return e.logger.scope(r).error("Push failed",{error:n,event:t.name}),f=!0,o.dlq.push([t,n]),!1})(e,o,t),t))),{id:n,destination:o,error:f}})),u=[],l=[],f=[];for(const e of c){if(e.skipped)continue;const t=e.destination,n={id:e.id,destination:t};e.error?f.push(n):e.queue&&e.queue.length?(t.queue=(t.queue||[]).concat(e.queue),l.push(n)):u.push(n)}return G({ok:!f.length,event:t,successful:u,queued:l,failed:f})}async function M(e,t){if(t.init&&!t.config.init){const n=t.type||"unknown",o=e.logger.scope(n),r={collector:e,config:t.config,env:H(t.env,t.config.env),logger:o},i=await A(t.init,"DestinationInit",e.hooks)(r);if(!1===i)return i;t.config={...i||t.config,init:!0}}return!0}async function B(e,t,n){var o;const{config:r}=t,i=await _(n,r,e);if(i.ignore)return!1;const a=t.type||"unknown",s=e.logger.scope(a),u={collector:e,config:r,data:i.data,mapping:i.mapping,env:H(t.env,r.env),logger:s},l=i.mapping;if((null==l?void 0:l.batch)&&t.pushBatch){const n=l.batched||{key:i.mappingKey||"",events:[],data:[]};n.events.push(i.event),c(i.data)&&n.data.push(i.data),l.batchFn=l.batchFn||function(e,t=1e3,n=!1){let o,r=null,i=!1;return(...a)=>new Promise(s=>{const c=n&&!i;r&&clearTimeout(r),r=setTimeout(()=>{r=null,n&&!i||(o=e(...a),s(o))},t),c&&(i=!0,o=e(...a),s(o))})}((e,t)=>{const o=e.type||"unknown",a=t.logger.scope(o),s={collector:t,config:r,data:i.data,mapping:l,env:H(e.env,r.env),logger:a};A(e.pushBatch,"DestinationPushBatch",t.hooks)(n,s),n.events=[],n.data=[]},l.batch),l.batched=n,null==(o=l.batchFn)||o.call(l,t,e)}else await A(t.push,"DestinationPush",e.hooks)(i.event,u);return!0}function G(e){var t;return a({ok:!(null==(t=null==e?void 0:e.failed)?void 0:t.length),successful:[],queued:[],failed:[]},e)}function H(e,t){return e||t?t?e&&u(e)&&u(t)?{...e,...t}:t:e:{}}function F(e,t,n,o){let r,i=n||[];switch(n||(i=e.on[t]||[]),t){case U.Consent:r=o||e.consent;break;case U.Session:r=e.session;break;case U.Ready:case U.Run:default:r=void 0}if(Object.values(e.sources).forEach(e=>{e.on&&j(e.on)(t,r)}),Object.values(e.destinations).forEach(e=>{if(e.on){j(e.on)(t,r)}}),i.length)switch(t){case U.Consent:!function(e,t,n){const o=n||e.consent;t.forEach(t=>{Object.keys(o).filter(e=>e in t).forEach(n=>{j(t[n])(e,o)})})}(e,i,o);break;case U.Ready:case U.Run:!function(e,t){e.allowed&&t.forEach(t=>{j(t)(e)})}(e,i);break;case U.Session:!function(e,t){e.session&&t.forEach(t=>{j(t)(e,e.session)})}(e,i)}}async function K(e,t,n,o){let r;switch(t){case U.Config:u(n)&&a(e.config,n,{shallow:!1});break;case U.Consent:u(n)&&(r=await async function(e,t){const{consent:n}=e;let o=!1;const r={};return Object.entries(t).forEach(([e,t])=>{const n=!!t;r[e]=n,o=o||n}),e.consent=a(n,r),F(e,"consent",void 0,r),o?W(e):G({ok:!0})}(e,n));break;case U.Custom:u(n)&&(e.custom=a(e.custom,n));break;case U.Destination:u(n)&&function(e){return"function"==typeof e}(n.push)&&(r=await async function(e,t,n){const{code:o,config:r={},env:i={}}=t,a=n||r||{init:!1},s={...o,config:a,env:H(o.env,i)};let c=s.config.id;if(!c)do{c=m(4)}while(e.destinations[c]);return e.destinations[c]=s,!1!==s.config.queue&&(s.queue=[...e.queue]),W(e,void 0,{[c]:s})}(e,{code:n},o));break;case U.Globals:u(n)&&(e.globals=a(e.globals,n));break;case U.On:l(n)&&function(e,t,n){const o=e.on,r=o[t]||[],i=s(n)?n:[n];i.forEach(e=>{r.push(e)}),o[t]=r,F(e,t,i)}(e,n,o);break;case U.Ready:F(e,"ready");break;case U.Run:r=await async function(e,t){e.allowed=!0,e.count=0,e.group=m(),e.timing=Date.now(),t&&(t.consent&&(e.consent=a(e.consent,t.consent)),t.user&&(e.user=a(e.user,t.user)),t.globals&&(e.globals=a(e.config.globalsStatic||{},t.globals)),t.custom&&(e.custom=a(e.custom,t.custom))),Object.values(e.destinations).forEach(e=>{e.queue=[]}),e.queue=[],e.round++;const n=await W(e);return F(e,"run"),n}(e,n);break;case U.Session:F(e,"session");break;case U.User:u(n)&&a(e.user,n,{shallow:!1})}return r||{ok:!0,successful:[],queued:[],failed:[]}}function J(e,t){return A(async(n,o={})=>await S(async()=>{let r=n;if(o.mapping){const t=await _(r,o.mapping,e);if(t.ignore)return G({ok:!0});if(o.mapping.consent&&!p(o.mapping.consent,e.consent,t.event.consent))return G({ok:!0});r=t.event}const i=t(r),a=function(e,t){if(!t.name)throw new Error("Event name is required");const[n,o]=t.name.split(" ");if(!n||!o)throw new Error("Event name is invalid");++e.count;const{timestamp:r=Date.now(),group:i=e.group,count:a=e.count}=t,{name:s=`${n} ${o}`,data:c={},context:u={},globals:l=e.globals,custom:d={},user:f=e.user,nested:g=[],consent:p=e.consent,id:m=`${r}-${i}-${a}`,trigger:y="",entity:b=n,action:h=o,timing:w=0,version:v={source:e.version,tagging:e.config.tagging||0},source:k={type:"collector",id:"",previous_id:""}}=t;return{name:s,data:c,context:u,globals:l,custom:d,user:f,nested:g,consent:p,id:m,trigger:y,entity:b,action:h,timestamp:r,timing:w,group:i,count:a,version:v,source:k}}(e,i);return await W(e,a)},()=>G({ok:!1}))(),"Push",e.hooks)}async function z(e){var t,n;const o=a({globalsStatic:{},sessionStatic:{},tagging:0,run:!0},e,{merge:!1,extend:!1}),r=w({level:null==(t=e.logger)?void 0:t.level,handler:null==(n=e.logger)?void 0:n.handler}),i={...o.globalsStatic,...e.globals},s={allowed:!1,config:o,consent:e.consent||{},count:0,custom:e.custom||{},destinations:{},globals:i,group:"",hooks:{},logger:r,on:{},queue:[],round:0,session:void 0,timing:Date.now(),user:e.user||{},version:"0.4.2",sources:{},push:void 0,command:void 0};return s.push=J(s,e=>({timing:Math.round((Date.now()-s.timing)/10)/100,source:{type:"collector",id:"",previous_id:""},...e})),s.command=(u=K,A(async(e,t,n)=>await S(async()=>await u(c,e,t,n),()=>G({ok:!1}))(),"Command",(c=s).hooks)),s.destinations=await async function(e,t={}){const n={};for(const[e,o]of Object.entries(t)){const{code:t,config:r={},env:i={}}=o,a={...t.config,...r},s=H(t.env,i);n[e]={...t,config:a,env:s}}return n}(0,e.destinations||{}),s;var c,u}async function Y(e){e=e||{};const t=await z(e),n=(o=t,{type:"elb",config:{},push:async(e,t,n,r,i,a)=>{if("string"==typeof e&&e.startsWith("walker ")){const r=e.replace("walker ","");return o.command(r,t,n)}let s;if("string"==typeof e)s={name:e},t&&"object"==typeof t&&!Array.isArray(t)&&(s.data=t);else{if(!e||"object"!=typeof e)return{ok:!1,successful:[],queued:[],failed:[]};s=e,t&&"object"==typeof t&&!Array.isArray(t)&&(s.data={...s.data||{},...t})}return r&&"object"==typeof r&&(s.context=r),i&&Array.isArray(i)&&(s.nested=i),a&&"object"==typeof a&&(s.custom=a),o.push(s)}});var o;t.sources.elb=n;const r=await async function(e,t={}){const n={};for(const[o,r]of Object.entries(t)){const{code:t,config:i={},env:a={},primary:s}=r,c=(t,n={})=>e.push(t,{...n,mapping:i}),u=e.logger.scope("source").scope(o),l={push:c,command:e.command,sources:e.sources,elb:e.sources.elb.push,logger:u,...a},d=await S(t)(i,l);if(!d)continue;const f=d.type||"unknown",g=e.logger.scope(f).scope(o);l.logger=g,s&&(d.config={...d.config,primary:s}),n[o]=d}return n}(t,e.sources||{});Object.assign(t.sources,r);const{consent:i,user:a,globals:s,custom:c}=e;i&&await t.command("consent",i),a&&await t.command("user",a),s&&Object.assign(t.globals,s),c&&Object.assign(t.custom,c),t.config.run&&await t.command("run");let u=n.push;const l=Object.values(t.sources).filter(e=>"elb"!==e.type),d=l.find(e=>e.config.primary);return d?u=d.push:l.length>0&&(u=l[0].push),{collector:t,elb:u}}var V,Q=Object.defineProperty,Z=(e,t)=>{for(var n in t)Q(e,n,{get:t[n],enumerable:!0})},ee=Object.defineProperty;((e,t)=>{for(var n in t)ee(e,n,{get:t[n],enumerable:!0})})({},{Level:()=>te});var te=((V=te||{})[V.ERROR=0]="ERROR",V[V.INFO=1]="INFO",V[V.DEBUG=2]="DEBUG",V),ne={merge:!0,shallow:!0,extend:!0};function oe(e,t={},n={}){n={...ne,...n};const o=Object.entries(t).reduce((t,[o,r])=>{const i=e[o];return n.merge&&Array.isArray(i)&&Array.isArray(r)?t[o]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||o in e)&&(t[o]=r),t},{});return n.shallow?{...e,...o}:(Object.assign(e,o),e)}function re(e){return Array.isArray(e)}function ie(e){return e===document||e instanceof Element}function ae(e){return"object"==typeof e&&null!==e&&!re(e)&&"[object Object]"===Object.prototype.toString.call(e)}function se(e){return"string"==typeof e}function ce(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return e==t&&""!==e?t:String(e)}function ue(e,t,n){return function(...o){try{return e(...o)}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}}function le(e){return e?e.trim().replace(/^'|'$/g,"").trim():""}function de(e,t,n=!0){return e+(null!=t?(n?"-":"")+t:"")}function fe(e,t,n,o=!0){return ke(C(t,de(e,n,o))||"").reduce((e,n)=>{let[o,r]=Ee(n);if(!o)return e;if(r||(o.endsWith(":")&&(o=o.slice(0,-1)),r=""),r.startsWith("#")){r=r.slice(1);try{let e=t[r];e||"selected"!==r||(e=t.options[t.selectedIndex].text),r=String(e)}catch(e){r=""}}return o.endsWith("[]")?(o=o.slice(0,-2),re(e[o])||(e[o]=[]),e[o].push(ce(r))):e[o]=ce(r),e},{})}function ge(e=U.Prefix,t=document){const n=de(e,U.Globals,!1);let o={};return ve(t,`[${n}]`,t=>{o=oe(o,fe(e,t,U.Globals,!1))}),o}function pe(e,t){const n=window.location,o="page",r=t===document?document.body:t,[i,a]=we(r,`[${de(e,o)}]`,e,o);return i.domain=n.hostname,i.title=document.title,i.referrer=document.referrer,n.search&&(i.search=n.search),n.hash&&(i.hash=n.hash),[i,a]}function me(e){const t={};return ke(e).forEach(e=>{const[n,o]=Ee(e),[r,i]=je(n);if(!r)return;let[a,s]=je(o||"");a=a||r,t[r]||(t[r]=[]),t[r].push({trigger:r,triggerParams:i,action:a,actionParams:s})}),t}function ye(e,t,n,o=!1){const r=[];let i=t;for(n=0!==Object.keys(n||{}).length?n:void 0;i;){const a=be(e,i,t,n);if(a&&(r.push(a),o))break;i=he(e,i)}return r}function be(e,t,n,o){const r=C(t,de(e));if(!r||o&&!o[r])return null;const i=[t],a=`[${de(e,r)}],[${de(e,"")}]`,s=de(e,U.Link,!1);let c={};const u=[],[l,d]=we(n||t,a,e,r);ve(t,`[${s}]`,t=>{const[n,o]=Ee(C(t,s));"parent"===o&&ve(document.body,`[${s}="${n}:child"]`,t=>{i.push(t);const n=be(e,t);n&&u.push(n)})});const f=[];i.forEach(e=>{e.matches(a)&&f.push(e),ve(e,a,e=>f.push(e))});let g={};return f.forEach(t=>{g=oe(g,fe(e,t,"")),c=oe(c,fe(e,t,r))}),c=oe(oe(g,c),l),i.forEach(t=>{ve(t,`[${de(e)}]`,t=>{const n=be(e,t);n&&u.push(n)})}),{entity:r,data:c,context:d,nested:u}}function he(e,t){const n=de(e,U.Link,!1);if(t.matches(`[${n}]`)){const[e,o]=Ee(C(t,n));if("child"===o)return document.querySelector(`[${n}="${e}:parent"]`)}return!t.parentElement&&t.getRootNode&&t.getRootNode()instanceof ShadowRoot?t.getRootNode().host:t.parentElement}function we(e,t,n,o){let r={};const i={};let a=e;const s=`[${de(n,U.Context,!1)}]`;let c=0;for(;a;)a.matches(t)&&(r=oe(fe(n,a,""),r),r=oe(fe(n,a,o),r)),a.matches(s)&&(Object.entries(fe(n,a,U.Context,!1)).forEach(([e,t])=>{t&&!i[e]&&(i[e]=[t,c])}),++c),a=he(n,a);return[r,i]}function ve(e,t,n){e.querySelectorAll(t).forEach(n)}function ke(e,t=";"){if(!e)return[];const n=new RegExp(`(?:[^${t}']+|'[^']*')+`,"ig");return e.match(n)||[]}function Ee(e){const[t,n]=e.split(/:(.+)/,2);return[le(t),le(n)]}function je(e){const[t,n]=e.split("(",2);return[t,n?n.slice(0,-1):""]}var Se,Oe=new WeakMap,Le=new WeakMap,_e=new WeakMap;function xe(e){const t=Date.now();let n=Le.get(e);return(!n||t-n.lastChecked>500)&&(n={isVisible:P(e),lastChecked:t},Le.set(e,n)),n.isVisible}function Ae(e){if(window.IntersectionObserver)return ue(()=>new window.IntersectionObserver(t=>{t.forEach(t=>{!function(e,t){var n,o;const r=t.target,i=_e.get(e);if(!i)return;const a=i.timers.get(r);if(t.intersectionRatio>0){const o=Date.now();let s=Oe.get(r);if((!s||o-s.lastChecked>1e3)&&(s={isLarge:r.offsetHeight>window.innerHeight,lastChecked:o},Oe.set(r,s)),t.intersectionRatio>=.5||s.isLarge&&xe(r)){const t=null==(n=i.elementConfigs)?void 0:n.get(r);if((null==t?void 0:t.multiple)&&t.blocked)return;if(!a){const t=window.setTimeout(async()=>{var t,n;if(xe(r)){const o=null==(t=i.elementConfigs)?void 0:t.get(r);(null==o?void 0:o.context)&&await Me(o.context,r,o.trigger);const a=null==(n=i.elementConfigs)?void 0:n.get(r);(null==a?void 0:a.multiple)?a.blocked=!0:function(e,t){const n=_e.get(e);if(!n)return;n.observer&&n.observer.unobserve(t);const o=n.timers.get(t);o&&(clearTimeout(o),n.timers.delete(t)),Oe.delete(t),Le.delete(t)}(e,r)}},i.duration);i.timers.set(r,t)}return}}a&&(clearTimeout(a),i.timers.delete(r));const s=null==(o=i.elementConfigs)?void 0:o.get(r);(null==s?void 0:s.multiple)&&(s.blocked=!1)}(e,t)})},{rootMargin:"0px",threshold:[0,.5]}),()=>{})()}function Ce(e,t,n={multiple:!1}){var o;const r=e.settings.scope||document,i=_e.get(r);(null==i?void 0:i.observer)&&t&&(i.elementConfigs||(i.elementConfigs=new WeakMap),i.elementConfigs.set(t,{multiple:null!=(o=n.multiple)&&o,blocked:!1,context:e,trigger:n.multiple?"visible":"impression"}),i.observer.observe(t))}function $e(e){if(!e)return;const t=_e.get(e);t&&(t.observer&&t.observer.disconnect(),_e.delete(e))}function qe(e,t,n,o,r,i,a){const{elb:s,settings:c}=e;if(se(t)&&t.startsWith("walker "))return s(t,n);if(ae(t)){const e=t;return e.source||(e.source=Pe()),e.globals||(e.globals=ge(c.prefix,c.scope||document)),s(e)}const[u]=String(ae(t)?t.name:t).split(" ");let l,d=ae(n)?n:{},f={},g=!1;if(ie(n)&&(l=n,g=!0),ie(r)?l=r:ae(r)&&Object.keys(r).length&&(f=r),l){const e=ye(c.prefix||"data-elb",l).find(e=>e.entity===u);e&&(g&&(d=e.data),f=e.context)}"page"===u&&(d.id=d.id||window.location.pathname);const p=ge(c.prefix,c.scope);return s({name:String(t||""),data:d,context:f,globals:p,nested:i,custom:a,trigger:se(o)?o:"",source:Pe()})}function Pe(){return{type:"browser",id:window.location.href,previous_id:document.referrer}}var Re=[],De="hover",Ie="load",Ne="pulse",Xe="scroll",Te="wait";function Ue(e,t){t.scope&&function(e,t){const n=t.scope;n&&(n.addEventListener("click",ue(function(t){Ge.call(this,e,t)})),n.addEventListener("submit",ue(function(t){He.call(this,e,t)})))}(e,t)}function We(e,t){t.scope&&function(e,t){const n=t.scope;Re=[];const o=n||document;$e(o),function(e,t=1e3){_e.has(e)||_e.set(e,{observer:Ae(e),timers:new WeakMap,duration:t})}(o,1e3);const r=de(t.prefix,U.Action,!1);o!==document&&Be(e,o,r,t),o.querySelectorAll(`[${r}]`).forEach(n=>{Be(e,n,r,t)}),Re.length&&function(e,t){const n=(e,t)=>e.filter(([e,n])=>{const o=window.scrollY+window.innerHeight,r=e.offsetTop;if(o<r)return!0;const i=e.clientHeight;return!(100*(1-(r+i-o)/(i||1))>=n&&(Me(t,e,Xe),1))});Se||(Se=function(e,t=1e3){let n=null;return function(...o){if(null===n)return n=setTimeout(()=>{n=null},t),e(...o)}}(function(){Re=n.call(t,Re,e)}),t.addEventListener("scroll",Se))}(e,o)}(e,t)}async function Me(e,t,n){const o=function(e,t,n=U.Prefix){const o=[],{actions:r,nearestOnly:i}=function(e,t,n){let o=t;for(;o;){const t=C(o,de(e,U.Actions,!1));if(t){const e=me(t);if(e[n])return{actions:e[n],nearestOnly:!1}}const r=C(o,de(e,U.Action,!1));if(r){const e=me(r);if(e[n]||"click"!==n)return{actions:e[n]||[],nearestOnly:!0}}o=he(e,o)}return{actions:[],nearestOnly:!1}}(n,e,t);return r.length?(r.forEach(r=>{const a=ke(r.actionParams||"",",").reduce((e,t)=>(e[le(t)]=!0,e),{}),s=ye(n,e,a,i);if(!s.length){const t="page",o=`[${de(n,t)}]`,[r,i]=we(e,o,n,t);s.push({entity:t,data:r,nested:[],context:i})}s.forEach(e=>{o.push({entity:e.entity,action:r.action,data:e.data,trigger:t,context:e.context,nested:e.nested})})}),o):o}(t,n,e.settings.prefix);return Promise.all(o.map(t=>qe(e,{name:`${t.entity} ${t.action}`,...t,trigger:n})))}function Be(e,t,n,o){const r=C(t,n);r&&Object.values(me(r)).forEach(n=>n.forEach(n=>{switch(n.trigger){case De:o=e,t.addEventListener("mouseenter",ue(function(e){e.target instanceof Element&&Me(o,e.target,De)}));break;case Ie:!function(e,t){Me(e,t,Ie)}(e,t);break;case Ne:!function(e,t,n=""){setInterval(()=>{document.hidden||Me(e,t,Ne)},parseInt(n||"")||15e3)}(e,t,n.triggerParams);break;case Xe:!function(e,t=""){const n=parseInt(t||"")||50;n<0||n>100||Re.push([e,n])}(t,n.triggerParams);break;case"impression":Ce(e,t);break;case"visible":Ce(e,t,{multiple:!0});break;case Te:!function(e,t,n=""){setTimeout(()=>Me(e,t,Te),parseInt(n||"")||15e3)}(e,t,n.triggerParams)}var o}))}function Ge(e,t){Me(e,t.target,"click")}function He(e,t){t.target&&Me(e,t.target,"submit")}function Fe(e,t,n,o){const r=[];let i=!0;n.forEach(e=>{const t=Je(e)?[...Array.from(e)]:null!=(n=e)&&"object"==typeof n&&"length"in n&&"number"==typeof n.length?Array.from(e):[e];var n;if(Array.isArray(t)&&0===t.length)return;if(Array.isArray(t)&&1===t.length&&!t[0])return;const a=t[0],s=!ae(a)&&se(a)&&a.startsWith("walker ");if(ae(a)){if("object"==typeof a&&0===Object.keys(a).length)return}else{const e=Array.from(t);if(!se(e[0])||""===e[0].trim())return;const n="walker run";i&&e[0]===n&&(i=!1)}(o&&s||!o&&!s)&&r.push(t)}),r.forEach(n=>{Ke(e,t,n)})}function Ke(e,t="data-elb",n){ue(()=>{if(Array.isArray(n)){const[o,...r]=n;if(!o||se(o)&&""===o.trim())return;if(se(o)&&o.startsWith("walker "))return void e(o,r[0]);qe({elb:e,settings:{prefix:t,scope:document,pageview:!1,session:!1,elb:"",elbLayer:!1}},o,...r)}else if(n&&"object"==typeof n){if(0===Object.keys(n).length)return;e(n)}},()=>{})()}function Je(e){return null!=e&&"object"==typeof e&&"[object Arguments]"===Object.prototype.toString.call(e)}function ze(e,t={},n){return function(e={}){const{cb:t,consent:n,collector:o,storage:r}=e;if(!n)return R((r?X:T)(e),o,t);{const r=function(e,t){let n;return(o,r)=>{if(c(n)&&n===(null==o?void 0:o.group))return;n=null==o?void 0:o.group;let i=()=>T(e);return e.consent&&p((s(e.consent)?e.consent:[e.consent]).reduce((e,t)=>({...e,[t]:!0}),{}),r)&&(i=()=>X(e)),R(i(),o,t)}}(e,t),i=(s(n)?n:[n]).reduce((e,t)=>({...e,[t]:r}),{});o?o.command("on","consent",i):q("walker on","consent",i)}}({...t,collector:{push:e,group:void 0,command:n}})}Z({},{env:()=>Ye});var Ye={};Z(Ye,{push:()=>et});var Ve=()=>{},Qe=()=>()=>Promise.resolve({ok:!0,successful:[],queued:[],failed:[]}),Ze={error:Ve,info:Ve,debug:Ve,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>Ze},et={get push(){return Qe()},get command(){return Qe()},get elb(){return Qe()},get window(){return{addEventListener:Ve,removeEventListener:Ve,location:{href:"https://example.com/page",pathname:"/page",search:"?query=test",hash:"#section",host:"example.com",hostname:"example.com",origin:"https://example.com",protocol:"https:"},document:{},navigator:{language:"en-US",userAgent:"Mozilla/5.0 (Test)"},screen:{width:1920,height:1080},innerWidth:1920,innerHeight:1080,pageXOffset:0,pageYOffset:0,scrollX:0,scrollY:0}},get document(){return{addEventListener:Ve,removeEventListener:Ve,querySelector:Ve,querySelectorAll:()=>[],getElementById:Ve,getElementsByClassName:()=>[],getElementsByTagName:()=>[],createElement:()=>({setAttribute:Ve,getAttribute:Ve,addEventListener:Ve,removeEventListener:Ve}),body:{appendChild:Ve,removeChild:Ve},documentElement:{scrollTop:0,scrollLeft:0},readyState:"complete",title:"Test Page",referrer:"",cookie:""}},logger:Ze},tt=async(e,t)=>{const{elb:n,command:o,window:r,document:i}=t,a=(null==e?void 0:e.settings)||{},s=r||(void 0!==globalThis.window?globalThis.window:void 0),c=i||(void 0!==globalThis.document?globalThis.document:void 0),u=function(e={},t){return{prefix:"data-elb",pageview:!0,session:!0,elb:"elb",elbLayer:"elbLayer",scope:t||void 0,...e}}(a,c),l={settings:u},d={elb:n,settings:u};if(s&&c){if(!1!==u.elbLayer&&n&&function(e,t={}){const n=t.name||"elbLayer",o=t.window||window;if(!o)return;const r=o;r[n]||(r[n]=[]);const i=r[n];i.push=function(...n){if(Je(n[0])){const o=[...Array.from(n[0])],r=Array.prototype.push.apply(this,[o]);return Ke(e,t.prefix,o),r}const o=Array.prototype.push.apply(this,n);return n.forEach(n=>{Ke(e,t.prefix,n)}),o},Array.isArray(i)&&i.length>0&&function(e,t="data-elb",n){Fe(e,t,n,!0),Fe(e,t,n,!1),n.length=0}(e,t.prefix,i)}(n,{name:se(u.elbLayer)?u.elbLayer:"elbLayer",prefix:u.prefix,window:s}),u.session&&n){const e="boolean"==typeof u.session?{}:u.session;ze(n,e,o)}await async function(e,t,n){const o=()=>{e(t,n)};"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}(Ue,d,u),(()=>{if(We(d,u),u.pageview){const[e,t]=pe(u.prefix||"data-elb",u.scope);qe(d,"page view",e,"load",t)}})(),se(u.elb)&&u.elb&&(s[u.elb]=(...e)=>{const[t,n,o,r,i,a]=e;return qe(d,t,n,o,r,i,a)})}return{type:"browser",config:l,push:(...e)=>{const[t,n,o,r,i,a]=e;return qe(d,t,n,o,r,i,a)},destroy:async()=>{c&&$e(u.scope||c)},on:async(e,t)=>{switch(e){case"consent":if(u.session&&t&&n){const e="boolean"==typeof u.session?{}:u.session;ze(n,e,o)}break;case"session":case"ready":default:break;case"run":if(c&&s&&(We(d,u),u.pageview)){const[e,t]=pe(u.prefix||"data-elb",u.scope);qe(d,"page view",e,"load",t)}}}}},nt=Object.defineProperty,ot=(e,t)=>{for(var n in t)nt(e,n,{get:t[n],enumerable:!0})},rt=!1;function it(e,t={},n){if(t.filter&&!0===j(()=>t.filter(n),()=>!1)())return;const o=function(e){if(u(e)&&l(e.event)){const{event:t,...n}=e;return{name:t,...n}}return s(e)&&e.length>=2?at(e):null!=(t=e)&&"object"==typeof t&&"length"in t&&"number"==typeof t.length&&t.length>0?at(Array.from(e)):null;var t}(n);if(!o)return;const r=`${t.prefix||"dataLayer"} ${o.name}`,{name:i,...a}=o,c={name:r,data:a};j(()=>e(c),()=>{})()}function at(e){const[t,n,o]=e;if(!l(t))return null;let r,i={};switch(t){case"consent":if(!l(n)||e.length<3)return null;if("default"!==n&&"update"!==n)return null;if(!u(o)||null===o)return null;r=`${t} ${n}`,i={...o};break;case"event":if(!l(n))return null;r=n,u(o)&&(i={...o});break;case"config":if(!l(n))return null;r=`${t} ${n}`,u(o)&&(i={...o});break;case"set":if(l(n))r=`${t} ${n}`,u(o)&&(i={...o});else{if(!u(n))return null;r=`${t} custom`,i={...n}}break;default:return null}return{name:r,...i}}ot({},{push:()=>lt});var st=()=>{},ct=()=>()=>Promise.resolve({ok:!0,successful:[],queued:[],failed:[]}),ut={error:st,info:st,debug:st,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>ut},lt={get push(){return ct()},get command(){return ct()},get elb(){return ct()},get window(){return{dataLayer:[],addEventListener:st,removeEventListener:st}},logger:ut};function dt(){return["consent","update",{ad_user_data:"granted",ad_personalization:"granted",ad_storage:"denied",analytics_storage:"granted"}]}function ft(){return["consent","default",{ad_storage:"denied",analytics_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"}]}function gt(){return["event","purchase",{transaction_id:"T_12345",value:25.42,currency:"EUR",items:[{item_id:"SKU_12345",item_name:"Product Name",item_category:"Category",quantity:1,price:25.42}]}]}function pt(){return["event","add_to_cart",{currency:"EUR",value:15.25,items:[{item_id:"SKU_12345",item_name:"Product Name",item_variant:"red",quantity:1,price:15.25}]}]}function mt(){return["event","view_item",{currency:"EUR",value:15.25,items:[{item_id:"SKU_12345",item_name:"Product Name",item_category:"Category",price:15.25}]}]}function yt(){return["config","G-XXXXXXXXXX",{page_title:"Custom Page Title",page_location:"https://example.com/page",send_page_view:!1}]}function bt(){return["set",{currency:"EUR",country:"DE"}]}function ht(){return{event:"custom_event",custom_parameter:"custom_value",user_id:"user123"}}ot({},{add_to_cart:()=>pt,config:()=>yt,consentDefault:()=>ft,consentUpdate:()=>dt,directDataLayerEvent:()=>ht,purchase:()=>gt,setCustom:()=>bt,view_item:()=>mt});ot({},{add_to_cart:()=>kt,config:()=>Ot,configGA4:()=>jt,consentOnlyMapping:()=>Lt,consentUpdate:()=>wt,customEvent:()=>St,purchase:()=>vt,view_item:()=>Et});var wt={name:"walker consent",settings:{command:{map:{functional:{value:!0},analytics:{key:"analytics_storage",fn:e=>"granted"===e},marketing:{key:"ad_storage",fn:e=>"granted"===e}}}}},vt={name:"order complete",data:{map:{id:"transaction_id",total:"value",currency:"currency",nested:{loop:["items",{map:{type:{value:"product"},data:{map:{id:"item_id",name:"item_name",category:"item_category",quantity:"quantity",price:"price"}}}}]}}}},kt={name:"product add",data:{map:{id:"items.0.item_id",name:"items.0.item_name",price:"value",currency:"currency",color:"items.0.item_variant",quantity:"items.0.quantity"}}},Et={name:"product view",data:{map:{id:"items.0.item_id",name:"items.0.item_name",category:"items.0.item_category",price:"items.0.price",currency:"currency"}}},jt={name:"page view",data:{map:{title:"page_title",url:"page_location"}}},St={data:{map:{user_id:"user_id",custom_parameter:"custom_parameter"}}},Ot={consent:{update:wt},purchase:vt,add_to_cart:kt,view_item:Et,"config G-XXXXXXXXXX":jt,custom_event:St,"*":{data:{}}},Lt={consent:{update:wt}},_t=async(e,t)=>{const{elb:n,window:o}=t,r={name:"dataLayer",prefix:"dataLayer",...null==e?void 0:e.settings},i={settings:r};return o&&(function(e,t){const n=t.settings,o=(null==n?void 0:n.name)||"dataLayer",r=window[o];if(Array.isArray(r)&&!rt){rt=!0;try{for(const t of r)it(e,n,t)}finally{rt=!1}}}(n,i),function(e,t){const n=t.settings,o=(null==n?void 0:n.name)||"dataLayer";window[o]||(window[o]=[]);const r=window[o];if(!Array.isArray(r))return;const i=r.push.bind(r);r.push=function(...t){if(rt)return i(...t);rt=!0;try{for(const o of t)it(e,n,o)}finally{rt=!1}return i(...t)}}(n,i)),{type:"dataLayer",config:i,push:n,destroy:async()=>{const e=r.name||"dataLayer";o&&o[e]&&Array.isArray(o[e])}}};function xt(){window.dataLayer=window.dataLayer||[];const e=e=>{u(e)&&u(e.source)&&String(e.source.type).includes("dataLayer")||window.dataLayer.push(e)};return{type:"dataLayer",config:{},push:(t,n)=>{e(n.data||t)},pushBatch:t=>{e({name:"batch",batched_event:t.key,events:t.data.length?t.data:t.events})}}}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{browserConfig:()=>Ct,collectorConfig:()=>qt,dataLayerConfig:()=>$t,settings:()=>At});var At={type:"object",properties:{elb:{type:"string",default:"elb",description:"Global function name for event tracking"},name:{type:"string",default:"walkerjs",description:"Global instance name"},run:{type:"boolean",default:!0,description:"Auto-initialize walker.js on load"},browser:{type:"object",default:{run:!0,session:!0,scope:"document.body",pageview:!0},description:"Browser source configuration. Set to false to disable. See browser configuration section below for details."},dataLayer:{type:"object",default:!1,description:"DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below."},collector:{type:"object",default:{},description:"Collector configuration including destinations and consent settings. See collector configuration section below."}}},Ct={type:"object",properties:{"browser.run":{type:"boolean",default:!0,description:"Auto-start DOM tracking"},"browser.session":{type:"boolean",default:!0,description:"Enable session tracking"},"browser.scope":{type:"string",default:"document.body",description:"DOM element scope for tracking"},"browser.pageview":{type:"boolean",default:!0,description:"Enable automatic page view events"}}},$t={type:"object",properties:{dataLayer:{type:"boolean",default:!1,description:"Enable dataLayer integration with defaults"},"dataLayer.name":{type:"string",default:"dataLayer",description:"DataLayer variable name"},"dataLayer.prefix":{type:"string",default:"dataLayer",description:"Event prefix for dataLayer events"}}},qt={type:"object",properties:{"collector.consent":{type:"object",default:{functional:!0},description:"Default consent state"},"collector.destinations":{type:"object",default:{},description:"Destination configurations. See destinations documentation for available options."}}};if(window&&document){const e=async()=>{let e;const t=document.querySelector("script[data-elbconfig]");if(t){const n=t.getAttribute("data-elbconfig")||"";n.includes(":")?e=$(n):n&&(e=window[n])}e||(e=window.elbConfig),e&&await async function(e={}){const t=a({collector:{destinations:{dataLayer:{code:xt()}}},browser:{session:!0},dataLayer:!1,elb:"elb",run:!0},e),n={...t.collector,sources:{browser:{code:tt,config:{settings:t.browser},env:{window:"undefined"!=typeof window?window:void 0,document:"undefined"!=typeof document?document:void 0}}}};if(t.dataLayer){const e=u(t.dataLayer)?t.dataLayer:{};n.sources&&(n.sources.dataLayer={code:_t,config:{settings:e}})}const o=await Y(n);return"undefined"!=typeof window&&(t.elb&&(window[t.elb]=o.elb),t.name&&(window[t.name]=o.collector)),o}(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}})();
1
+ "use strict";(()=>{var e=Object.defineProperty,t=Object.defineProperty;((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{Level:()=>o});var n,o=((n=o||{})[n.ERROR=0]="ERROR",n[n.INFO=1]="INFO",n[n.DEBUG=2]="DEBUG",n),r={Storage:{Local:"local",Session:"session",Cookie:"cookie"}},i={merge:!0,shallow:!0,extend:!0};function a(e,t={},n={}){n={...i,...n};const o=Object.entries(t).reduce((t,[o,r])=>{const i=e[o];return n.merge&&Array.isArray(i)&&Array.isArray(r)?t[o]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||o in e)&&(t[o]=r),t},{});return n.shallow?{...e,...o}:(Object.assign(e,o),e)}function s(e){return Array.isArray(e)}function c(e){return void 0!==e}function u(e){return"object"==typeof e&&null!==e&&!s(e)&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return"string"==typeof e}function d(e,t=new WeakMap){if("object"!=typeof e||null===e)return e;if(t.has(e))return t.get(e);const n=Object.prototype.toString.call(e);if("[object Object]"===n){const n={};t.set(e,n);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=d(e[o],t));return n}if("[object Array]"===n){const n=[];return t.set(e,n),e.forEach(e=>{n.push(d(e,t))}),n}if("[object Date]"===n)return new Date(e.getTime());if("[object RegExp]"===n){const t=e;return new RegExp(t.source,t.flags)}return e}function f(e,t="",n){const o=t.split(".");let r=e;for(let e=0;e<o.length;e++){const t=o[e];if("*"===t&&s(r)){const t=o.slice(e+1).join("."),i=[];for(const e of r){const o=f(e,t,n);i.push(o)}return i}if(r=r instanceof Object?r[t]:void 0,!r)break}return c(r)?r:n}function g(e,t,n){if(!u(e))return e;const o=d(e),r=t.split(".");let i=o;for(let e=0;e<r.length;e++){const t=r[e];e===r.length-1?i[t]=n:(t in i&&"object"==typeof i[t]&&null!==i[t]||(i[t]={}),i=i[t])}return o}function p(e,t={},n={}){const o={...t,...n},r={};let i=void 0===e;return Object.keys(o).forEach(t=>{o[t]&&(r[t]=!0,e&&e[t]&&(i=!0))}),!!i&&r}function m(e=6){let t="";for(let n=36;t.length<e;)t+=(Math.random()*n|0).toString(n);return t}function y(e){return{message:e.message,name:e.name,stack:e.stack,cause:e.cause}}function h(e,t){let n,o={};return e instanceof Error?(n=e.message,o.error=y(e)):n=e,void 0!==t&&(t instanceof Error?o.error=y(t):"object"==typeof t&&null!==t?(o={...o,...t},"error"in o&&o.error instanceof Error&&(o.error=y(o.error))):o.value=t),{message:n,context:o}}var b=(e,t,n,r)=>{const i=`${o[e]}${r.length>0?` [${r.join(":")}]`:""}`,a=Object.keys(n).length>0;0===e?a?console.error(i,t,n):console.error(i,t):a?console.log(i,t,n):console.log(i,t)};function v(e={}){return w({level:void 0!==e.level?(t=e.level,"string"==typeof t?o[t]:t):0,handler:e.handler,scope:[]});var t}function w(e){const{level:t,handler:n,scope:o}=e,r=(e,r,i)=>{if(e<=t){const t=h(r,i);n?n(e,t.message,t.context,o,b):b(e,t.message,t.context,o)}};return{error:(e,t)=>r(0,e,t),info:(e,t)=>r(1,e,t),debug:(e,t)=>r(2,e,t),throw:(e,t)=>{const r=h(e,t);throw n?n(0,r.message,r.context,o,b):b(0,r.message,r.context,o),new Error(r.message)},scope:e=>w({level:t,handler:n,scope:[...o,e]})}}function k(e){return function(e){return"boolean"==typeof e}(e)||l(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!c(e)||s(e)&&e.every(k)||u(e)&&Object.values(e).every(k)}function E(e){return k(e)?e:void 0}function j(e,t,n){return function(...o){try{return e(...o)}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}}function S(e,t,n){return async function(...o){try{return await e(...o)}catch(e){if(!t)return;return await t(e)}finally{await(null==n?void 0:n())}}}async function O(e,t={},n={}){var o;if(!c(e))return;const r=u(e)&&e.consent||n.consent||(null==(o=n.collector)?void 0:o.consent),i=s(t)?t:[t];for(const t of i){const o=await S(L)(e,t,{...n,consent:r});if(c(o))return o}}async function L(e,t,n={}){const{collector:o,consent:r}=n;return(s(t)?t:[t]).reduce(async(t,i)=>{const a=await t;if(a)return a;const u=l(i)?{key:i}:i;if(!Object.keys(u).length)return;const{condition:d,consent:g,fn:m,key:y,loop:h,map:b,set:v,validate:w,value:k}=u;if(d&&!await S(d)(e,i,o))return;if(g&&!p(g,r))return k;let j=c(k)?k:e;if(m&&(j=await S(m)(e,i,n)),y&&(j=f(e,y,k)),h){const[t,o]=h,r="this"===t?[e]:await O(e,t,n);s(r)&&(j=(await Promise.all(r.map(e=>O(e,o,n)))).filter(c))}else b?j=await Object.entries(b).reduce(async(t,[o,r])=>{const i=await t,a=await O(e,r,n);return c(a)&&(i[o]=a),i},Promise.resolve({})):v&&(j=await Promise.all(v.map(t=>L(e,t,n))));w&&!await S(w)(j)&&(j=void 0);const _=E(j);return c(_)?_:E(k)},Promise.resolve(void 0))}async function _(e,t,n){t.policy&&await Promise.all(Object.entries(t.policy).map(async([t,o])=>{const r=await O(e,o,{collector:n});e=g(e,t,r)}));const{eventMapping:o,mappingKey:r}=await async function(e,t){var n;const[o,r]=(e.name||"").split(" ");if(!t||!o||!r)return{};let i,a="",c=o,u=r;const l=t=>{if(t)return(t=s(t)?t:[t]).find(t=>!t.condition||t.condition(e))};t[c]||(c="*");const d=t[c];return d&&(d[u]||(u="*"),i=l(d[u])),i||(c="*",u="*",i=l(null==(n=t[c])?void 0:n[u])),i&&(a=`${c} ${u}`),{eventMapping:i,mappingKey:a}}(e,t.mapping);(null==o?void 0:o.policy)&&await Promise.all(Object.entries(o.policy).map(async([t,o])=>{const r=await O(e,o,{collector:n});e=g(e,t,r)}));let i=t.data&&await O(e,t.data,{collector:n});if(o){if(o.ignore)return{event:e,data:i,mapping:o,mappingKey:r,ignore:!0};if(o.name&&(e.name=o.name),o.data){const t=o.data&&await O(e,o.data,{collector:n});i=u(i)&&u(t)?a(i,t):t}}return{event:e,data:i,mapping:o,mappingKey:r,ignore:!1}}function x(e){return e?e.trim().replace(/^'|'$/g,"").trim():""}function A(e,t,n){return function(...o){let r;const i="post"+t,a=n["pre"+t],s=n[i];return r=a?a({fn:e},...o):e(...o),s&&(r=s({fn:e,result:r},...o)),r}}function C(e,t){return(e.getAttribute(t)||"").trim()}function $(e){const t={};return function(e,t=";"){if(!e)return[];const n=new RegExp(`(?:[^${t}']+|'[^']*')+`,"ig");return e.match(n)||[]}(e).forEach(e=>{const[n,o]=function(e){const[t,n]=e.split(/:(.+)/,2);return[x(t||""),x(n||"")]}(e);n&&("true"===o?t[n]=!0:"false"===o?t[n]=!1:o&&/^\d+$/.test(o)?t[n]=parseInt(o,10):o&&/^\d+\.\d+$/.test(o)?t[n]=parseFloat(o):t[n]=o||!0)}),t}var q=function(){const e=window;(e.elbLayer=e.elbLayer||[]).push(arguments)};function P(e){const t=getComputedStyle(e);if("none"===t.display)return!1;if("visible"!==t.visibility)return!1;if(t.opacity&&Number(t.opacity)<.1)return!1;let n;const o=window.innerHeight,r=e.getBoundingClientRect(),i=r.height,a=r.y,s=a+i,c={x:r.x+e.offsetWidth/2,y:r.y+e.offsetHeight/2};if(i<=o){if(e.offsetWidth+r.width===0||e.offsetHeight+r.height===0)return!1;if(c.x<0)return!1;if(c.x>(document.documentElement.clientWidth||window.innerWidth))return!1;if(c.y<0)return!1;if(c.y>(document.documentElement.clientHeight||window.innerHeight))return!1;n=document.elementFromPoint(c.x,c.y)}else{const e=o/2;if(a<0&&s<e)return!1;if(s>o&&a>e)return!1;n=document.elementFromPoint(c.x,o/2)}if(n)do{if(n===e)return!0}while(n=n.parentElement);return!1}function R(e,t,n){return!1===n?e:(n||(n=D),n(e,t,D))}var D=(e,t)=>{const n={};return e.id&&(n.session=e.id),e.storage&&e.device&&(n.device=e.device),t?t.command("user",n):q("walker user",n),e.isStart&&(t?t.push({name:"session start",data:e}):q({name:"session start",data:e})),e};function I(e,t=r.Storage.Session){var n;function o(e){try{return JSON.parse(e||"")}catch(t){let n=1,o="";return e&&(n=0,o=e),{e:n,v:o}}}let i,a;switch(t){case r.Storage.Cookie:i=decodeURIComponent((null==(n=document.cookie.split("; ").find(t=>t.startsWith(e+"=")))?void 0:n.split("=")[1])||"");break;case r.Storage.Local:a=o(window.localStorage.getItem(e));break;case r.Storage.Session:a=o(window.sessionStorage.getItem(e))}return a&&(i=a.v,0!=a.e&&a.e<Date.now()&&(function(e,t=r.Storage.Session){switch(t){case r.Storage.Cookie:N(e,"",0,t);break;case r.Storage.Local:window.localStorage.removeItem(e);break;case r.Storage.Session:window.sessionStorage.removeItem(e)}}(e,t),i="")),function(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return e==t&&""!==e?t:String(e)}(i||"")}function N(e,t,n=30,o=r.Storage.Session,i){const a={e:Date.now()+6e4*n,v:String(t)},s=JSON.stringify(a);switch(o){case r.Storage.Cookie:{t="object"==typeof t?JSON.stringify(t):t;let o=`${e}=${encodeURIComponent(t)}; max-age=${60*n}; path=/; SameSite=Lax; secure`;i&&(o+="; domain="+i),document.cookie=o;break}case r.Storage.Local:window.localStorage.setItem(e,s);break;case r.Storage.Session:window.sessionStorage.setItem(e,s)}return I(e,o)}function X(e={}){const t=Date.now(),{length:n=30,deviceKey:o="elbDeviceId",deviceStorage:r="local",deviceAge:i=30,sessionKey:a="elbSessionId",sessionStorage:s="local",pulse:c=!1}=e,u=T(e);let l=!1;const d=j((e,t,n)=>{let o=I(e,n);return o||(o=m(8),N(e,o,1440*t,n)),String(o)})(o,i,r),f=j((e,o)=>{const r=JSON.parse(String(I(e,o)));return c||(r.isNew=!1,u.marketing&&(Object.assign(r,u),l=!0),l||r.updated+6e4*n<t?(delete r.id,delete r.referrer,r.start=t,r.count++,r.runs=1,l=!0):r.runs++),r},()=>{l=!0})(a,s)||{},g={id:m(12),start:t,isNew:!0,count:1,runs:1},p=Object.assign(g,u,f,{device:d},{isStart:l,storage:!0,updated:t},e.data);return N(a,JSON.stringify(p),2*n,s),p}function T(e={}){let t=e.isStart||!1;const n={isStart:t,storage:!1};if(!1===e.isStart)return n;if(!t){const[e]=performance.getEntriesByType("navigation");if("navigate"!==e.type)return n}const o=new URL(e.url||window.location.href),r=e.referrer||document.referrer,i=r&&new URL(r).hostname,s=function(e,t={}){const n="clickId",o={},r={utm_campaign:"campaign",utm_content:"content",utm_medium:"medium",utm_source:"source",utm_term:"term",dclid:n,fbclid:n,gclid:n,msclkid:n,ttclid:n,twclid:n,igshid:n,sclid:n};return Object.entries(a(r,t)).forEach(([t,r])=>{const i=e.searchParams.get(t);i&&(r===n&&(r=t,o[n]=t),o[r]=i)}),o}(o,e.parameters);if(Object.keys(s).length&&(s.marketing||(s.marketing=!0),t=!0),!t){const n=e.domains||[];n.push(o.hostname),t=!n.includes(i)}return t?Object.assign({isStart:t,storage:!1,start:Date.now(),id:m(12),referrer:i},s,e.data):n}var U={Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Session:"session",User:"user",Walker:"walker"},W={type:"code",config:{},init(e){var t;const{config:n,logger:o}=e,r=null==(t=n.settings)?void 0:t.init;if(r)try{new Function("context",r)(e)}catch(e){o.error("Code destination init error:",e)}},push(e,t){var n,o;const{mapping:r,config:i,logger:a}=t,s=null!=(o=null==r?void 0:r.push)?o:null==(n=i.settings)?void 0:n.push;if(s)try{new Function("event","context",s)(e,t)}catch(e){a.error("Code destination push error:",e)}},pushBatch(e,t){var n,o;const{mapping:r,config:i,logger:a}=t,s=null!=(o=null==r?void 0:r.pushBatch)?o:null==(n=i.settings)?void 0:n.pushBatch;if(s)try{new Function("batch","context",s)(e,t)}catch(e){a.error("Code destination pushBatch error:",e)}},on(e,t){var n;const{config:o,logger:r}=t,i=null==(n=o.settings)?void 0:n.on;if(i)try{new Function("type","context",i)(e,t)}catch(e){r.error("Code destination on error:",e)}}};function B(e){return!0===e?W:e}async function M(e,t,n){const{allowed:o,consent:r,globals:i,user:s}=e;if(!o)return H({ok:!1});t&&e.queue.push(t),n||(n=e.destinations);const c=await Promise.all(Object.entries(n||{}).map(async([n,o])=>{let c=(o.queue||[]).map(e=>({...e,consent:r}));if(o.queue=[],t){const e=d(t);c.push(e)}if(!c.length)return{id:n,destination:o,skipped:!0};const u=[],l=c.filter(e=>{const t=p(o.config.consent,r,e.consent);return!t||(e.consent=t,u.push(e),!1)});if(o.queue.concat(l),!u.length)return{id:n,destination:o,queue:c};if(!await S(F)(e,o))return{id:n,destination:o,queue:c};let f=!1;return o.dlq||(o.dlq=[]),await Promise.all(u.map(async t=>(t.globals=a(i,t.globals),t.user=a(s,t.user),await S(G,n=>{const r=o.type||"unknown";return e.logger.scope(r).error("Push failed",{error:n,event:t.name}),f=!0,o.dlq.push([t,n]),!1})(e,o,t),t))),{id:n,destination:o,error:f}})),u=[],l=[],f=[];for(const e of c){if(e.skipped)continue;const t=e.destination,n={id:e.id,destination:t};e.error?f.push(n):e.queue&&e.queue.length?(t.queue=(t.queue||[]).concat(e.queue),l.push(n)):u.push(n)}return H({ok:!f.length,event:t,successful:u,queued:l,failed:f})}async function F(e,t){if(t.init&&!t.config.init){const n=t.type||"unknown",o=e.logger.scope(n),r={collector:e,config:t.config,env:K(t.env,t.config.env),logger:o};o.debug("init");const i=await A(t.init,"DestinationInit",e.hooks)(r);if(!1===i)return i;t.config={...i||t.config,init:!0},o.debug("init done")}return!0}async function G(e,t,n){var o;const{config:r}=t,i=await _(n,r,e);if(i.ignore)return!1;const a=t.type||"unknown",s=e.logger.scope(a),u={collector:e,config:r,data:i.data,mapping:i.mapping,env:K(t.env,r.env),logger:s},l=i.mapping;if((null==l?void 0:l.batch)&&t.pushBatch){const n=l.batched||{key:i.mappingKey||"",events:[],data:[]};n.events.push(i.event),c(i.data)&&n.data.push(i.data),l.batchFn=l.batchFn||function(e,t=1e3,n=!1){let o,r=null,i=!1;return(...a)=>new Promise(s=>{const c=n&&!i;r&&clearTimeout(r),r=setTimeout(()=>{r=null,n&&!i||(o=e(...a),s(o))},t),c&&(i=!0,o=e(...a),s(o))})}((e,t)=>{const o=e.type||"unknown",a=t.logger.scope(o),s={collector:t,config:r,data:i.data,mapping:l,env:K(e.env,r.env),logger:a};a.debug("push batch",{events:n.events.length}),A(e.pushBatch,"DestinationPushBatch",t.hooks)(n,s),a.debug("push batch done"),n.events=[],n.data=[]},l.batch),l.batched=n,null==(o=l.batchFn)||o.call(l,t,e)}else s.debug("push",{event:i.event.name}),await A(t.push,"DestinationPush",e.hooks)(i.event,u),s.debug("push done");return!0}function H(e){var t;return a({ok:!(null==(t=null==e?void 0:e.failed)?void 0:t.length),successful:[],queued:[],failed:[]},e)}function K(e,t){return e||t?t?e&&u(e)&&u(t)?{...e,...t}:t:e:{}}function J(e,t,n,o){let r,i=n||[];switch(n||(i=e.on[t]||[]),t){case U.Consent:r=o||e.consent;break;case U.Session:r=e.session;break;case U.Ready:case U.Run:default:r=void 0}if(Object.values(e.sources).forEach(e=>{e.on&&j(e.on)(t,r)}),Object.values(e.destinations).forEach(n=>{if(n.on){const o=n.type||"unknown",i=e.logger.scope(o).scope("on").scope(t),a={collector:e,config:n.config,data:r,env:K(n.env,n.config.env),logger:i};j(n.on)(t,a)}}),i.length)switch(t){case U.Consent:!function(e,t,n){const o=n||e.consent;t.forEach(t=>{Object.keys(o).filter(e=>e in t).forEach(n=>{j(t[n])(e,o)})})}(e,i,o);break;case U.Ready:case U.Run:s=i,(a=e).allowed&&s.forEach(e=>{j(e)(a)});break;case U.Session:!function(e,t){e.session&&t.forEach(t=>{j(t)(e,e.session)})}(e,i)}var a,s}async function z(e,t,n,o){let r;switch(t){case U.Config:u(n)&&a(e.config,n,{shallow:!1});break;case U.Consent:u(n)&&(r=await async function(e,t){const{consent:n}=e;let o=!1;const r={};return Object.entries(t).forEach(([e,t])=>{const n=!!t;r[e]=n,o=o||n}),e.consent=a(n,r),J(e,"consent",void 0,r),o?M(e):H({ok:!0})}(e,n));break;case U.Custom:u(n)&&(e.custom=a(e.custom,n));break;case U.Destination:u(n)&&function(e){return"function"==typeof e}(n.push)&&(r=await async function(e,t,n){const{code:o,config:r={},env:i={}}=t,a=n||r||{init:!1},s=B(o),c={...s,config:a,env:K(s.env,i)};let u=c.config.id;if(!u)do{u=m(4)}while(e.destinations[u]);return e.destinations[u]=c,!1!==c.config.queue&&(c.queue=[...e.queue]),M(e,void 0,{[u]:c})}(e,{code:n},o));break;case U.Globals:u(n)&&(e.globals=a(e.globals,n));break;case U.On:l(n)&&function(e,t,n){const o=e.on,r=o[t]||[],i=s(n)?n:[n];i.forEach(e=>{r.push(e)}),o[t]=r,J(e,t,i)}(e,n,o);break;case U.Ready:J(e,"ready");break;case U.Run:r=await async function(e,t){e.allowed=!0,e.count=0,e.group=m(),e.timing=Date.now(),t&&(t.consent&&(e.consent=a(e.consent,t.consent)),t.user&&(e.user=a(e.user,t.user)),t.globals&&(e.globals=a(e.config.globalsStatic||{},t.globals)),t.custom&&(e.custom=a(e.custom,t.custom))),Object.values(e.destinations).forEach(e=>{e.queue=[]}),e.queue=[],e.round++;const n=await M(e);return J(e,"run"),n}(e,n);break;case U.Session:J(e,"session");break;case U.User:u(n)&&a(e.user,n,{shallow:!1})}return r||{ok:!0,successful:[],queued:[],failed:[]}}function Y(e,t){return A(async(n,o={})=>await S(async()=>{let r=n;if(o.mapping){const t=await _(r,o.mapping,e);if(t.ignore)return H({ok:!0});if(o.mapping.consent&&!p(o.mapping.consent,e.consent,t.event.consent))return H({ok:!0});r=t.event}const i=t(r),a=function(e,t){if(!t.name)throw new Error("Event name is required");const[n,o]=t.name.split(" ");if(!n||!o)throw new Error("Event name is invalid");++e.count;const{timestamp:r=Date.now(),group:i=e.group,count:a=e.count}=t,{name:s=`${n} ${o}`,data:c={},context:u={},globals:l=e.globals,custom:d={},user:f=e.user,nested:g=[],consent:p=e.consent,id:m=`${r}-${i}-${a}`,trigger:y="",entity:h=n,action:b=o,timing:v=0,version:w={source:e.version,tagging:e.config.tagging||0},source:k={type:"collector",id:"",previous_id:""}}=t;return{name:s,data:c,context:u,globals:l,custom:d,user:f,nested:g,consent:p,id:m,trigger:y,entity:h,action:b,timestamp:r,timing:v,group:i,count:a,version:w,source:k}}(e,i);return await M(e,a)},()=>H({ok:!1}))(),"Push",e.hooks)}async function V(e){var t,n;const o=a({globalsStatic:{},sessionStatic:{},tagging:0,run:!0},e,{merge:!1,extend:!1}),r=v({level:null==(t=e.logger)?void 0:t.level,handler:null==(n=e.logger)?void 0:n.handler}),i={...o.globalsStatic,...e.globals},s={allowed:!1,config:o,consent:e.consent||{},count:0,custom:e.custom||{},destinations:{},globals:i,group:"",hooks:{},logger:r,on:{},queue:[],round:0,session:void 0,timing:Date.now(),user:e.user||{},version:"0.5.0",sources:{},push:void 0,command:void 0};return s.push=Y(s,e=>({timing:Math.round((Date.now()-s.timing)/10)/100,source:{type:"collector",id:"",previous_id:""},...e})),s.command=(u=z,A(async(e,t,n)=>await S(async()=>await u(c,e,t,n),()=>H({ok:!1}))(),"Command",(c=s).hooks)),s.destinations=await async function(e,t={}){const n={};for(const[e,o]of Object.entries(t)){const{code:t,config:r={},env:i={}}=o,a=B(t),s={...a.config,...r},c=K(a.env,i);n[e]={...a,config:s,env:c}}return n}(0,e.destinations||{}),s;var c,u}async function Q(e){e=e||{};const t=await V(e),n=(o=t,{type:"elb",config:{},push:async(e,t,n,r,i,a)=>{if("string"==typeof e&&e.startsWith("walker ")){const r=e.replace("walker ","");return o.command(r,t,n)}let s;if("string"==typeof e)s={name:e},t&&"object"==typeof t&&!Array.isArray(t)&&(s.data=t);else{if(!e||"object"!=typeof e)return{ok:!1,successful:[],queued:[],failed:[]};s=e,t&&"object"==typeof t&&!Array.isArray(t)&&(s.data={...s.data||{},...t})}return r&&"object"==typeof r&&(s.context=r),i&&Array.isArray(i)&&(s.nested=i),a&&"object"==typeof a&&(s.custom=a),o.push(s)}});var o;t.sources.elb=n;const r=await async function(e,t={}){const n={};for(const[o,r]of Object.entries(t)){const{code:t,config:i={},env:a={},primary:s}=r,c=(t,n={})=>e.push(t,{...n,mapping:i}),u=e.logger.scope("source").scope(o),l={push:c,command:e.command,sources:e.sources,elb:e.sources.elb.push,logger:u,...a},d=await S(t)(i,l);if(!d)continue;const f=d.type||"unknown",g=e.logger.scope(f).scope(o);l.logger=g,s&&(d.config={...d.config,primary:s}),n[o]=d}return n}(t,e.sources||{});Object.assign(t.sources,r);const{consent:i,user:a,globals:s,custom:c}=e;i&&await t.command("consent",i),a&&await t.command("user",a),s&&Object.assign(t.globals,s),c&&Object.assign(t.custom,c),t.config.run&&await t.command("run");let u=n.push;const l=Object.values(t.sources).filter(e=>"elb"!==e.type),d=l.find(e=>e.config.primary);return d?u=d.push:l.length>0&&(u=l[0].push),{collector:t,elb:u}}var Z,ee=Object.defineProperty,te=(e,t)=>{for(var n in t)ee(e,n,{get:t[n],enumerable:!0})},ne=Object.defineProperty;((e,t)=>{for(var n in t)ne(e,n,{get:t[n],enumerable:!0})})({},{Level:()=>oe});var oe=((Z=oe||{})[Z.ERROR=0]="ERROR",Z[Z.INFO=1]="INFO",Z[Z.DEBUG=2]="DEBUG",Z),re={merge:!0,shallow:!0,extend:!0};function ie(e,t={},n={}){n={...re,...n};const o=Object.entries(t).reduce((t,[o,r])=>{const i=e[o];return n.merge&&Array.isArray(i)&&Array.isArray(r)?t[o]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...i]):(n.extend||o in e)&&(t[o]=r),t},{});return n.shallow?{...e,...o}:(Object.assign(e,o),e)}function ae(e){return Array.isArray(e)}function se(e){return e===document||e instanceof Element}function ce(e){return"object"==typeof e&&null!==e&&!ae(e)&&"[object Object]"===Object.prototype.toString.call(e)}function ue(e){return"string"==typeof e}function le(e){if("true"===e)return!0;if("false"===e)return!1;const t=Number(e);return e==t&&""!==e?t:String(e)}function de(e,t,n){return function(...o){try{return e(...o)}catch(e){if(!t)return;return t(e)}finally{null==n||n()}}}function fe(e){return e?e.trim().replace(/^'|'$/g,"").trim():""}function ge(e,t,n=!0){return e+(null!=t?(n?"-":"")+t:"")}function pe(e,t,n,o=!0){return je(C(t,ge(e,n,o))||"").reduce((e,n)=>{let[o,r]=Se(n);if(!o)return e;if(r||(o.endsWith(":")&&(o=o.slice(0,-1)),r=""),r.startsWith("#")){r=r.slice(1);try{let e=t[r];e||"selected"!==r||(e=t.options[t.selectedIndex].text),r=String(e)}catch(e){r=""}}return o.endsWith("[]")?(o=o.slice(0,-2),ae(e[o])||(e[o]=[]),e[o].push(le(r))):e[o]=le(r),e},{})}function me(e=U.Prefix,t=document){const n=ge(e,U.Globals,!1);let o={};return Ee(t,`[${n}]`,t=>{o=ie(o,pe(e,t,U.Globals,!1))}),o}function ye(e,t){const n=window.location,o="page",r=t===document?document.body:t,[i,a]=ke(r,`[${ge(e,o)}]`,e,o);return i.domain=n.hostname,i.title=document.title,i.referrer=document.referrer,n.search&&(i.search=n.search),n.hash&&(i.hash=n.hash),[i,a]}function he(e){const t={};return je(e).forEach(e=>{const[n,o]=Se(e),[r,i]=Oe(n);if(!r)return;let[a,s]=Oe(o||"");a=a||r,t[r]||(t[r]=[]),t[r].push({trigger:r,triggerParams:i,action:a,actionParams:s})}),t}function be(e,t,n,o=!1){const r=[];let i=t;for(n=0!==Object.keys(n||{}).length?n:void 0;i;){const a=ve(e,i,t,n);if(a&&(r.push(a),o))break;i=we(e,i)}return r}function ve(e,t,n,o){const r=C(t,ge(e));if(!r||o&&!o[r])return null;const i=[t],a=`[${ge(e,r)}],[${ge(e,"")}]`,s=ge(e,U.Link,!1);let c={};const u=[],[l,d]=ke(n||t,a,e,r);Ee(t,`[${s}]`,t=>{const[n,o]=Se(C(t,s));"parent"===o&&Ee(document.body,`[${s}="${n}:child"]`,t=>{i.push(t);const n=ve(e,t);n&&u.push(n)})});const f=[];i.forEach(e=>{e.matches(a)&&f.push(e),Ee(e,a,e=>f.push(e))});let g={};return f.forEach(t=>{g=ie(g,pe(e,t,"")),c=ie(c,pe(e,t,r))}),c=ie(ie(g,c),l),i.forEach(t=>{Ee(t,`[${ge(e)}]`,t=>{const n=ve(e,t);n&&u.push(n)})}),{entity:r,data:c,context:d,nested:u}}function we(e,t){const n=ge(e,U.Link,!1);if(t.matches(`[${n}]`)){const[e,o]=Se(C(t,n));if("child"===o)return document.querySelector(`[${n}="${e}:parent"]`)}return!t.parentElement&&t.getRootNode&&t.getRootNode()instanceof ShadowRoot?t.getRootNode().host:t.parentElement}function ke(e,t,n,o){let r={};const i={};let a=e;const s=`[${ge(n,U.Context,!1)}]`;let c=0;for(;a;)a.matches(t)&&(r=ie(pe(n,a,""),r),r=ie(pe(n,a,o),r)),a.matches(s)&&(Object.entries(pe(n,a,U.Context,!1)).forEach(([e,t])=>{t&&!i[e]&&(i[e]=[t,c])}),++c),a=we(n,a);return[r,i]}function Ee(e,t,n){e.querySelectorAll(t).forEach(n)}function je(e,t=";"){if(!e)return[];const n=new RegExp(`(?:[^${t}']+|'[^']*')+`,"ig");return e.match(n)||[]}function Se(e){const[t,n]=e.split(/:(.+)/,2);return[fe(t),fe(n)]}function Oe(e){const[t,n]=e.split("(",2);return[t,n?n.slice(0,-1):""]}var Le,_e=new WeakMap,xe=new WeakMap,Ae=new WeakMap;function Ce(e){const t=Date.now();let n=xe.get(e);return(!n||t-n.lastChecked>500)&&(n={isVisible:P(e),lastChecked:t},xe.set(e,n)),n.isVisible}function $e(e){if(window.IntersectionObserver)return de(()=>new window.IntersectionObserver(t=>{t.forEach(t=>{!function(e,t){var n,o;const r=t.target,i=Ae.get(e);if(!i)return;const a=i.timers.get(r);if(t.intersectionRatio>0){const o=Date.now();let s=_e.get(r);if((!s||o-s.lastChecked>1e3)&&(s={isLarge:r.offsetHeight>window.innerHeight,lastChecked:o},_e.set(r,s)),t.intersectionRatio>=.5||s.isLarge&&Ce(r)){const t=null==(n=i.elementConfigs)?void 0:n.get(r);if((null==t?void 0:t.multiple)&&t.blocked)return;if(!a){const t=window.setTimeout(async()=>{var t,n;if(Ce(r)){const o=null==(t=i.elementConfigs)?void 0:t.get(r);(null==o?void 0:o.context)&&await Fe(o.context,r,o.trigger);const a=null==(n=i.elementConfigs)?void 0:n.get(r);(null==a?void 0:a.multiple)?a.blocked=!0:function(e,t){const n=Ae.get(e);if(!n)return;n.observer&&n.observer.unobserve(t);const o=n.timers.get(t);o&&(clearTimeout(o),n.timers.delete(t)),_e.delete(t),xe.delete(t)}(e,r)}},i.duration);i.timers.set(r,t)}return}}a&&(clearTimeout(a),i.timers.delete(r));const s=null==(o=i.elementConfigs)?void 0:o.get(r);(null==s?void 0:s.multiple)&&(s.blocked=!1)}(e,t)})},{rootMargin:"0px",threshold:[0,.5]}),()=>{})()}function qe(e,t,n={multiple:!1}){var o;const r=e.settings.scope||document,i=Ae.get(r);(null==i?void 0:i.observer)&&t&&(i.elementConfigs||(i.elementConfigs=new WeakMap),i.elementConfigs.set(t,{multiple:null!=(o=n.multiple)&&o,blocked:!1,context:e,trigger:n.multiple?"visible":"impression"}),i.observer.observe(t))}function Pe(e){if(!e)return;const t=Ae.get(e);t&&(t.observer&&t.observer.disconnect(),Ae.delete(e))}function Re(e,t,n,o,r,i,a){const{elb:s,settings:c}=e;if(ue(t)&&t.startsWith("walker "))return s(t,n);if(ce(t)){const e=t;return e.source||(e.source=De()),e.globals||(e.globals=me(c.prefix,c.scope||document)),s(e)}const[u]=String(ce(t)?t.name:t).split(" ");let l,d=ce(n)?n:{},f={},g=!1;if(se(n)&&(l=n,g=!0),se(r)?l=r:ce(r)&&Object.keys(r).length&&(f=r),l){const e=be(c.prefix||"data-elb",l).find(e=>e.entity===u);e&&(g&&(d=e.data),f=e.context)}"page"===u&&(d.id=d.id||window.location.pathname);const p=me(c.prefix,c.scope);return s({name:String(t||""),data:d,context:f,globals:p,nested:i,custom:a,trigger:ue(o)?o:"",source:De()})}function De(){return{type:"browser",id:window.location.href,previous_id:document.referrer}}var Ie=[],Ne="hover",Xe="load",Te="pulse",Ue="scroll",We="wait";function Be(e,t){t.scope&&function(e,t){const n=t.scope;n&&(n.addEventListener("click",de(function(t){He.call(this,e,t)})),n.addEventListener("submit",de(function(t){Ke.call(this,e,t)})))}(e,t)}function Me(e,t){t.scope&&function(e,t){const n=t.scope;Ie=[];const o=n||document;Pe(o),function(e,t=1e3){Ae.has(e)||Ae.set(e,{observer:$e(e),timers:new WeakMap,duration:t})}(o,1e3);const r=ge(t.prefix,U.Action,!1);o!==document&&Ge(e,o,r,t),o.querySelectorAll(`[${r}]`).forEach(n=>{Ge(e,n,r,t)}),Ie.length&&function(e,t){const n=(e,t)=>e.filter(([e,n])=>{const o=window.scrollY+window.innerHeight,r=e.offsetTop;if(o<r)return!0;const i=e.clientHeight;return!(100*(1-(r+i-o)/(i||1))>=n&&(Fe(t,e,Ue),1))});Le||(Le=function(e,t=1e3){let n=null;return function(...o){if(null===n)return n=setTimeout(()=>{n=null},t),e(...o)}}(function(){Ie=n.call(t,Ie,e)}),t.addEventListener("scroll",Le))}(e,o)}(e,t)}async function Fe(e,t,n){const o=function(e,t,n=U.Prefix){const o=[],{actions:r,nearestOnly:i}=function(e,t,n){let o=t;for(;o;){const t=C(o,ge(e,U.Actions,!1));if(t){const e=he(t);if(e[n])return{actions:e[n],nearestOnly:!1}}const r=C(o,ge(e,U.Action,!1));if(r){const e=he(r);if(e[n]||"click"!==n)return{actions:e[n]||[],nearestOnly:!0}}o=we(e,o)}return{actions:[],nearestOnly:!1}}(n,e,t);return r.length?(r.forEach(r=>{const a=je(r.actionParams||"",",").reduce((e,t)=>(e[fe(t)]=!0,e),{}),s=be(n,e,a,i);if(!s.length){const t="page",o=`[${ge(n,t)}]`,[r,i]=ke(e,o,n,t);s.push({entity:t,data:r,nested:[],context:i})}s.forEach(e=>{o.push({entity:e.entity,action:r.action,data:e.data,trigger:t,context:e.context,nested:e.nested})})}),o):o}(t,n,e.settings.prefix);return Promise.all(o.map(t=>Re(e,{name:`${t.entity} ${t.action}`,...t,trigger:n})))}function Ge(e,t,n,o){const r=C(t,n);r&&Object.values(he(r)).forEach(n=>n.forEach(n=>{switch(n.trigger){case Ne:o=e,t.addEventListener("mouseenter",de(function(e){e.target instanceof Element&&Fe(o,e.target,Ne)}));break;case Xe:!function(e,t){Fe(e,t,Xe)}(e,t);break;case Te:!function(e,t,n=""){setInterval(()=>{document.hidden||Fe(e,t,Te)},parseInt(n||"")||15e3)}(e,t,n.triggerParams);break;case Ue:!function(e,t=""){const n=parseInt(t||"")||50;n<0||n>100||Ie.push([e,n])}(t,n.triggerParams);break;case"impression":qe(e,t);break;case"visible":qe(e,t,{multiple:!0});break;case We:!function(e,t,n=""){setTimeout(()=>Fe(e,t,We),parseInt(n||"")||15e3)}(e,t,n.triggerParams)}var o}))}function He(e,t){Fe(e,t.target,"click")}function Ke(e,t){t.target&&Fe(e,t.target,"submit")}function Je(e,t,n,o){const r=[];let i=!0;n.forEach(e=>{const t=Ye(e)?[...Array.from(e)]:null!=(n=e)&&"object"==typeof n&&"length"in n&&"number"==typeof n.length?Array.from(e):[e];var n;if(Array.isArray(t)&&0===t.length)return;if(Array.isArray(t)&&1===t.length&&!t[0])return;const a=t[0],s=!ce(a)&&ue(a)&&a.startsWith("walker ");if(ce(a)){if("object"==typeof a&&0===Object.keys(a).length)return}else{const e=Array.from(t);if(!ue(e[0])||""===e[0].trim())return;const n="walker run";i&&e[0]===n&&(i=!1)}(o&&s||!o&&!s)&&r.push(t)}),r.forEach(n=>{ze(e,t,n)})}function ze(e,t="data-elb",n){de(()=>{if(Array.isArray(n)){const[o,...r]=n;if(!o||ue(o)&&""===o.trim())return;if(ue(o)&&o.startsWith("walker "))return void e(o,r[0]);Re({elb:e,settings:{prefix:t,scope:document,pageview:!1,session:!1,elb:"",elbLayer:!1}},o,...r)}else if(n&&"object"==typeof n){if(0===Object.keys(n).length)return;e(n)}},()=>{})()}function Ye(e){return null!=e&&"object"==typeof e&&"[object Arguments]"===Object.prototype.toString.call(e)}function Ve(e,t={},n){return function(e={}){const{cb:t,consent:n,collector:o,storage:r}=e;if(!n)return R((r?X:T)(e),o,t);{const r=function(e,t){let n;return(o,r)=>{if(c(n)&&n===(null==o?void 0:o.group))return;n=null==o?void 0:o.group;let i=()=>T(e);return e.consent&&p((s(e.consent)?e.consent:[e.consent]).reduce((e,t)=>({...e,[t]:!0}),{}),r)&&(i=()=>X(e)),R(i(),o,t)}}(e,t),i=(s(n)?n:[n]).reduce((e,t)=>({...e,[t]:r}),{});o?o.command("on","consent",i):q("walker on","consent",i)}}({...t,collector:{push:e,group:void 0,command:n}})}te({},{env:()=>Qe});var Qe={};te(Qe,{push:()=>nt});var Ze=()=>{},et=()=>()=>Promise.resolve({ok:!0,successful:[],queued:[],failed:[]}),tt={error:Ze,info:Ze,debug:Ze,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>tt},nt={get push(){return et()},get command(){return et()},get elb(){return et()},get window(){return{addEventListener:Ze,removeEventListener:Ze,location:{href:"https://example.com/page",pathname:"/page",search:"?query=test",hash:"#section",host:"example.com",hostname:"example.com",origin:"https://example.com",protocol:"https:"},document:{},navigator:{language:"en-US",userAgent:"Mozilla/5.0 (Test)"},screen:{width:1920,height:1080},innerWidth:1920,innerHeight:1080,pageXOffset:0,pageYOffset:0,scrollX:0,scrollY:0}},get document(){return{addEventListener:Ze,removeEventListener:Ze,querySelector:Ze,querySelectorAll:()=>[],getElementById:Ze,getElementsByClassName:()=>[],getElementsByTagName:()=>[],createElement:()=>({setAttribute:Ze,getAttribute:Ze,addEventListener:Ze,removeEventListener:Ze}),body:{appendChild:Ze,removeChild:Ze},documentElement:{scrollTop:0,scrollLeft:0},readyState:"complete",title:"Test Page",referrer:"",cookie:""}},logger:tt},ot=async(e,t)=>{const{elb:n,command:o,window:r,document:i}=t,a=(null==e?void 0:e.settings)||{},s=r||(void 0!==globalThis.window?globalThis.window:void 0),c=i||(void 0!==globalThis.document?globalThis.document:void 0),u=function(e={},t){return{prefix:"data-elb",pageview:!0,session:!0,elb:"elb",elbLayer:"elbLayer",scope:t||void 0,...e}}(a,c),l={settings:u},d={elb:n,settings:u};if(s&&c){if(!1!==u.elbLayer&&n&&function(e,t={}){const n=t.name||"elbLayer",o=t.window||window;if(!o)return;const r=o;r[n]||(r[n]=[]);const i=r[n];i.push=function(...n){if(Ye(n[0])){const o=[...Array.from(n[0])],r=Array.prototype.push.apply(this,[o]);return ze(e,t.prefix,o),r}const o=Array.prototype.push.apply(this,n);return n.forEach(n=>{ze(e,t.prefix,n)}),o},Array.isArray(i)&&i.length>0&&function(e,t="data-elb",n){Je(e,t,n,!0),Je(e,t,n,!1),n.length=0}(e,t.prefix,i)}(n,{name:ue(u.elbLayer)?u.elbLayer:"elbLayer",prefix:u.prefix,window:s}),u.session&&n){const e="boolean"==typeof u.session?{}:u.session;Ve(n,e,o)}await async function(e,t,n){const o=()=>{e(t,n)};"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}(Be,d,u),(()=>{if(Me(d,u),u.pageview){const[e,t]=ye(u.prefix||"data-elb",u.scope);Re(d,"page view",e,"load",t)}})(),ue(u.elb)&&u.elb&&(s[u.elb]=(...e)=>{const[t,n,o,r,i,a]=e;return Re(d,t,n,o,r,i,a)})}return{type:"browser",config:l,push:(...e)=>{const[t,n,o,r,i,a]=e;return Re(d,t,n,o,r,i,a)},destroy:async()=>{c&&Pe(u.scope||c)},on:async(e,t)=>{switch(e){case"consent":if(u.session&&t&&n){const e="boolean"==typeof u.session?{}:u.session;Ve(n,e,o)}break;case"session":case"ready":default:break;case"run":if(c&&s&&(Me(d,u),u.pageview)){const[e,t]=ye(u.prefix||"data-elb",u.scope);Re(d,"page view",e,"load",t)}}}}},rt=Object.defineProperty,it=(e,t)=>{for(var n in t)rt(e,n,{get:t[n],enumerable:!0})},at=!1;function st(e,t={},n){if(t.filter&&!0===j(()=>t.filter(n),()=>!1)())return;const o=function(e){if(u(e)&&l(e.event)){const{event:t,...n}=e;return{name:t,...n}}return s(e)&&e.length>=2?ct(e):null!=(t=e)&&"object"==typeof t&&"length"in t&&"number"==typeof t.length&&t.length>0?ct(Array.from(e)):null;var t}(n);if(!o)return;const r=`${t.prefix||"dataLayer"} ${o.name}`,{name:i,...a}=o,c={name:r,data:a};j(()=>e(c),()=>{})()}function ct(e){const[t,n,o]=e;if(!l(t))return null;let r,i={};switch(t){case"consent":if(!l(n)||e.length<3)return null;if("default"!==n&&"update"!==n)return null;if(!u(o)||null===o)return null;r=`${t} ${n}`,i={...o};break;case"event":if(!l(n))return null;r=n,u(o)&&(i={...o});break;case"config":if(!l(n))return null;r=`${t} ${n}`,u(o)&&(i={...o});break;case"set":if(l(n))r=`${t} ${n}`,u(o)&&(i={...o});else{if(!u(n))return null;r=`${t} custom`,i={...n}}break;default:return null}return{name:r,...i}}it({},{push:()=>ft});var ut=()=>{},lt=()=>()=>Promise.resolve({ok:!0,successful:[],queued:[],failed:[]}),dt={error:ut,info:ut,debug:ut,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>dt},ft={get push(){return lt()},get command(){return lt()},get elb(){return lt()},get window(){return{dataLayer:[],addEventListener:ut,removeEventListener:ut}},logger:dt};function gt(){return["consent","update",{ad_user_data:"granted",ad_personalization:"granted",ad_storage:"denied",analytics_storage:"granted"}]}function pt(){return["consent","default",{ad_storage:"denied",analytics_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"}]}function mt(){return["event","purchase",{transaction_id:"T_12345",value:25.42,currency:"EUR",items:[{item_id:"SKU_12345",item_name:"Product Name",item_category:"Category",quantity:1,price:25.42}]}]}function yt(){return["event","add_to_cart",{currency:"EUR",value:15.25,items:[{item_id:"SKU_12345",item_name:"Product Name",item_variant:"red",quantity:1,price:15.25}]}]}function ht(){return["event","view_item",{currency:"EUR",value:15.25,items:[{item_id:"SKU_12345",item_name:"Product Name",item_category:"Category",price:15.25}]}]}function bt(){return["config","G-XXXXXXXXXX",{page_title:"Custom Page Title",page_location:"https://example.com/page",send_page_view:!1}]}function vt(){return["set",{currency:"EUR",country:"DE"}]}function wt(){return{event:"custom_event",custom_parameter:"custom_value",user_id:"user123"}}it({},{add_to_cart:()=>yt,config:()=>bt,consentDefault:()=>pt,consentUpdate:()=>gt,directDataLayerEvent:()=>wt,purchase:()=>mt,setCustom:()=>vt,view_item:()=>ht});it({},{add_to_cart:()=>jt,config:()=>_t,configGA4:()=>Ot,consentOnlyMapping:()=>xt,consentUpdate:()=>kt,customEvent:()=>Lt,purchase:()=>Et,view_item:()=>St});var kt={name:"walker consent",settings:{command:{map:{functional:{value:!0},analytics:{key:"analytics_storage",fn:e=>"granted"===e},marketing:{key:"ad_storage",fn:e=>"granted"===e}}}}},Et={name:"order complete",data:{map:{id:"transaction_id",total:"value",currency:"currency",nested:{loop:["items",{map:{type:{value:"product"},data:{map:{id:"item_id",name:"item_name",category:"item_category",quantity:"quantity",price:"price"}}}}]}}}},jt={name:"product add",data:{map:{id:"items.0.item_id",name:"items.0.item_name",price:"value",currency:"currency",color:"items.0.item_variant",quantity:"items.0.quantity"}}},St={name:"product view",data:{map:{id:"items.0.item_id",name:"items.0.item_name",category:"items.0.item_category",price:"items.0.price",currency:"currency"}}},Ot={name:"page view",data:{map:{title:"page_title",url:"page_location"}}},Lt={data:{map:{user_id:"user_id",custom_parameter:"custom_parameter"}}},_t={consent:{update:kt},purchase:Et,add_to_cart:jt,view_item:St,"config G-XXXXXXXXXX":Ot,custom_event:Lt,"*":{data:{}}},xt={consent:{update:kt}},At=async(e,t)=>{const{elb:n,window:o}=t,r={name:"dataLayer",prefix:"dataLayer",...null==e?void 0:e.settings},i={settings:r};return o&&(function(e,t){const n=t.settings,o=(null==n?void 0:n.name)||"dataLayer",r=window[o];if(Array.isArray(r)&&!at){at=!0;try{for(const t of r)st(e,n,t)}finally{at=!1}}}(n,i),function(e,t){const n=t.settings,o=(null==n?void 0:n.name)||"dataLayer";window[o]||(window[o]=[]);const r=window[o];if(!Array.isArray(r))return;const i=r.push.bind(r);r.push=function(...t){if(at)return i(...t);at=!0;try{for(const o of t)st(e,n,o)}finally{at=!1}return i(...t)}}(n,i)),{type:"dataLayer",config:i,push:n,destroy:async()=>{const e=r.name||"dataLayer";o&&o[e]&&Array.isArray(o[e])}}};function Ct(){window.dataLayer=window.dataLayer||[];const e=e=>{u(e)&&u(e.source)&&String(e.source.type).includes("dataLayer")||window.dataLayer.push(e)};return{type:"dataLayer",config:{},push:(t,n)=>{e(n.data||t)},pushBatch:t=>{e({name:"batch",batched_event:t.key,events:t.data.length?t.data:t.events})}}}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{browserConfig:()=>qt,collectorConfig:()=>Rt,dataLayerConfig:()=>Pt,settings:()=>$t});var $t={type:"object",properties:{elb:{type:"string",default:"elb",description:"Global function name for event tracking"},name:{type:"string",default:"walkerjs",description:"Global instance name"},run:{type:"boolean",default:!0,description:"Auto-initialize walker.js on load"},browser:{type:"object",default:{run:!0,session:!0,scope:"document.body",pageview:!0},description:"Browser source configuration. Set to false to disable. See browser configuration section below for details."},dataLayer:{type:"object",default:!1,description:"DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below."},collector:{type:"object",default:{},description:"Collector configuration including destinations and consent settings. See collector configuration section below."}}},qt={type:"object",properties:{"browser.run":{type:"boolean",default:!0,description:"Auto-start DOM tracking"},"browser.session":{type:"boolean",default:!0,description:"Enable session tracking"},"browser.scope":{type:"string",default:"document.body",description:"DOM element scope for tracking"},"browser.pageview":{type:"boolean",default:!0,description:"Enable automatic page view events"}}},Pt={type:"object",properties:{dataLayer:{type:"boolean",default:!1,description:"Enable dataLayer integration with defaults"},"dataLayer.name":{type:"string",default:"dataLayer",description:"DataLayer variable name"},"dataLayer.prefix":{type:"string",default:"dataLayer",description:"Event prefix for dataLayer events"}}},Rt={type:"object",properties:{"collector.consent":{type:"object",default:{functional:!0},description:"Default consent state"},"collector.destinations":{type:"object",default:{},description:"Destination configurations. See destinations documentation for available options."}}};if(window&&document){const e=async()=>{let e;const t=document.querySelector("script[data-elbconfig]");if(t){const n=t.getAttribute("data-elbconfig")||"";n.includes(":")?e=$(n):n&&(e=window[n])}e||(e=window.elbConfig),e&&await async function(e={}){const t=a({collector:{destinations:{dataLayer:{code:Ct()}}},browser:{session:!0},dataLayer:!1,elb:"elb",run:!0},e),n={...t.collector,sources:{browser:{code:ot,config:{settings:t.browser},env:{window:"undefined"!=typeof window?window:void 0,document:"undefined"!=typeof document?document:void 0}}}};if(t.dataLayer){const e=u(t.dataLayer)?t.dataLayer:{};n.sources&&(n.sources.dataLayer={code:At,config:{settings:e}})}const o=await Q(n);return"undefined"!=typeof window&&(t.elb&&(window[t.elb]=o.elb),t.name&&(window[t.name]=o.collector)),o}(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}})();
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=walkerjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walkerjs.d.ts","sourceRoot":"","sources":["../src/walkerjs.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { parseInlineConfig } from '@walkeros/web-core';
2
+ import { createWalkerjs } from './index';
3
+ if (window && document) {
4
+ const initializeWalker = async () => {
5
+ let globalConfig;
6
+ // Check for config from script tag
7
+ const scriptElement = document.querySelector('script[data-elbconfig]');
8
+ if (scriptElement) {
9
+ const configValue = scriptElement.getAttribute('data-elbconfig') || '';
10
+ if (configValue.includes(':')) {
11
+ // Inline config: "elb:track;run:false;instance:myWalker"
12
+ globalConfig = parseInlineConfig(configValue);
13
+ }
14
+ else if (configValue) {
15
+ // Named config: "myWalkerConfig"
16
+ globalConfig = window[configValue];
17
+ }
18
+ }
19
+ // Fallback to window.elbConfig
20
+ if (!globalConfig)
21
+ globalConfig = window.elbConfig;
22
+ // Auto-initialize if config is found
23
+ if (globalConfig) {
24
+ await createWalkerjs(globalConfig);
25
+ }
26
+ };
27
+ // Initialize immediately if DOM is ready, otherwise wait for DOM ready
28
+ if (document.readyState === 'loading') {
29
+ document.addEventListener('DOMContentLoaded', initializeWalker);
30
+ }
31
+ else {
32
+ initializeWalker();
33
+ }
34
+ }
35
+ //# sourceMappingURL=walkerjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walkerjs.js","sourceRoot":"","sources":["../src/walkerjs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;IACvB,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;QAClC,IAAI,YAAgC,CAAC;QAErC,mCAAmC;QACnC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;QACvE,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,WAAW,GAAG,aAAa,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAEvE,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,yDAAyD;gBACzD,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAW,CAAC;YAC1D,CAAC;iBAAM,IAAI,WAAW,EAAE,CAAC;gBACvB,iCAAiC;gBACjC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAW,CAAC;YAC/C,CAAC;QACH,CAAC;QAED,+BAA+B;QAC/B,IAAI,CAAC,YAAY;YAAE,YAAY,GAAG,MAAM,CAAC,SAAmB,CAAC;QAE7D,qCAAqC;QACrC,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,cAAc,CAAC,YAAY,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CAAC;IAEF,uEAAuE;IACvE,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACtC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,gBAAgB,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walkeros/walker.js",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "Ready-to-use walkerOS bundle with browser source, collector, and dataLayer support",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -38,11 +38,11 @@
38
38
  "preview": "npm run build && npx serve -l 3333 examples"
39
39
  },
40
40
  "dependencies": {
41
- "@walkeros/core": "0.4.2",
42
- "@walkeros/collector": "0.4.2",
43
- "@walkeros/web-core": "0.4.2",
44
- "@walkeros/web-source-browser": "0.4.2",
45
- "@walkeros/web-source-datalayer": "0.4.2"
41
+ "@walkeros/core": "0.5.0",
42
+ "@walkeros/collector": "0.5.0",
43
+ "@walkeros/web-core": "0.5.0",
44
+ "@walkeros/web-source-browser": "0.5.0",
45
+ "@walkeros/web-source-datalayer": "0.5.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@swc/jest": "^0.2.36",