@blotoutio/providers-listrak-sdk 0.26.5 → 0.27.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.
package/index.cjs.js ADDED
@@ -0,0 +1,61 @@
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 tag = () => {
36
+ const isLoaded = window && window._ltk;
37
+ return {
38
+ loaded: isLoaded,
39
+ sdkVersion: "0.27.0" ,
40
+ };
41
+ };
42
+
43
+ const data = {
44
+ name: 'listrak',
45
+ user,
46
+ init,
47
+ tag,
48
+ };
49
+ try {
50
+ if (window) {
51
+ if (!window.edgetagProviders) {
52
+ window.edgetagProviders = [];
53
+ }
54
+ window.edgetagProviders.push(data);
55
+ }
56
+ }
57
+ catch {
58
+ // No window
59
+ }
60
+
61
+ module.exports = data;
package/index.js CHANGED
@@ -33,35 +33,11 @@ var ProvidersListrakSdk = (function () {
33
33
  }
34
34
  };
35
35
 
36
- const getCookieValue = (key) => {
37
- try {
38
- if (!document || !document.cookie) {
39
- return '';
40
- }
41
- const name = `${key}=`;
42
- const decodedCookie = decodeURIComponent(document.cookie);
43
- const ca = decodedCookie.split(';');
44
- for (let i = 0; i < ca.length; i++) {
45
- let c = ca[i];
46
- while (c.charAt(0) === ' ') {
47
- c = c.substring(1);
48
- }
49
- if (c.indexOf(name) === 0) {
50
- return c.substring(name.length, c.length);
51
- }
52
- }
53
- return '';
54
- }
55
- catch {
56
- return '';
57
- }
58
- };
59
-
60
36
  const tag = () => {
61
- const isLoaded = window && window._ltk && !!getCookieValue('usid');
37
+ const isLoaded = window && window._ltk;
62
38
  return {
63
39
  loaded: isLoaded,
64
- sdkVersion: "0.26.5" ,
40
+ sdkVersion: "0.27.0" ,
65
41
  };
66
42
  };
67
43
 
package/index.mjs ADDED
@@ -0,0 +1,59 @@
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 tag = () => {
34
+ const isLoaded = window && window._ltk;
35
+ return {
36
+ loaded: isLoaded,
37
+ sdkVersion: "0.27.0" ,
38
+ };
39
+ };
40
+
41
+ const data = {
42
+ name: 'listrak',
43
+ user,
44
+ init,
45
+ tag,
46
+ };
47
+ try {
48
+ if (window) {
49
+ if (!window.edgetagProviders) {
50
+ window.edgetagProviders = [];
51
+ }
52
+ window.edgetagProviders.push(data);
53
+ }
54
+ }
55
+ catch {
56
+ // No window
57
+ }
58
+
59
+ 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.27.0",
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
  ]