@builder.io/sdk-qwik 0.18.12 → 0.18.13
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/lib/browser/blocks/personalization-container/component-info.qwik.cjs +48 -0
- package/lib/browser/blocks/personalization-container/component-info.qwik.mjs +48 -0
- package/lib/browser/blocks/personalization-container/helpers/inlined-fns.qwik.cjs +82 -0
- package/lib/browser/blocks/personalization-container/helpers/inlined-fns.qwik.mjs +82 -0
- package/lib/browser/blocks/personalization-container/helpers.qwik.cjs +86 -0
- package/lib/browser/blocks/personalization-container/helpers.qwik.mjs +87 -0
- package/lib/browser/blocks/personalization-container/personalization-container.qwik.cjs +382 -0
- package/lib/browser/blocks/personalization-container/personalization-container.qwik.mjs +382 -0
- package/lib/browser/components/blocks/blocks.qwik.cjs +37 -34
- package/lib/browser/components/blocks/blocks.qwik.mjs +38 -35
- package/lib/browser/components/content-variants/content-variants.qwik.cjs +42 -21
- package/lib/browser/components/content-variants/content-variants.qwik.mjs +42 -21
- package/lib/browser/constants/builder-registered-components.qwik.cjs +14 -10
- package/lib/browser/constants/builder-registered-components.qwik.mjs +14 -10
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/blocks/personalization-container/component-info.qwik.cjs +48 -0
- package/lib/edge/blocks/personalization-container/component-info.qwik.mjs +48 -0
- package/lib/edge/blocks/personalization-container/helpers/inlined-fns.qwik.cjs +82 -0
- package/lib/edge/blocks/personalization-container/helpers/inlined-fns.qwik.mjs +82 -0
- package/lib/edge/blocks/personalization-container/helpers.qwik.cjs +86 -0
- package/lib/edge/blocks/personalization-container/helpers.qwik.mjs +87 -0
- package/lib/edge/blocks/personalization-container/personalization-container.qwik.cjs +382 -0
- package/lib/edge/blocks/personalization-container/personalization-container.qwik.mjs +382 -0
- package/lib/edge/components/blocks/blocks.qwik.cjs +37 -34
- package/lib/edge/components/blocks/blocks.qwik.mjs +38 -35
- package/lib/edge/components/content-variants/content-variants.qwik.cjs +42 -21
- package/lib/edge/components/content-variants/content-variants.qwik.mjs +42 -21
- package/lib/edge/constants/builder-registered-components.qwik.cjs +14 -11
- package/lib/edge/constants/builder-registered-components.qwik.mjs +14 -11
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/blocks/personalization-container/component-info.qwik.cjs +48 -0
- package/lib/node/blocks/personalization-container/component-info.qwik.mjs +48 -0
- package/lib/node/blocks/personalization-container/helpers/inlined-fns.qwik.cjs +82 -0
- package/lib/node/blocks/personalization-container/helpers/inlined-fns.qwik.mjs +82 -0
- package/lib/node/blocks/personalization-container/helpers.qwik.cjs +86 -0
- package/lib/node/blocks/personalization-container/helpers.qwik.mjs +87 -0
- package/lib/node/blocks/personalization-container/personalization-container.qwik.cjs +382 -0
- package/lib/node/blocks/personalization-container/personalization-container.qwik.mjs +382 -0
- package/lib/node/components/blocks/blocks.qwik.cjs +37 -34
- package/lib/node/components/blocks/blocks.qwik.mjs +38 -35
- package/lib/node/components/content-variants/content-variants.qwik.cjs +42 -21
- package/lib/node/components/content-variants/content-variants.qwik.mjs +42 -21
- package/lib/node/constants/builder-registered-components.qwik.cjs +14 -11
- package/lib/node/constants/builder-registered-components.qwik.mjs +14 -11
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/package.json +2 -2
- package/types/src/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
- package/types/src/blocks/personalization-container/helpers.d.ts +24 -4
- package/types/src/blocks/personalization-container/personalization-container.types.d.ts +2 -2
- package/types/src/components/blocks/blocks-wrapper.d.ts +13 -1
- package/types/src/components/blocks/blocks.types.d.ts +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
4
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
5
|
+
const helpers$1 = require("../../blocks/personalization-container/helpers.qwik.cjs");
|
|
5
6
|
const target = require("../../constants/target.qwik.cjs");
|
|
6
7
|
const abTests = require("../../helpers/ab-tests.qwik.cjs");
|
|
7
8
|
const canTrack = require("../../helpers/canTrack.qwik.cjs");
|
|
@@ -49,22 +50,42 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
49
50
|
]));
|
|
50
51
|
return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
|
|
51
52
|
children: [
|
|
52
|
-
!props.isNestedRender && target.TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
!props.isNestedRender && target.TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
|
|
56
|
+
id: "builderio-init-variants-fns",
|
|
57
|
+
get scriptStr() {
|
|
58
|
+
return helpers.getInitVariantsFnsScriptString();
|
|
59
|
+
},
|
|
60
|
+
get nonce() {
|
|
61
|
+
return props.nonce || "";
|
|
62
|
+
},
|
|
63
|
+
[qwik._IMMUTABLE]: {
|
|
64
|
+
id: qwik._IMMUTABLE,
|
|
65
|
+
nonce: qwik._fnSignal((p0) => p0.nonce || "", [
|
|
66
|
+
props
|
|
67
|
+
], 'p0.nonce||""'),
|
|
68
|
+
scriptStr: qwik._IMMUTABLE
|
|
69
|
+
}
|
|
70
|
+
}, 3, "XM_0"),
|
|
71
|
+
helpers$1.SDKS_SUPPORTING_PERSONALIZATION.includes(target.TARGET) ? /* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
|
|
72
|
+
id: "builderio-init-personalization-variants-fns",
|
|
73
|
+
get nonce() {
|
|
74
|
+
return props.nonce || "";
|
|
75
|
+
},
|
|
76
|
+
get scriptStr() {
|
|
77
|
+
return helpers$1.getInitPersonalizationVariantsFnsScriptString();
|
|
78
|
+
},
|
|
79
|
+
[qwik._IMMUTABLE]: {
|
|
80
|
+
id: qwik._IMMUTABLE,
|
|
81
|
+
nonce: qwik._fnSignal((p0) => p0.nonce || "", [
|
|
82
|
+
props
|
|
83
|
+
], 'p0.nonce||""'),
|
|
84
|
+
scriptStr: qwik._IMMUTABLE
|
|
85
|
+
}
|
|
86
|
+
}, 3, "XM_1") : null
|
|
87
|
+
]
|
|
88
|
+
}, 1, "XM_2") : null,
|
|
68
89
|
state.shouldRenderVariants ? /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
|
|
69
90
|
children: [
|
|
70
91
|
/* @__PURE__ */ qwik._jsxC(inlinedStyles.InlinedStyles, {
|
|
@@ -84,7 +105,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
84
105
|
hideVariantsStyleString
|
|
85
106
|
], "p0.value")
|
|
86
107
|
}
|
|
87
|
-
}, 3, "
|
|
108
|
+
}, 3, "XM_3"),
|
|
88
109
|
/* @__PURE__ */ qwik._jsxC(inlinedScript.InlinedScript, {
|
|
89
110
|
id: "builderio-variants-visibility",
|
|
90
111
|
get scriptStr() {
|
|
@@ -102,7 +123,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
102
123
|
updateCookieAndStylesScriptStr
|
|
103
124
|
], "p0.value")
|
|
104
125
|
}
|
|
105
|
-
}, 3, "
|
|
126
|
+
}, 3, "XM_4"),
|
|
106
127
|
(helpers.getVariants(props.content) || []).map((variant) => {
|
|
107
128
|
return /* @__PURE__ */ qwik._jsxC(content.ContentComponent, {
|
|
108
129
|
get apiHost() {
|
|
@@ -227,7 +248,7 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
227
248
|
}, 3, variant.testVariationId);
|
|
228
249
|
})
|
|
229
250
|
]
|
|
230
|
-
}, 1, "
|
|
251
|
+
}, 1, "XM_5") : null,
|
|
231
252
|
/* @__PURE__ */ qwik._jsxC(content.ContentComponent, {
|
|
232
253
|
get apiHost() {
|
|
233
254
|
return props.apiHost;
|
|
@@ -353,9 +374,9 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
|
|
|
353
374
|
props
|
|
354
375
|
], "p0.trustedHosts")
|
|
355
376
|
}
|
|
356
|
-
}, 3, "
|
|
377
|
+
}, 3, "XM_6")
|
|
357
378
|
]
|
|
358
|
-
}, 1, "
|
|
379
|
+
}, 1, "XM_7");
|
|
359
380
|
}, "ContentVariants_component_4tFRiQMMEfM"));
|
|
360
381
|
exports.ContentVariants = ContentVariants;
|
|
361
382
|
exports.default = ContentVariants;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { componentQrl, inlinedQrl, _jsxBranch, useStore, useComputedQrl, useLexicalScope, _jsxC, Fragment, _IMMUTABLE, _fnSignal } from "@builder.io/qwik";
|
|
2
2
|
import { Fragment as Fragment$1 } from "@builder.io/qwik/jsx-runtime";
|
|
3
|
+
import { SDKS_SUPPORTING_PERSONALIZATION, getInitPersonalizationVariantsFnsScriptString } from "../../blocks/personalization-container/helpers.qwik.mjs";
|
|
3
4
|
import { TARGET } from "../../constants/target.qwik.mjs";
|
|
4
5
|
import { handleABTestingSync } from "../../helpers/ab-tests.qwik.mjs";
|
|
5
6
|
import { getDefaultCanTrack } from "../../helpers/canTrack.qwik.mjs";
|
|
@@ -47,22 +48,42 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
47
48
|
]));
|
|
48
49
|
return /* @__PURE__ */ _jsxC(Fragment, {
|
|
49
50
|
children: [
|
|
50
|
-
!props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
!props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(Fragment$1, {
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ _jsxC(InlinedScript, {
|
|
54
|
+
id: "builderio-init-variants-fns",
|
|
55
|
+
get scriptStr() {
|
|
56
|
+
return getInitVariantsFnsScriptString();
|
|
57
|
+
},
|
|
58
|
+
get nonce() {
|
|
59
|
+
return props.nonce || "";
|
|
60
|
+
},
|
|
61
|
+
[_IMMUTABLE]: {
|
|
62
|
+
id: _IMMUTABLE,
|
|
63
|
+
nonce: _fnSignal((p0) => p0.nonce || "", [
|
|
64
|
+
props
|
|
65
|
+
], 'p0.nonce||""'),
|
|
66
|
+
scriptStr: _IMMUTABLE
|
|
67
|
+
}
|
|
68
|
+
}, 3, "XM_0"),
|
|
69
|
+
SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET) ? /* @__PURE__ */ _jsxC(InlinedScript, {
|
|
70
|
+
id: "builderio-init-personalization-variants-fns",
|
|
71
|
+
get nonce() {
|
|
72
|
+
return props.nonce || "";
|
|
73
|
+
},
|
|
74
|
+
get scriptStr() {
|
|
75
|
+
return getInitPersonalizationVariantsFnsScriptString();
|
|
76
|
+
},
|
|
77
|
+
[_IMMUTABLE]: {
|
|
78
|
+
id: _IMMUTABLE,
|
|
79
|
+
nonce: _fnSignal((p0) => p0.nonce || "", [
|
|
80
|
+
props
|
|
81
|
+
], 'p0.nonce||""'),
|
|
82
|
+
scriptStr: _IMMUTABLE
|
|
83
|
+
}
|
|
84
|
+
}, 3, "XM_1") : null
|
|
85
|
+
]
|
|
86
|
+
}, 1, "XM_2") : null,
|
|
66
87
|
state.shouldRenderVariants ? /* @__PURE__ */ _jsxC(Fragment$1, {
|
|
67
88
|
children: [
|
|
68
89
|
/* @__PURE__ */ _jsxC(InlinedStyles, {
|
|
@@ -82,7 +103,7 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
82
103
|
hideVariantsStyleString
|
|
83
104
|
], "p0.value")
|
|
84
105
|
}
|
|
85
|
-
}, 3, "
|
|
106
|
+
}, 3, "XM_3"),
|
|
86
107
|
/* @__PURE__ */ _jsxC(InlinedScript, {
|
|
87
108
|
id: "builderio-variants-visibility",
|
|
88
109
|
get scriptStr() {
|
|
@@ -100,7 +121,7 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
100
121
|
updateCookieAndStylesScriptStr
|
|
101
122
|
], "p0.value")
|
|
102
123
|
}
|
|
103
|
-
}, 3, "
|
|
124
|
+
}, 3, "XM_4"),
|
|
104
125
|
(getVariants(props.content) || []).map((variant) => {
|
|
105
126
|
return /* @__PURE__ */ _jsxC(ContentComponent, {
|
|
106
127
|
get apiHost() {
|
|
@@ -225,7 +246,7 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
225
246
|
}, 3, variant.testVariationId);
|
|
226
247
|
})
|
|
227
248
|
]
|
|
228
|
-
}, 1, "
|
|
249
|
+
}, 1, "XM_5") : null,
|
|
229
250
|
/* @__PURE__ */ _jsxC(ContentComponent, {
|
|
230
251
|
get apiHost() {
|
|
231
252
|
return props.apiHost;
|
|
@@ -351,9 +372,9 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
|
|
|
351
372
|
props
|
|
352
373
|
], "p0.trustedHosts")
|
|
353
374
|
}
|
|
354
|
-
}, 3, "
|
|
375
|
+
}, 3, "XM_6")
|
|
355
376
|
]
|
|
356
|
-
}, 1, "
|
|
377
|
+
}, 1, "XM_7");
|
|
357
378
|
}, "ContentVariants_component_4tFRiQMMEfM"));
|
|
358
379
|
export {
|
|
359
380
|
ContentVariants,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const componentInfo$
|
|
3
|
+
const componentInfo$a = require("../blocks/accordion/component-info.qwik.cjs");
|
|
4
4
|
const accordion = require("../blocks/accordion/accordion.qwik.cjs");
|
|
5
5
|
const componentInfo = require("../blocks/button/component-info.qwik.cjs");
|
|
6
6
|
const button = require("../blocks/button/button.qwik.cjs");
|
|
@@ -10,23 +10,21 @@ const componentInfo$2 = require("../blocks/fragment/component-info.qwik.cjs");
|
|
|
10
10
|
const fragment = require("../blocks/fragment/fragment.qwik.cjs");
|
|
11
11
|
const componentInfo$3 = require("../blocks/image/component-info.qwik.cjs");
|
|
12
12
|
const image = require("../blocks/image/image.qwik.cjs");
|
|
13
|
-
require("
|
|
14
|
-
require("
|
|
15
|
-
require("../
|
|
16
|
-
require("../context/components.context.qwik.cjs");
|
|
17
|
-
require("@builder.io/qwik/build");
|
|
18
|
-
require("../functions/evaluate/edge-runtime/edge-runtime.qwik.cjs");
|
|
13
|
+
const componentInfo$8 = require("../blocks/personalization-container/component-info.qwik.cjs");
|
|
14
|
+
const helpers = require("../blocks/personalization-container/helpers.qwik.cjs");
|
|
15
|
+
const personalizationContainer = require("../blocks/personalization-container/personalization-container.qwik.cjs");
|
|
19
16
|
const componentInfo$4 = require("../blocks/section/component-info.qwik.cjs");
|
|
20
17
|
const section = require("../blocks/section/section.qwik.cjs");
|
|
21
18
|
const componentInfo$5 = require("../blocks/slot/component-info.qwik.cjs");
|
|
22
19
|
const slot = require("../blocks/slot/slot.qwik.cjs");
|
|
23
20
|
const componentInfo$6 = require("../blocks/symbol/component-info.qwik.cjs");
|
|
24
21
|
const symbol = require("../blocks/symbol/symbol.qwik.cjs");
|
|
25
|
-
const componentInfo$
|
|
22
|
+
const componentInfo$9 = require("../blocks/tabs/component-info.qwik.cjs");
|
|
26
23
|
const tabs = require("../blocks/tabs/tabs.qwik.cjs");
|
|
27
24
|
const componentInfo$7 = require("../blocks/text/component-info.qwik.cjs");
|
|
28
25
|
const text = require("../blocks/text/text.qwik.cjs");
|
|
29
26
|
const extraComponents = require("./extra-components.qwik.cjs");
|
|
27
|
+
const target = require("./target.qwik.cjs");
|
|
30
28
|
const getDefaultRegisteredComponents = () => [
|
|
31
29
|
{
|
|
32
30
|
component: button.Button,
|
|
@@ -60,15 +58,20 @@ const getDefaultRegisteredComponents = () => [
|
|
|
60
58
|
component: text.Text,
|
|
61
59
|
...componentInfo$7.componentInfo
|
|
62
60
|
},
|
|
63
|
-
...[
|
|
61
|
+
...helpers.SDKS_SUPPORTING_PERSONALIZATION.includes(target.TARGET) ? [
|
|
62
|
+
{
|
|
63
|
+
component: personalizationContainer.PersonalizationContainer,
|
|
64
|
+
...componentInfo$8.componentInfo
|
|
65
|
+
}
|
|
66
|
+
] : [],
|
|
64
67
|
...[
|
|
65
68
|
{
|
|
66
69
|
component: tabs.Tabs,
|
|
67
|
-
...componentInfo$
|
|
70
|
+
...componentInfo$9.componentInfo
|
|
68
71
|
},
|
|
69
72
|
{
|
|
70
73
|
component: accordion.Accordion,
|
|
71
|
-
...componentInfo$
|
|
74
|
+
...componentInfo$a.componentInfo
|
|
72
75
|
}
|
|
73
76
|
],
|
|
74
77
|
...extraComponents.getExtraComponents()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentInfo as componentInfo$
|
|
1
|
+
import { componentInfo as componentInfo$a } from "../blocks/accordion/component-info.qwik.mjs";
|
|
2
2
|
import { Accordion } from "../blocks/accordion/accordion.qwik.mjs";
|
|
3
3
|
import { componentInfo } from "../blocks/button/component-info.qwik.mjs";
|
|
4
4
|
import { Button } from "../blocks/button/button.qwik.mjs";
|
|
@@ -8,23 +8,21 @@ import { componentInfo as componentInfo$2 } from "../blocks/fragment/component-i
|
|
|
8
8
|
import { FragmentComponent } from "../blocks/fragment/fragment.qwik.mjs";
|
|
9
9
|
import { componentInfo as componentInfo$3 } from "../blocks/image/component-info.qwik.mjs";
|
|
10
10
|
import { Image } from "../blocks/image/image.qwik.mjs";
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "../
|
|
14
|
-
import "../context/components.context.qwik.mjs";
|
|
15
|
-
import "@builder.io/qwik/build";
|
|
16
|
-
import "../functions/evaluate/edge-runtime/edge-runtime.qwik.mjs";
|
|
11
|
+
import { componentInfo as componentInfo$8 } from "../blocks/personalization-container/component-info.qwik.mjs";
|
|
12
|
+
import { SDKS_SUPPORTING_PERSONALIZATION } from "../blocks/personalization-container/helpers.qwik.mjs";
|
|
13
|
+
import { PersonalizationContainer } from "../blocks/personalization-container/personalization-container.qwik.mjs";
|
|
17
14
|
import { componentInfo as componentInfo$4 } from "../blocks/section/component-info.qwik.mjs";
|
|
18
15
|
import { SectionComponent } from "../blocks/section/section.qwik.mjs";
|
|
19
16
|
import { componentInfo as componentInfo$5 } from "../blocks/slot/component-info.qwik.mjs";
|
|
20
17
|
import { Slot } from "../blocks/slot/slot.qwik.mjs";
|
|
21
18
|
import { componentInfo as componentInfo$6 } from "../blocks/symbol/component-info.qwik.mjs";
|
|
22
19
|
import { Symbol as Symbol$1 } from "../blocks/symbol/symbol.qwik.mjs";
|
|
23
|
-
import { componentInfo as componentInfo$
|
|
20
|
+
import { componentInfo as componentInfo$9 } from "../blocks/tabs/component-info.qwik.mjs";
|
|
24
21
|
import { Tabs } from "../blocks/tabs/tabs.qwik.mjs";
|
|
25
22
|
import { componentInfo as componentInfo$7 } from "../blocks/text/component-info.qwik.mjs";
|
|
26
23
|
import { Text } from "../blocks/text/text.qwik.mjs";
|
|
27
24
|
import { getExtraComponents } from "./extra-components.qwik.mjs";
|
|
25
|
+
import { TARGET } from "./target.qwik.mjs";
|
|
28
26
|
const getDefaultRegisteredComponents = () => [
|
|
29
27
|
{
|
|
30
28
|
component: Button,
|
|
@@ -58,15 +56,20 @@ const getDefaultRegisteredComponents = () => [
|
|
|
58
56
|
component: Text,
|
|
59
57
|
...componentInfo$7
|
|
60
58
|
},
|
|
61
|
-
...[
|
|
59
|
+
...SDKS_SUPPORTING_PERSONALIZATION.includes(TARGET) ? [
|
|
60
|
+
{
|
|
61
|
+
component: PersonalizationContainer,
|
|
62
|
+
...componentInfo$8
|
|
63
|
+
}
|
|
64
|
+
] : [],
|
|
62
65
|
...[
|
|
63
66
|
{
|
|
64
67
|
component: Tabs,
|
|
65
|
-
...componentInfo$
|
|
68
|
+
...componentInfo$9
|
|
66
69
|
},
|
|
67
70
|
{
|
|
68
71
|
component: Accordion,
|
|
69
|
-
...componentInfo$
|
|
72
|
+
...componentInfo$a
|
|
70
73
|
}
|
|
71
74
|
],
|
|
72
75
|
...getExtraComponents()
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const componentInfo = {
|
|
4
|
+
name: "PersonalizationContainer",
|
|
5
|
+
shouldReceiveBuilderProps: {
|
|
6
|
+
builderBlock: true,
|
|
7
|
+
builderContext: true,
|
|
8
|
+
builderComponents: true
|
|
9
|
+
},
|
|
10
|
+
noWrap: true,
|
|
11
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
12
|
+
canHaveChildren: true,
|
|
13
|
+
inputs: [
|
|
14
|
+
{
|
|
15
|
+
name: "variants",
|
|
16
|
+
defaultValue: [],
|
|
17
|
+
behavior: "personalizationVariantList",
|
|
18
|
+
type: "list",
|
|
19
|
+
subFields: [
|
|
20
|
+
{
|
|
21
|
+
name: "name",
|
|
22
|
+
type: "text"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "query",
|
|
26
|
+
friendlyName: "Targeting rules",
|
|
27
|
+
type: "BuilderQuery",
|
|
28
|
+
defaultValue: []
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "startDate",
|
|
32
|
+
type: "date"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "endDate",
|
|
36
|
+
type: "date"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "blocks",
|
|
40
|
+
type: "uiBlocks",
|
|
41
|
+
hideFromUI: true,
|
|
42
|
+
defaultValue: []
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
exports.componentInfo = componentInfo;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const componentInfo = {
|
|
2
|
+
name: "PersonalizationContainer",
|
|
3
|
+
shouldReceiveBuilderProps: {
|
|
4
|
+
builderBlock: true,
|
|
5
|
+
builderContext: true,
|
|
6
|
+
builderComponents: true
|
|
7
|
+
},
|
|
8
|
+
noWrap: true,
|
|
9
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
|
|
10
|
+
canHaveChildren: true,
|
|
11
|
+
inputs: [
|
|
12
|
+
{
|
|
13
|
+
name: "variants",
|
|
14
|
+
defaultValue: [],
|
|
15
|
+
behavior: "personalizationVariantList",
|
|
16
|
+
type: "list",
|
|
17
|
+
subFields: [
|
|
18
|
+
{
|
|
19
|
+
name: "name",
|
|
20
|
+
type: "text"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "query",
|
|
24
|
+
friendlyName: "Targeting rules",
|
|
25
|
+
type: "BuilderQuery",
|
|
26
|
+
defaultValue: []
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "startDate",
|
|
30
|
+
type: "date"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "endDate",
|
|
34
|
+
type: "date"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "blocks",
|
|
38
|
+
type: "uiBlocks",
|
|
39
|
+
hideFromUI: true,
|
|
40
|
+
defaultValue: []
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
componentInfo
|
|
48
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
4
|
+
function isString(val) {
|
|
5
|
+
return typeof val === "string";
|
|
6
|
+
}
|
|
7
|
+
function isNumber(val) {
|
|
8
|
+
return typeof val === "number";
|
|
9
|
+
}
|
|
10
|
+
function objectMatchesQuery(userattr, query2) {
|
|
11
|
+
const result = (() => {
|
|
12
|
+
const property = query2.property;
|
|
13
|
+
const operator = query2.operator;
|
|
14
|
+
let testValue = query2.value;
|
|
15
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/"))
|
|
16
|
+
testValue = query2.value.slice(0, -1);
|
|
17
|
+
if (!(property && operator))
|
|
18
|
+
return true;
|
|
19
|
+
if (Array.isArray(testValue)) {
|
|
20
|
+
if (operator === "isNot")
|
|
21
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
22
|
+
property,
|
|
23
|
+
operator,
|
|
24
|
+
value: val
|
|
25
|
+
}));
|
|
26
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
27
|
+
property,
|
|
28
|
+
operator,
|
|
29
|
+
value: val
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
const value = userattr[property];
|
|
33
|
+
if (Array.isArray(value))
|
|
34
|
+
return value.includes(testValue);
|
|
35
|
+
switch (operator) {
|
|
36
|
+
case "is":
|
|
37
|
+
return value === testValue;
|
|
38
|
+
case "isNot":
|
|
39
|
+
return value !== testValue;
|
|
40
|
+
case "contains":
|
|
41
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
42
|
+
case "startsWith":
|
|
43
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
44
|
+
case "endsWith":
|
|
45
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
46
|
+
case "greaterThan":
|
|
47
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
48
|
+
case "lessThan":
|
|
49
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
50
|
+
case "greaterThanOrEqualTo":
|
|
51
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
52
|
+
case "lessThanOrEqualTo":
|
|
53
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
54
|
+
default:
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
})();
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
const item = {
|
|
61
|
+
query,
|
|
62
|
+
startDate,
|
|
63
|
+
endDate
|
|
64
|
+
};
|
|
65
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
66
|
+
if (item.startDate && new Date(item.startDate) > now)
|
|
67
|
+
return false;
|
|
68
|
+
else if (item.endDate && new Date(item.endDate) < now)
|
|
69
|
+
return false;
|
|
70
|
+
if (!item.query || !item.query.length)
|
|
71
|
+
return true;
|
|
72
|
+
return item.query.every((filter) => {
|
|
73
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
|
|
77
|
+
const FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
|
|
78
|
+
const UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
|
|
79
|
+
exports.FILTER_WITH_CUSTOM_TARGETING_SCRIPT = FILTER_WITH_CUSTOM_TARGETING_SCRIPT;
|
|
80
|
+
exports.PERSONALIZATION_SCRIPT = PERSONALIZATION_SCRIPT;
|
|
81
|
+
exports.UPDATE_VISIBILITY_STYLES_SCRIPT = UPDATE_VISIBILITY_STYLES_SCRIPT;
|
|
82
|
+
exports.filterWithCustomTargeting = filterWithCustomTargeting;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
2
|
+
function isString(val) {
|
|
3
|
+
return typeof val === "string";
|
|
4
|
+
}
|
|
5
|
+
function isNumber(val) {
|
|
6
|
+
return typeof val === "number";
|
|
7
|
+
}
|
|
8
|
+
function objectMatchesQuery(userattr, query2) {
|
|
9
|
+
const result = (() => {
|
|
10
|
+
const property = query2.property;
|
|
11
|
+
const operator = query2.operator;
|
|
12
|
+
let testValue = query2.value;
|
|
13
|
+
if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/"))
|
|
14
|
+
testValue = query2.value.slice(0, -1);
|
|
15
|
+
if (!(property && operator))
|
|
16
|
+
return true;
|
|
17
|
+
if (Array.isArray(testValue)) {
|
|
18
|
+
if (operator === "isNot")
|
|
19
|
+
return testValue.every((val) => objectMatchesQuery(userattr, {
|
|
20
|
+
property,
|
|
21
|
+
operator,
|
|
22
|
+
value: val
|
|
23
|
+
}));
|
|
24
|
+
return !!testValue.find((val) => objectMatchesQuery(userattr, {
|
|
25
|
+
property,
|
|
26
|
+
operator,
|
|
27
|
+
value: val
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
const value = userattr[property];
|
|
31
|
+
if (Array.isArray(value))
|
|
32
|
+
return value.includes(testValue);
|
|
33
|
+
switch (operator) {
|
|
34
|
+
case "is":
|
|
35
|
+
return value === testValue;
|
|
36
|
+
case "isNot":
|
|
37
|
+
return value !== testValue;
|
|
38
|
+
case "contains":
|
|
39
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
40
|
+
case "startsWith":
|
|
41
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
42
|
+
case "endsWith":
|
|
43
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
44
|
+
case "greaterThan":
|
|
45
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
46
|
+
case "lessThan":
|
|
47
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
48
|
+
case "greaterThanOrEqualTo":
|
|
49
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
50
|
+
case "lessThanOrEqualTo":
|
|
51
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
52
|
+
default:
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
})();
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
const item = {
|
|
59
|
+
query,
|
|
60
|
+
startDate,
|
|
61
|
+
endDate
|
|
62
|
+
};
|
|
63
|
+
const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
|
|
64
|
+
if (item.startDate && new Date(item.startDate) > now)
|
|
65
|
+
return false;
|
|
66
|
+
else if (item.endDate && new Date(item.endDate) < now)
|
|
67
|
+
return false;
|
|
68
|
+
if (!item.query || !item.query.length)
|
|
69
|
+
return true;
|
|
70
|
+
return item.query.every((filter) => {
|
|
71
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const PERSONALIZATION_SCRIPT = "function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n const parentDiv = document.currentScript?.parentElement;\n const variantId = parentDiv?.getAttribute('data-variant-id');\n const isDefaultVariant = variantId === `${blockId}-default`;\n const isWinningVariant = winningVariantIndex !== -1 && variantId === `${blockId}-${winningVariantIndex}` || winningVariantIndex === -1 && isDefaultVariant;\n if (isWinningVariant && !isDefaultVariant) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultVariant) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n const itsStyleEl = parentDiv?.previousElementSibling;\n if (itsStyleEl) {\n itsStyleEl.remove();\n }\n parentDiv?.remove();\n }\n const thisScript = document.currentScript;\n if (thisScript) {\n thisScript.remove();\n }\n }\n}";
|
|
75
|
+
const FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
|
|
76
|
+
const UPDATE_VISIBILITY_STYLES_SCRIPT = "function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const visibilityStylesEl = document.currentScript?.previousElementSibling;\n if (!visibilityStylesEl) {\n return;\n }\n if (isHydrationTarget) {\n visibilityStylesEl.remove();\n const currentScript = document.currentScript;\n if (currentScript) {\n currentScript.remove();\n }\n } else {\n const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');\n if (locale) {\n attributes.locale = locale;\n }\n const winningVariantIndex = variants?.findIndex(function (variant) {\n return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);\n });\n if (winningVariantIndex !== -1) {\n let newStyleStr = variants?.map((_, index) => {\n if (index === winningVariantIndex) return '';\n return `div[data-variant-id=\"${blockId}-${index}\"] { display: none !important; } `;\n }).join('') || '';\n newStyleStr += `div[data-variant-id=\"${blockId}-default\"] { display: none !important; } `;\n visibilityStylesEl.innerHTML = newStyleStr;\n }\n }\n}";
|
|
77
|
+
export {
|
|
78
|
+
FILTER_WITH_CUSTOM_TARGETING_SCRIPT,
|
|
79
|
+
PERSONALIZATION_SCRIPT,
|
|
80
|
+
UPDATE_VISIBILITY_STYLES_SCRIPT,
|
|
81
|
+
filterWithCustomTargeting
|
|
82
|
+
};
|