@builder.io/sdk-solid 3.0.5 → 3.0.7

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.
@@ -1099,8 +1099,13 @@ import { Show as Show2, createMemo } from "solid-js";
1099
1099
 
1100
1100
  // src/constants/device-sizes.ts
1101
1101
  var SIZES = {
1102
+ xsmall: {
1103
+ min: 0,
1104
+ default: 160,
1105
+ max: 320
1106
+ },
1102
1107
  small: {
1103
- min: 320,
1108
+ min: 321,
1104
1109
  default: 321,
1105
1110
  max: 640
1106
1111
  },
@@ -1116,15 +1121,28 @@ var SIZES = {
1116
1121
  }
1117
1122
  };
1118
1123
  var getMaxWidthQueryForSize = (size, sizeValues = SIZES) => `@media (max-width: ${sizeValues[size].max}px)`;
1119
- var getSizesForBreakpoints = ({
1120
- small,
1121
- medium
1122
- }) => {
1124
+ var getSizesForBreakpoints = (breakpoints) => {
1123
1125
  const newSizes = fastClone(SIZES);
1126
+ if (!breakpoints) {
1127
+ return newSizes;
1128
+ }
1129
+ const {
1130
+ xsmall,
1131
+ small,
1132
+ medium
1133
+ } = breakpoints;
1134
+ if (xsmall) {
1135
+ const xsmallMin = Math.floor(xsmall / 2);
1136
+ newSizes.xsmall = {
1137
+ max: xsmall,
1138
+ min: xsmallMin,
1139
+ default: xsmallMin + 1
1140
+ };
1141
+ }
1124
1142
  if (!small || !medium) {
1125
1143
  return newSizes;
1126
1144
  }
1127
- const smallMin = Math.floor(small / 2);
1145
+ const smallMin = xsmall ? newSizes.xsmall.max + 1 : Math.floor(small / 2);
1128
1146
  newSizes.small = {
1129
1147
  max: small,
1130
1148
  min: smallMin,
@@ -1175,9 +1193,13 @@ function BlockStyles(props) {
1175
1193
  const sizesWithUpdatedBreakpoints = getSizesForBreakpoints(
1176
1194
  content?.meta?.breakpoints || {}
1177
1195
  );
1196
+ const contentHasXSmallBreakpoint = Boolean(
1197
+ content?.meta?.breakpoints?.xsmall
1198
+ );
1178
1199
  const largeStyles = styles?.large;
1179
1200
  const mediumStyles = styles?.medium;
1180
1201
  const smallStyles = styles?.small;
1202
+ const xsmallStyles = styles?.xsmall;
1181
1203
  const className = processedBlock.id;
1182
1204
  if (!className) {
1183
1205
  return "";
@@ -1202,6 +1224,14 @@ function BlockStyles(props) {
1202
1224
  sizesWithUpdatedBreakpoints
1203
1225
  )
1204
1226
  }) : "";
1227
+ const xsmallStylesClass = xsmallStyles && contentHasXSmallBreakpoint ? createCssClass({
1228
+ className,
1229
+ styles: xsmallStyles,
1230
+ mediaQuery: getMaxWidthQueryForSize(
1231
+ "xsmall",
1232
+ sizesWithUpdatedBreakpoints
1233
+ )
1234
+ }) : "";
1205
1235
  const hoverAnimation = processedBlock.animations && processedBlock.animations.find((item) => item.trigger === "hover");
1206
1236
  let hoverStylesClass = "";
1207
1237
  if (hoverAnimation) {
@@ -1221,6 +1251,7 @@ function BlockStyles(props) {
1221
1251
  largeStylesClass,
1222
1252
  mediumStylesClass,
1223
1253
  smallStylesClass,
1254
+ xsmallStylesClass,
1224
1255
  hoverStylesClass
1225
1256
  ].join(" ");
1226
1257
  });
@@ -1627,8 +1658,9 @@ function BlocksWrapper(props) {
1627
1658
  if (!props.path) {
1628
1659
  return void 0;
1629
1660
  }
1661
+ const thisPrefix = "this.";
1630
1662
  const pathPrefix = "component.options.";
1631
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1663
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1632
1664
  });
1633
1665
  function onClick() {
1634
1666
  if (isEditing() && !props.blocks?.length) {
@@ -1663,7 +1695,7 @@ function BlocksWrapper(props) {
1663
1695
  });
1664
1696
  return <>
1665
1697
  <Dynamic4
1666
- class={className() + " dynamic-3c4beb0c"}
1698
+ class={className() + " dynamic-3d7ff108"}
1667
1699
  ref={blocksWrapperRef}
1668
1700
  builder-path={dataPath()}
1669
1701
  builder-parent-id={props.parent}
@@ -1675,7 +1707,7 @@ function BlocksWrapper(props) {
1675
1707
  {...props.BlocksWrapperProps}
1676
1708
  component={props.BlocksWrapper}
1677
1709
  >{props.children}</Dynamic4>
1678
- <style>{`.dynamic-3c4beb0c {
1710
+ <style>{`.dynamic-3d7ff108 {
1679
1711
  display: flex;
1680
1712
  flex-direction: column;
1681
1713
  align-items: stretch;
@@ -2047,10 +2079,10 @@ function SectionComponent(props) {
2047
2079
  var section_default = SectionComponent;
2048
2080
 
2049
2081
  // src/blocks/symbol/symbol.tsx
2050
- import { onMount as onMount7, on as on4, createEffect as createEffect4, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
2082
+ import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
2051
2083
 
2052
2084
  // src/components/content-variants/content-variants.tsx
2053
- import { Show as Show15, For as For8, onMount as onMount6, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
2085
+ import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
2054
2086
 
2055
2087
  // src/helpers/url.ts
2056
2088
  var getTopLevelDomain = (host) => {
@@ -2240,11 +2272,61 @@ var handleABTesting = async ({
2240
2272
  };
2241
2273
  };
2242
2274
 
2275
+ // src/helpers/user-attributes.ts
2276
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
2277
+ function createUserAttributesService() {
2278
+ let canTrack = true;
2279
+ const subscribers = /* @__PURE__ */ new Set();
2280
+ return {
2281
+ setUserAttributes(newAttrs) {
2282
+ if (!isBrowser()) {
2283
+ return;
2284
+ }
2285
+ const userAttributes = {
2286
+ ...this.getUserAttributes(),
2287
+ ...newAttrs
2288
+ };
2289
+ setCookie({
2290
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2291
+ value: JSON.stringify(userAttributes),
2292
+ canTrack
2293
+ });
2294
+ subscribers.forEach((callback) => callback(userAttributes));
2295
+ },
2296
+ getUserAttributes() {
2297
+ if (!isBrowser()) {
2298
+ return {};
2299
+ }
2300
+ return JSON.parse(getCookieSync({
2301
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2302
+ canTrack
2303
+ }) || "{}");
2304
+ },
2305
+ subscribeOnUserAttributesChange(callback) {
2306
+ subscribers.add(callback);
2307
+ return () => {
2308
+ subscribers.delete(callback);
2309
+ };
2310
+ },
2311
+ setCanTrack(value) {
2312
+ canTrack = value;
2313
+ }
2314
+ };
2315
+ }
2316
+ var userAttributesService = createUserAttributesService();
2317
+ var setClientUserAttributes = (attributes) => {
2318
+ userAttributesService.setUserAttributes(attributes);
2319
+ };
2320
+
2243
2321
  // src/helpers/canTrack.ts
2244
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2322
+ var getDefaultCanTrack = (canTrack) => {
2323
+ const result = checkIsDefined(canTrack) ? canTrack : true;
2324
+ userAttributesService.setCanTrack(result);
2325
+ return result;
2326
+ };
2245
2327
 
2246
2328
  // src/components/content/content.tsx
2247
- import { Show as Show14, createSignal as createSignal17 } from "solid-js";
2329
+ import { Show as Show15, createSignal as createSignal18 } from "solid-js";
2248
2330
 
2249
2331
  // src/blocks/accordion/component-info.ts
2250
2332
  var defaultTitle = {
@@ -2938,8 +3020,388 @@ var componentInfo5 = {
2938
3020
  }
2939
3021
  };
2940
3022
 
2941
- // src/blocks/section/component-info.ts
3023
+ // src/blocks/personalization-container/component-info.ts
2942
3024
  var componentInfo6 = {
3025
+ name: "PersonalizationContainer",
3026
+ shouldReceiveBuilderProps: {
3027
+ builderBlock: true,
3028
+ builderContext: true
3029
+ },
3030
+ noWrap: true,
3031
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
3032
+ canHaveChildren: true,
3033
+ inputs: [{
3034
+ name: "variants",
3035
+ defaultValue: [],
3036
+ behavior: "personalizationVariantList",
3037
+ type: "list",
3038
+ subFields: [{
3039
+ name: "name",
3040
+ type: "text"
3041
+ }, {
3042
+ name: "query",
3043
+ friendlyName: "Targeting rules",
3044
+ type: "BuilderQuery",
3045
+ defaultValue: []
3046
+ }, {
3047
+ name: "startDate",
3048
+ type: "date"
3049
+ }, {
3050
+ name: "endDate",
3051
+ type: "date"
3052
+ }, {
3053
+ name: "blocks",
3054
+ type: "uiBlocks",
3055
+ hideFromUI: true,
3056
+ defaultValue: []
3057
+ }]
3058
+ }]
3059
+ };
3060
+
3061
+ // src/blocks/personalization-container/personalization-container.tsx
3062
+ import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
3063
+
3064
+ // src/components/inlined-script.tsx
3065
+ function InlinedScript(props) {
3066
+ return <><script
3067
+ innerHTML={props.scriptStr}
3068
+ data-id={props.id}
3069
+ nonce={props.nonce || ""}
3070
+ /></>;
3071
+ }
3072
+ var Inlined_script_default = InlinedScript;
3073
+
3074
+ // src/functions/is-previewing.ts
3075
+ function isPreviewing(_search) {
3076
+ const search = _search || (isBrowser() ? window.location.search : void 0);
3077
+ if (!search) {
3078
+ return false;
3079
+ }
3080
+ const normalizedSearch = getSearchString(search);
3081
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
3082
+ }
3083
+
3084
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
3085
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
3086
+ function isString(val) {
3087
+ return typeof val === "string";
3088
+ }
3089
+ function isNumber(val) {
3090
+ return typeof val === "number";
3091
+ }
3092
+ function objectMatchesQuery(userattr, query2) {
3093
+ const result = (() => {
3094
+ const property = query2.property;
3095
+ const operator = query2.operator;
3096
+ let testValue = query2.value;
3097
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
3098
+ testValue = query2.value.slice(0, -1);
3099
+ }
3100
+ if (!(property && operator)) {
3101
+ return true;
3102
+ }
3103
+ if (Array.isArray(testValue)) {
3104
+ if (operator === "isNot") {
3105
+ return testValue.every((val) => objectMatchesQuery(userattr, {
3106
+ property,
3107
+ operator,
3108
+ value: val
3109
+ }));
3110
+ }
3111
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
3112
+ property,
3113
+ operator,
3114
+ value: val
3115
+ }));
3116
+ }
3117
+ const value = userattr[property];
3118
+ if (Array.isArray(value)) {
3119
+ return value.includes(testValue);
3120
+ }
3121
+ switch (operator) {
3122
+ case "is":
3123
+ return value === testValue;
3124
+ case "isNot":
3125
+ return value !== testValue;
3126
+ case "contains":
3127
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
3128
+ case "startsWith":
3129
+ return isString(value) && value.startsWith(String(testValue));
3130
+ case "endsWith":
3131
+ return isString(value) && value.endsWith(String(testValue));
3132
+ case "greaterThan":
3133
+ return isNumber(value) && isNumber(testValue) && value > testValue;
3134
+ case "lessThan":
3135
+ return isNumber(value) && isNumber(testValue) && value < testValue;
3136
+ case "greaterThanOrEqualTo":
3137
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
3138
+ case "lessThanOrEqualTo":
3139
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
3140
+ default:
3141
+ return false;
3142
+ }
3143
+ })();
3144
+ return result;
3145
+ }
3146
+ const item = {
3147
+ query,
3148
+ startDate,
3149
+ endDate
3150
+ };
3151
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
3152
+ if (item.startDate && new Date(item.startDate) > now) {
3153
+ return false;
3154
+ } else if (item.endDate && new Date(item.endDate) < now) {
3155
+ return false;
3156
+ }
3157
+ if (!item.query || !item.query.length) {
3158
+ return true;
3159
+ }
3160
+ return item.query.every((filter) => {
3161
+ return objectMatchesQuery(userAttributes, filter);
3162
+ });
3163
+ }
3164
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
3165
+ if (!navigator.cookieEnabled) {
3166
+ return;
3167
+ }
3168
+ function getCookie(name) {
3169
+ const nameEQ = name + '=';
3170
+ const ca = document.cookie.split(';');
3171
+ for (let i = 0; i < ca.length; i++) {
3172
+ let c = ca[i];
3173
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
3174
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
3175
+ }
3176
+ return null;
3177
+ }
3178
+ function removeVariants() {
3179
+ variants?.forEach(function (_, index) {
3180
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
3181
+ });
3182
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
3183
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
3184
+ }
3185
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
3186
+ if (locale) {
3187
+ attributes.locale = locale;
3188
+ }
3189
+ const winningVariantIndex = variants?.findIndex(function (variant) {
3190
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
3191
+ });
3192
+ const isDebug = location.href.includes('builder.debug=true');
3193
+ if (isDebug) {
3194
+ console.debug('PersonalizationContainer', {
3195
+ attributes,
3196
+ variants,
3197
+ winningVariantIndex
3198
+ });
3199
+ }
3200
+ if (winningVariantIndex !== -1) {
3201
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
3202
+ if (winningVariant) {
3203
+ const parentNode = winningVariant.parentNode;
3204
+ if (parentNode) {
3205
+ const newParent = parentNode.cloneNode(false);
3206
+ newParent.appendChild(winningVariant.content.firstChild);
3207
+ newParent.appendChild(winningVariant.content.lastChild);
3208
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
3209
+ }
3210
+ if (isDebug) {
3211
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
3212
+ }
3213
+ }
3214
+ } else if (variants && variants.length > 0) {
3215
+ removeVariants();
3216
+ }
3217
+ }`;
3218
+ var 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}";
3219
+
3220
+ // src/blocks/personalization-container/helpers.ts
3221
+ function checkShouldRenderVariants(variants, canTrack) {
3222
+ const hasVariants = variants && variants.length > 0;
3223
+ if (TARGET === "reactNative")
3224
+ return false;
3225
+ if (!hasVariants)
3226
+ return false;
3227
+ if (!canTrack)
3228
+ return false;
3229
+ if (TARGET === "vue" || TARGET === "svelte")
3230
+ return true;
3231
+ if (isBrowser())
3232
+ return false;
3233
+ return true;
3234
+ }
3235
+ function getBlocksToRender({
3236
+ variants,
3237
+ previewingIndex,
3238
+ isHydrated,
3239
+ filteredVariants,
3240
+ fallbackBlocks
3241
+ }) {
3242
+ const fallback = {
3243
+ blocks: fallbackBlocks ?? [],
3244
+ path: "this.children"
3245
+ };
3246
+ if (isHydrated && isEditing()) {
3247
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
3248
+ const variant = variants[previewingIndex];
3249
+ return {
3250
+ blocks: variant.blocks,
3251
+ path: `component.options.variants.${previewingIndex}.blocks`
3252
+ };
3253
+ }
3254
+ return fallback;
3255
+ }
3256
+ if (isBrowser()) {
3257
+ const winningVariant = filteredVariants?.[0];
3258
+ if (winningVariant) {
3259
+ return {
3260
+ blocks: winningVariant.blocks,
3261
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
3262
+ };
3263
+ }
3264
+ }
3265
+ return fallback;
3266
+ }
3267
+ var getPersonalizationScript = (variants, blockId, locale) => {
3268
+ return `
3269
+ (function() {
3270
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
3271
+ ${PERSONALIZATION_SCRIPT}
3272
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
3273
+ })();
3274
+ `;
3275
+ };
3276
+
3277
+ // src/blocks/personalization-container/personalization-container.tsx
3278
+ function PersonalizationContainer(props) {
3279
+ const [userAttributes, setUserAttributes] = createSignal10(
3280
+ userAttributesService.getUserAttributes()
3281
+ );
3282
+ const [scriptStr, setScriptStr] = createSignal10(
3283
+ getPersonalizationScript(
3284
+ props.variants,
3285
+ props.builderBlock?.id || "none",
3286
+ props.builderContext?.rootState?.locale
3287
+ )
3288
+ );
3289
+ const [unsubscribers, setUnsubscribers] = createSignal10([]);
3290
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
3291
+ checkShouldRenderVariants(
3292
+ props.variants,
3293
+ getDefaultCanTrack(props.builderContext?.canTrack)
3294
+ )
3295
+ );
3296
+ const [isHydrated, setIsHydrated] = createSignal10(false);
3297
+ const filteredVariants = createMemo10(() => {
3298
+ return (props.variants || []).filter((variant) => {
3299
+ return filterWithCustomTargeting(
3300
+ {
3301
+ ...props.builderContext?.rootState?.locale ? {
3302
+ locale: props.builderContext?.rootState?.locale
3303
+ } : {},
3304
+ ...userAttributes()
3305
+ },
3306
+ variant.query,
3307
+ variant.startDate,
3308
+ variant.endDate
3309
+ );
3310
+ });
3311
+ });
3312
+ const blocksToRender = createMemo10(() => {
3313
+ return getBlocksToRender({
3314
+ variants: props.variants,
3315
+ fallbackBlocks: props.builderBlock?.children,
3316
+ isHydrated: isHydrated(),
3317
+ filteredVariants: filteredVariants(),
3318
+ previewingIndex: props.previewingIndex
3319
+ });
3320
+ });
3321
+ const hideVariantsStyleString = createMemo10(() => {
3322
+ return (props.variants || []).map(
3323
+ (_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
3324
+ ).join("");
3325
+ });
3326
+ let rootRef;
3327
+ onMount4(() => {
3328
+ setIsHydrated(true);
3329
+ const unsub = userAttributesService.subscribeOnUserAttributesChange(
3330
+ (attrs) => {
3331
+ setUserAttributes(attrs);
3332
+ }
3333
+ );
3334
+ if (!(isEditing() || isPreviewing())) {
3335
+ const variant = filteredVariants()[0];
3336
+ if (rootRef) {
3337
+ rootRef.dispatchEvent(
3338
+ new CustomEvent("builder.variantLoaded", {
3339
+ detail: {
3340
+ variant: variant || "default",
3341
+ content: props.builderContext?.content
3342
+ },
3343
+ bubbles: true
3344
+ })
3345
+ );
3346
+ const observer = new IntersectionObserver((entries) => {
3347
+ entries.forEach((entry) => {
3348
+ if (entry.isIntersecting && rootRef) {
3349
+ rootRef.dispatchEvent(
3350
+ new CustomEvent("builder.variantDisplayed", {
3351
+ detail: {
3352
+ variant: variant || "default",
3353
+ content: props.builderContext?.content
3354
+ },
3355
+ bubbles: true
3356
+ })
3357
+ );
3358
+ }
3359
+ });
3360
+ });
3361
+ observer.observe(rootRef);
3362
+ }
3363
+ }
3364
+ unsubscribers().push(unsub);
3365
+ });
3366
+ return <><div
3367
+ class={`builder-personalization-container ${props.attributes?.className || ""}`}
3368
+ ref={rootRef}
3369
+ {...props.attributes}
3370
+ >
3371
+ <Show10 when={shouldRenderVariants()}>
3372
+ <For6 each={props.variants}>{(variant, _index) => {
3373
+ const index = _index();
3374
+ return <template
3375
+ key={index}
3376
+ data-variant-id={`${props.builderBlock?.id}-${index}`}
3377
+ ><Blocks_default
3378
+ blocks={variant.blocks}
3379
+ parent={props.builderBlock?.id}
3380
+ path={`component.options.variants.${index}.blocks`}
3381
+ /></template>;
3382
+ }}</For6>
3383
+ <Inlined_styles_default
3384
+ nonce={props.builderContext?.nonce || ""}
3385
+ styles={hideVariantsStyleString()}
3386
+ id={`variants-styles-${props.builderBlock?.id}`}
3387
+ />
3388
+ <Inlined_script_default
3389
+ nonce={props.builderContext?.nonce || ""}
3390
+ scriptStr={scriptStr()}
3391
+ id={`variants-script-${props.builderBlock?.id}`}
3392
+ />
3393
+ </Show10>
3394
+ <Blocks_default
3395
+ blocks={blocksToRender().blocks}
3396
+ parent={props.builderBlock?.id}
3397
+ path={blocksToRender().path}
3398
+ />
3399
+ </div></>;
3400
+ }
3401
+ var personalization_container_default = PersonalizationContainer;
3402
+
3403
+ // src/blocks/section/component-info.ts
3404
+ var componentInfo7 = {
2943
3405
  name: "Core:Section",
2944
3406
  static: true,
2945
3407
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2981,7 +3443,7 @@ var componentInfo6 = {
2981
3443
  };
2982
3444
 
2983
3445
  // src/blocks/slot/component-info.ts
2984
- var componentInfo7 = {
3446
+ var componentInfo8 = {
2985
3447
  name: "Slot",
2986
3448
  isRSC: true,
2987
3449
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -3020,7 +3482,7 @@ function Slot(props) {
3020
3482
  var slot_default = Slot;
3021
3483
 
3022
3484
  // src/blocks/symbol/component-info.ts
3023
- var componentInfo8 = {
3485
+ var componentInfo9 = {
3024
3486
  name: "Symbol",
3025
3487
  noWrap: true,
3026
3488
  static: true,
@@ -3102,7 +3564,7 @@ var defaultElement = {
3102
3564
  }
3103
3565
  }
3104
3566
  };
3105
- var componentInfo9 = {
3567
+ var componentInfo10 = {
3106
3568
  name: "Builder: Tabs",
3107
3569
  inputs: [{
3108
3570
  name: "tabs",
@@ -3208,9 +3670,9 @@ var componentInfo9 = {
3208
3670
  };
3209
3671
 
3210
3672
  // src/blocks/tabs/tabs.tsx
3211
- import { Show as Show10, For as For6, createSignal as createSignal10 } from "solid-js";
3673
+ import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
3212
3674
  function Tabs(props) {
3213
- const [activeTab, setActiveTab] = createSignal10(
3675
+ const [activeTab, setActiveTab] = createSignal11(
3214
3676
  props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
3215
3677
  );
3216
3678
  function activeTabContent(active) {
@@ -3232,7 +3694,7 @@ function Tabs(props) {
3232
3694
  "justify-content": props.tabHeaderLayout || "flex-start",
3233
3695
  overflow: "auto"
3234
3696
  }}
3235
- ><For6 each={props.tabs}>{(tab, _index) => {
3697
+ ><For7 each={props.tabs}>{(tab, _index) => {
3236
3698
  const index = _index();
3237
3699
  return <span
3238
3700
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
@@ -3249,21 +3711,21 @@ function Tabs(props) {
3249
3711
  registeredComponents={props.builderComponents}
3250
3712
  linkComponent={props.builderLinkComponent}
3251
3713
  /></span>;
3252
- }}</For6></div>
3253
- <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
3714
+ }}</For7></div>
3715
+ <Show11 when={activeTabContent(activeTab())}><div><Blocks_default
3254
3716
  parent={props.builderBlock.id}
3255
3717
  path={`tabs.${activeTab()}.content`}
3256
3718
  blocks={activeTabContent(activeTab())}
3257
3719
  context={props.builderContext}
3258
3720
  registeredComponents={props.builderComponents}
3259
3721
  linkComponent={props.builderLinkComponent}
3260
- /></div></Show10>
3722
+ /></div></Show11>
3261
3723
  </div></>;
3262
3724
  }
3263
3725
  var tabs_default = Tabs;
3264
3726
 
3265
3727
  // src/blocks/text/component-info.ts
3266
- var componentInfo10 = {
3728
+ var componentInfo11 = {
3267
3729
  shouldReceiveBuilderProps: {
3268
3730
  builderBlock: TARGET === "reactNative" ? true : false,
3269
3731
  builderContext: true
@@ -3300,7 +3762,7 @@ function Text(props) {
3300
3762
  var text_default = Text;
3301
3763
 
3302
3764
  // src/blocks/custom-code/component-info.ts
3303
- var componentInfo11 = {
3765
+ var componentInfo12 = {
3304
3766
  name: "Custom Code",
3305
3767
  static: true,
3306
3768
  requiredPermissions: ["editCode"],
@@ -3325,12 +3787,12 @@ var componentInfo11 = {
3325
3787
  };
3326
3788
 
3327
3789
  // src/blocks/custom-code/custom-code.tsx
3328
- import { onMount as onMount4, createSignal as createSignal11 } from "solid-js";
3790
+ import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
3329
3791
  function CustomCode(props) {
3330
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
3331
- const [scriptsRun, setScriptsRun] = createSignal11([]);
3792
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3793
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
3332
3794
  let elementRef;
3333
- onMount4(() => {
3795
+ onMount5(() => {
3334
3796
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
3335
3797
  return;
3336
3798
  }
@@ -3371,7 +3833,7 @@ function CustomCode(props) {
3371
3833
  var custom_code_default = CustomCode;
3372
3834
 
3373
3835
  // src/blocks/embed/component-info.ts
3374
- var componentInfo12 = {
3836
+ var componentInfo13 = {
3375
3837
  name: "Embed",
3376
3838
  static: true,
3377
3839
  inputs: [{
@@ -3389,7 +3851,7 @@ var componentInfo12 = {
3389
3851
  };
3390
3852
 
3391
3853
  // src/blocks/embed/embed.tsx
3392
- import { on as on2, createEffect as createEffect2, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
3854
+ import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
3393
3855
 
3394
3856
  // src/blocks/embed/helpers.ts
3395
3857
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -3397,9 +3859,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3397
3859
 
3398
3860
  // src/blocks/embed/embed.tsx
3399
3861
  function Embed(props) {
3400
- const [scriptsInserted, setScriptsInserted] = createSignal12([]);
3401
- const [scriptsRun, setScriptsRun] = createSignal12([]);
3402
- const [ranInitFn, setRanInitFn] = createSignal12(false);
3862
+ const [scriptsInserted, setScriptsInserted] = createSignal13([]);
3863
+ const [scriptsRun, setScriptsRun] = createSignal13([]);
3864
+ const [ranInitFn, setRanInitFn] = createSignal13(false);
3403
3865
  function findAndRunScripts() {
3404
3866
  if (!elem || !elem.getElementsByTagName)
3405
3867
  return;
@@ -3422,8 +3884,8 @@ function Embed(props) {
3422
3884
  }
3423
3885
  }
3424
3886
  let elem;
3425
- const onUpdateFn_0_elem = createMemo12(() => elem);
3426
- const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
3887
+ const onUpdateFn_0_elem = createMemo13(() => elem);
3888
+ const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
3427
3889
  function onUpdateFn_0() {
3428
3890
  if (elem && !ranInitFn()) {
3429
3891
  setRanInitFn(true);
@@ -3438,7 +3900,7 @@ function Embed(props) {
3438
3900
  var embed_default = Embed;
3439
3901
 
3440
3902
  // src/blocks/form/form/component-info.ts
3441
- var componentInfo13 = {
3903
+ var componentInfo14 = {
3442
3904
  name: "Form:Form",
3443
3905
  // editableTags: ['builder-form-error']
3444
3906
  defaults: {
@@ -3678,7 +4140,7 @@ var componentInfo13 = {
3678
4140
  };
3679
4141
 
3680
4142
  // src/blocks/form/form/form.tsx
3681
- import { Show as Show11, createSignal as createSignal13 } from "solid-js";
4143
+ import { Show as Show12, createSignal as createSignal14 } from "solid-js";
3682
4144
 
3683
4145
  // src/functions/get-env.ts
3684
4146
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -3698,9 +4160,9 @@ function logFetch(url) {
3698
4160
 
3699
4161
  // src/blocks/form/form/form.tsx
3700
4162
  function FormComponent(props) {
3701
- const [formState, setFormState] = createSignal13("unsubmitted");
3702
- const [responseData, setResponseData] = createSignal13(null);
3703
- const [formErrorMessage, setFormErrorMessage] = createSignal13("");
4163
+ const [formState, setFormState] = createSignal14("unsubmitted");
4164
+ const [responseData, setResponseData] = createSignal14(null);
4165
+ const [formErrorMessage, setFormErrorMessage] = createSignal14("");
3704
4166
  function mergeNewRootState(newData) {
3705
4167
  const combinedState = {
3706
4168
  ...props.builderContext.rootState,
@@ -3896,22 +4358,22 @@ function FormComponent(props) {
3896
4358
  {...props.attributes}
3897
4359
  >
3898
4360
  {props.children}
3899
- <Show11 when={submissionState() === "error"}><Blocks_default
4361
+ <Show12 when={submissionState() === "error"}><Blocks_default
3900
4362
  path="errorMessage"
3901
4363
  blocks={props.errorMessage}
3902
4364
  context={props.builderContext}
3903
- /></Show11>
3904
- <Show11 when={submissionState() === "sending"}><Blocks_default
4365
+ /></Show12>
4366
+ <Show12 when={submissionState() === "sending"}><Blocks_default
3905
4367
  path="sendingMessage"
3906
4368
  blocks={props.sendingMessage}
3907
4369
  context={props.builderContext}
3908
- /></Show11>
3909
- <Show11 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show11>
3910
- <Show11 when={submissionState() === "success"}><Blocks_default
4370
+ /></Show12>
4371
+ <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
4372
+ <Show12 when={submissionState() === "success"}><Blocks_default
3911
4373
  path="successMessage"
3912
4374
  blocks={props.successMessage}
3913
4375
  context={props.builderContext}
3914
- /></Show11>
4376
+ /></Show12>
3915
4377
  </form>
3916
4378
  <style>{`.pre-04a43b72 {
3917
4379
  padding: 10px;
@@ -3923,7 +4385,7 @@ function FormComponent(props) {
3923
4385
  var form_default = FormComponent;
3924
4386
 
3925
4387
  // src/blocks/form/input/component-info.ts
3926
- var componentInfo14 = {
4388
+ var componentInfo15 = {
3927
4389
  name: "Form:Input",
3928
4390
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
3929
4391
  inputs: [
@@ -3993,7 +4455,7 @@ function FormInputComponent(props) {
3993
4455
  var input_default = FormInputComponent;
3994
4456
 
3995
4457
  // src/blocks/form/select/component-info.ts
3996
- var componentInfo15 = {
4458
+ var componentInfo16 = {
3997
4459
  name: "Form:Select",
3998
4460
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
3999
4461
  defaultStyles: {
@@ -4038,7 +4500,7 @@ var componentInfo15 = {
4038
4500
  };
4039
4501
 
4040
4502
  // src/blocks/form/select/select.tsx
4041
- import { For as For7 } from "solid-js";
4503
+ import { For as For8 } from "solid-js";
4042
4504
  function SelectComponent(props) {
4043
4505
  return <><select
4044
4506
  {...{}}
@@ -4048,15 +4510,15 @@ function SelectComponent(props) {
4048
4510
  defaultValue={props.defaultValue}
4049
4511
  name={props.name}
4050
4512
  required={props.required}
4051
- ><For7 each={props.options}>{(option, _index) => {
4513
+ ><For8 each={props.options}>{(option, _index) => {
4052
4514
  const index = _index();
4053
4515
  return <option key={`${option.name}-${index}`} value={option.value}>{option.name || option.value}</option>;
4054
- }}</For7></select></>;
4516
+ }}</For8></select></>;
4055
4517
  }
4056
4518
  var select_default = SelectComponent;
4057
4519
 
4058
4520
  // src/blocks/form/submit-button/component-info.ts
4059
- var componentInfo16 = {
4521
+ var componentInfo17 = {
4060
4522
  name: "Form:SubmitButton",
4061
4523
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
4062
4524
  defaultStyles: {
@@ -4090,7 +4552,7 @@ function SubmitButton(props) {
4090
4552
  var submit_button_default = SubmitButton;
4091
4553
 
4092
4554
  // src/blocks/form/textarea/component-info.ts
4093
- var componentInfo17 = {
4555
+ var componentInfo18 = {
4094
4556
  name: "Form:TextArea",
4095
4557
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
4096
4558
  inputs: [{
@@ -4143,7 +4605,7 @@ function Textarea(props) {
4143
4605
  var textarea_default = Textarea;
4144
4606
 
4145
4607
  // src/blocks/img/component-info.ts
4146
- var componentInfo18 = {
4608
+ var componentInfo19 = {
4147
4609
  // friendlyName?
4148
4610
  name: "Raw:Img",
4149
4611
  hideFromInsertMenu: true,
@@ -4176,7 +4638,7 @@ function ImgComponent(props) {
4176
4638
  var img_default = ImgComponent;
4177
4639
 
4178
4640
  // src/blocks/video/component-info.ts
4179
- var componentInfo19 = {
4641
+ var componentInfo20 = {
4180
4642
  name: "Video",
4181
4643
  canHaveChildren: true,
4182
4644
  defaultStyles: {
@@ -4263,9 +4725,9 @@ var componentInfo19 = {
4263
4725
  };
4264
4726
 
4265
4727
  // src/blocks/video/video.tsx
4266
- import { Show as Show12, createMemo as createMemo14 } from "solid-js";
4728
+ import { Show as Show13, createMemo as createMemo15 } from "solid-js";
4267
4729
  function Video(props) {
4268
- const videoProps = createMemo14(() => {
4730
+ const videoProps = createMemo15(() => {
4269
4731
  return {
4270
4732
  ...props.autoPlay === true ? {
4271
4733
  autoPlay: true
@@ -4284,7 +4746,7 @@ function Video(props) {
4284
4746
  } : {}
4285
4747
  };
4286
4748
  });
4287
- const spreadProps = createMemo14(() => {
4749
+ const spreadProps = createMemo15(() => {
4288
4750
  return {
4289
4751
  ...videoProps()
4290
4752
  };
@@ -4313,8 +4775,8 @@ function Video(props) {
4313
4775
  }}
4314
4776
  src={props.video || "no-src"}
4315
4777
  poster={props.posterImage}
4316
- ><Show12 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show12></video>
4317
- <Show12
4778
+ ><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
4779
+ <Show13
4318
4780
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
4319
4781
  ><div
4320
4782
  style={{
@@ -4323,15 +4785,15 @@ function Video(props) {
4323
4785
  "pointer-events": "none",
4324
4786
  "font-size": "0px"
4325
4787
  }}
4326
- /></Show12>
4327
- <Show12 when={props.builderBlock?.children?.length && props.fitContent}><div
4788
+ /></Show13>
4789
+ <Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
4328
4790
  style={{
4329
4791
  display: "flex",
4330
4792
  "flex-direction": "column",
4331
4793
  "align-items": "stretch"
4332
4794
  }}
4333
- >{props.children}</div></Show12>
4334
- <Show12 when={props.builderBlock?.children?.length && !props.fitContent}><div
4795
+ >{props.children}</div></Show13>
4796
+ <Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
4335
4797
  style={{
4336
4798
  "pointer-events": "none",
4337
4799
  display: "flex",
@@ -4343,7 +4805,7 @@ function Video(props) {
4343
4805
  width: "100%",
4344
4806
  height: "100%"
4345
4807
  }}
4346
- >{props.children}</div></Show12>
4808
+ >{props.children}</div></Show13>
4347
4809
  </div></>;
4348
4810
  }
4349
4811
  var video_default = Video;
@@ -4351,31 +4813,31 @@ var video_default = Video;
4351
4813
  // src/constants/extra-components.ts
4352
4814
  var getExtraComponents = () => [{
4353
4815
  component: custom_code_default,
4354
- ...componentInfo11
4816
+ ...componentInfo12
4355
4817
  }, {
4356
4818
  component: embed_default,
4357
- ...componentInfo12
4819
+ ...componentInfo13
4358
4820
  }, ...TARGET === "rsc" ? [] : [{
4359
4821
  component: form_default,
4360
- ...componentInfo13
4822
+ ...componentInfo14
4361
4823
  }, {
4362
4824
  component: input_default,
4363
- ...componentInfo14
4825
+ ...componentInfo15
4364
4826
  }, {
4365
4827
  component: submit_button_default,
4366
- ...componentInfo16
4828
+ ...componentInfo17
4367
4829
  }, {
4368
4830
  component: select_default,
4369
- ...componentInfo15
4831
+ ...componentInfo16
4370
4832
  }, {
4371
4833
  component: textarea_default,
4372
- ...componentInfo17
4834
+ ...componentInfo18
4373
4835
  }], {
4374
4836
  component: img_default,
4375
- ...componentInfo18
4837
+ ...componentInfo19
4376
4838
  }, {
4377
4839
  component: video_default,
4378
- ...componentInfo19
4840
+ ...componentInfo20
4379
4841
  }];
4380
4842
 
4381
4843
  // src/constants/builder-registered-components.ts
@@ -4393,19 +4855,22 @@ var getDefaultRegisteredComponents = () => [{
4393
4855
  ...componentInfo5
4394
4856
  }, {
4395
4857
  component: section_default,
4396
- ...componentInfo6
4858
+ ...componentInfo7
4397
4859
  }, {
4398
4860
  component: slot_default,
4399
- ...componentInfo7
4861
+ ...componentInfo8
4400
4862
  }, {
4401
4863
  component: symbol_default,
4402
- ...componentInfo8
4864
+ ...componentInfo9
4403
4865
  }, {
4404
4866
  component: text_default,
4405
- ...componentInfo10
4406
- }, ...TARGET === "rsc" ? [] : [{
4867
+ ...componentInfo11
4868
+ }, ...TARGET === "react" ? [{
4869
+ component: personalization_container_default,
4870
+ ...componentInfo6
4871
+ }] : [], ...TARGET === "rsc" ? [] : [{
4407
4872
  component: tabs_default,
4408
- ...componentInfo9
4873
+ ...componentInfo10
4409
4874
  }, {
4410
4875
  component: accordion_default,
4411
4876
  ...componentInfo
@@ -4443,7 +4908,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
4443
4908
  testVariationId: variant.id,
4444
4909
  id: content?.id
4445
4910
  }));
4446
- var checkShouldRenderVariants = ({
4911
+ var checkShouldRenderVariants2 = ({
4447
4912
  canTrack,
4448
4913
  content
4449
4914
  }) => {
@@ -4477,24 +4942,14 @@ var getUpdateVariantVisibilityScript = ({
4477
4942
  "${variationId}", "${contentId}", ${isHydrationTarget}
4478
4943
  )`;
4479
4944
 
4480
- // src/components/inlined-script.tsx
4481
- function InlinedScript(props) {
4482
- return <><script
4483
- innerHTML={props.scriptStr}
4484
- data-id={props.id}
4485
- nonce={props.nonce || ""}
4486
- /></>;
4487
- }
4488
- var Inlined_script_default = InlinedScript;
4489
-
4490
4945
  // src/components/content/components/enable-editor.tsx
4491
4946
  import {
4492
- Show as Show13,
4493
- onMount as onMount5,
4947
+ Show as Show14,
4948
+ onMount as onMount6,
4494
4949
  on as on3,
4495
4950
  createEffect as createEffect3,
4496
- createMemo as createMemo15,
4497
- createSignal as createSignal15
4951
+ createMemo as createMemo16,
4952
+ createSignal as createSignal16
4498
4953
  } from "solid-js";
4499
4954
  import { Dynamic as Dynamic5 } from "solid-js/web";
4500
4955
 
@@ -4504,7 +4959,7 @@ function getPreviewContent(_searchParams) {
4504
4959
  }
4505
4960
 
4506
4961
  // src/constants/sdk-version.ts
4507
- var SDK_VERSION = "3.0.5";
4962
+ var SDK_VERSION = "3.0.7";
4508
4963
 
4509
4964
  // src/helpers/sdk-headers.ts
4510
4965
  var getSdkHeaders = () => ({
@@ -4799,16 +5254,6 @@ async function fetchEntries(options) {
4799
5254
  return _processContentResult(options, content);
4800
5255
  }
4801
5256
 
4802
- // src/functions/is-previewing.ts
4803
- function isPreviewing(_search) {
4804
- const search = _search || (isBrowser() ? window.location.search : void 0);
4805
- if (!search) {
4806
- return false;
4807
- }
4808
- const normalizedSearch = getSearchString(search);
4809
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
4810
- }
4811
-
4812
5257
  // src/helpers/uuid.ts
4813
5258
  function uuidv4() {
4814
5259
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -5131,7 +5576,9 @@ var setupBrowserForEditing = (options = {}) => {
5131
5576
  // Supports builder-model="..." attribute which is needed to
5132
5577
  // scope our '+ add block' button styling
5133
5578
  supportsAddBlockScoping: true,
5134
- supportsCustomBreakpoints: true
5579
+ supportsCustomBreakpoints: true,
5580
+ supportsXSmallBreakpoint: TARGET === "reactNative" ? false : true,
5581
+ blockLevelPersonalization: true
5135
5582
  }
5136
5583
  }, "*");
5137
5584
  window.parent?.postMessage({
@@ -5346,12 +5793,12 @@ var getWrapperClassName = (variationId) => {
5346
5793
 
5347
5794
  // src/components/content/components/enable-editor.tsx
5348
5795
  function EnableEditor(props) {
5349
- const [ContentWrapper, setContentWrapper] = createSignal15(
5796
+ const [ContentWrapper, setContentWrapper] = createSignal16(
5350
5797
  props.contentWrapper || "div"
5351
5798
  );
5352
- const [httpReqsData, setHttpReqsData] = createSignal15({});
5353
- const [httpReqsPending, setHttpReqsPending] = createSignal15({});
5354
- const [clicked, setClicked] = createSignal15(false);
5799
+ const [httpReqsData, setHttpReqsData] = createSignal16({});
5800
+ const [httpReqsPending, setHttpReqsPending] = createSignal16({});
5801
+ const [clicked, setClicked] = createSignal16(false);
5355
5802
  function mergeNewRootState(newData) {
5356
5803
  const combinedState = {
5357
5804
  ...props.builderContextSignal.rootState,
@@ -5385,7 +5832,7 @@ function EnableEditor(props) {
5385
5832
  content: newContentValue
5386
5833
  }));
5387
5834
  }
5388
- const showContentProps = createMemo15(() => {
5835
+ const showContentProps = createMemo16(() => {
5389
5836
  return props.showContent ? {} : {
5390
5837
  hidden: true,
5391
5838
  "aria-hidden": true
@@ -5491,7 +5938,7 @@ function EnableEditor(props) {
5491
5938
  let elementRef;
5492
5939
  runHttpRequests();
5493
5940
  emitStateUpdate();
5494
- onMount5(() => {
5941
+ onMount6(() => {
5495
5942
  if (isBrowser()) {
5496
5943
  if (isEditing() && !props.isNestedRender) {
5497
5944
  window.addEventListener("message", processMessage);
@@ -5560,14 +6007,14 @@ function EnableEditor(props) {
5560
6007
  }
5561
6008
  }
5562
6009
  });
5563
- const onUpdateFn_0_props_content = createMemo15(() => props.content);
6010
+ const onUpdateFn_0_props_content = createMemo16(() => props.content);
5564
6011
  function onUpdateFn_0() {
5565
6012
  if (props.content) {
5566
6013
  mergeNewContent(props.content);
5567
6014
  }
5568
6015
  }
5569
6016
  createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
5570
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo15(
6017
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
5571
6018
  () => props.builderContextSignal.rootState
5572
6019
  );
5573
6020
  function onUpdateFn_1() {
@@ -5579,14 +6026,14 @@ function EnableEditor(props) {
5579
6026
  onUpdateFn_1
5580
6027
  )
5581
6028
  );
5582
- const onUpdateFn_2_props_data = createMemo15(() => props.data);
6029
+ const onUpdateFn_2_props_data = createMemo16(() => props.data);
5583
6030
  function onUpdateFn_2() {
5584
6031
  if (props.data) {
5585
6032
  mergeNewRootState(props.data);
5586
6033
  }
5587
6034
  }
5588
6035
  createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
5589
- const onUpdateFn_3_props_locale = createMemo15(() => props.locale);
6036
+ const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
5590
6037
  function onUpdateFn_3() {
5591
6038
  if (props.locale) {
5592
6039
  mergeNewRootState({
@@ -5595,7 +6042,7 @@ function EnableEditor(props) {
5595
6042
  }
5596
6043
  }
5597
6044
  createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
5598
- return <><builder_context_default.Provider value={props.builderContextSignal}><Show13
6045
+ return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
5599
6046
  when={props.builderContextSignal.content || needsElementRefDivForEditing()}
5600
6047
  ><Dynamic5
5601
6048
  class={getWrapperClassName(
@@ -5613,14 +6060,14 @@ function EnableEditor(props) {
5613
6060
  {...showContentProps()}
5614
6061
  {...props.contentWrapperProps}
5615
6062
  component={ContentWrapper()}
5616
- >{props.children}</Dynamic5></Show13></builder_context_default.Provider></>;
6063
+ >{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
5617
6064
  }
5618
6065
  var Enable_editor_default = EnableEditor;
5619
6066
 
5620
6067
  // src/components/content/components/styles.tsx
5621
- import { createSignal as createSignal16 } from "solid-js";
6068
+ import { createSignal as createSignal17 } from "solid-js";
5622
6069
  function ContentStyles(props) {
5623
- const [injectedStyles, setInjectedStyles] = createSignal16(
6070
+ const [injectedStyles, setInjectedStyles] = createSignal17(
5624
6071
  `
5625
6072
  ${getCss({
5626
6073
  cssCode: props.cssCode,
@@ -5678,7 +6125,7 @@ var getContentInitialValue = ({
5678
6125
 
5679
6126
  // src/components/content/content.tsx
5680
6127
  function ContentComponent(props) {
5681
- const [scriptStr, setScriptStr] = createSignal17(
6128
+ const [scriptStr, setScriptStr] = createSignal18(
5682
6129
  getUpdateVariantVisibilityScript({
5683
6130
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5684
6131
  variationId: props.content?.testVariationId,
@@ -5686,7 +6133,7 @@ function ContentComponent(props) {
5686
6133
  contentId: props.content?.id
5687
6134
  })
5688
6135
  );
5689
- const [registeredComponents, setRegisteredComponents] = createSignal17(
6136
+ const [registeredComponents, setRegisteredComponents] = createSignal18(
5690
6137
  [
5691
6138
  ...getDefaultRegisteredComponents(),
5692
6139
  ...props.customComponents || []
@@ -5701,7 +6148,7 @@ function ContentComponent(props) {
5701
6148
  {}
5702
6149
  )
5703
6150
  );
5704
- const [builderContextSignal, setBuilderContextSignal] = createSignal17({
6151
+ const [builderContextSignal, setBuilderContextSignal] = createSignal18({
5705
6152
  content: getContentInitialValue({
5706
6153
  content: props.content,
5707
6154
  data: props.data
@@ -5785,18 +6232,18 @@ function ContentComponent(props) {
5785
6232
  setBuilderContextSignal
5786
6233
  }}
5787
6234
  >
5788
- <Show14 when={props.isSsrAbTest}><Inlined_script_default
6235
+ <Show15 when={props.isSsrAbTest}><Inlined_script_default
5789
6236
  id="builderio-variant-visibility"
5790
6237
  scriptStr={scriptStr()}
5791
6238
  nonce={props.nonce || ""}
5792
- /></Show14>
5793
- <Show14 when={TARGET !== "reactNative"}><Styles_default
6239
+ /></Show15>
6240
+ <Show15 when={TARGET !== "reactNative"}><Styles_default
5794
6241
  nonce={props.nonce || ""}
5795
6242
  isNestedRender={props.isNestedRender}
5796
6243
  contentId={builderContextSignal().content?.id}
5797
6244
  cssCode={builderContextSignal().content?.data?.cssCode}
5798
6245
  customFonts={builderContextSignal().content?.data?.customFonts}
5799
- /></Show14>
6246
+ /></Show15>
5800
6247
  <Blocks_default
5801
6248
  blocks={builderContextSignal().content?.data?.blocks}
5802
6249
  context={builderContextSignal()}
@@ -5809,13 +6256,13 @@ var Content_default = ContentComponent;
5809
6256
 
5810
6257
  // src/components/content-variants/content-variants.tsx
5811
6258
  function ContentVariants(props) {
5812
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
5813
- checkShouldRenderVariants({
6259
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
6260
+ checkShouldRenderVariants2({
5814
6261
  canTrack: getDefaultCanTrack(props.canTrack),
5815
6262
  content: props.content
5816
6263
  })
5817
6264
  );
5818
- const updateCookieAndStylesScriptStr = createMemo18(() => {
6265
+ const updateCookieAndStylesScriptStr = createMemo19(() => {
5819
6266
  return getUpdateCookieAndStylesScript(
5820
6267
  getVariants(props.content).map((value) => ({
5821
6268
  id: value.testVariationId,
@@ -5824,10 +6271,10 @@ function ContentVariants(props) {
5824
6271
  props.content?.id || ""
5825
6272
  );
5826
6273
  });
5827
- const hideVariantsStyleString = createMemo18(() => {
6274
+ const hideVariantsStyleString = createMemo19(() => {
5828
6275
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
5829
6276
  });
5830
- const defaultContent = createMemo18(() => {
6277
+ const defaultContent = createMemo19(() => {
5831
6278
  return shouldRenderVariants() ? {
5832
6279
  ...props.content,
5833
6280
  testVariationId: props.content?.id
@@ -5836,16 +6283,16 @@ function ContentVariants(props) {
5836
6283
  canTrack: getDefaultCanTrack(props.canTrack)
5837
6284
  });
5838
6285
  });
5839
- onMount6(() => {
6286
+ onMount7(() => {
5840
6287
  setShouldRenderVariants(false);
5841
6288
  });
5842
6289
  return <><>
5843
- <Show15 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
6290
+ <Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
5844
6291
  id="builderio-init-variants-fns"
5845
6292
  scriptStr={getInitVariantsFnsScriptString()}
5846
6293
  nonce={props.nonce || ""}
5847
- /></Show15>
5848
- <Show15 when={shouldRenderVariants()}>
6294
+ /></Show16>
6295
+ <Show16 when={shouldRenderVariants()}>
5849
6296
  <Inlined_styles_default
5850
6297
  id="builderio-variants"
5851
6298
  styles={hideVariantsStyleString()}
@@ -5856,7 +6303,7 @@ function ContentVariants(props) {
5856
6303
  scriptStr={updateCookieAndStylesScriptStr()}
5857
6304
  nonce={props.nonce || ""}
5858
6305
  />
5859
- <For8 each={getVariants(props.content)}>{(variant, _index) => {
6306
+ <For9 each={getVariants(props.content)}>{(variant, _index) => {
5860
6307
  const index = _index();
5861
6308
  return <Content_default
5862
6309
  apiHost={props.apiHost}
@@ -5883,8 +6330,8 @@ function ContentVariants(props) {
5883
6330
  trustedHosts={props.trustedHosts}
5884
6331
  {...{}}
5885
6332
  />;
5886
- }}</For8>
5887
- </Show15>
6333
+ }}</For9>
6334
+ </Show16>
5888
6335
  <Content_default
5889
6336
  apiHost={props.apiHost}
5890
6337
  nonce={props.nonce}
@@ -5939,14 +6386,14 @@ var fetchSymbolContent = async ({
5939
6386
 
5940
6387
  // src/blocks/symbol/symbol.tsx
5941
6388
  function Symbol(props) {
5942
- const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
5943
- const blocksWrapper = createMemo19(() => {
6389
+ const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
6390
+ const blocksWrapper = createMemo20(() => {
5944
6391
  return "div";
5945
6392
  });
5946
- const contentWrapper = createMemo19(() => {
6393
+ const contentWrapper = createMemo20(() => {
5947
6394
  return "div";
5948
6395
  });
5949
- const className = createMemo19(() => {
6396
+ const className = createMemo20(() => {
5950
6397
  return [
5951
6398
  ...[props.attributes[getClassPropName()]],
5952
6399
  "builder-symbol",
@@ -5966,9 +6413,9 @@ function Symbol(props) {
5966
6413
  }
5967
6414
  });
5968
6415
  }
5969
- onMount7(() => {
6416
+ onMount8(() => {
5970
6417
  });
5971
- const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
6418
+ const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
5972
6419
  function onUpdateFn_0() {
5973
6420
  setContent();
5974
6421
  }
@@ -6053,6 +6500,7 @@ export {
6053
6500
  isEditing,
6054
6501
  isPreviewing,
6055
6502
  register,
6503
+ setClientUserAttributes,
6056
6504
  setEditorSettings,
6057
6505
  subscribeToEditor,
6058
6506
  track