@c15t/scripts 2.0.0 → 2.1.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.
Files changed (110) hide show
  1. package/README.md +9 -9
  2. package/dist/e2e-test-utils.cjs +125 -0
  3. package/dist/e2e-test-utils.js +67 -0
  4. package/dist/engine/runtime.cjs +19 -9
  5. package/dist/engine/runtime.js +19 -9
  6. package/dist/registry.cjs +338 -0
  7. package/dist/registry.js +292 -0
  8. package/dist/types.cjs +18 -0
  9. package/dist/types.js +10 -1
  10. package/dist/vendors/_shared/attributes.cjs +51 -0
  11. package/dist/vendors/_shared/attributes.js +14 -0
  12. package/dist/vendors/_shared/google-consent.cjs +64 -0
  13. package/dist/vendors/_shared/google-consent.js +27 -0
  14. package/dist/vendors/_shared/install-builders.cjs +55 -0
  15. package/dist/vendors/_shared/install-builders.js +21 -0
  16. package/dist/vendors/_shared/script-url.cjs +74 -0
  17. package/dist/vendors/_shared/script-url.js +28 -0
  18. package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +2 -2
  19. package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
  20. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +202 -0
  21. package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
  22. package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +31 -14
  23. package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
  24. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +147 -0
  25. package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
  26. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +127 -0
  27. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
  28. package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +2 -2
  29. package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
  30. package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +6 -3
  31. package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
  32. package/dist/vendors/analytics/ahrefs-analytics.cjs +64 -0
  33. package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
  34. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +69 -0
  35. package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
  36. package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +3 -3
  37. package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
  38. package/dist/vendors/analytics/fathom-analytics.cjs +72 -0
  39. package/dist/vendors/analytics/fathom-analytics.js +35 -0
  40. package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +7 -28
  41. package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
  42. package/dist/vendors/analytics/hotjar.cjs +81 -0
  43. package/dist/vendors/analytics/hotjar.js +44 -0
  44. package/dist/vendors/analytics/matomo-analytics.cjs +228 -0
  45. package/dist/vendors/analytics/matomo-analytics.js +191 -0
  46. package/dist/vendors/analytics/microsoft-clarity.cjs +110 -0
  47. package/dist/vendors/analytics/microsoft-clarity.js +73 -0
  48. package/dist/vendors/analytics/mixpanel-analytics.cjs +119 -0
  49. package/dist/vendors/analytics/mixpanel-analytics.js +82 -0
  50. package/dist/vendors/analytics/plausible-analytics.cjs +118 -0
  51. package/dist/vendors/analytics/plausible-analytics.js +81 -0
  52. package/dist/{posthog.cjs → vendors/analytics/posthog.cjs} +69 -6
  53. package/dist/vendors/analytics/posthog.js +163 -0
  54. package/dist/vendors/analytics/promptwatch.cjs +66 -0
  55. package/dist/vendors/analytics/promptwatch.js +29 -0
  56. package/dist/vendors/analytics/rybbit-analytics.cjs +100 -0
  57. package/dist/vendors/analytics/rybbit-analytics.js +63 -0
  58. package/dist/vendors/analytics/segment.cjs +93 -0
  59. package/dist/vendors/analytics/segment.js +56 -0
  60. package/dist/vendors/analytics/umami-analytics.cjs +76 -0
  61. package/dist/vendors/analytics/umami-analytics.js +39 -0
  62. package/dist/vendors/analytics/vercel-analytics.cjs +90 -0
  63. package/dist/vendors/analytics/vercel-analytics.js +53 -0
  64. package/dist/vendors/functional/crisp.cjs +139 -0
  65. package/dist/vendors/functional/crisp.js +102 -0
  66. package/dist/vendors/functional/intercom.cjs +85 -0
  67. package/dist/vendors/functional/intercom.js +45 -0
  68. package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +6 -27
  69. package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
  70. package/dist-types/__tests__/helpers.d.ts +141 -0
  71. package/dist-types/engine/runtime.d.ts +1 -1
  72. package/dist-types/registry.d.ts +368 -0
  73. package/dist-types/types.d.ts +13 -0
  74. package/dist-types/vendors/_shared/attributes.d.ts +35 -0
  75. package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
  76. package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
  77. package/dist-types/vendors/_shared/script-url.d.ts +75 -0
  78. package/dist-types/{linkedin-insights.d.ts → vendors/ads-and-pixels/linkedin-insights.d.ts} +22 -9
  79. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
  80. package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +21 -10
  81. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
  82. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
  83. package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +20 -5
  84. package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +21 -4
  85. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
  86. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
  87. package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
  88. package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +5 -8
  89. package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
  90. package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
  91. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +86 -0
  92. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +101 -0
  93. package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
  94. package/dist-types/{posthog.d.ts → vendors/analytics/posthog.d.ts} +47 -5
  95. package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
  96. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
  97. package/dist-types/vendors/analytics/segment.d.ts +158 -0
  98. package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
  99. package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
  100. package/dist-types/vendors/functional/crisp.d.ts +78 -0
  101. package/dist-types/vendors/functional/intercom.d.ts +135 -0
  102. package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +5 -8
  103. package/package.json +166 -5
  104. package/dist/meta-pixel.cjs +0 -129
  105. package/dist/meta-pixel.js +0 -89
  106. package/dist/posthog.js +0 -100
  107. package/dist-types/engine.test.d.ts +0 -1
  108. package/dist-types/helpers.test.d.ts +0 -1
  109. package/dist-types/meta-pixel.d.ts +0 -185
  110. /package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +0 -0
@@ -0,0 +1,39 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ import { booleanDataAttribute, listDataAttribute } from "../_shared/attributes.js";
4
+ import { resolveScriptUrl } from "../_shared/script-url.js";
5
+ const umamiAnalyticsManifest = {
6
+ ...vendorManifestContract,
7
+ vendor: 'umami-analytics',
8
+ category: 'measurement',
9
+ install: [
10
+ {
11
+ type: 'loadScript',
12
+ src: "{{scriptUrl}}",
13
+ defer: true,
14
+ attributes: {
15
+ 'data-website-id': '{{websiteId}}',
16
+ 'data-host-url': '{{hostUrl}}',
17
+ 'data-auto-track': '{{autoTrackAttribute}}',
18
+ 'data-domains': '{{domains}}',
19
+ 'data-tag': '{{tag}}',
20
+ 'data-before-send': '{{beforeSend}}'
21
+ }
22
+ }
23
+ ]
24
+ };
25
+ function umamiAnalytics(options) {
26
+ const websiteId = options.websiteId.trim();
27
+ if (0 === websiteId.length) throw new Error('umamiAnalytics: invalid websiteId - must be a non-empty string');
28
+ const resolved = resolveManifest(umamiAnalyticsManifest, {
29
+ websiteId,
30
+ hostUrl: options.hostUrl,
31
+ autoTrackAttribute: booleanDataAttribute(options.autoTrack),
32
+ domains: listDataAttribute(options.domains),
33
+ tag: options.tag,
34
+ beforeSend: options.beforeSend,
35
+ scriptUrl: resolveScriptUrl(options.scriptUrl, "https://cloud.umami.is/script.js")
36
+ });
37
+ return resolved;
38
+ }
39
+ export { umamiAnalytics, umamiAnalyticsManifest };
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ vercelAnalyticsManifest: ()=>vercelAnalyticsManifest,
28
+ vercelAnalytics: ()=>vercelAnalytics
29
+ });
30
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
31
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
32
+ const vercelAnalyticsManifest = {
33
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
34
+ vendor: 'vercel-analytics',
35
+ category: 'measurement',
36
+ bootstrap: [
37
+ {
38
+ type: 'setGlobal',
39
+ name: 'vaq',
40
+ value: [],
41
+ ifUndefined: true
42
+ },
43
+ {
44
+ type: 'defineStubFunction',
45
+ name: 'va',
46
+ queue: {
47
+ global: 'vaq'
48
+ },
49
+ queueFormat: 'array',
50
+ ifUndefined: true
51
+ }
52
+ ],
53
+ install: [
54
+ {
55
+ type: 'loadScript',
56
+ src: "{{scriptUrl}}",
57
+ defer: true,
58
+ attributes: {
59
+ 'data-sdkn': 'c15t',
60
+ 'data-dsn': '{{dsn}}',
61
+ 'data-disable-auto-track': '{{disableAutoTrackAttribute}}',
62
+ 'data-endpoint': '{{endpoint}}'
63
+ }
64
+ }
65
+ ]
66
+ };
67
+ function getVercelScriptUrl(options) {
68
+ if (options.scriptUrl) return options.scriptUrl;
69
+ if ('development' === options.mode || options.debug) return "https://va.vercel-scripts.com/v1/script.debug.js";
70
+ return "https://va.vercel-scripts.com/v1/script.js";
71
+ }
72
+ function vercelAnalytics(options = {}) {
73
+ let disableAutoTrackAttribute;
74
+ if (options.disableAutoTrack) disableAutoTrackAttribute = '1';
75
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(vercelAnalyticsManifest, {
76
+ scriptUrl: getVercelScriptUrl(options),
77
+ dsn: options.dsn,
78
+ endpoint: options.endpoint,
79
+ disableAutoTrackAttribute
80
+ });
81
+ }
82
+ exports.vercelAnalytics = __webpack_exports__.vercelAnalytics;
83
+ exports.vercelAnalyticsManifest = __webpack_exports__.vercelAnalyticsManifest;
84
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
85
+ "vercelAnalytics",
86
+ "vercelAnalyticsManifest"
87
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
88
+ Object.defineProperty(exports, '__esModule', {
89
+ value: true
90
+ });
@@ -0,0 +1,53 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ const vercelAnalyticsManifest = {
4
+ ...vendorManifestContract,
5
+ vendor: 'vercel-analytics',
6
+ category: 'measurement',
7
+ bootstrap: [
8
+ {
9
+ type: 'setGlobal',
10
+ name: 'vaq',
11
+ value: [],
12
+ ifUndefined: true
13
+ },
14
+ {
15
+ type: 'defineStubFunction',
16
+ name: 'va',
17
+ queue: {
18
+ global: 'vaq'
19
+ },
20
+ queueFormat: 'array',
21
+ ifUndefined: true
22
+ }
23
+ ],
24
+ install: [
25
+ {
26
+ type: 'loadScript',
27
+ src: "{{scriptUrl}}",
28
+ defer: true,
29
+ attributes: {
30
+ 'data-sdkn': 'c15t',
31
+ 'data-dsn': '{{dsn}}',
32
+ 'data-disable-auto-track': '{{disableAutoTrackAttribute}}',
33
+ 'data-endpoint': '{{endpoint}}'
34
+ }
35
+ }
36
+ ]
37
+ };
38
+ function getVercelScriptUrl(options) {
39
+ if (options.scriptUrl) return options.scriptUrl;
40
+ if ('development' === options.mode || options.debug) return "https://va.vercel-scripts.com/v1/script.debug.js";
41
+ return "https://va.vercel-scripts.com/v1/script.js";
42
+ }
43
+ function vercelAnalytics(options = {}) {
44
+ let disableAutoTrackAttribute;
45
+ if (options.disableAutoTrack) disableAutoTrackAttribute = '1';
46
+ return resolveManifest(vercelAnalyticsManifest, {
47
+ scriptUrl: getVercelScriptUrl(options),
48
+ dsn: options.dsn,
49
+ endpoint: options.endpoint,
50
+ disableAutoTrackAttribute
51
+ });
52
+ }
53
+ export { vercelAnalytics, vercelAnalyticsManifest };
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ crisp: ()=>crisp,
28
+ crispManifest: ()=>crispManifest
29
+ });
30
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
31
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
32
+ const crispManifest = {
33
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
34
+ vendor: 'crisp',
35
+ category: 'functionality',
36
+ install: [
37
+ {
38
+ type: 'setGlobal',
39
+ name: '$crisp',
40
+ value: [],
41
+ ifUndefined: false
42
+ },
43
+ {
44
+ type: 'setGlobal',
45
+ name: 'CRISP_WEBSITE_ID',
46
+ value: '{{websiteId}}',
47
+ ifUndefined: false
48
+ },
49
+ {
50
+ type: 'loadScript',
51
+ src: "{{scriptSrc}}",
52
+ async: true
53
+ }
54
+ ]
55
+ };
56
+ function createCrispManifest(options) {
57
+ const install = [
58
+ {
59
+ type: 'setGlobal',
60
+ name: '$crisp',
61
+ value: [],
62
+ ifUndefined: false
63
+ },
64
+ {
65
+ type: 'setGlobal',
66
+ name: 'CRISP_WEBSITE_ID',
67
+ value: '{{websiteId}}',
68
+ ifUndefined: false
69
+ }
70
+ ];
71
+ if (void 0 !== options.locale || void 0 !== options.sessionMerge) install.push({
72
+ type: 'setGlobal',
73
+ name: 'CRISP_RUNTIME_CONFIG',
74
+ value: {
75
+ ...void 0 !== options.locale ? {
76
+ locale: '{{locale}}'
77
+ } : {},
78
+ ...void 0 !== options.sessionMerge ? {
79
+ session_merge: '{{sessionMerge}}'
80
+ } : {}
81
+ },
82
+ ifUndefined: false
83
+ });
84
+ if (options.cookieDomain) install.push({
85
+ type: 'setGlobal',
86
+ name: 'CRISP_COOKIE_DOMAIN',
87
+ value: '{{cookieDomain}}',
88
+ ifUndefined: false
89
+ });
90
+ if (void 0 !== options.cookieExpiry) install.push({
91
+ type: 'setGlobal',
92
+ name: 'CRISP_COOKIE_EXPIRE',
93
+ value: '{{cookieExpiry}}',
94
+ ifUndefined: false
95
+ });
96
+ if (options.tokenId) install.push({
97
+ type: 'setGlobal',
98
+ name: 'CRISP_TOKEN_ID',
99
+ value: '{{tokenId}}',
100
+ ifUndefined: false
101
+ });
102
+ if (options.safeMode) install.push({
103
+ type: 'pushToQueue',
104
+ queue: '$crisp',
105
+ value: [
106
+ 'safe',
107
+ true
108
+ ]
109
+ });
110
+ install.push({
111
+ type: 'loadScript',
112
+ src: "{{scriptSrc}}",
113
+ async: true
114
+ });
115
+ return {
116
+ ...crispManifest,
117
+ install
118
+ };
119
+ }
120
+ function crisp(options) {
121
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(createCrispManifest(options), {
122
+ websiteId: options.websiteId,
123
+ locale: options.locale,
124
+ cookieDomain: options.cookieDomain,
125
+ cookieExpiry: options.cookieExpiry,
126
+ tokenId: options.tokenId,
127
+ sessionMerge: options.sessionMerge,
128
+ scriptSrc: options.scriptSrc ?? 'https://client.crisp.chat/l.js'
129
+ });
130
+ }
131
+ exports.crisp = __webpack_exports__.crisp;
132
+ exports.crispManifest = __webpack_exports__.crispManifest;
133
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
134
+ "crisp",
135
+ "crispManifest"
136
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
137
+ Object.defineProperty(exports, '__esModule', {
138
+ value: true
139
+ });
@@ -0,0 +1,102 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ const crispManifest = {
4
+ ...vendorManifestContract,
5
+ vendor: 'crisp',
6
+ category: 'functionality',
7
+ install: [
8
+ {
9
+ type: 'setGlobal',
10
+ name: '$crisp',
11
+ value: [],
12
+ ifUndefined: false
13
+ },
14
+ {
15
+ type: 'setGlobal',
16
+ name: 'CRISP_WEBSITE_ID',
17
+ value: '{{websiteId}}',
18
+ ifUndefined: false
19
+ },
20
+ {
21
+ type: 'loadScript',
22
+ src: "{{scriptSrc}}",
23
+ async: true
24
+ }
25
+ ]
26
+ };
27
+ function createCrispManifest(options) {
28
+ const install = [
29
+ {
30
+ type: 'setGlobal',
31
+ name: '$crisp',
32
+ value: [],
33
+ ifUndefined: false
34
+ },
35
+ {
36
+ type: 'setGlobal',
37
+ name: 'CRISP_WEBSITE_ID',
38
+ value: '{{websiteId}}',
39
+ ifUndefined: false
40
+ }
41
+ ];
42
+ if (void 0 !== options.locale || void 0 !== options.sessionMerge) install.push({
43
+ type: 'setGlobal',
44
+ name: 'CRISP_RUNTIME_CONFIG',
45
+ value: {
46
+ ...void 0 !== options.locale ? {
47
+ locale: '{{locale}}'
48
+ } : {},
49
+ ...void 0 !== options.sessionMerge ? {
50
+ session_merge: '{{sessionMerge}}'
51
+ } : {}
52
+ },
53
+ ifUndefined: false
54
+ });
55
+ if (options.cookieDomain) install.push({
56
+ type: 'setGlobal',
57
+ name: 'CRISP_COOKIE_DOMAIN',
58
+ value: '{{cookieDomain}}',
59
+ ifUndefined: false
60
+ });
61
+ if (void 0 !== options.cookieExpiry) install.push({
62
+ type: 'setGlobal',
63
+ name: 'CRISP_COOKIE_EXPIRE',
64
+ value: '{{cookieExpiry}}',
65
+ ifUndefined: false
66
+ });
67
+ if (options.tokenId) install.push({
68
+ type: 'setGlobal',
69
+ name: 'CRISP_TOKEN_ID',
70
+ value: '{{tokenId}}',
71
+ ifUndefined: false
72
+ });
73
+ if (options.safeMode) install.push({
74
+ type: 'pushToQueue',
75
+ queue: '$crisp',
76
+ value: [
77
+ 'safe',
78
+ true
79
+ ]
80
+ });
81
+ install.push({
82
+ type: 'loadScript',
83
+ src: "{{scriptSrc}}",
84
+ async: true
85
+ });
86
+ return {
87
+ ...crispManifest,
88
+ install
89
+ };
90
+ }
91
+ function crisp(options) {
92
+ return resolveManifest(createCrispManifest(options), {
93
+ websiteId: options.websiteId,
94
+ locale: options.locale,
95
+ cookieDomain: options.cookieDomain,
96
+ cookieExpiry: options.cookieExpiry,
97
+ tokenId: options.tokenId,
98
+ sessionMerge: options.sessionMerge,
99
+ scriptSrc: options.scriptSrc ?? 'https://client.crisp.chat/l.js'
100
+ });
101
+ }
102
+ export { crisp, crispManifest };
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ intercom: ()=>intercom,
28
+ intercomManifest: ()=>intercomManifest,
29
+ INTERCOM_API_BASES: ()=>INTERCOM_API_BASES
30
+ });
31
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
32
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
33
+ const INTERCOM_API_BASES = {
34
+ us: 'https://api-iam.intercom.io',
35
+ eu: 'https://api-iam.eu.intercom.io',
36
+ au: 'https://api-iam.au.intercom.io'
37
+ };
38
+ const intercomManifest = {
39
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
40
+ vendor: 'intercom',
41
+ category: 'functionality',
42
+ install: [
43
+ {
44
+ type: 'defineStubFunction',
45
+ name: 'Intercom',
46
+ queue: {
47
+ property: 'q'
48
+ },
49
+ queueFormat: 'array',
50
+ ifUndefined: true
51
+ },
52
+ {
53
+ type: 'setGlobal',
54
+ name: 'intercomSettings',
55
+ value: '{{settings}}',
56
+ ifUndefined: false
57
+ },
58
+ {
59
+ type: 'loadScript',
60
+ src: "{{scriptSrc}}",
61
+ async: true
62
+ }
63
+ ]
64
+ };
65
+ function intercom({ appId, apiBase = INTERCOM_API_BASES.us, settings, scriptSrc }) {
66
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(intercomManifest, {
67
+ settings: {
68
+ ...settings ?? {},
69
+ app_id: appId,
70
+ api_base: apiBase
71
+ },
72
+ scriptSrc: scriptSrc ?? `https://widget.intercom.io/widget/${appId}`
73
+ });
74
+ }
75
+ exports.INTERCOM_API_BASES = __webpack_exports__.INTERCOM_API_BASES;
76
+ exports.intercom = __webpack_exports__.intercom;
77
+ exports.intercomManifest = __webpack_exports__.intercomManifest;
78
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
79
+ "INTERCOM_API_BASES",
80
+ "intercom",
81
+ "intercomManifest"
82
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
83
+ Object.defineProperty(exports, '__esModule', {
84
+ value: true
85
+ });
@@ -0,0 +1,45 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ const INTERCOM_API_BASES = {
4
+ us: 'https://api-iam.intercom.io',
5
+ eu: 'https://api-iam.eu.intercom.io',
6
+ au: 'https://api-iam.au.intercom.io'
7
+ };
8
+ const intercomManifest = {
9
+ ...vendorManifestContract,
10
+ vendor: 'intercom',
11
+ category: 'functionality',
12
+ install: [
13
+ {
14
+ type: 'defineStubFunction',
15
+ name: 'Intercom',
16
+ queue: {
17
+ property: 'q'
18
+ },
19
+ queueFormat: 'array',
20
+ ifUndefined: true
21
+ },
22
+ {
23
+ type: 'setGlobal',
24
+ name: 'intercomSettings',
25
+ value: '{{settings}}',
26
+ ifUndefined: false
27
+ },
28
+ {
29
+ type: 'loadScript',
30
+ src: "{{scriptSrc}}",
31
+ async: true
32
+ }
33
+ ]
34
+ };
35
+ function intercom({ appId, apiBase = INTERCOM_API_BASES.us, settings, scriptSrc }) {
36
+ return resolveManifest(intercomManifest, {
37
+ settings: {
38
+ ...settings ?? {},
39
+ app_id: appId,
40
+ api_base: apiBase
41
+ },
42
+ scriptSrc: scriptSrc ?? `https://widget.intercom.io/widget/${appId}`
43
+ });
44
+ }
45
+ export { INTERCOM_API_BASES, intercom, intercomManifest };
@@ -27,8 +27,9 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  googleTagManagerManifest: ()=>googleTagManagerManifest,
28
28
  googleTagManager: ()=>googleTagManager
29
29
  });
30
- const external_resolve_cjs_namespaceObject = require("./resolve.cjs");
31
- const external_types_cjs_namespaceObject = require("./types.cjs");
30
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
31
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
32
+ const google_consent_cjs_namespaceObject = require("../_shared/google-consent.cjs");
32
33
  const googleTagManagerManifest = {
33
34
  ...external_types_cjs_namespaceObject.vendorManifestContract,
34
35
  vendor: 'google-tag-manager',
@@ -53,7 +54,7 @@ const googleTagManagerManifest = {
53
54
  type: 'pushToQueue',
54
55
  queue: 'dataLayer',
55
56
  value: {
56
- 'gtm.start': '{{loadTime}}',
57
+ 'gtm.start': external_types_cjs_namespaceObject.runtimeTimestampValue,
57
58
  event: 'gtm.js'
58
59
  }
59
60
  },
@@ -73,35 +74,13 @@ const googleTagManagerManifest = {
73
74
  ]
74
75
  }
75
76
  ],
76
- consentMapping: {
77
- necessary: [
78
- 'security_storage'
79
- ],
80
- functionality: [
81
- 'functionality_storage'
82
- ],
83
- measurement: [
84
- 'analytics_storage'
85
- ],
86
- marketing: [
87
- 'ad_storage',
88
- 'ad_user_data',
89
- 'ad_personalization'
90
- ],
91
- experience: [
92
- 'personalization_storage'
93
- ]
94
- },
77
+ consentMapping: google_consent_cjs_namespaceObject.GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING,
95
78
  consentSignal: 'gtag'
96
79
  };
97
80
  function googleTagManager({ id, updateEventName, consentMapping }) {
98
- const manifest = consentMapping ? {
99
- ...googleTagManagerManifest,
100
- consentMapping
101
- } : googleTagManagerManifest;
81
+ const manifest = (0, google_consent_cjs_namespaceObject.withOptionalConsentMapping)(googleTagManagerManifest, consentMapping);
102
82
  const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
103
83
  id,
104
- loadTime: Date.now(),
105
84
  updateEventName: updateEventName ?? 'consent-update'
106
85
  });
107
86
  return resolved;
@@ -1,5 +1,6 @@
1
- import { resolveManifest } from "./resolve.js";
2
- import { vendorManifestContract } from "./types.js";
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { runtimeTimestampValue, vendorManifestContract } from "../../types.js";
3
+ import { GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING, withOptionalConsentMapping } from "../_shared/google-consent.js";
3
4
  const googleTagManagerManifest = {
4
5
  ...vendorManifestContract,
5
6
  vendor: 'google-tag-manager',
@@ -24,7 +25,7 @@ const googleTagManagerManifest = {
24
25
  type: 'pushToQueue',
25
26
  queue: 'dataLayer',
26
27
  value: {
27
- 'gtm.start': '{{loadTime}}',
28
+ 'gtm.start': runtimeTimestampValue,
28
29
  event: 'gtm.js'
29
30
  }
30
31
  },
@@ -44,35 +45,13 @@ const googleTagManagerManifest = {
44
45
  ]
45
46
  }
46
47
  ],
47
- consentMapping: {
48
- necessary: [
49
- 'security_storage'
50
- ],
51
- functionality: [
52
- 'functionality_storage'
53
- ],
54
- measurement: [
55
- 'analytics_storage'
56
- ],
57
- marketing: [
58
- 'ad_storage',
59
- 'ad_user_data',
60
- 'ad_personalization'
61
- ],
62
- experience: [
63
- 'personalization_storage'
64
- ]
65
- },
48
+ consentMapping: GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING,
66
49
  consentSignal: 'gtag'
67
50
  };
68
51
  function googleTagManager({ id, updateEventName, consentMapping }) {
69
- const manifest = consentMapping ? {
70
- ...googleTagManagerManifest,
71
- consentMapping
72
- } : googleTagManagerManifest;
52
+ const manifest = withOptionalConsentMapping(googleTagManagerManifest, consentMapping);
73
53
  const resolved = resolveManifest(manifest, {
74
54
  id,
75
- loadTime: Date.now(),
76
55
  updateEventName: updateEventName ?? 'consent-update'
77
56
  });
78
57
  return resolved;