@builder.io/sdk-solid 3.0.3 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/node/dev.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
2
- import { createContext, useContext, Show, For, createMemo, onMount, createSignal, createEffect, on } from 'solid-js';
2
+ import { createContext, useContext, Show, For, createMemo, createSignal, onMount, createEffect, on } from 'solid-js';
3
3
  import { createRequire } from 'node:module';
4
4
 
5
5
  // src/blocks/button/button.tsx
@@ -1785,7 +1785,7 @@ function Block(props) {
1785
1785
  });
1786
1786
  }
1787
1787
  var block_default = Block;
1788
- var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3c4beb0c {
1788
+ var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
1789
1789
  display: flex;
1790
1790
  flex-direction: column;
1791
1791
  align-items: stretch;
@@ -1798,8 +1798,9 @@ function BlocksWrapper(props) {
1798
1798
  if (!props.path) {
1799
1799
  return void 0;
1800
1800
  }
1801
+ const thisPrefix = "this.";
1801
1802
  const pathPrefix = "component.options.";
1802
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1803
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
1803
1804
  });
1804
1805
  function onClick() {
1805
1806
  if (isEditing() && !props.blocks?.length) {
@@ -1828,7 +1829,7 @@ function BlocksWrapper(props) {
1828
1829
  });
1829
1830
  return [createComponent(Dynamic, mergeProps({
1830
1831
  get ["class"]() {
1831
- return className() + " dynamic-3c4beb0c";
1832
+ return className() + " dynamic-3d7ff108";
1832
1833
  },
1833
1834
  ref(r$) {
1834
1835
  const _ref$ = blocksWrapperRef;
@@ -1927,7 +1928,7 @@ var getColumnsClass = (id) => {
1927
1928
 
1928
1929
  // src/blocks/columns/columns.tsx
1929
1930
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
1930
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-3e5f33a4 {
1931
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-6331dfc5 {
1931
1932
  display: flex;
1932
1933
  line-height: normal;
1933
1934
  }`);
@@ -2056,7 +2057,7 @@ function Columns(props) {
2056
2057
  const _el$ = _tmpl$3();
2057
2058
  spread(_el$, mergeProps({
2058
2059
  get ["class"]() {
2059
- return getColumnsClass(props.builderBlock?.id) + " div-3e5f33a4";
2060
+ return getColumnsClass(props.builderBlock?.id) + " div-6331dfc5";
2060
2061
  },
2061
2062
  get style() {
2062
2063
  return columnsCssVars();
@@ -2097,9 +2098,6 @@ function Columns(props) {
2097
2098
  get parent() {
2098
2099
  return props.builderBlock.id;
2099
2100
  },
2100
- styleProp: {
2101
- flexGrow: "1"
2102
- },
2103
2101
  get context() {
2104
2102
  return props.builderContext;
2105
2103
  },
@@ -2111,6 +2109,9 @@ function Columns(props) {
2111
2109
  },
2112
2110
  get blocks() {
2113
2111
  return column.blocks;
2112
+ },
2113
+ styleProp: {
2114
+ "flex-grow": "1"
2114
2115
  }
2115
2116
  });
2116
2117
  }
@@ -2181,16 +2182,16 @@ function getSrcSet(url) {
2181
2182
  // src/blocks/image/image.tsx
2182
2183
  var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
2183
2184
  var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
2184
- var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-56e07140">`);
2185
- var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-56e07140-2>`);
2186
- var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-56e07140 {
2185
+ var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-dc6700b4">`);
2186
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-dc6700b4-2>`);
2187
+ var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-dc6700b4 {
2187
2188
  opacity: 1;
2188
2189
  transition: opacity 0.2s ease-in-out;
2189
- }.div-56e07140 {
2190
+ }.div-dc6700b4 {
2190
2191
  width: 100%;
2191
2192
  pointer-events: none;
2192
2193
  font-size: 0;
2193
- }.div-56e07140-2 {
2194
+ }.div-dc6700b4-2 {
2194
2195
  display: flex;
2195
2196
  flex-direction: column;
2196
2197
  align-items: stretch;
@@ -2240,8 +2241,6 @@ function Image(props) {
2240
2241
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
2241
2242
  return out;
2242
2243
  });
2243
- onMount(() => {
2244
- });
2245
2244
  return [[(() => {
2246
2245
  const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
2247
2246
  insert(_el$, createComponent(Show, {
@@ -2255,7 +2254,7 @@ function Image(props) {
2255
2254
  }
2256
2255
  }), _el$3);
2257
2256
  effect((_p$) => {
2258
- const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-56e07140", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
2257
+ const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-dc6700b4", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
2259
2258
  "object-position": props.backgroundPosition || "center",
2260
2259
  "object-fit": props.backgroundSize || "cover",
2261
2260
  ...aspectRatioCss()
@@ -2524,8 +2523,58 @@ var handleABTesting = async ({
2524
2523
  };
2525
2524
  };
2526
2525
 
2526
+ // src/helpers/user-attributes.ts
2527
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
2528
+ function createUserAttributesService() {
2529
+ let canTrack = true;
2530
+ const subscribers = /* @__PURE__ */ new Set();
2531
+ return {
2532
+ setUserAttributes(newAttrs) {
2533
+ if (!isBrowser()) {
2534
+ return;
2535
+ }
2536
+ const userAttributes = {
2537
+ ...this.getUserAttributes(),
2538
+ ...newAttrs
2539
+ };
2540
+ setCookie({
2541
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2542
+ value: JSON.stringify(userAttributes),
2543
+ canTrack
2544
+ });
2545
+ subscribers.forEach((callback) => callback(userAttributes));
2546
+ },
2547
+ getUserAttributes() {
2548
+ if (!isBrowser()) {
2549
+ return {};
2550
+ }
2551
+ return JSON.parse(getCookieSync({
2552
+ name: USER_ATTRIBUTES_COOKIE_NAME,
2553
+ canTrack
2554
+ }) || "{}");
2555
+ },
2556
+ subscribeOnUserAttributesChange(callback) {
2557
+ subscribers.add(callback);
2558
+ return () => {
2559
+ subscribers.delete(callback);
2560
+ };
2561
+ },
2562
+ setCanTrack(value) {
2563
+ canTrack = value;
2564
+ }
2565
+ };
2566
+ }
2567
+ var userAttributesService = createUserAttributesService();
2568
+ var setClientUserAttributes = (attributes) => {
2569
+ userAttributesService.setUserAttributes(attributes);
2570
+ };
2571
+
2527
2572
  // src/helpers/canTrack.ts
2528
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2573
+ var getDefaultCanTrack = (canTrack) => {
2574
+ const result = checkIsDefined(canTrack) ? canTrack : true;
2575
+ userAttributesService.setCanTrack(result);
2576
+ return result;
2577
+ };
2529
2578
 
2530
2579
  // src/blocks/accordion/component-info.ts
2531
2580
  var defaultTitle = {
@@ -3256,8 +3305,408 @@ var componentInfo5 = {
3256
3305
  }
3257
3306
  };
3258
3307
 
3259
- // src/blocks/section/component-info.ts
3308
+ // src/blocks/personalization-container/component-info.ts
3260
3309
  var componentInfo6 = {
3310
+ name: "PersonalizationContainer",
3311
+ shouldReceiveBuilderProps: {
3312
+ builderBlock: true,
3313
+ builderContext: true
3314
+ },
3315
+ noWrap: true,
3316
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
3317
+ canHaveChildren: true,
3318
+ inputs: [{
3319
+ name: "variants",
3320
+ defaultValue: [],
3321
+ behavior: "personalizationVariantList",
3322
+ type: "list",
3323
+ subFields: [{
3324
+ name: "name",
3325
+ type: "text"
3326
+ }, {
3327
+ name: "query",
3328
+ friendlyName: "Targeting rules",
3329
+ type: "BuilderQuery",
3330
+ defaultValue: []
3331
+ }, {
3332
+ name: "startDate",
3333
+ type: "date"
3334
+ }, {
3335
+ name: "endDate",
3336
+ type: "date"
3337
+ }, {
3338
+ name: "blocks",
3339
+ type: "uiBlocks",
3340
+ hideFromUI: true,
3341
+ defaultValue: []
3342
+ }]
3343
+ }]
3344
+ };
3345
+ var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
3346
+ function InlinedScript(props) {
3347
+ return (() => {
3348
+ const _el$ = _tmpl$8();
3349
+ effect((_p$) => {
3350
+ const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
3351
+ _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
3352
+ _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
3353
+ _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
3354
+ return _p$;
3355
+ }, {
3356
+ _v$: void 0,
3357
+ _v$2: void 0,
3358
+ _v$3: void 0
3359
+ });
3360
+ return _el$;
3361
+ })();
3362
+ }
3363
+ var inlined_script_default = InlinedScript;
3364
+
3365
+ // src/functions/is-previewing.ts
3366
+ function isPreviewing(_search) {
3367
+ const search = _search || (isBrowser() ? window.location.search : void 0);
3368
+ if (!search) {
3369
+ return false;
3370
+ }
3371
+ const normalizedSearch = getSearchString(search);
3372
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
3373
+ }
3374
+
3375
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
3376
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
3377
+ function isString(val) {
3378
+ return typeof val === "string";
3379
+ }
3380
+ function isNumber(val) {
3381
+ return typeof val === "number";
3382
+ }
3383
+ function objectMatchesQuery(userattr, query2) {
3384
+ const result = (() => {
3385
+ const property = query2.property;
3386
+ const operator = query2.operator;
3387
+ let testValue = query2.value;
3388
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
3389
+ testValue = query2.value.slice(0, -1);
3390
+ }
3391
+ if (!(property && operator)) {
3392
+ return true;
3393
+ }
3394
+ if (Array.isArray(testValue)) {
3395
+ if (operator === "isNot") {
3396
+ return testValue.every((val) => objectMatchesQuery(userattr, {
3397
+ property,
3398
+ operator,
3399
+ value: val
3400
+ }));
3401
+ }
3402
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
3403
+ property,
3404
+ operator,
3405
+ value: val
3406
+ }));
3407
+ }
3408
+ const value = userattr[property];
3409
+ if (Array.isArray(value)) {
3410
+ return value.includes(testValue);
3411
+ }
3412
+ switch (operator) {
3413
+ case "is":
3414
+ return value === testValue;
3415
+ case "isNot":
3416
+ return value !== testValue;
3417
+ case "contains":
3418
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
3419
+ case "startsWith":
3420
+ return isString(value) && value.startsWith(String(testValue));
3421
+ case "endsWith":
3422
+ return isString(value) && value.endsWith(String(testValue));
3423
+ case "greaterThan":
3424
+ return isNumber(value) && isNumber(testValue) && value > testValue;
3425
+ case "lessThan":
3426
+ return isNumber(value) && isNumber(testValue) && value < testValue;
3427
+ case "greaterThanOrEqualTo":
3428
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
3429
+ case "lessThanOrEqualTo":
3430
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
3431
+ default:
3432
+ return false;
3433
+ }
3434
+ })();
3435
+ return result;
3436
+ }
3437
+ const item = {
3438
+ query,
3439
+ startDate,
3440
+ endDate
3441
+ };
3442
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
3443
+ if (item.startDate && new Date(item.startDate) > now) {
3444
+ return false;
3445
+ } else if (item.endDate && new Date(item.endDate) < now) {
3446
+ return false;
3447
+ }
3448
+ if (!item.query || !item.query.length) {
3449
+ return true;
3450
+ }
3451
+ return item.query.every((filter) => {
3452
+ return objectMatchesQuery(userAttributes, filter);
3453
+ });
3454
+ }
3455
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
3456
+ if (!navigator.cookieEnabled) {
3457
+ return;
3458
+ }
3459
+ function getCookie(name) {
3460
+ const nameEQ = name + '=';
3461
+ const ca = document.cookie.split(';');
3462
+ for (let i = 0; i < ca.length; i++) {
3463
+ let c = ca[i];
3464
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
3465
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
3466
+ }
3467
+ return null;
3468
+ }
3469
+ function removeVariants() {
3470
+ variants?.forEach(function (_, index) {
3471
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
3472
+ });
3473
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
3474
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
3475
+ }
3476
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
3477
+ if (locale) {
3478
+ attributes.locale = locale;
3479
+ }
3480
+ const winningVariantIndex = variants?.findIndex(function (variant) {
3481
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
3482
+ });
3483
+ const isDebug = location.href.includes('builder.debug=true');
3484
+ if (isDebug) {
3485
+ console.debug('PersonalizationContainer', {
3486
+ attributes,
3487
+ variants,
3488
+ winningVariantIndex
3489
+ });
3490
+ }
3491
+ if (winningVariantIndex !== -1) {
3492
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
3493
+ if (winningVariant) {
3494
+ const parentNode = winningVariant.parentNode;
3495
+ if (parentNode) {
3496
+ const newParent = parentNode.cloneNode(false);
3497
+ newParent.appendChild(winningVariant.content.firstChild);
3498
+ newParent.appendChild(winningVariant.content.lastChild);
3499
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
3500
+ }
3501
+ if (isDebug) {
3502
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
3503
+ }
3504
+ }
3505
+ } else if (variants && variants.length > 0) {
3506
+ removeVariants();
3507
+ }
3508
+ }`;
3509
+ 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}";
3510
+
3511
+ // src/blocks/personalization-container/helpers.ts
3512
+ function checkShouldRenderVariants(variants, canTrack) {
3513
+ const hasVariants = variants && variants.length > 0;
3514
+ if (TARGET === "reactNative")
3515
+ return false;
3516
+ if (!hasVariants)
3517
+ return false;
3518
+ if (!canTrack)
3519
+ return false;
3520
+ if (TARGET === "vue" || TARGET === "svelte")
3521
+ return true;
3522
+ if (isBrowser())
3523
+ return false;
3524
+ return true;
3525
+ }
3526
+ function getBlocksToRender({
3527
+ variants,
3528
+ previewingIndex,
3529
+ isHydrated,
3530
+ filteredVariants,
3531
+ fallbackBlocks
3532
+ }) {
3533
+ const fallback = {
3534
+ blocks: fallbackBlocks ?? [],
3535
+ path: "this.children"
3536
+ };
3537
+ if (isHydrated && isEditing()) {
3538
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
3539
+ const variant = variants[previewingIndex];
3540
+ return {
3541
+ blocks: variant.blocks,
3542
+ path: `component.options.variants.${previewingIndex}.blocks`
3543
+ };
3544
+ }
3545
+ return fallback;
3546
+ }
3547
+ if (isBrowser()) {
3548
+ const winningVariant = filteredVariants?.[0];
3549
+ if (winningVariant) {
3550
+ return {
3551
+ blocks: winningVariant.blocks,
3552
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
3553
+ };
3554
+ }
3555
+ }
3556
+ return fallback;
3557
+ }
3558
+ var getPersonalizationScript = (variants, blockId, locale) => {
3559
+ return `
3560
+ (function() {
3561
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
3562
+ ${PERSONALIZATION_SCRIPT}
3563
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
3564
+ })();
3565
+ `;
3566
+ };
3567
+
3568
+ // src/blocks/personalization-container/personalization-container.tsx
3569
+ var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
3570
+ var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
3571
+ function PersonalizationContainer(props) {
3572
+ const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
3573
+ const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
3574
+ const [unsubscribers, setUnsubscribers] = createSignal([]);
3575
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
3576
+ const [isHydrated, setIsHydrated] = createSignal(false);
3577
+ const filteredVariants = createMemo(() => {
3578
+ return (props.variants || []).filter((variant) => {
3579
+ return filterWithCustomTargeting({
3580
+ ...props.builderContext?.rootState?.locale ? {
3581
+ locale: props.builderContext?.rootState?.locale
3582
+ } : {},
3583
+ ...userAttributes()
3584
+ }, variant.query, variant.startDate, variant.endDate);
3585
+ });
3586
+ });
3587
+ const blocksToRender = createMemo(() => {
3588
+ return getBlocksToRender({
3589
+ variants: props.variants,
3590
+ fallbackBlocks: props.builderBlock?.children,
3591
+ isHydrated: isHydrated(),
3592
+ filteredVariants: filteredVariants(),
3593
+ previewingIndex: props.previewingIndex
3594
+ });
3595
+ });
3596
+ const hideVariantsStyleString = createMemo(() => {
3597
+ return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
3598
+ });
3599
+ let rootRef;
3600
+ onMount(() => {
3601
+ setIsHydrated(true);
3602
+ const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
3603
+ setUserAttributes(attrs);
3604
+ });
3605
+ if (!(isEditing() || isPreviewing())) {
3606
+ const variant = filteredVariants()[0];
3607
+ if (rootRef) {
3608
+ rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
3609
+ detail: {
3610
+ variant: variant || "default",
3611
+ content: props.builderContext?.content
3612
+ },
3613
+ bubbles: true
3614
+ }));
3615
+ const observer = new IntersectionObserver((entries) => {
3616
+ entries.forEach((entry) => {
3617
+ if (entry.isIntersecting && rootRef) {
3618
+ rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
3619
+ detail: {
3620
+ variant: variant || "default",
3621
+ content: props.builderContext?.content
3622
+ },
3623
+ bubbles: true
3624
+ }));
3625
+ }
3626
+ });
3627
+ });
3628
+ observer.observe(rootRef);
3629
+ }
3630
+ }
3631
+ unsubscribers().push(unsub);
3632
+ });
3633
+ return (() => {
3634
+ const _el$ = _tmpl$9();
3635
+ const _ref$ = rootRef;
3636
+ typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
3637
+ spread(_el$, mergeProps({
3638
+ get ["class"]() {
3639
+ return `builder-personalization-container ${props.attributes?.className || ""}`;
3640
+ }
3641
+ }, () => props.attributes), false, true);
3642
+ insert(_el$, createComponent(Show, {
3643
+ get when() {
3644
+ return shouldRenderVariants();
3645
+ },
3646
+ get children() {
3647
+ return [createComponent(For, {
3648
+ get each() {
3649
+ return props.variants;
3650
+ },
3651
+ children: (variant, _index) => {
3652
+ const index = _index();
3653
+ return (() => {
3654
+ const _el$2 = _tmpl$25();
3655
+ setAttribute(_el$2, "key", index);
3656
+ insert(_el$2, createComponent(blocks_default, {
3657
+ get blocks() {
3658
+ return variant.blocks;
3659
+ },
3660
+ get parent() {
3661
+ return props.builderBlock?.id;
3662
+ },
3663
+ path: `component.options.variants.${index}.blocks`
3664
+ }));
3665
+ effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
3666
+ return _el$2;
3667
+ })();
3668
+ }
3669
+ }), createComponent(inlined_styles_default, {
3670
+ get nonce() {
3671
+ return props.builderContext?.nonce || "";
3672
+ },
3673
+ get styles() {
3674
+ return hideVariantsStyleString();
3675
+ },
3676
+ get id() {
3677
+ return `variants-styles-${props.builderBlock?.id}`;
3678
+ }
3679
+ }), createComponent(inlined_script_default, {
3680
+ get nonce() {
3681
+ return props.builderContext?.nonce || "";
3682
+ },
3683
+ get scriptStr() {
3684
+ return scriptStr();
3685
+ },
3686
+ get id() {
3687
+ return `variants-script-${props.builderBlock?.id}`;
3688
+ }
3689
+ })];
3690
+ }
3691
+ }), null);
3692
+ insert(_el$, createComponent(blocks_default, {
3693
+ get blocks() {
3694
+ return blocksToRender().blocks;
3695
+ },
3696
+ get parent() {
3697
+ return props.builderBlock?.id;
3698
+ },
3699
+ get path() {
3700
+ return blocksToRender().path;
3701
+ }
3702
+ }), null);
3703
+ return _el$;
3704
+ })();
3705
+ }
3706
+ var personalization_container_default = PersonalizationContainer;
3707
+
3708
+ // src/blocks/section/component-info.ts
3709
+ var componentInfo7 = {
3261
3710
  name: "Core:Section",
3262
3711
  static: true,
3263
3712
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -3299,7 +3748,7 @@ var componentInfo6 = {
3299
3748
  };
3300
3749
 
3301
3750
  // src/blocks/slot/component-info.ts
3302
- var componentInfo7 = {
3751
+ var componentInfo8 = {
3303
3752
  name: "Slot",
3304
3753
  isRSC: true,
3305
3754
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -3317,10 +3766,10 @@ var componentInfo7 = {
3317
3766
  builderComponents: true
3318
3767
  }
3319
3768
  };
3320
- var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
3769
+ var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
3321
3770
  function Slot(props) {
3322
3771
  return (() => {
3323
- const _el$ = _tmpl$8();
3772
+ const _el$ = _tmpl$10();
3324
3773
  _el$.style.setProperty("pointer-events", "auto");
3325
3774
  spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
3326
3775
  "builder-slot": props.name
@@ -3348,7 +3797,7 @@ function Slot(props) {
3348
3797
  var slot_default = Slot;
3349
3798
 
3350
3799
  // src/blocks/symbol/component-info.ts
3351
- var componentInfo8 = {
3800
+ var componentInfo9 = {
3352
3801
  name: "Symbol",
3353
3802
  noWrap: true,
3354
3803
  static: true,
@@ -3430,7 +3879,7 @@ var defaultElement = {
3430
3879
  }
3431
3880
  }
3432
3881
  };
3433
- var componentInfo9 = {
3882
+ var componentInfo10 = {
3434
3883
  name: "Builder: Tabs",
3435
3884
  inputs: [{
3436
3885
  name: "tabs",
@@ -3534,8 +3983,8 @@ var componentInfo9 = {
3534
3983
  builderLinkComponent: true
3535
3984
  }
3536
3985
  };
3537
- var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
3538
- var _tmpl$25 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
3986
+ var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
3987
+ var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
3539
3988
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
3540
3989
  function Tabs(props) {
3541
3990
  const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
@@ -3550,7 +3999,7 @@ function Tabs(props) {
3550
3999
  }
3551
4000
  }
3552
4001
  return (() => {
3553
- const _el$ = _tmpl$25(), _el$2 = _el$.firstChild;
4002
+ const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
3554
4003
  _el$2.style.setProperty("display", "flex");
3555
4004
  _el$2.style.setProperty("flex-direction", "row");
3556
4005
  _el$2.style.setProperty("overflow", "auto");
@@ -3602,7 +4051,7 @@ function Tabs(props) {
3602
4051
  return activeTabContent(activeTab());
3603
4052
  },
3604
4053
  get children() {
3605
- const _el$3 = _tmpl$9();
4054
+ const _el$3 = _tmpl$11();
3606
4055
  insert(_el$3, createComponent(blocks_default, {
3607
4056
  get parent() {
3608
4057
  return props.builderBlock.id;
@@ -3634,7 +4083,7 @@ var tabs_default = Tabs;
3634
4083
  delegateEvents(["click"]);
3635
4084
 
3636
4085
  // src/blocks/text/component-info.ts
3637
- var componentInfo10 = {
4086
+ var componentInfo11 = {
3638
4087
  shouldReceiveBuilderProps: {
3639
4088
  builderBlock: TARGET === "reactNative" ? true : false,
3640
4089
  builderContext: true
@@ -3657,10 +4106,10 @@ var componentInfo10 = {
3657
4106
  textAlign: "center"
3658
4107
  }
3659
4108
  };
3660
- var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
4109
+ var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
3661
4110
  function Text(props) {
3662
4111
  return (() => {
3663
- const _el$ = _tmpl$10();
4112
+ const _el$ = _tmpl$12();
3664
4113
  _el$.style.setProperty("outline", "none");
3665
4114
  effect(() => _el$.innerHTML = props.text?.toString() || "");
3666
4115
  return _el$;
@@ -3669,7 +4118,7 @@ function Text(props) {
3669
4118
  var text_default = Text;
3670
4119
 
3671
4120
  // src/blocks/custom-code/component-info.ts
3672
- var componentInfo11 = {
4121
+ var componentInfo12 = {
3673
4122
  name: "Custom Code",
3674
4123
  static: true,
3675
4124
  requiredPermissions: ["editCode"],
@@ -3692,7 +4141,7 @@ var componentInfo11 = {
3692
4141
  advanced: true
3693
4142
  }]
3694
4143
  };
3695
- var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
4144
+ var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
3696
4145
  function CustomCode(props) {
3697
4146
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3698
4147
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3727,7 +4176,7 @@ function CustomCode(props) {
3727
4176
  }
3728
4177
  });
3729
4178
  return (() => {
3730
- const _el$ = _tmpl$11();
4179
+ const _el$ = _tmpl$13();
3731
4180
  const _ref$ = elementRef;
3732
4181
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
3733
4182
  effect((_p$) => {
@@ -3745,7 +4194,7 @@ function CustomCode(props) {
3745
4194
  var custom_code_default = CustomCode;
3746
4195
 
3747
4196
  // src/blocks/embed/component-info.ts
3748
- var componentInfo12 = {
4197
+ var componentInfo13 = {
3749
4198
  name: "Embed",
3750
4199
  static: true,
3751
4200
  inputs: [{
@@ -3767,7 +4216,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
3767
4216
  var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
3768
4217
 
3769
4218
  // src/blocks/embed/embed.tsx
3770
- var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-embed>`);
4219
+ var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
3771
4220
  function Embed(props) {
3772
4221
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
3773
4222
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -3805,7 +4254,7 @@ function Embed(props) {
3805
4254
  }
3806
4255
  createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
3807
4256
  return (() => {
3808
- const _el$ = _tmpl$12();
4257
+ const _el$ = _tmpl$14();
3809
4258
  const _ref$ = elem;
3810
4259
  typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
3811
4260
  effect(() => _el$.innerHTML = props.content);
@@ -3815,7 +4264,7 @@ function Embed(props) {
3815
4264
  var embed_default = Embed;
3816
4265
 
3817
4266
  // src/blocks/form/form/component-info.ts
3818
- var componentInfo13 = {
4267
+ var componentInfo14 = {
3819
4268
  name: "Form:Form",
3820
4269
  // editableTags: ['builder-form-error']
3821
4270
  defaults: {
@@ -4071,9 +4520,9 @@ function logFetch(url) {
4071
4520
  }
4072
4521
 
4073
4522
  // src/blocks/form/form/form.tsx
4074
- var _tmpl$13 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-27d18614">`);
4075
- var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
4076
- var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-27d18614 {
4523
+ var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
4524
+ var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
4525
+ var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
4077
4526
  padding: 10px;
4078
4527
  color: red;
4079
4528
  text-align: center;
@@ -4265,7 +4714,7 @@ function FormComponent(props) {
4265
4714
  }
4266
4715
  let formRef;
4267
4716
  return [(() => {
4268
- const _el$ = _tmpl$26();
4717
+ const _el$ = _tmpl$27();
4269
4718
  _el$.addEventListener("submit", (event) => onSubmit(event));
4270
4719
  const _ref$ = formRef;
4271
4720
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -4283,34 +4732,7 @@ function FormComponent(props) {
4283
4732
  return props.name;
4284
4733
  }
4285
4734
  }, {}, {}, () => props.attributes), false, true);
4286
- insert(_el$, createComponent(Show, {
4287
- get when() {
4288
- return props.builderBlock && props.builderBlock.children;
4289
- },
4290
- get children() {
4291
- return createComponent(For, {
4292
- get each() {
4293
- return props.builderBlock?.children;
4294
- },
4295
- children: (block, _index) => {
4296
- const idx = _index();
4297
- return createComponent(block_default, {
4298
- key: `form-block-${idx}`,
4299
- block,
4300
- get context() {
4301
- return props.builderContext;
4302
- },
4303
- get registeredComponents() {
4304
- return props.builderComponents;
4305
- },
4306
- get linkComponent() {
4307
- return props.builderLinkComponent;
4308
- }
4309
- });
4310
- }
4311
- });
4312
- }
4313
- }), null);
4735
+ insert(_el$, () => props.children, null);
4314
4736
  insert(_el$, createComponent(Show, {
4315
4737
  get when() {
4316
4738
  return submissionState() === "error";
@@ -4348,7 +4770,7 @@ function FormComponent(props) {
4348
4770
  return memo(() => submissionState() === "error")() && responseData();
4349
4771
  },
4350
4772
  get children() {
4351
- const _el$2 = _tmpl$13();
4773
+ const _el$2 = _tmpl$15();
4352
4774
  insert(_el$2, () => JSON.stringify(responseData(), null, 2));
4353
4775
  return _el$2;
4354
4776
  }
@@ -4375,7 +4797,7 @@ function FormComponent(props) {
4375
4797
  var form_default = FormComponent;
4376
4798
 
4377
4799
  // src/blocks/form/input/component-info.ts
4378
- var componentInfo14 = {
4800
+ var componentInfo15 = {
4379
4801
  name: "Form:Input",
4380
4802
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
4381
4803
  inputs: [
@@ -4427,10 +4849,10 @@ var componentInfo14 = {
4427
4849
  borderColor: "#ccc"
4428
4850
  }
4429
4851
  };
4430
- var _tmpl$14 = /* @__PURE__ */ template(`<input>`);
4852
+ var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
4431
4853
  function FormInputComponent(props) {
4432
4854
  return (() => {
4433
- const _el$ = _tmpl$14();
4855
+ const _el$ = _tmpl$16();
4434
4856
  spread(_el$, mergeProps({}, () => props.attributes, {
4435
4857
  get key() {
4436
4858
  return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
@@ -4460,7 +4882,7 @@ function FormInputComponent(props) {
4460
4882
  var input_default = FormInputComponent;
4461
4883
 
4462
4884
  // src/blocks/form/select/component-info.ts
4463
- var componentInfo15 = {
4885
+ var componentInfo16 = {
4464
4886
  name: "Form:Select",
4465
4887
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
4466
4888
  defaultStyles: {
@@ -4503,11 +4925,11 @@ var componentInfo15 = {
4503
4925
  static: true,
4504
4926
  noWrap: true
4505
4927
  };
4506
- var _tmpl$15 = /* @__PURE__ */ template(`<select>`);
4507
- var _tmpl$27 = /* @__PURE__ */ template(`<option>`);
4928
+ var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
4929
+ var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
4508
4930
  function SelectComponent(props) {
4509
4931
  return (() => {
4510
- const _el$ = _tmpl$15();
4932
+ const _el$ = _tmpl$17();
4511
4933
  spread(_el$, mergeProps({}, () => props.attributes, {
4512
4934
  get value() {
4513
4935
  return props.value;
@@ -4532,7 +4954,7 @@ function SelectComponent(props) {
4532
4954
  children: (option, _index) => {
4533
4955
  const index = _index();
4534
4956
  return (() => {
4535
- const _el$2 = _tmpl$27();
4957
+ const _el$2 = _tmpl$28();
4536
4958
  insert(_el$2, () => option.name || option.value);
4537
4959
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
4538
4960
  effect(() => _el$2.value = option.value);
@@ -4546,7 +4968,7 @@ function SelectComponent(props) {
4546
4968
  var select_default = SelectComponent;
4547
4969
 
4548
4970
  // src/blocks/form/submit-button/component-info.ts
4549
- var componentInfo16 = {
4971
+ var componentInfo17 = {
4550
4972
  name: "Form:SubmitButton",
4551
4973
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
4552
4974
  defaultStyles: {
@@ -4572,10 +4994,10 @@ var componentInfo16 = {
4572
4994
  // TODO: defaultChildren
4573
4995
  // canHaveChildren: true,
4574
4996
  };
4575
- var _tmpl$16 = /* @__PURE__ */ template(`<button type=submit>`);
4997
+ var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
4576
4998
  function SubmitButton(props) {
4577
4999
  return (() => {
4578
- const _el$ = _tmpl$16();
5000
+ const _el$ = _tmpl$18();
4579
5001
  spread(_el$, mergeProps({}, () => props.attributes), false, true);
4580
5002
  insert(_el$, () => props.text);
4581
5003
  return _el$;
@@ -4584,7 +5006,7 @@ function SubmitButton(props) {
4584
5006
  var submit_button_default = SubmitButton;
4585
5007
 
4586
5008
  // src/blocks/form/textarea/component-info.ts
4587
- var componentInfo17 = {
5009
+ var componentInfo18 = {
4588
5010
  name: "Form:TextArea",
4589
5011
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
4590
5012
  inputs: [{
@@ -4621,10 +5043,10 @@ var componentInfo17 = {
4621
5043
  static: true,
4622
5044
  noWrap: true
4623
5045
  };
4624
- var _tmpl$17 = /* @__PURE__ */ template(`<textarea>`);
5046
+ var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
4625
5047
  function Textarea(props) {
4626
5048
  return (() => {
4627
- const _el$ = _tmpl$17();
5049
+ const _el$ = _tmpl$19();
4628
5050
  spread(_el$, mergeProps({}, () => props.attributes, {
4629
5051
  get placeholder() {
4630
5052
  return props.placeholder;
@@ -4648,7 +5070,7 @@ function Textarea(props) {
4648
5070
  var textarea_default = Textarea;
4649
5071
 
4650
5072
  // src/blocks/img/component-info.ts
4651
- var componentInfo18 = {
5073
+ var componentInfo19 = {
4652
5074
  // friendlyName?
4653
5075
  name: "Raw:Img",
4654
5076
  hideFromInsertMenu: true,
@@ -4663,10 +5085,10 @@ var componentInfo18 = {
4663
5085
  noWrap: true,
4664
5086
  static: true
4665
5087
  };
4666
- var _tmpl$18 = /* @__PURE__ */ template(`<img>`);
5088
+ var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
4667
5089
  function ImgComponent(props) {
4668
5090
  return (() => {
4669
- const _el$ = _tmpl$18();
5091
+ const _el$ = _tmpl$20();
4670
5092
  spread(_el$, mergeProps({
4671
5093
  get style() {
4672
5094
  return {
@@ -4690,7 +5112,7 @@ function ImgComponent(props) {
4690
5112
  var img_default = ImgComponent;
4691
5113
 
4692
5114
  // src/blocks/video/component-info.ts
4693
- var componentInfo19 = {
5115
+ var componentInfo20 = {
4694
5116
  name: "Video",
4695
5117
  canHaveChildren: true,
4696
5118
  defaultStyles: {
@@ -4775,8 +5197,8 @@ var componentInfo19 = {
4775
5197
  builderBlock: true
4776
5198
  }
4777
5199
  };
4778
- var _tmpl$19 = /* @__PURE__ */ template(`<source type=video/mp4>`);
4779
- var _tmpl$28 = /* @__PURE__ */ template(`<div>`);
5200
+ var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
5201
+ var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
4780
5202
  var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
4781
5203
  function Video(props) {
4782
5204
  const videoProps = createMemo(() => {
@@ -4819,7 +5241,6 @@ function Video(props) {
4819
5241
  "object-position": props.position,
4820
5242
  // Hack to get object fit to work as expected and
4821
5243
  // not have the video overflow
4822
- "z-index": 2,
4823
5244
  "border-radius": "1px",
4824
5245
  ...props.aspectRatio ? {
4825
5246
  position: "absolute"
@@ -4838,7 +5259,7 @@ function Video(props) {
4838
5259
  return !props.lazyLoad;
4839
5260
  },
4840
5261
  get children() {
4841
- const _el$3 = _tmpl$19();
5262
+ const _el$3 = _tmpl$21();
4842
5263
  effect(() => setAttribute(_el$3, "src", props.video));
4843
5264
  return _el$3;
4844
5265
  }
@@ -4848,7 +5269,7 @@ function Video(props) {
4848
5269
  return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
4849
5270
  },
4850
5271
  get children() {
4851
- const _el$4 = _tmpl$28();
5272
+ const _el$4 = _tmpl$29();
4852
5273
  _el$4.style.setProperty("width", "100%");
4853
5274
  _el$4.style.setProperty("pointer-events", "none");
4854
5275
  _el$4.style.setProperty("font-size", "0px");
@@ -4861,7 +5282,7 @@ function Video(props) {
4861
5282
  return props.builderBlock?.children?.length && props.fitContent;
4862
5283
  },
4863
5284
  get children() {
4864
- const _el$5 = _tmpl$28();
5285
+ const _el$5 = _tmpl$29();
4865
5286
  _el$5.style.setProperty("display", "flex");
4866
5287
  _el$5.style.setProperty("flex-direction", "column");
4867
5288
  _el$5.style.setProperty("align-items", "stretch");
@@ -4874,7 +5295,7 @@ function Video(props) {
4874
5295
  return props.builderBlock?.children?.length && !props.fitContent;
4875
5296
  },
4876
5297
  get children() {
4877
- const _el$6 = _tmpl$28();
5298
+ const _el$6 = _tmpl$29();
4878
5299
  _el$6.style.setProperty("pointer-events", "none");
4879
5300
  _el$6.style.setProperty("display", "flex");
4880
5301
  _el$6.style.setProperty("flex-direction", "column");
@@ -4896,31 +5317,31 @@ var video_default = Video;
4896
5317
  // src/constants/extra-components.ts
4897
5318
  var getExtraComponents = () => [{
4898
5319
  component: custom_code_default,
4899
- ...componentInfo11
5320
+ ...componentInfo12
4900
5321
  }, {
4901
5322
  component: embed_default,
4902
- ...componentInfo12
5323
+ ...componentInfo13
4903
5324
  }, ...TARGET === "rsc" ? [] : [{
4904
5325
  component: form_default,
4905
- ...componentInfo13
5326
+ ...componentInfo14
4906
5327
  }, {
4907
5328
  component: input_default,
4908
- ...componentInfo14
5329
+ ...componentInfo15
4909
5330
  }, {
4910
5331
  component: submit_button_default,
4911
- ...componentInfo16
5332
+ ...componentInfo17
4912
5333
  }, {
4913
5334
  component: select_default,
4914
- ...componentInfo15
5335
+ ...componentInfo16
4915
5336
  }, {
4916
5337
  component: textarea_default,
4917
- ...componentInfo17
5338
+ ...componentInfo18
4918
5339
  }], {
4919
5340
  component: img_default,
4920
- ...componentInfo18
5341
+ ...componentInfo19
4921
5342
  }, {
4922
5343
  component: video_default,
4923
- ...componentInfo19
5344
+ ...componentInfo20
4924
5345
  }];
4925
5346
 
4926
5347
  // src/constants/builder-registered-components.ts
@@ -4938,19 +5359,22 @@ var getDefaultRegisteredComponents = () => [{
4938
5359
  ...componentInfo5
4939
5360
  }, {
4940
5361
  component: section_default,
4941
- ...componentInfo6
5362
+ ...componentInfo7
4942
5363
  }, {
4943
5364
  component: slot_default,
4944
- ...componentInfo7
5365
+ ...componentInfo8
4945
5366
  }, {
4946
5367
  component: symbol_default,
4947
- ...componentInfo8
5368
+ ...componentInfo9
4948
5369
  }, {
4949
5370
  component: text_default,
4950
- ...componentInfo10
4951
- }, ...TARGET === "rsc" ? [] : [{
5371
+ ...componentInfo11
5372
+ }, ...TARGET === "react" ? [{
5373
+ component: personalization_container_default,
5374
+ ...componentInfo6
5375
+ }] : [], ...TARGET === "rsc" ? [] : [{
4952
5376
  component: tabs_default,
4953
- ...componentInfo9
5377
+ ...componentInfo10
4954
5378
  }, {
4955
5379
  component: accordion_default,
4956
5380
  ...componentInfo
@@ -4988,7 +5412,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
4988
5412
  testVariationId: variant.id,
4989
5413
  id: content?.id
4990
5414
  }));
4991
- var checkShouldRenderVariants = ({
5415
+ var checkShouldRenderVariants2 = ({
4992
5416
  canTrack,
4993
5417
  content
4994
5418
  }) => {
@@ -5021,25 +5445,6 @@ var getUpdateVariantVisibilityScript = ({
5021
5445
  }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
5022
5446
  "${variationId}", "${contentId}", ${isHydrationTarget}
5023
5447
  )`;
5024
- var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
5025
- function InlinedScript(props) {
5026
- return (() => {
5027
- const _el$ = _tmpl$20();
5028
- effect((_p$) => {
5029
- const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
5030
- _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
5031
- _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
5032
- _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
5033
- return _p$;
5034
- }, {
5035
- _v$: void 0,
5036
- _v$2: void 0,
5037
- _v$3: void 0
5038
- });
5039
- return _el$;
5040
- })();
5041
- }
5042
- var inlined_script_default = InlinedScript;
5043
5448
 
5044
5449
  // src/helpers/preview-lru-cache/get.ts
5045
5450
  function getPreviewContent(_searchParams) {
@@ -5047,7 +5452,7 @@ function getPreviewContent(_searchParams) {
5047
5452
  }
5048
5453
 
5049
5454
  // src/constants/sdk-version.ts
5050
- var SDK_VERSION = "3.0.3";
5455
+ var SDK_VERSION = "3.0.6";
5051
5456
 
5052
5457
  // src/helpers/sdk-headers.ts
5053
5458
  var getSdkHeaders = () => ({
@@ -5344,16 +5749,6 @@ async function fetchEntries(options) {
5344
5749
  return _processContentResult(options, content);
5345
5750
  }
5346
5751
 
5347
- // src/functions/is-previewing.ts
5348
- function isPreviewing(_search) {
5349
- const search = _search || (isBrowser() ? window.location.search : void 0);
5350
- if (!search) {
5351
- return false;
5352
- }
5353
- const normalizedSearch = getSearchString(search);
5354
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
5355
- }
5356
-
5357
5752
  // src/helpers/uuid.ts
5358
5753
  function uuidv4() {
5359
5754
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -5680,7 +6075,8 @@ var setupBrowserForEditing = (options = {}) => {
5680
6075
  // Supports builder-model="..." attribute which is needed to
5681
6076
  // scope our '+ add block' button styling
5682
6077
  supportsAddBlockScoping: true,
5683
- supportsCustomBreakpoints: true
6078
+ supportsCustomBreakpoints: true,
6079
+ blockLevelPersonalization: true
5684
6080
  }
5685
6081
  }, "*");
5686
6082
  window.parent?.postMessage({
@@ -6417,7 +6813,7 @@ var content_default = ContentComponent;
6417
6813
 
6418
6814
  // src/components/content-variants/content-variants.tsx
6419
6815
  function ContentVariants(props) {
6420
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants({
6816
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
6421
6817
  canTrack: getDefaultCanTrack(props.canTrack),
6422
6818
  content: props.content
6423
6819
  }));
@@ -6643,7 +7039,7 @@ var fetchSymbolContent = async ({
6643
7039
  };
6644
7040
 
6645
7041
  // src/blocks/symbol/symbol.tsx
6646
- var _tmpl$21 = /* @__PURE__ */ template(`<div>`);
7042
+ var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
6647
7043
  function Symbol(props) {
6648
7044
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
6649
7045
  const blocksWrapper = createMemo(() => {
@@ -6675,7 +7071,7 @@ function Symbol(props) {
6675
7071
  }
6676
7072
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
6677
7073
  return (() => {
6678
- const _el$ = _tmpl$21();
7074
+ const _el$ = _tmpl$30();
6679
7075
  spread(_el$, mergeProps({
6680
7076
  get ["class"]() {
6681
7077
  return className();
@@ -6767,4 +7163,4 @@ var fetchBuilderProps = async (_args) => {
6767
7163
  };
6768
7164
  };
6769
7165
 
6770
- export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setEditorSettings, subscribeToEditor, track };
7166
+ export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };