@blotoutio/providers-listrak-sdk 0.26.5 → 0.26.6

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/index.cjs.js ADDED
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ const init = ({ getEdgeData }) => {
4
+ var _a, _b;
5
+ if (!window || !window._ltk || !getEdgeData) {
6
+ return;
7
+ }
8
+ if (!((_b = (_a = window._ltk) === null || _a === void 0 ? void 0 : _a.Customer) === null || _b === void 0 ? void 0 : _b.Email)) {
9
+ getEdgeData(['email'], (data) => {
10
+ var _a, _b, _c;
11
+ if (!data || !data['email']) {
12
+ return;
13
+ }
14
+ if ((_a = window._ltk) === null || _a === void 0 ? void 0 : _a.SCA) {
15
+ window._ltk.SCA.Meta5 = 'blotout';
16
+ (_c = (_b = window._ltk.SCA).Update) === null || _c === void 0 ? void 0 : _c.call(_b, 'email', data['email']);
17
+ }
18
+ });
19
+ }
20
+ };
21
+
22
+ const user = ({ data }) => {
23
+ var _a, _b, _c, _d, _e;
24
+ if (!window || !window._ltk || !data) {
25
+ return;
26
+ }
27
+ if (!((_b = (_a = window._ltk) === null || _a === void 0 ? void 0 : _a.Customer) === null || _b === void 0 ? void 0 : _b.Email) && data['email']) {
28
+ if ((_c = window._ltk) === null || _c === void 0 ? void 0 : _c.SCA) {
29
+ window._ltk.SCA.Meta5 = 'blotout';
30
+ }
31
+ (_e = (_d = window._ltk.SCA) === null || _d === void 0 ? void 0 : _d.Update) === null || _e === void 0 ? void 0 : _e.call(_d, 'email', data['email']);
32
+ }
33
+ };
34
+
35
+ const getCookieValue = (key) => {
36
+ try {
37
+ if (!document || !document.cookie) {
38
+ return '';
39
+ }
40
+ const name = `${key}=`;
41
+ const decodedCookie = decodeURIComponent(document.cookie);
42
+ const ca = decodedCookie.split(';');
43
+ for (let i = 0; i < ca.length; i++) {
44
+ let c = ca[i];
45
+ while (c.charAt(0) === ' ') {
46
+ c = c.substring(1);
47
+ }
48
+ if (c.indexOf(name) === 0) {
49
+ return c.substring(name.length, c.length);
50
+ }
51
+ }
52
+ return '';
53
+ }
54
+ catch {
55
+ return '';
56
+ }
57
+ };
58
+
59
+ const tag = () => {
60
+ const isLoaded = window && window._ltk && !!getCookieValue('usid');
61
+ return {
62
+ loaded: isLoaded,
63
+ sdkVersion: "0.26.6" ,
64
+ };
65
+ };
66
+
67
+ const data = {
68
+ name: 'listrak',
69
+ user,
70
+ init,
71
+ tag,
72
+ };
73
+ try {
74
+ if (window) {
75
+ if (!window.edgetagProviders) {
76
+ window.edgetagProviders = [];
77
+ }
78
+ window.edgetagProviders.push(data);
79
+ }
80
+ }
81
+ catch {
82
+ // No window
83
+ }
84
+
85
+ module.exports = data;
package/index.js CHANGED
@@ -61,7 +61,7 @@ var ProvidersListrakSdk = (function () {
61
61
  const isLoaded = window && window._ltk && !!getCookieValue('usid');
62
62
  return {
63
63
  loaded: isLoaded,
64
- sdkVersion: "0.26.5" ,
64
+ sdkVersion: "0.26.6" ,
65
65
  };
66
66
  };
67
67
 
package/index.mjs ADDED
@@ -0,0 +1,83 @@
1
+ const init = ({ getEdgeData }) => {
2
+ var _a, _b;
3
+ if (!window || !window._ltk || !getEdgeData) {
4
+ return;
5
+ }
6
+ if (!((_b = (_a = window._ltk) === null || _a === void 0 ? void 0 : _a.Customer) === null || _b === void 0 ? void 0 : _b.Email)) {
7
+ getEdgeData(['email'], (data) => {
8
+ var _a, _b, _c;
9
+ if (!data || !data['email']) {
10
+ return;
11
+ }
12
+ if ((_a = window._ltk) === null || _a === void 0 ? void 0 : _a.SCA) {
13
+ window._ltk.SCA.Meta5 = 'blotout';
14
+ (_c = (_b = window._ltk.SCA).Update) === null || _c === void 0 ? void 0 : _c.call(_b, 'email', data['email']);
15
+ }
16
+ });
17
+ }
18
+ };
19
+
20
+ const user = ({ data }) => {
21
+ var _a, _b, _c, _d, _e;
22
+ if (!window || !window._ltk || !data) {
23
+ return;
24
+ }
25
+ if (!((_b = (_a = window._ltk) === null || _a === void 0 ? void 0 : _a.Customer) === null || _b === void 0 ? void 0 : _b.Email) && data['email']) {
26
+ if ((_c = window._ltk) === null || _c === void 0 ? void 0 : _c.SCA) {
27
+ window._ltk.SCA.Meta5 = 'blotout';
28
+ }
29
+ (_e = (_d = window._ltk.SCA) === null || _d === void 0 ? void 0 : _d.Update) === null || _e === void 0 ? void 0 : _e.call(_d, 'email', data['email']);
30
+ }
31
+ };
32
+
33
+ const getCookieValue = (key) => {
34
+ try {
35
+ if (!document || !document.cookie) {
36
+ return '';
37
+ }
38
+ const name = `${key}=`;
39
+ const decodedCookie = decodeURIComponent(document.cookie);
40
+ const ca = decodedCookie.split(';');
41
+ for (let i = 0; i < ca.length; i++) {
42
+ let c = ca[i];
43
+ while (c.charAt(0) === ' ') {
44
+ c = c.substring(1);
45
+ }
46
+ if (c.indexOf(name) === 0) {
47
+ return c.substring(name.length, c.length);
48
+ }
49
+ }
50
+ return '';
51
+ }
52
+ catch {
53
+ return '';
54
+ }
55
+ };
56
+
57
+ const tag = () => {
58
+ const isLoaded = window && window._ltk && !!getCookieValue('usid');
59
+ return {
60
+ loaded: isLoaded,
61
+ sdkVersion: "0.26.6" ,
62
+ };
63
+ };
64
+
65
+ const data = {
66
+ name: 'listrak',
67
+ user,
68
+ init,
69
+ tag,
70
+ };
71
+ try {
72
+ if (window) {
73
+ if (!window.edgetagProviders) {
74
+ window.edgetagProviders = [];
75
+ }
76
+ window.edgetagProviders.push(data);
77
+ }
78
+ }
79
+ catch {
80
+ // No window
81
+ }
82
+
83
+ export { data as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-listrak-sdk",
3
- "version": "0.26.5",
3
+ "version": "0.26.6",
4
4
  "description": "Listrak Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",
@@ -8,13 +8,16 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "main": "./index.js",
11
+ "main": "./index.cjs.js",
12
+ "module": "./index.mjs",
12
13
  "repository": {
13
14
  "type": "git",
14
15
  "url": "git+https://github.com/blotoutio/edgetag-sdk.git"
15
16
  },
16
17
  "files": [
17
18
  "index.js",
19
+ "index.cjs.js",
20
+ "index.mjs",
18
21
  "package.json",
19
22
  "README.md"
20
23
  ]