@epigraph/epigraph-std-lib 5.0.0-alpha.14 → 5.0.0-alpha.16
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.
- package/README.md +68 -68
- package/dist/Epigraph/epigraph.cjs +1 -1
- package/dist/Epigraph/epigraph.js +94 -126
- package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
- package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
- package/dist/EpigraphLibs/EpigraphAnalytics/consent-plugins/auto-consent-resolver.d.ts +21 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/consent-plugins/one-trust-consent-plugin.d.ts +1 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.d.ts +14 -5
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -1057
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.d.ts +6 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.d.ts +1 -0
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
- package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
- package/dist/enums-BSSe4NAs.js +8 -0
- package/dist/enums-PfFMiIoe.cjs +1 -0
- package/dist/epigraph-std-lib.cjs +1 -1
- package/dist/epigraph-std-lib.js +11 -74
- package/dist/epigraphAnalytics-CADAVr-I.cjs +1 -0
- package/dist/epigraphAnalytics-Dv5dGbcW.js +851 -0
- package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
- package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
- package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
- package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
- package/dist/lit--5TUYSGn.js +508 -0
- package/dist/lit-DZtv4Pds.cjs +2 -0
- package/package.json +40 -40
- package/dist/enums-1vqWxJ0i.cjs +0 -1
- package/dist/enums-CvOTKyNu.js +0 -5
- package/dist/lit-element-C3moVMGu.js +0 -524
- package/dist/lit-element-CYaaFRfk.cjs +0 -19
|
@@ -1,78 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import m from "qr-creator";
|
|
4
|
-
var f = Object.defineProperty, c = (i, t, e, n) => {
|
|
5
|
-
for (var r = void 0, a = i.length - 1, o; a >= 0; a--)
|
|
6
|
-
(o = i[a]) && (r = o(t, e, r) || r);
|
|
7
|
-
return r && f(t, e, r), r;
|
|
8
|
-
};
|
|
9
|
-
class s extends d {
|
|
10
|
-
static {
|
|
11
|
-
this.webComponentName = "epigraph-qr-code-generator";
|
|
12
|
-
}
|
|
13
|
-
static {
|
|
14
|
-
this.styles = l`
|
|
15
|
-
:host {
|
|
16
|
-
display: none;
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
}
|
|
20
|
-
get qrCodeGenCanvasRef() {
|
|
21
|
-
return this._qrCodeGenCanvasRef;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Converts any given data uri to a blob.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} dataUri Raw data URI, either fetched from an HTML Canvas or any other valid source.
|
|
27
|
-
* @returns {Blob} The generate blob.
|
|
28
|
-
*/
|
|
29
|
-
dataUritoBlob(t) {
|
|
30
|
-
const e = t.split(",");
|
|
31
|
-
if (e.length !== 2)
|
|
32
|
-
throw new Error("Invalid data URI format");
|
|
33
|
-
const n = e[0].split(":")[1].split(";")[0], r = atob(e[1]), a = new Uint8Array(Array.from(r, (o) => o.charCodeAt(0)));
|
|
34
|
-
return new Blob([a], { type: n });
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Generates a QR code as image data url for the qrCodeContent provided.
|
|
38
|
-
*
|
|
39
|
-
* @param {string} qrCodeContent The content to be embedded in the QR code.
|
|
40
|
-
* @returns {string} Session data URL for the generated QR code.
|
|
41
|
-
*/
|
|
42
|
-
generateQrCode(t = {
|
|
43
|
-
text: "www.epigraph.us",
|
|
44
|
-
radius: 0.5,
|
|
45
|
-
// 0.0 to 0.5
|
|
46
|
-
ecLevel: "H",
|
|
47
|
-
// L, M, Q, H
|
|
48
|
-
fill: "black",
|
|
49
|
-
// foreground color
|
|
50
|
-
background: null,
|
|
51
|
-
// color or null for transparent
|
|
52
|
-
size: 256
|
|
53
|
-
// in pixels
|
|
54
|
-
}) {
|
|
55
|
-
if (!this._qrCodeGenCanvasRef)
|
|
56
|
-
return "";
|
|
57
|
-
m.render(t, this._qrCodeGenCanvasRef);
|
|
58
|
-
const e = this._qrCodeGenCanvasRef.toDataURL(), n = this.dataUritoBlob(e);
|
|
59
|
-
return URL.createObjectURL(n);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Override for the LitElement's render method.
|
|
63
|
-
*
|
|
64
|
-
* @returns {html} HTML to be rendered by this component.
|
|
65
|
-
*/
|
|
66
|
-
render() {
|
|
67
|
-
return C`
|
|
68
|
-
<canvas id="qrCodeCanvas"></canvas>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
c([
|
|
73
|
-
p("#qrCodeCanvas")
|
|
74
|
-
], s.prototype, "_qrCodeGenCanvasRef");
|
|
75
|
-
window.customElements.get(s.webComponentName) === void 0 && window.customElements.define(s.webComponentName, s);
|
|
76
|
-
export {
|
|
77
|
-
s as EpigraphQrCodeGenerator
|
|
78
|
-
};
|
|
1
|
+
import { t as e } from "../../epigraphQrCodeGenerator-BXUNL2XK.js";
|
|
2
|
+
export { e as EpigraphQrCodeGenerator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=class{constructor(e,t,n,r=``){this._success=e,this._payload=t,this._status=n,this._message=r}get success(){return this._success}get payload(){return this._payload}get status(){return this._status}get message(){return this._message}};function t(t,n,r=``){return new e(!0,t,n,r)}function n(t,n,r=``){return new e(!1,t,n,r)}exports.Result=e,exports.failureResult=n,exports.successResult=t;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
//#region lib/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
constructor(e, t, n, r = "") {
|
|
4
|
+
this._success = e, this._payload = t, this._status = n, this._message = r;
|
|
5
|
+
}
|
|
6
|
+
get success() {
|
|
7
|
+
return this._success;
|
|
8
|
+
}
|
|
9
|
+
get payload() {
|
|
10
|
+
return this._payload;
|
|
11
|
+
}
|
|
12
|
+
get status() {
|
|
13
|
+
return this._status;
|
|
14
|
+
}
|
|
15
|
+
get message() {
|
|
16
|
+
return this._message;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function t(t, n, r = "") {
|
|
20
|
+
return new e(!0, t, n, r);
|
|
20
21
|
}
|
|
21
|
-
function n(
|
|
22
|
-
|
|
22
|
+
function n(t, n, r = "") {
|
|
23
|
+
return new e(!1, t, n, r);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
n as failureResult,
|
|
27
|
-
c as successResult
|
|
28
|
-
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { e as Result, n as failureResult, t as successResult };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../epigraphUnitsConverter-CwpmWl7p.cjs");exports.Distance=e.t,exports.DistanceUnits=e.n,exports.UnitTypes=e.r;
|
|
@@ -1,88 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
r[`${e.millimeter}-${e.meter}`] = 1e-3;
|
|
4
|
-
r[`${e.meter}-${e.millimeter}`] = 1e3;
|
|
5
|
-
r[`${e.centimeter}-${e.meter}`] = 0.01;
|
|
6
|
-
r[`${e.meter}-${e.centimeter}`] = 100;
|
|
7
|
-
r[`${e.decimeter}-${e.meter}`] = 0.1;
|
|
8
|
-
r[`${e.meter}-${e.decimeter}`] = 10;
|
|
9
|
-
r[`${e.meter}-${e.meter}`] = 1;
|
|
10
|
-
r[`${e.decameter}-${e.meter}`] = 10;
|
|
11
|
-
r[`${e.meter}-${e.decameter}`] = 0.1;
|
|
12
|
-
r[`${e.hectometer}-${e.meter}`] = 100;
|
|
13
|
-
r[`${e.meter}-${e.hectometer}`] = 0.01;
|
|
14
|
-
r[`${e.kilometer}-${e.meter}`] = 1e3;
|
|
15
|
-
r[`${e.meter}-${e.kilometer}`] = 1e-3;
|
|
16
|
-
r[`${e.inch}-${e.meter}`] = 0.0254;
|
|
17
|
-
r[`${e.meter}-${e.inch}`] = 39.3701;
|
|
18
|
-
r[`${e.foot}-${e.meter}`] = 0.3048;
|
|
19
|
-
r[`${e.meter}-${e.foot}`] = 3.28084;
|
|
20
|
-
r[`${e.yard}-${e.meter}`] = 0.9144;
|
|
21
|
-
r[`${e.meter}-${e.yard}`] = 1.09361;
|
|
22
|
-
r[`${e.mile}-${e.meter}`] = 1609.34;
|
|
23
|
-
r[`${e.meter}-${e.mile}`] = 621371e-9;
|
|
24
|
-
class m {
|
|
25
|
-
constructor(l, i) {
|
|
26
|
-
if (this._type = o.DISTANCE, this._rawValue = l, this._rawValueUnit = i, i !== e.meter) {
|
|
27
|
-
const u = m.convert(this._rawValue, i, e.meter);
|
|
28
|
-
this._rawValue = u.value, this._rawValueUnit = u.valueUnit;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
get type() {
|
|
32
|
-
return this._type;
|
|
33
|
-
}
|
|
34
|
-
static buildConvertedUnitResult(l, i) {
|
|
35
|
-
return {
|
|
36
|
-
value: l,
|
|
37
|
-
valueUnit: i,
|
|
38
|
-
valueWithUnit: `${l.toFixed(2)}${i}`
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
static convert(l, i, u) {
|
|
42
|
-
let a = l, $ = u;
|
|
43
|
-
if (i === u)
|
|
44
|
-
return m.buildConvertedUnitResult(a, $);
|
|
45
|
-
const n = r[`${i}-${u}`];
|
|
46
|
-
return a = l * n, m.buildConvertedUnitResult(a, $);
|
|
47
|
-
}
|
|
48
|
-
/** ----------------- METRIC UNITS ----------------- */
|
|
49
|
-
get inMillimeters() {
|
|
50
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.millimeter);
|
|
51
|
-
}
|
|
52
|
-
get inCentimeters() {
|
|
53
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.centimeter);
|
|
54
|
-
}
|
|
55
|
-
get inDecimeters() {
|
|
56
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.decimeter);
|
|
57
|
-
}
|
|
58
|
-
get inMeters() {
|
|
59
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.meter);
|
|
60
|
-
}
|
|
61
|
-
get inDecameters() {
|
|
62
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.decameter);
|
|
63
|
-
}
|
|
64
|
-
get inHectometers() {
|
|
65
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.hectometer);
|
|
66
|
-
}
|
|
67
|
-
get inKilometers() {
|
|
68
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.kilometer);
|
|
69
|
-
}
|
|
70
|
-
/** ----------------- METRIC UNITS ----------------- */
|
|
71
|
-
get inInches() {
|
|
72
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.inch);
|
|
73
|
-
}
|
|
74
|
-
get inFeet() {
|
|
75
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.foot);
|
|
76
|
-
}
|
|
77
|
-
get inYard() {
|
|
78
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.yard);
|
|
79
|
-
}
|
|
80
|
-
get inMiles() {
|
|
81
|
-
return m.convert(this._rawValue, this._rawValueUnit, e.mile);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export {
|
|
85
|
-
m as Distance,
|
|
86
|
-
e as DistanceUnits,
|
|
87
|
-
o as UnitTypes
|
|
88
|
-
};
|
|
1
|
+
import { n as e, r as t, t as n } from "../../epigraphUnitsConverter-DsX4Rmsp.js";
|
|
2
|
+
export { n as Distance, e as DistanceUnits, t as UnitTypes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=function(e){return e.AR=`ar`,e}({}),t=function(e){return e.type=`t`,e.identifierType=`idt`,e.identifier=`id`,e.epigraphSessionId=`eid`,e.action=`a`,e.sharedConfig=`sc`,e}({}),n=class{constructor(e=window.location.href){this._baseUrl=e}get baseUrl(){return this._baseUrl}set baseUrl(e){this._baseUrl=e}getParameterInUrl(e){let t=new URL(this._baseUrl),n=t.searchParams.get(e);return n||=this.decryptQueryParametersInUrl(t).searchParams.get(e),n}hasParameterInUrl(e){return!!this.getParameterInUrl(e)}generateQrCodeUrl(e={},t=!0){let n=new URL(this._baseUrl);for(let[t,r]of Object.entries(e))n.searchParams.set(t,r);return t&&this.encryptQueryParametersInUrl(n),n}encryptQueryParametersInUrl(e){return e.search=btoa(e.search),e}decryptQueryParametersInUrl(e){let t=e;try{e.search=atob(e.search.slice(1)),t=e}catch(t){window.epigraph.logger.info({title:`Couldn't decode URL: ${e}`,details:t})}return t}};exports.EpigraphUrlProcessor=n,exports.QUERY_PARAMETER_ACTION_NAMES=e,exports.QUERY_PARAMETER_NAMES=t;
|
|
@@ -1,76 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
for (const [s, n] of Object.entries(e))
|
|
44
|
-
t.searchParams.set(s, n);
|
|
45
|
-
return a && this.encryptQueryParametersInUrl(t), t;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Encrypts the query parameters in a given URL object using base64 encoding.
|
|
49
|
-
*
|
|
50
|
-
* @param {URL} url The original url object with query parameters.
|
|
51
|
-
* @returns {URL} Process URL object with encrypted parameters
|
|
52
|
-
*/
|
|
53
|
-
encryptQueryParametersInUrl(e) {
|
|
54
|
-
return e.search = btoa(e.search), e;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Decrypts the query parameters in a given URL object using base64 encoding.
|
|
58
|
-
*
|
|
59
|
-
* @param {URL} url The original url object with query parameters.
|
|
60
|
-
* @returns {URL} Process URL object with decrypted parameters
|
|
61
|
-
*/
|
|
62
|
-
decryptQueryParametersInUrl(e) {
|
|
63
|
-
let a = e;
|
|
64
|
-
try {
|
|
65
|
-
e.search = atob(e.search.slice(1)), a = e;
|
|
66
|
-
} catch (t) {
|
|
67
|
-
window.epigraph.logger.info({ title: `Couldn't decode URL: ${e}`, details: t });
|
|
68
|
-
}
|
|
69
|
-
return a;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
l as EpigraphUrlProcessor,
|
|
74
|
-
i as QUERY_PARAMETER_ACTION_NAMES,
|
|
75
|
-
c as QUERY_PARAMETER_NAMES
|
|
1
|
+
//#region lib/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.AR = "ar", e;
|
|
4
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.type = "t", e.identifierType = "idt", e.identifier = "id", e.epigraphSessionId = "eid", e.action = "a", e.sharedConfig = "sc", e;
|
|
6
|
+
}({}), n = class {
|
|
7
|
+
constructor(e = window.location.href) {
|
|
8
|
+
this._baseUrl = e;
|
|
9
|
+
}
|
|
10
|
+
get baseUrl() {
|
|
11
|
+
return this._baseUrl;
|
|
12
|
+
}
|
|
13
|
+
set baseUrl(e) {
|
|
14
|
+
this._baseUrl = e;
|
|
15
|
+
}
|
|
16
|
+
getParameterInUrl(e) {
|
|
17
|
+
let t = new URL(this._baseUrl), n = t.searchParams.get(e);
|
|
18
|
+
return n ||= this.decryptQueryParametersInUrl(t).searchParams.get(e), n;
|
|
19
|
+
}
|
|
20
|
+
hasParameterInUrl(e) {
|
|
21
|
+
return !!this.getParameterInUrl(e);
|
|
22
|
+
}
|
|
23
|
+
generateQrCodeUrl(e = {}, t = !0) {
|
|
24
|
+
let n = new URL(this._baseUrl);
|
|
25
|
+
for (let [t, r] of Object.entries(e)) n.searchParams.set(t, r);
|
|
26
|
+
return t && this.encryptQueryParametersInUrl(n), n;
|
|
27
|
+
}
|
|
28
|
+
encryptQueryParametersInUrl(e) {
|
|
29
|
+
return e.search = btoa(e.search), e;
|
|
30
|
+
}
|
|
31
|
+
decryptQueryParametersInUrl(e) {
|
|
32
|
+
let t = e;
|
|
33
|
+
try {
|
|
34
|
+
e.search = atob(e.search.slice(1)), t = e;
|
|
35
|
+
} catch (t) {
|
|
36
|
+
window.epigraph.logger.info({
|
|
37
|
+
title: `Couldn't decode URL: ${e}`,
|
|
38
|
+
details: t
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
}
|
|
76
43
|
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { n as EpigraphUrlProcessor, e as QUERY_PARAMETER_ACTION_NAMES, t as QUERY_PARAMETER_NAMES };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region lib/Epigraph/constants/enums.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.DEVELOPMENT = "development", e.STAGING = "staging", e.PRODUCTION = "production", e;
|
|
4
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.PRODUCTION = "https://api.myepigraph.com/api/", e.STAGING = "https://nexus.epigraph.dev/api/", e.STAGING_CANARY = "https://staging-canary.epigraph.dev/api/", e.LOCAL = "https://nexus.test/api/", e;
|
|
6
|
+
}({});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as n, e as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=function(e){return e.DEVELOPMENT=`development`,e.STAGING=`staging`,e.PRODUCTION=`production`,e}({}),t=function(e){return e.PRODUCTION=`https://api.myepigraph.com/api/`,e.STAGING=`https://nexus.epigraph.dev/api/`,e.STAGING_CANARY=`https://staging-canary.epigraph.dev/api/`,e.LOCAL=`https://nexus.test/api/`,e}({});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./epigraphQrCodeGenerator-F2eLrPC_.cjs"),t=require("./EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),n=require("./enums-PfFMiIoe.cjs"),r=require("./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs"),i=require("./Epigraph/epigraph.cjs"),a=require("./Epigraph/epigraphBaseSolutions.cjs"),o=require("./epigraphAnalytics-CADAVr-I.cjs"),s=require("./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs"),c=require("./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs"),l=require("./epigraphUnitsConverter-CwpmWl7p.cjs");exports.ACTION_PERFORMED=o.n,exports.AutoConsentResolver=o.F,exports.BUTTON_TYPE=o.r,exports.CONTENT_TYPES=o.i,exports.CURRENCY=o.a,exports.ConsentPluginNames=o.I,exports.Distance=l.t,exports.DistanceUnits=l.n,exports.ENVIRONMENT_TYPE=n.t,exports.Epigraph=i.Epigraph,exports.EpigraphAddToFavouritesEvent=o.o,exports.EpigraphAnalytics=o.t,exports.EpigraphArRequestedEvent=o.s,exports.EpigraphBaseSolutionHtmlElement=a.EpigraphBaseSolutionHtmlElement,exports.EpigraphBaseSolutionLitElement=a.EpigraphBaseSolutionLitElement,exports.EpigraphButtonClickEvent=o.c,exports.EpigraphChangeRateEvent=o.l,exports.EpigraphCheckoutEvent=o.u,exports.EpigraphCompletionRateEvent=o.d,exports.EpigraphContentSharedEvent=o.f,exports.EpigraphConversionEvent=o.p,exports.EpigraphCustomEvent=o.m,exports.EpigraphEngagementRateEvent=o.h,exports.EpigraphItemAddedEvent=o.g,exports.EpigraphItemMovedEvent=o._,exports.EpigraphItemRemovedEvent=o.v,exports.EpigraphKeyboardInteractionEvent=o.y,exports.EpigraphLogger=t.EpigraphLogger,exports.EpigraphModuleClosedEvent=o.b,exports.EpigraphModuleFailedEvent=o.x,exports.EpigraphModuleLoadingEvent=o.S,exports.EpigraphModuleReadyEvent=o.C,exports.EpigraphNexusAPI=c.EpigraphNexusAPI,exports.EpigraphPanelClosedEvent=o.w,exports.EpigraphPanelOpenedEvent=o.T,exports.EpigraphQrCodeGenerator=e.t,exports.EpigraphSupportDetectedEvent=o.E,exports.EpigraphTouchInteractionEvent=o.D,exports.EpigraphUrlProcessor=r.EpigraphUrlProcessor,exports.EpigraphVariantChangedEvent=o.O,exports.GA4AnalyticsPlugin=o.B,exports.HTTPMethod=c.HTTPMethod,exports.LogTypes=t.LogTypes,exports.LoggerModeNames=t.LoggerModeNames,exports.MODULE_FAILED_ERRORS=o.k,exports.NexusAPIResourceIdentifier=c.NexusAPIResourceIdentifier,exports.NexusAPIRoutes=c.NexusAPIRoutes,exports.NexusAPIVersions=c.NexusAPIVersions,exports.NexusAnalyticsPlugin=o.z,exports.NexusEndpoints=n.n,exports.NexusSolutionsAnalyticsPlugin=o.R,exports.OneTrustConsentPlugin=o.L,exports.PANEL_TYPE=o.A,exports.QUERY_PARAMETER_ACTION_NAMES=r.QUERY_PARAMETER_ACTION_NAMES,exports.QUERY_PARAMETER_NAMES=r.QUERY_PARAMETER_NAMES,exports.Result=s.Result,exports.SHARE_DESTINATIONS=o.j,exports.SUPPORT_TYPE=o.M,exports.TRIGGER_SOURCE=o.N,exports.UnitTypes=l.r,exports.VARIANT_CHANGE_TYPES=o.P,exports.failureResult=s.failureResult,exports.successResult=s.successResult;
|
package/dist/epigraph-std-lib.js
CHANGED
|
@@ -1,74 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Result as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export {
|
|
12
|
-
a as ACTION_PERFORMED,
|
|
13
|
-
i as BUTTON_TYPE,
|
|
14
|
-
g as CONTENT_TYPES,
|
|
15
|
-
s as CURRENCY,
|
|
16
|
-
h as ConsentPluginNames,
|
|
17
|
-
ge as Distance,
|
|
18
|
-
se as DistanceUnits,
|
|
19
|
-
Ae as ENVIRONMENT_TYPE,
|
|
20
|
-
t as Epigraph,
|
|
21
|
-
u as EpigraphAddToFavouritesEvent,
|
|
22
|
-
l as EpigraphAnalytics,
|
|
23
|
-
R as EpigraphArRequestedEvent,
|
|
24
|
-
r as EpigraphBaseSolutionHtmlElement,
|
|
25
|
-
n as EpigraphBaseSolutionLitElement,
|
|
26
|
-
d as EpigraphButtonClickEvent,
|
|
27
|
-
v as EpigraphChangeRateEvent,
|
|
28
|
-
A as EpigraphCheckoutEvent,
|
|
29
|
-
T as EpigraphCompletionRateEvent,
|
|
30
|
-
N as EpigraphContentSharedEvent,
|
|
31
|
-
P as EpigraphConversionEvent,
|
|
32
|
-
m as EpigraphCustomEvent,
|
|
33
|
-
C as EpigraphEngagementRateEvent,
|
|
34
|
-
I as EpigraphItemAddedEvent,
|
|
35
|
-
x as EpigraphItemMovedEvent,
|
|
36
|
-
_ as EpigraphItemRemovedEvent,
|
|
37
|
-
c as EpigraphKeyboardInteractionEvent,
|
|
38
|
-
w as EpigraphLogger,
|
|
39
|
-
S as EpigraphModuleClosedEvent,
|
|
40
|
-
M as EpigraphModuleFailedEvent,
|
|
41
|
-
O as EpigraphModuleLoadingEvent,
|
|
42
|
-
f as EpigraphModuleReadyEvent,
|
|
43
|
-
X as EpigraphNexusAPI,
|
|
44
|
-
U as EpigraphPanelClosedEvent,
|
|
45
|
-
Y as EpigraphPanelOpenedEvent,
|
|
46
|
-
pe as EpigraphQrCodeGenerator,
|
|
47
|
-
y as EpigraphSupportDetectedEvent,
|
|
48
|
-
L as EpigraphTouchInteractionEvent,
|
|
49
|
-
le as EpigraphUrlProcessor,
|
|
50
|
-
D as EpigraphVariantChangedEvent,
|
|
51
|
-
G as GA4AnalyticsPlugin,
|
|
52
|
-
Z as HTTPMethod,
|
|
53
|
-
z as LogTypes,
|
|
54
|
-
J as LoggerModeNames,
|
|
55
|
-
B as MODULE_FAILED_ERRORS,
|
|
56
|
-
$ as NexusAPIResourceIdentifier,
|
|
57
|
-
ee as NexusAPIRoutes,
|
|
58
|
-
Ee as NexusAPIVersions,
|
|
59
|
-
F as NexusAnalyticsPlugin,
|
|
60
|
-
Te as NexusEndpoints,
|
|
61
|
-
H as NexusSolutionsAnalyticsPlugin,
|
|
62
|
-
V as OneTrustConsentPlugin,
|
|
63
|
-
Q as PANEL_TYPE,
|
|
64
|
-
Re as QUERY_PARAMETER_ACTION_NAMES,
|
|
65
|
-
de as QUERY_PARAMETER_NAMES,
|
|
66
|
-
ne as Result,
|
|
67
|
-
k as SHARE_DESTINATIONS,
|
|
68
|
-
b as SUPPORT_TYPE,
|
|
69
|
-
q as TRIGGER_SOURCE,
|
|
70
|
-
he as UnitTypes,
|
|
71
|
-
K as VARIANT_CHANGE_TYPES,
|
|
72
|
-
oe as failureResult,
|
|
73
|
-
ae as successResult
|
|
74
|
-
};
|
|
1
|
+
import { EpigraphLogger as e, LogTypes as t, LoggerModeNames as n } from "./EpigraphLibs/EpigraphLogger/epigraphLogger.js";
|
|
2
|
+
import { n as r, t as i } from "./enums-BSSe4NAs.js";
|
|
3
|
+
import { EpigraphUrlProcessor as a, QUERY_PARAMETER_ACTION_NAMES as o, QUERY_PARAMETER_NAMES as s } from "./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
|
|
4
|
+
import { Epigraph as c } from "./Epigraph/epigraph.js";
|
|
5
|
+
import { EpigraphBaseSolutionHtmlElement as l, EpigraphBaseSolutionLitElement as u } from "./Epigraph/epigraphBaseSolutions.js";
|
|
6
|
+
import { A as d, B as f, C as p, D as m, E as h, F as g, I as _, L as v, M as y, N as b, O as x, P as S, R as C, S as w, T, _ as E, a as D, b as O, c as k, d as A, f as j, g as M, h as N, i as P, j as F, k as I, l as L, m as R, n as z, o as B, p as V, r as H, s as U, t as W, u as G, v as K, w as q, x as J, y as Y, z as X } from "./epigraphAnalytics-Dv5dGbcW.js";
|
|
7
|
+
import { Result as Z, failureResult as Q, successResult as $ } from "./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js";
|
|
8
|
+
import { EpigraphNexusAPI as ee, HTTPMethod as te, NexusAPIResourceIdentifier as ne, NexusAPIRoutes as re, NexusAPIVersions as ie } from "./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js";
|
|
9
|
+
import { t as ae } from "./epigraphQrCodeGenerator-BXUNL2XK.js";
|
|
10
|
+
import { n as oe, r as se, t as ce } from "./epigraphUnitsConverter-DsX4Rmsp.js";
|
|
11
|
+
export { z as ACTION_PERFORMED, g as AutoConsentResolver, H as BUTTON_TYPE, P as CONTENT_TYPES, D as CURRENCY, _ as ConsentPluginNames, ce as Distance, oe as DistanceUnits, i as ENVIRONMENT_TYPE, c as Epigraph, B as EpigraphAddToFavouritesEvent, W as EpigraphAnalytics, U as EpigraphArRequestedEvent, l as EpigraphBaseSolutionHtmlElement, u as EpigraphBaseSolutionLitElement, k as EpigraphButtonClickEvent, L as EpigraphChangeRateEvent, G as EpigraphCheckoutEvent, A as EpigraphCompletionRateEvent, j as EpigraphContentSharedEvent, V as EpigraphConversionEvent, R as EpigraphCustomEvent, N as EpigraphEngagementRateEvent, M as EpigraphItemAddedEvent, E as EpigraphItemMovedEvent, K as EpigraphItemRemovedEvent, Y as EpigraphKeyboardInteractionEvent, e as EpigraphLogger, O as EpigraphModuleClosedEvent, J as EpigraphModuleFailedEvent, w as EpigraphModuleLoadingEvent, p as EpigraphModuleReadyEvent, ee as EpigraphNexusAPI, q as EpigraphPanelClosedEvent, T as EpigraphPanelOpenedEvent, ae as EpigraphQrCodeGenerator, h as EpigraphSupportDetectedEvent, m as EpigraphTouchInteractionEvent, a as EpigraphUrlProcessor, x as EpigraphVariantChangedEvent, f as GA4AnalyticsPlugin, te as HTTPMethod, t as LogTypes, n as LoggerModeNames, I as MODULE_FAILED_ERRORS, ne as NexusAPIResourceIdentifier, re as NexusAPIRoutes, ie as NexusAPIVersions, X as NexusAnalyticsPlugin, r as NexusEndpoints, C as NexusSolutionsAnalyticsPlugin, v as OneTrustConsentPlugin, d as PANEL_TYPE, o as QUERY_PARAMETER_ACTION_NAMES, s as QUERY_PARAMETER_NAMES, Z as Result, F as SHARE_DESTINATIONS, y as SUPPORT_TYPE, b as TRIGGER_SOURCE, se as UnitTypes, S as VARIANT_CHANGE_TYPES, Q as failureResult, $ as successResult };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./enums-PfFMiIoe.cjs");var t=function(e){return e.UNAVAILABLE=`unavailable`,e.AVAILABLE=`available`,e.RESTRICTED=`restricted`,e}({}),n=Symbol(`data`),r=Symbol(`next`),i=class e{constructor(e){this[n]=e,this[r]=null}get data(){return this[n]}set next(t){if(!(t instanceof e)&&t!==null)throw Error(`This node is not an instance of the custom class 'Node'.`);this[r]=t}get next(){return this[r]}},a=Symbol(`head`),o=class{constructor(){this[a]=null}set head(e){this[a]=e}get head(){return this[a]}addToTail(e){let t=this.head;if(t){for(;t.next!==null;)t=t?.next;return t.next=new i(e)}return this.head=new i(e)}removeHead(){let e=this.head;if(e)return this.head=e.next,e.data}},s=Symbol(`queue`),c=Symbol(`size`),l=class{constructor(){this[s]=new o,this[c]=0}get queue(){return this[s]}get size(){return this[c]}enqueue(e){this.queue.addToTail(e),this[c]++}dequeue(){let e=this.queue.removeHead();return this[c]--,e}},u=class{static{this.NOTIFICATION_NAME=`epg-notification`}static{this.ACTION_SEND_EVENT=`send-event`}static{this.ACTION_INITIALIZED=`initialized`}static{this.ACTION_FAILED_INITIALIZATION=`initialization-failed`}constructor(e,t,n,r,i,a){this._pluginName=e,this._trackingId=t,this._experienceId=n,this._solution=r,this._initializer=i,this._status=a}updateStatus(e){this._status=e}updateInitializer(e){this._initializer=e}notify(e,t){let n={pluginName:this._pluginName,trackingId:this._trackingId,experienceId:this._experienceId,solution:this._solution,initializer:this._initializer,status:this._status,action:e,eventDetails:t};window.dispatchEvent(new CustomEvent(`epg-notification`,{detail:n}))}},d=class{constructor({trackingID:e,experienceID:n,solution:r,verboseLogging:i=!1}){this.__status=t.UNAVAILABLE,this.__sentEventCount=0,this.__initializationAttempts=0,this.__lastInitializationAttempt=performance.now(),this.__maxInitializationAttempts=10,this.__initializationRetryDelay=2e3,this.__maxQueuedEvents=200,this.__isInitialized=!1,this.__initializationMethod=`NONE`,this.__nexusFailureReported=!1,this.name=this.pluginName=`GA4-PLUGIN`,this.trackingID=e,this.experienceID=n,this.solution=r,this.verboseLogging=i,this.__queue=new l,this.__epigraphNotifier=new u(this.pluginName,this.pluginName,this.experienceID,this.solution,this.__initializationMethod,this.__status),this.initializePlugin()}setTrackingID(e){if(!e)return;let t=this.trackingID!==e;this.trackingID=e,t&&this.__isInitialized&&(this.resetInitialization(),this.initializePlugin())}setExperienceID(e){this.experienceID=e}setSolution(e){this.solution=e}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.trackingID}`}setupPlugin(){this.__isInitialized&&this.dataLayer!==void 0&&this.dequeueAndSendEvents()}async sendEvent(e,n){if(this.__queue.size>=this.__maxQueuedEvents&&this.__queue.dequeue(),this.__queue.enqueue(e),!n){this.setStatus(t.RESTRICTED);return}if(this.__status===t.RESTRICTED&&this.__isInitialized&&this.setStatus(t.AVAILABLE),this.__isInitialized||this.initializePlugin(),!this.__isInitialized){this.logger(`Cannot send analytics event: dataLayer not defined or plugin not initialized.`);return}try{await this.dequeueAndSendEvents()}catch(e){this.logger(e),await this.reportFailureToNexus(`EVENT_SEND_ERROR`,e?.toString()||`Unknown error`)}}resetInitialization(){this.__isInitialized=!1,this.__status=t.UNAVAILABLE,this.dataLayer=void 0,this.dataLayerName=void 0,this.__initializationMethod=`NONE`,this.__initializationAttempts=0,this.__nexusFailureReported=!1,this.__epigraphNotifier.updateStatus(this.__status)}initializePlugin(){if(this.__isInitialized)return;let e=performance.now();if(this.__initializationAttempts>0&&e-this.__lastInitializationAttempt<this.__initializationRetryDelay)return;this.__lastInitializationAttempt=e,this.__initializationAttempts++;let n=this.detectAndSetupAnalytics();n.success?(this.__isInitialized=!0,this.setStatus(t.AVAILABLE),this.__initializationMethod=n.method,this.dataLayerName=n.dataLayerName,this.dataLayer=window[this.dataLayerName]=window[this.dataLayerName]||[],this.logger(`Successfully initialized ${n.method} with dataLayer: ${this.dataLayerName}`),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{}),this.__queue.size>0&&this.dequeueAndSendEvents()):(this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${n.error}`),this.__initializationAttempts<this.__maxInitializationAttempts?setTimeout(()=>{this.initializePlugin()},this.__initializationRetryDelay):this.__nexusFailureReported||(this.reportFailureToNexus(`MAX_INITIALIZATION_ATTEMPTS`,`Maximum initialization attempts reached`),this.__nexusFailureReported=!0,this.__epigraphNotifier.notify(u.ACTION_FAILED_INITIALIZATION,{})))}detectAndSetupAnalytics(){let e=this.detectGTM();if(e)return this.logger(`GTM detected with container ID: ${e.containerId}`),this.__epigraphNotifier.updateInitializer(`GTM`),{success:!0,method:`GTM`,dataLayerName:e.dataLayerName};let t=this.findGA4Info(this.trackingID);if(t){let e=t.l||`dataLayer`;return this.logger(`GA4 script found, setting up with dataLayer: ${e}`),this.__epigraphNotifier.updateInitializer(`GA4`),{success:!0,method:`GA4`,dataLayerName:e}}return{success:!1,method:`NONE`,dataLayerName:`dataLayer`,error:`No analytics setup found and unable to create one`}}detectGTM(){let e=window.google_tag_manager;if(e){let t=Object.keys(e).find(e=>e.startsWith(`GTM-`));if(t)return{containerId:t,dataLayerName:this.getRuntimeDataLayerName(e[t])||`dataLayer`}}let t=document.querySelectorAll(`script[src*="gtm.js?id="]`);for(let e of Array.from(t)){let t=e.getAttribute(`src`);if(t){let e=t.match(/gtm\.js\?id=([^&]+)/);if(e&&e.length>0){let n=t.match(/&l=([^&]+)/),r=n?n[1]:`dataLayer`;return{containerId:e[1],dataLayerName:r}}}}return null}getRuntimeDataLayerName(e){let t=e?.dataLayer?.name??e?.dataLayerName;return typeof t==`string`&&t.length>0?t:void 0}async dequeueAndSendEvents(){if(!this.__isInitialized||!this.dataLayer)return;let e=this.__queue.size;for(let t=0;t<e;t++){let e=this.__queue.dequeue();try{this.__initializationMethod===`GTM`?(this.sendGTMEvent(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__initializationMethod===`GA4`?(this.sendGA4Event(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__queue.enqueue(e)}catch(t){this.logger(`Error sending event ${e.eventName}: ${t}`),this.__queue.enqueue(e)}}}async sendGTMEvent(e){let t=e.getGTMParameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGTMParametersToEpgEventTag(e.eventName,t)),this.dataLayer&&(this.dataLayer.push(t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n))}async sendGA4Event(e){let t=e.getGa4Parameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGA4ParametersToEpgEventTag(t));let r=this.dataLayer;r&&((function(...e){r.push(arguments)})(`event`,e.eventName,t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n))}isValidPayload(e){if(Object.keys(e).length>=25)return!1;for(let[t,n]of Object.entries(e))if(t!==`items`&&(t.length>40||String(n).length>100))return!1;return!0}async convertGTMParametersToEpgEventTag(e,t){try{return{event:e,epg_event_tag:await this.sendGA4LongParameters(t),send_to:this.trackingID}}catch{return t}}async convertGA4ParametersToEpgEventTag(e){try{return{epg_event_tag:await this.sendGA4LongParameters(e),send_to:this.trackingID}}catch{return e}}logger(e){this.verboseLogging&&console.warn(e)}async sendGA4LongParameters(e){let t={parameters:e};try{let e=await fetch(`https://api.myepigraph.com/api/analytics/ga4/custom`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return e.ok?(await e.json())?.id??``:``}catch{return``}}async reportFailureToNexus(e,t){try{let n={plugin:`GA4`,trackingId:this.trackingID,solution:this.solution,experienceId:this.experienceID,failureType:e,errorMessage:t,timestamp:new Date().toISOString(),url:window.location.href,userAgent:navigator.userAgent};this.logger(`Failure reported to Nexus: ${JSON.stringify(n)}`)}catch(e){this.logger(`Error reporting failure to Nexus: ${e}`)}}findGA4Info(e){if(window.google_tag_manager&&window.google_tag_manager[e])return{fullSrc:``,id:e,l:this.getRuntimeDataLayerName(window.google_tag_manager[e])};let t=document.querySelectorAll(`script[src]`);for(let n of t){let t=n.getAttribute(`src`);if(t&&t.includes(e)){let e=new URL(t,location.href),n=Object.fromEntries(e.searchParams.entries());return{fullSrc:e.href,id:n.id||void 0,l:n.l||void 0}}}return null}},f=class{constructor({trackingID:n,experienceID:r,solution:i,sessionId:a,xPath:o,verboseLogging:s=!1,baseUrl:c=e.n.PRODUCTION}){this.__status=t.UNAVAILABLE,this.__sentEventCount=0,this.__maxQueuedEvents=200,this.sessionId=a,this.xPath=o,this.name=this.pluginName=`NEXUS-PLUGIN`,this.trackingID=n,this.experienceID=r,this.solution=i,this.verboseLogging=s,this.__queue=new l,this.url=`${c}analytics/event`,this.__status=t.AVAILABLE,this.__epigraphNotifier=new u(this.pluginName,this.trackingID,this.experienceID,this.solution,`NEXUS`,this.__status),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{})}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return this.name+`-`+this.trackingID}setupPlugin(){}async sendEvent(e,n){if(this.__queue.size>=this.__maxQueuedEvents&&this.__queue.dequeue(),this.__queue.enqueue(e),!n){this.setStatus(t.RESTRICTED);return}this.__status===t.RESTRICTED&&this.setStatus(t.AVAILABLE),await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(let e=0;e<this.__queue.size;e++){let e=this.__queue.dequeue(),t={send_to:this.trackingID,experience_id:this.experienceID,solution:this.solution,event:e.eventName,parameters:e.getNexusParameters()};try{return(await fetch(this.url,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"EPG-SESSION-ID":this.sessionId,"EPG-XPATH":this.xPath,Origin:typeof window<`u`?window.location.origin:``},body:JSON.stringify(t)})).ok&&this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,t),``}catch{return``}this.__sentEventCount++}return``}},p=class{constructor({productId:n,identifier:r,identifierType:i,experienceType:a,renderMode:o=`geo`,sessionId:s,xPath:c,solution:d=``,verboseLogging:f=!1,baseUrl:p=e.n.PRODUCTION}){if(this.experienceID=``,this.__status=t.UNAVAILABLE,this.__sentEventCount=0,n<=0)throw Error(`NexusSolutionsAnalyticsPlugin requires a valid productId greater than 0.`);this.sessionId=s,this.xPath=c,this.name=this.pluginName=`NEXUS-SOLUTIONS-PLUGIN`,this.verboseLogging=f,this.__queue=new l,this.productId=n,this.identifier=r,this.identifierType=i,this.experienceType=a,this.renderMode=o,this.solution=d,this.trackingID=String(n),this.url=`${p}analytics/event`,this.__status=t.AVAILABLE,this.__epigraphNotifier=new u(this.pluginName,this.trackingID,`${r}@${i}`,this.solution,`NEXUS-SOLUTIONS`,this.__status),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{})}setProductId(e){e<=0||(this.productId=e,this.trackingID=String(e))}setIdentifier(e){this.identifier=e}setIdentifierType(e){this.identifierType=e}setExperienceType(e){this.experienceType=e}setRenderMode(e){this.renderMode=e}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.sessionId}`}setupPlugin(){}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED,this.__epigraphNotifier.updateStatus(this.__status);return}await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(;this.__queue.size>0;){let e=this.__queue.dequeue(),t={action:e.eventName,product_id:this.productId,identifier:this.identifier,identifier_type:this.identifierType,experience_type:this.experienceType,render_mode:this.renderMode,parameters:e.getNexusParameters()};try{(await fetch(this.url,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"EPG-SESSION-ID":this.sessionId,"EPG-XPATH":this.xPath,Origin:typeof window<`u`?window.location.origin:``},body:JSON.stringify(t)})).ok&&(this.__sentEventCount++,this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,t))}catch{return}}}},m=class{constructor(e){this.consentSet=!1,this.consent=!1,this.pluginName=`OneTrustConsentPlugin`,this.consentIdentifier=e,this.consent=!1,this.addConsentChangedListener()}hasConsent(){if(this.consentSet)return this.consent;if(window.OnetrustActiveGroups!==void 0){let e=String(window.OnetrustActiveGroups).split(`,`);this.consent=e.includes(this.consentIdentifier),this.consentSet=!0}return this.consent}addConsentChangedListener(){this.hasConsent(),this.registerOnConsentChanged(20)}registerOnConsentChanged(e){if(window.OneTrust!==void 0&&typeof window.OneTrust==`object`&&typeof window.OneTrust.OnConsentChanged==`function`){window.OneTrust.OnConsentChanged(()=>{this.consentSet=!1,this.hasConsent()});return}e>0&&setTimeout(()=>this.registerOnConsentChanged(e-1),1e3)}},h=function(e){return e.OneTrust=`onetrust`,e}({}),g=class{resolve(){let e=this.readGoogleConsentMode();if(e!==`unknown`)return e;let t=this.readCookiebot();return t===`unknown`?this.readOneTrust():t}readGoogleConsentMode(){let e=window.google_tag_data?.ics;if(!e||e.active!==!0||!e.entries)return`unknown`;let t=e.entries.analytics_storage;return t?typeof t.update==`boolean`?t.update?`granted`:`denied`:typeof t.default==`boolean`?t.default?`granted`:`denied`:`unknown`:`unknown`}readCookiebot(){let e=window.Cookiebot;return!e||!e.consent||e.hasResponse!==!0?`unknown`:e.consent.statistics===!0?`granted`:`denied`}readOneTrust(){let e=window.OnetrustActiveGroups;return typeof e!=`string`||e.length===0?`unknown`:e.split(`,`).includes(`C0002`)?`granted`:`denied`}},_=class{constructor({eventName:e,interactiveEvent:t,customParameters:n}){this.eventName=e,this.interactiveEvent=t,this.customParameters=n}getGa4Parameters(e,t,n){let r={solution:e,experience_id:t,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getGTMParameters(e,t,n){let r={solution:e,experience_id:t,event:this.eventName,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getNexusParameters(){let e={interactive_event:this.interactiveEvent};return e=Object.assign(e,JSON.parse(JSON.stringify(this.customParameters))),e}},v=function(e){return e.VARIANT=`variant`,e.CATEGORY_VARIANT=`category_variant`,e.GEOMETRY=`geometry`,e.CATEGORY_GEOMETRY=`category_geometry`,e.GLOBAL=`global`,e}({}),y=function(e){return e.AR=`ar`,e.QR=`qr`,e.INFO=`info`,e.INSTRUCTIONS=`instructions`,e.DOWNLOAD=`download`,e.PREVIEW_CART=`preview_cart`,e.HOTSPOT_PANEL=`hotspot_panel`,e.SHARE_MODAL=`share_modal`,e.RESTART_MODAL=`restart_modal`,e.REMOVE_MODAL=`remove_modal`,e.LOAD_PRECONFIG_MODAL=`load_preconfig_modal`,e.MOVE_MODAL=`move_modal`,e.OUT_OF_STOCK_MODAL=`out_of_stock_modal`,e}({}),b=function(e){return e.NETWORK=`network`,e.EXPERIENCE_CONFIG_ERROR=`experience-config-error`,e.SCENE_LOAD_ERROR=`scene-load-error`,e.INITIAL_SCENE_LOAD_ERROR=`initial-scene-load-error`,e.AUTHENTICATION_FAILED=`authentication-failed`,e}({}),x=function(e){return e.AUTO=`auto`,e.BUTTON=`button`,e.HOTSPOT=`hotspot`,e.GESTURE=`gesture`,e}({}),S=function(e){return e.USD=`USD`,e.EUR=`EUR`,e.GBP=`GBP`,e.CAD=`CAD`,e}({}),C=function(e){return e.AR=`ar`,e.QR=`qr`,e.AR_WEBGL2=`ar-webgl2`,e.QR_WEBGL2=`qr-webgl2`,e}({}),w=function(e){return e.AR_VIEW=`ar_view`,e.DIMENSION_TOGGLE=`dimension_toggle`,e.HOTSPOTS_TOGGLE=`hotspots_toggle`,e.HELP_TOGGLE=`help_toggle`,e.UTILITY_MENU_TOGGLE=`utility_menu_toggle`,e.HOTSPOT_ENTER=`hotspot_enter`,e.HOTSPOT_EXIT=`hotspot_exit`,e.SHARE=`share`,e.PDF_DOWNLOAD=`pdf_download`,e.COPY=`copy`,e.RESTART=`restart`,e.INSTRUCTIONS_SHOW=`show_instructions`,e.REVIEW_CART=`review_cart`,e.SHOP_NOW=`shop_now`,e.SUB_CATEGORY=`sub_category`,e.NEXT_STEP=`next_step`,e.PREVIOUS_STEP=`previous_step`,e}({}),T=function(e){return e.ZOOM=`zoom`,e.ROTATE=`rotate`,e.PAN=`pan`,e}({}),E=function(e){return e.CONFIGURATION=`configuration`,e.SCENE=`scene`,e.PRODUCT=`product`,e}({}),D=function(e){return e.FACEBOOK=`facebook`,e.TWITTER=`twitter`,e.EMAIL=`email`,e.COPY_LINK=`copy_link`,e.WHATSAPP=`whatsapp`,e.LINKEDIN=`linkedin`,e}({}),O=class extends _{constructor(e){super({eventName:`epigraph_ar_requested`,interactiveEvent:!0,customParameters:{items:e}})}},k=class extends _{constructor(e){super({eventName:`epigraph_module_loading`,interactiveEvent:!1,customParameters:{is_pre_config:e}})}},A=class extends _{constructor(e,t){super({eventName:`epigraph_module_ready`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t}})}},j=class extends _{static{this.MODULE_FAILED_ERRORS=b}constructor(e,t,n){super({eventName:`epigraph_module_failed`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t,error_type:n}})}},M=class extends _{constructor(e){super({eventName:`epigraph_module_closed`,interactiveEvent:!0,customParameters:{items:e}})}},N=class extends _{static{this.SUPPORT_TYPE=C}constructor(e){super({eventName:`epigraph_support_detected`,interactiveEvent:!1,customParameters:{support_type:e}})}},P=class extends _{static{this.BUTTON_TYPE=w}constructor(e,t){super({eventName:`epigraph_button_click`,interactiveEvent:!0,customParameters:{button_type:e,button_name:t}})}},F=class extends _{static{this.PANEL_TYPE=y}static{this.TRIGGER_SOURCE=x}constructor(e,t,n,r){super({eventName:`epigraph_panel_opened`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},I=class extends _{static{this.PANEL_TYPE=y}static{this.TRIGGER_SOURCE=x}constructor(e,t,n,r){super({eventName:`epigraph_panel_closed`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},L=class extends _{constructor(e){super({eventName:`epigraph_add_to_favourites`,interactiveEvent:!0,customParameters:{items:e}})}},R=class extends _{static{this.ACTION_PERFORMED=T}constructor(e){super({eventName:`epigraph_keyboard_interaction`,interactiveEvent:!0,customParameters:{action_performed:e}})}},z=class extends _{static{this.INTERACTION_TYPE=T}constructor(e){super({eventName:`epigraph_touch_interaction`,interactiveEvent:!0,customParameters:{interaction_type:e}})}},B=class extends _{static{this.CURRENCY=S}constructor(e,t,n,r,i){super({eventName:`epigraph_item_added`,interactiveEvent:e,customParameters:{items:i,value:t,currency:n,quantity:r}})}},V=class extends _{constructor(e){super({eventName:`epigraph_item_moved`,interactiveEvent:!0,customParameters:{items:e}})}},H=class extends _{static{this.CURRENCY=S}constructor(e,t,n,r){super({eventName:`epigraph_item_removed`,interactiveEvent:!0,customParameters:{items:r,value:e,currency:t,quantity:n}})}},U=class extends _{static{this.VARIANT_CHANGE_TYPES=v}constructor(e,t){super({eventName:`epigraph_variant_changed`,interactiveEvent:!0,customParameters:{items:t,change_type:e}})}},W=class extends _{static{this.CONTENT_TYPES=E}static{this.SHARE_DESTINATIONS=D}constructor(e,t,n){super({eventName:`epigraph_content_shared`,interactiveEvent:!0,customParameters:{items:n,content_type:e,share_destination:t}})}},G=class extends _{static{this.CURRENCY=S}constructor(e,t,n){super({eventName:`epigraph_checkout`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},K=class extends _{static{this.CURRENCY=S}constructor(e,t,n){super({eventName:`epigraph_conversion`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},q=class extends _{constructor(e){super({eventName:`epigraph_changeRate`,interactiveEvent:!1,customParameters:{value:e}})}},J=class extends _{constructor(e){super({eventName:`epigraph_completionRate`,interactiveEvent:!1,customParameters:{value:e}})}},Y=class extends _{constructor(e){super({eventName:`epigraph_engagementRate`,interactiveEvent:!1,customParameters:{value:e}})}},X=class extends _{constructor(e,t,n){super({eventName:e,interactiveEvent:t,customParameters:n})}},Z=Symbol(`analyticsPluginsMap`),Q=class{constructor(e,n,r){this[Z]=new Map,this.__consentPlugin=null,this.__autoConsentResolver=new g,this.__onConsentChangeFromEvent=e=>{let n=e;this.__overrideConsent=n.detail.hasConsent;for(let e of this[Z].values())this.__resolveConsent()!==`granted`&&e.setStatus(t.RESTRICTED)},this.__defaultConsent=r?.defaultConsent??!0,e&&n&&(this.__consentPlugin=this.buildConsentPlugin(e,n)),window.addEventListener(`epigraphAnalyticsConsentChange`,this.__onConsentChangeFromEvent)}addEventPlugin(e){this[Z].has(e.getUniquePluginIdentifier())||(this[Z].set(e.getUniquePluginIdentifier(),e),e.setupPlugin())}__resolveConsent(){if(this.__overrideConsent!==void 0)return this.__overrideConsent?`granted`:`denied`;if(this.__consentPlugin)return this.__consentPlugin.hasConsent()?`granted`:`denied`;let e=this.__autoConsentResolver.resolve();return e===`unknown`?this.__defaultConsent?`granted`:`unknown`:e}sendEvent(e){let n=this.__resolveConsent();if(n===`denied`){this[Z].forEach(e=>{e.setStatus(t.RESTRICTED)});return}this[Z].forEach(t=>{t.sendEvent(e,n===`granted`)})}buildConsentPlugin(e,t){return e.toLowerCase()===h.OneTrust.toLowerCase()?new m(t):null}};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return f}});
|