@builder.io/sdk-qwik 0.14.17 → 0.14.19

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.
@@ -53,22 +53,26 @@ const getClassPropName = () => {
53
53
  case "vue":
54
54
  case "solid":
55
55
  case "qwik":
56
+ case "angular":
56
57
  return "class";
57
58
  }
58
59
  };
60
+ const attrs = function attrs2(props, state) {
61
+ return {
62
+ ...props.attributes,
63
+ [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
64
+ ...props.link ? {
65
+ href: props.link,
66
+ target: props.openLinkInNewTab ? "_blank" : void 0,
67
+ role: "link"
68
+ } : {
69
+ role: "button"
70
+ }
71
+ };
72
+ };
59
73
  const Button = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
60
74
  return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
61
- attributes: {
62
- ...props.attributes,
63
- [getClassPropName()]: `${props.link ? "" : "builder-button"} ${props.attributes[getClassPropName()] || ""}`,
64
- ...props.link ? {
65
- href: props.link,
66
- target: props.openLinkInNewTab ? "_blank" : void 0,
67
- role: "link"
68
- } : {
69
- role: "button"
70
- }
71
- },
75
+ attributes: attrs(props),
72
76
  get TagName() {
73
77
  return props.link ? props.builderLinkComponent || "a" : "button";
74
78
  },
@@ -281,16 +285,17 @@ function theFunction() {
281
285
  ${code}
282
286
  }
283
287
 
284
- let output = theFunction()
288
+ const output = theFunction()
285
289
 
286
290
  if (typeof output === 'object' && output !== null) {
287
- output = JSON.stringify(output.copySync ? output.copySync() : output);
291
+ return JSON.stringify(output.copySync ? output.copySync() : output);
292
+ } else {
293
+ return output;
288
294
  }
289
-
290
- output;
291
295
  `;
292
296
  };
293
297
  let IVM_INSTANCE = null;
298
+ let IVM_CONTEXT = null;
294
299
  const getIvm = () => {
295
300
  try {
296
301
  if (IVM_INSTANCE)
@@ -310,12 +315,26 @@ const getIvm = () => {
310
315
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
311
316
  `);
312
317
  };
313
- const getIsolateContext = () => {
318
+ function setIsolateContext(options = {
319
+ memoryLimit: 128
320
+ }) {
314
321
  const ivm = getIvm();
315
- const isolate = new ivm.Isolate({
316
- memoryLimit: 128
322
+ const isolate = new ivm.Isolate(options);
323
+ const context = isolate.createContextSync();
324
+ const jail = context.global;
325
+ jail.setSync("global", jail.derefInto());
326
+ jail.setSync("log", function(...logArgs) {
327
+ console.log(...logArgs);
317
328
  });
318
- return isolate.createContextSync();
329
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
330
+ IVM_CONTEXT = context;
331
+ return context;
332
+ }
333
+ const getIsolateContext = () => {
334
+ if (IVM_CONTEXT)
335
+ return IVM_CONTEXT;
336
+ const context = setIsolateContext();
337
+ return context;
319
338
  };
320
339
  const runInNode = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
321
340
  const ivm = getIvm();
@@ -331,10 +350,6 @@ const runInNode = ({ code, builder, context, event, localState, rootSetState, ro
331
350
  });
332
351
  const isolateContext = getIsolateContext();
333
352
  const jail = isolateContext.global;
334
- jail.setSync("global", jail.derefInto());
335
- jail.setSync("log", function(...logArgs) {
336
- console.log(...logArgs);
337
- });
338
353
  jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
339
354
  set(rootState, key, value);
340
355
  rootSetState == null ? void 0 : rootSetState(rootState);
@@ -349,12 +364,11 @@ const runInNode = ({ code, builder, context, event, localState, rootSetState, ro
349
364
  ) : null;
350
365
  jail.setSync(getSyncValName(key), val);
351
366
  });
352
- jail.setSync(INJECTED_IVM_GLOBAL, ivm);
353
367
  const evalStr = processCode({
354
368
  code,
355
369
  args
356
370
  });
357
- const resultStr = isolateContext.evalSync(evalStr);
371
+ const resultStr = isolateContext.evalClosureSync(evalStr);
358
372
  try {
359
373
  const res = JSON.parse(resultStr);
360
374
  return res;
@@ -688,6 +702,7 @@ function mapStyleObjToStrIfNeeded(style) {
688
702
  case "svelte":
689
703
  case "vue":
690
704
  case "solid":
705
+ case "angular":
691
706
  return convertStyleMapToCSSArray(style).join(" ");
692
707
  case "qwik":
693
708
  case "reactNative":
@@ -748,6 +763,23 @@ const getRepeatItemData = ({ block, context }) => {
748
763
  }));
749
764
  return repeatArray;
750
765
  };
766
+ const shouldPassLinkComponent = (block) => {
767
+ return block && (block.isRSC || [
768
+ "Core:Button",
769
+ "Symbol",
770
+ "Columns",
771
+ "Form:Form",
772
+ "Builder: Tabs"
773
+ ].includes(block.name));
774
+ };
775
+ const shouldPassRegisteredComponents = (block) => {
776
+ return block && (block.isRSC || [
777
+ "Symbol",
778
+ "Columns",
779
+ "Form:Form",
780
+ "Builder: Tabs"
781
+ ].includes(block.name));
782
+ };
751
783
  const SIZES = {
752
784
  small: {
753
785
  min: 320,
@@ -991,22 +1023,35 @@ const BlockWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
991
1023
  }, 1, "87_1");
992
1024
  }, "BlockWrapper_component_kOI0j0aW8Nw"));
993
1025
  const InteractiveElement = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
994
- return /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
995
- ...props.wrapperProps,
996
- attributes: props.includeBlockProps ? {
1026
+ const attributes = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
1027
+ const [props2] = qwik.useLexicalScope();
1028
+ return props2.includeBlockProps ? {
997
1029
  ...getBlockProperties({
998
- block: props.block,
999
- context: props.context
1030
+ block: props2.block,
1031
+ context: props2.context
1000
1032
  }),
1001
1033
  ...getBlockActions({
1002
- block: props.block,
1003
- rootState: props.context.rootState,
1004
- rootSetState: props.context.rootSetState,
1005
- localState: props.context.localState,
1006
- context: props.context.context
1034
+ block: props2.block,
1035
+ rootState: props2.context.rootState,
1036
+ rootSetState: props2.context.rootSetState,
1037
+ localState: props2.context.localState,
1038
+ context: props2.context.context
1007
1039
  })
1008
- } : {},
1009
- children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "q0_0")
1040
+ } : {};
1041
+ }, "InteractiveElement_component_attributes_useComputed_0kUhl8Qa4CE", [
1042
+ props
1043
+ ]));
1044
+ return /* @__PURE__ */ qwik._jsxC(props.Wrapper, {
1045
+ ...props.wrapperProps,
1046
+ get attributes() {
1047
+ return attributes.value;
1048
+ },
1049
+ children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "q0_0"),
1050
+ [qwik._IMMUTABLE]: {
1051
+ attributes: qwik._fnSignal((p0) => p0.value, [
1052
+ attributes
1053
+ ], "p0.value")
1054
+ }
1010
1055
  }, 0, "q0_1");
1011
1056
  }, "InteractiveElement_component_0UqfJpjhn0g"));
1012
1057
  const getWrapperProps = ({ componentOptions, builderBlock, context, componentRef, includeBlockProps, isInteractive, contextValue }) => {
@@ -1184,7 +1229,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1184
1229
  repeatItem
1185
1230
  ]));
1186
1231
  const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
1187
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1232
+ var _a2, _b, _c;
1188
1233
  const [blockComponent2, processedBlock2, props2] = qwik.useLexicalScope();
1189
1234
  return {
1190
1235
  blockChildren: processedBlock2.value.children ?? [],
@@ -1192,10 +1237,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1192
1237
  componentOptions: {
1193
1238
  ...getBlockComponentOptions(processedBlock2.value),
1194
1239
  builderContext: props2.context,
1195
- ...((_b = blockComponent2.value) == null ? void 0 : _b.name) === "Core:Button" || ((_c = blockComponent2.value) == null ? void 0 : _c.name) === "Symbol" || ((_d = blockComponent2.value) == null ? void 0 : _d.name) === "Columns" || ((_e = blockComponent2.value) == null ? void 0 : _e.name) === "Form:Form" ? {
1240
+ ...shouldPassLinkComponent(blockComponent2.value) ? {
1196
1241
  builderLinkComponent: props2.linkComponent
1197
1242
  } : {},
1198
- ...((_f = blockComponent2.value) == null ? void 0 : _f.name) === "Symbol" || ((_g = blockComponent2.value) == null ? void 0 : _g.name) === "Columns" || ((_h = blockComponent2.value) == null ? void 0 : _h.name) === "Form:Form" ? {
1243
+ ...shouldPassRegisteredComponents(blockComponent2.value) ? {
1199
1244
  builderComponents: props2.registeredComponents
1200
1245
  } : {}
1201
1246
  },
@@ -1203,8 +1248,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1203
1248
  linkComponent: props2.linkComponent,
1204
1249
  registeredComponents: props2.registeredComponents,
1205
1250
  builderBlock: processedBlock2.value,
1206
- includeBlockProps: ((_i = blockComponent2.value) == null ? void 0 : _i.noWrap) === true,
1207
- isInteractive: !((_j = blockComponent2.value) == null ? void 0 : _j.isRSC)
1251
+ includeBlockProps: ((_b = blockComponent2.value) == null ? void 0 : _b.noWrap) === true,
1252
+ isInteractive: !((_c = blockComponent2.value) == null ? void 0 : _c.isRSC)
1208
1253
  };
1209
1254
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
1210
1255
  blockComponent,
@@ -1441,7 +1486,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1441
1486
  }, 1, "jN_4") : null
1442
1487
  }, 1, "jN_5");
1443
1488
  }, "Block_component_nnPv0RY0U0k"));
1444
- const onClick$1 = function onClick2(props, state) {
1489
+ const onClick$1 = function onClick2(props, state, className) {
1445
1490
  var _a, _b;
1446
1491
  if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
1447
1492
  (_b = window.parent) == null ? void 0 : _b.postMessage({
@@ -1452,7 +1497,7 @@ const onClick$1 = function onClick2(props, state) {
1452
1497
  }
1453
1498
  }, "*");
1454
1499
  };
1455
- const onMouseEnter = function onMouseEnter2(props, state) {
1500
+ const onMouseEnter = function onMouseEnter2(props, state, className) {
1456
1501
  var _a, _b;
1457
1502
  if (isEditing() && !((_a = props.blocks) == null ? void 0 : _a.length))
1458
1503
  (_b = window.parent) == null ? void 0 : _b.postMessage({
@@ -1487,23 +1532,26 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
1487
1532
  return props.styleProp;
1488
1533
  },
1489
1534
  onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
1490
- const [props2, state2] = qwik.useLexicalScope();
1535
+ const [className2, props2, state2] = qwik.useLexicalScope();
1491
1536
  return onClick$1(props2);
1492
1537
  }, "BlocksWrapper_component_onClick_ufezvOupQrM", [
1538
+ className,
1493
1539
  props,
1494
1540
  state
1495
1541
  ]),
1496
1542
  onKeyPress$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
1497
- const [props2, state2] = qwik.useLexicalScope();
1543
+ const [className2, props2, state2] = qwik.useLexicalScope();
1498
1544
  return onClick$1(props2);
1499
1545
  }, "BlocksWrapper_component_onKeyPress_9bz8vCQc3kg", [
1546
+ className,
1500
1547
  props,
1501
1548
  state
1502
1549
  ]),
1503
1550
  onMouseEnter$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
1504
- const [props2, state2] = qwik.useLexicalScope();
1551
+ const [className2, props2, state2] = qwik.useLexicalScope();
1505
1552
  return onMouseEnter(props2);
1506
1553
  }, "BlocksWrapper_component_onMouseEnter_j4FJjnLtraQ", [
1554
+ className,
1507
1555
  props,
1508
1556
  state
1509
1557
  ]),
@@ -1616,6 +1664,12 @@ const Blocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
1616
1664
  function deoptSignal(value) {
1617
1665
  return value;
1618
1666
  }
1667
+ const getColumnsClass = (id) => {
1668
+ return `builder-columns ${id}-breakpoints`;
1669
+ };
1670
+ const getTagName = function getTagName2(props, state, column) {
1671
+ return column.link ? props.builderLinkComponent || "a" : "div";
1672
+ };
1619
1673
  const getWidth = function getWidth2(props, state, index) {
1620
1674
  var _a;
1621
1675
  return ((_a = state.cols[index]) == null ? void 0 : _a.width) || 100 / state.cols.length;
@@ -1630,6 +1684,15 @@ const getTabletStyle = function getTabletStyle2(props, state, { stackedStyle, de
1630
1684
  const getMobileStyle = function getMobileStyle2(props, state, { stackedStyle, desktopStyle }) {
1631
1685
  return state.stackAt === "never" ? desktopStyle : stackedStyle;
1632
1686
  };
1687
+ const columnsCssVars = function columnsCssVars2(props, state) {
1688
+ return {
1689
+ "--flex-dir": state.flexDir,
1690
+ "--flex-dir-tablet": getTabletStyle(props, state, {
1691
+ stackedStyle: state.flexDir,
1692
+ desktopStyle: "row"
1693
+ })
1694
+ };
1695
+ };
1633
1696
  const columnCssVars = function columnCssVars2(props, state, index) {
1634
1697
  const gutter = index === 0 ? 0 : state.gutterSize;
1635
1698
  const width = getColumnCssWidth(props, state, index);
@@ -1669,90 +1732,68 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
1669
1732
  const breakpointSizes = getSizesForBreakpoints(((_b = (_a = props.builderContext.content) == null ? void 0 : _a.meta) == null ? void 0 : _b.breakpoints) || {});
1670
1733
  return breakpointSizes[size].max;
1671
1734
  };
1672
- const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
1673
- qwik._jsxBranch();
1674
- const state = qwik.useStore({
1675
- cols: props.columns || [],
1676
- flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
1677
- gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
1678
- stackAt: props.stackColumnsAt || "tablet"
1679
- });
1680
- qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
1681
- const columnsCssVars = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
1682
- const [props2, state2] = qwik.useLexicalScope();
1683
- return {
1684
- "--flex-dir": state2.flexDir,
1685
- "--flex-dir-tablet": getTabletStyle(props2, state2, {
1686
- stackedStyle: state2.flexDir,
1687
- desktopStyle: "row"
1688
- })
1689
- };
1690
- }, "Columns_component_columnsCssVars_useComputed_adFEq2RWT9s", [
1691
- props,
1692
- state
1693
- ]));
1694
- const columnsStyles = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
1695
- const [props2, state2] = qwik.useLexicalScope();
1696
- return `
1697
- @media (max-width: ${getWidthForBreakpointSize(props2, state2, "medium")}px) {
1698
- .${props2.builderBlock.id}-breakpoints {
1735
+ const columnsStyles = function columnsStyles2(props, state) {
1736
+ return `
1737
+ @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
1738
+ .${props.builderBlock.id}-breakpoints {
1699
1739
  flex-direction: var(--flex-dir-tablet);
1700
1740
  align-items: stretch;
1701
1741
  }
1702
1742
 
1703
- .${props2.builderBlock.id}-breakpoints > .builder-column {
1743
+ .${props.builderBlock.id}-breakpoints > .builder-column {
1704
1744
  width: var(--column-width-tablet) !important;
1705
1745
  margin-left: var(--column-margin-left-tablet) !important;
1706
1746
  }
1707
1747
  }
1708
1748
 
1709
- @media (max-width: ${getWidthForBreakpointSize(props2, state2, "small")}px) {
1710
- .${props2.builderBlock.id}-breakpoints {
1749
+ @media (max-width: ${getWidthForBreakpointSize(props, state, "small")}px) {
1750
+ .${props.builderBlock.id}-breakpoints {
1711
1751
  flex-direction: var(--flex-dir);
1712
1752
  align-items: stretch;
1713
1753
  }
1714
1754
 
1715
- .${props2.builderBlock.id}-breakpoints > .builder-column {
1755
+ .${props.builderBlock.id}-breakpoints > .builder-column {
1716
1756
  width: var(--column-width-mobile) !important;
1717
1757
  margin-left: var(--column-margin-left-mobile) !important;
1718
1758
  }
1719
1759
  },
1720
1760
  `;
1721
- }, "Columns_component_columnsStyles_useComputed_nBtMPbzd1Wc", [
1722
- props,
1723
- state
1724
- ]));
1725
- return /* @__PURE__ */ qwik._jsxQ("div", null, {
1726
- class: qwik._fnSignal((p0) => `builder-columns ${p0.builderBlock.id}-breakpoints div-Columns`, [
1727
- props
1728
- ], '`builder-columns ${p0.builderBlock.id}-breakpoints`+" div-Columns"'),
1729
- style: qwik._fnSignal((p0) => p0.value, [
1730
- columnsCssVars
1731
- ], "p0.value")
1732
- }, [
1761
+ };
1762
+ const getAttributes = function getAttributes2(props, state, column, index) {
1763
+ return {
1764
+ ...column.link ? {
1765
+ href: column.link
1766
+ } : {},
1767
+ [getClassPropName()]: "builder-column",
1768
+ style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
1769
+ };
1770
+ };
1771
+ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
1772
+ var _a;
1773
+ qwik._jsxBranch();
1774
+ const state = qwik.useStore({
1775
+ cols: props.columns || [],
1776
+ flexDir: props.stackColumnsAt === "never" ? "row" : props.reverseColumnsWhenStacked ? "column-reverse" : "column",
1777
+ gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
1778
+ stackAt: props.stackColumnsAt || "tablet"
1779
+ });
1780
+ qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
1781
+ return /* @__PURE__ */ qwik._jsxQ("div", {
1782
+ class: getColumnsClass((_a = props.builderBlock) == null ? void 0 : _a.id) + " div-Columns",
1783
+ style: columnsCssVars(props, state)
1784
+ }, null, [
1733
1785
  /* @__PURE__ */ qwik._jsxC(InlinedStyles, {
1734
1786
  id: "builderio-columns",
1735
- get styles() {
1736
- return columnsStyles.value;
1737
- },
1787
+ styles: columnsStyles(props, state),
1738
1788
  [qwik._IMMUTABLE]: {
1739
- id: qwik._IMMUTABLE,
1740
- styles: qwik._fnSignal((p0) => p0.value, [
1741
- columnsStyles
1742
- ], "p0.value")
1789
+ id: qwik._IMMUTABLE
1743
1790
  }
1744
1791
  }, 3, "c0_0"),
1745
1792
  (props.columns || []).map((column, index) => {
1746
1793
  return /* @__PURE__ */ qwik._jsxC(DynamicRenderer, {
1747
- TagName: column.link ? props.builderLinkComponent || "a" : "div",
1794
+ TagName: getTagName(props, state, column),
1748
1795
  actionAttributes: {},
1749
- attributes: {
1750
- ...column.link ? {
1751
- href: column.link
1752
- } : {},
1753
- [getClassPropName()]: "builder-column",
1754
- style: mapStyleObjToStrIfNeeded(columnCssVars(props, state, index))
1755
- },
1796
+ attributes: getAttributes(props, state, column, index),
1756
1797
  children: /* @__PURE__ */ qwik._jsxC(Blocks, {
1757
1798
  path: `component.options.columns.${index}.blocks`,
1758
1799
  get parent() {
@@ -1860,7 +1901,7 @@ function getSrcSet(url) {
1860
1901
  return url;
1861
1902
  }
1862
1903
  const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
1863
- var _a, _b, _c, _d;
1904
+ var _a, _b, _c, _d, _e, _f;
1864
1905
  qwik._jsxBranch();
1865
1906
  qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
1866
1907
  const srcSetToUse = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
@@ -1956,7 +1997,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1956
1997
  ], '{paddingTop:p0.aspectRatio*100+"%"}')
1957
1998
  }, null, 3, "0A_1") : null,
1958
1999
  ((_d = (_c = props.builderBlock) == null ? void 0 : _c.children) == null ? void 0 : _d.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "0A_2") : null,
1959
- !props.fitContent && props.children ? /* @__PURE__ */ qwik._jsxQ("div", null, {
2000
+ !props.fitContent && ((_f = (_e = props.builderBlock) == null ? void 0 : _e.children) == null ? void 0 : _f.length) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
1960
2001
  class: "div-Image-2"
1961
2002
  }, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "0A_3"), 1, "0A_4") : null
1962
2003
  ]
@@ -2175,7 +2216,7 @@ const handleABTesting = async ({ item, canTrack }) => {
2175
2216
  };
2176
2217
  };
2177
2218
  const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
2178
- const componentInfo$f = {
2219
+ const componentInfo$g = {
2179
2220
  name: "Core:Button",
2180
2221
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
2181
2222
  defaultStyles: {
@@ -2213,7 +2254,7 @@ const componentInfo$f = {
2213
2254
  static: true,
2214
2255
  noWrap: true
2215
2256
  };
2216
- const componentInfo$e = {
2257
+ const componentInfo$f = {
2217
2258
  // TODO: ways to statically preprocess JSON for references, functions, etc
2218
2259
  name: "Columns",
2219
2260
  isRSC: true,
@@ -2455,14 +2496,14 @@ const componentInfo$e = {
2455
2496
  }
2456
2497
  ]
2457
2498
  };
2458
- const componentInfo$d = {
2499
+ const componentInfo$e = {
2459
2500
  name: "Fragment",
2460
2501
  static: true,
2461
2502
  hidden: true,
2462
2503
  canHaveChildren: true,
2463
2504
  noWrap: true
2464
2505
  };
2465
- const componentInfo$c = {
2506
+ const componentInfo$d = {
2466
2507
  name: "Image",
2467
2508
  static: true,
2468
2509
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -2610,7 +2651,7 @@ const componentInfo$c = {
2610
2651
  }
2611
2652
  ]
2612
2653
  };
2613
- const componentInfo$b = {
2654
+ const componentInfo$c = {
2614
2655
  name: "Core:Section",
2615
2656
  static: true,
2616
2657
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -2655,7 +2696,7 @@ const componentInfo$b = {
2655
2696
  }
2656
2697
  ]
2657
2698
  };
2658
- const componentInfo$a = {
2699
+ const componentInfo$b = {
2659
2700
  name: "Slot",
2660
2701
  isRSC: true,
2661
2702
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -2710,7 +2751,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
2710
2751
  }
2711
2752
  }, 0, "B1_1");
2712
2753
  }, "Slot_component_WWgWgfV0bb0"));
2713
- const componentInfo$9 = {
2754
+ const componentInfo$a = {
2714
2755
  name: "Symbol",
2715
2756
  noWrap: true,
2716
2757
  static: true,
@@ -2750,6 +2791,282 @@ const componentInfo$9 = {
2750
2791
  }
2751
2792
  ]
2752
2793
  };
2794
+ const defaultTab = {
2795
+ "@type": "@builder.io/sdk:Element",
2796
+ responsiveStyles: {
2797
+ large: {
2798
+ paddingLeft: "20px",
2799
+ paddingRight: "20px",
2800
+ paddingTop: "10px",
2801
+ paddingBottom: "10px",
2802
+ minWidth: "100px",
2803
+ textAlign: "center",
2804
+ display: "flex",
2805
+ flexDirection: "column",
2806
+ cursor: "pointer",
2807
+ userSelect: "none"
2808
+ }
2809
+ },
2810
+ component: {
2811
+ name: "Text",
2812
+ options: {
2813
+ text: "New tab"
2814
+ }
2815
+ }
2816
+ };
2817
+ const defaultElement = {
2818
+ "@type": "@builder.io/sdk:Element",
2819
+ responsiveStyles: {
2820
+ large: {
2821
+ height: "200px",
2822
+ display: "flex",
2823
+ marginTop: "20px",
2824
+ flexDirection: "column"
2825
+ }
2826
+ },
2827
+ component: {
2828
+ name: "Text",
2829
+ options: {
2830
+ text: "New tab content "
2831
+ }
2832
+ }
2833
+ };
2834
+ const componentInfo$9 = {
2835
+ name: "Builder: Tabs",
2836
+ inputs: [
2837
+ {
2838
+ name: "tabs",
2839
+ type: "list",
2840
+ broadcast: true,
2841
+ subFields: [
2842
+ {
2843
+ name: "label",
2844
+ type: "uiBlocks",
2845
+ hideFromUI: true,
2846
+ defaultValue: [
2847
+ defaultTab
2848
+ ]
2849
+ },
2850
+ {
2851
+ name: "content",
2852
+ type: "uiBlocks",
2853
+ hideFromUI: true,
2854
+ defaultValue: [
2855
+ defaultElement
2856
+ ]
2857
+ }
2858
+ ],
2859
+ defaultValue: [
2860
+ {
2861
+ label: [
2862
+ {
2863
+ ...defaultTab,
2864
+ component: {
2865
+ name: "Text",
2866
+ options: {
2867
+ text: "Tab 1"
2868
+ }
2869
+ }
2870
+ }
2871
+ ],
2872
+ content: [
2873
+ {
2874
+ ...defaultElement,
2875
+ component: {
2876
+ name: "Text",
2877
+ options: {
2878
+ text: "Tab 1 content"
2879
+ }
2880
+ }
2881
+ }
2882
+ ]
2883
+ },
2884
+ {
2885
+ label: [
2886
+ {
2887
+ ...defaultTab,
2888
+ component: {
2889
+ name: "Text",
2890
+ options: {
2891
+ text: "Tab 2"
2892
+ }
2893
+ }
2894
+ }
2895
+ ],
2896
+ content: [
2897
+ {
2898
+ ...defaultElement,
2899
+ component: {
2900
+ name: "Text",
2901
+ options: {
2902
+ text: "Tab 2 content"
2903
+ }
2904
+ }
2905
+ }
2906
+ ]
2907
+ }
2908
+ ]
2909
+ },
2910
+ {
2911
+ name: "activeTabStyle",
2912
+ type: "uiStyle",
2913
+ helperText: "CSS styles for the active tab",
2914
+ defaultValue: {
2915
+ backgroundColor: "rgba(0, 0, 0, 0.1)"
2916
+ }
2917
+ },
2918
+ {
2919
+ name: "defaultActiveTab",
2920
+ type: "number",
2921
+ helperText: 'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',
2922
+ defaultValue: 1,
2923
+ advanced: true
2924
+ },
2925
+ {
2926
+ name: "collapsible",
2927
+ type: "boolean",
2928
+ helperText: "If on, clicking an open tab closes it so no tabs are active",
2929
+ defaultValue: false,
2930
+ advanced: true
2931
+ },
2932
+ {
2933
+ name: "tabHeaderLayout",
2934
+ type: "enum",
2935
+ helperText: "Change the layout of the tab headers (uses justify-content)",
2936
+ defaultValue: "flex-start",
2937
+ enum: [
2938
+ {
2939
+ label: "Center",
2940
+ value: "center"
2941
+ },
2942
+ {
2943
+ label: "Space between",
2944
+ value: "space-between"
2945
+ },
2946
+ {
2947
+ label: "Space around",
2948
+ value: "space-around"
2949
+ },
2950
+ {
2951
+ label: "Left",
2952
+ value: "flex-start"
2953
+ },
2954
+ {
2955
+ label: "Right",
2956
+ value: "flex-end"
2957
+ }
2958
+ ]
2959
+ }
2960
+ ]
2961
+ };
2962
+ const activeTabContent = function activeTabContent2(props, state, active) {
2963
+ return props.tabs && props.tabs[active].content;
2964
+ };
2965
+ const getActiveTabStyle = function getActiveTabStyle2(props, state, index) {
2966
+ return state.activeTab === index ? props.activeTabStyle : {};
2967
+ };
2968
+ const Tabs = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
2969
+ qwik._jsxBranch();
2970
+ const state = qwik.useStore({
2971
+ activeTab: props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
2972
+ });
2973
+ return /* @__PURE__ */ qwik._jsxQ("div", null, null, [
2974
+ /* @__PURE__ */ qwik._jsxQ("div", null, {
2975
+ class: "builder-tabs-wrap",
2976
+ style: qwik._fnSignal((p0) => ({
2977
+ display: "flex",
2978
+ flexDirection: "row",
2979
+ justifyContent: p0.tabHeaderLayout || "flex-start",
2980
+ overflow: "auto"
2981
+ }), [
2982
+ props
2983
+ ], '{display:"flex",flexDirection:"row",justifyContent:p0.tabHeaderLayout||"flex-start",overflow:"auto"}')
2984
+ }, (props.tabs || []).map((tab, index) => {
2985
+ return /* @__PURE__ */ qwik._jsxQ("span", {
2986
+ class: `builder-tab-wrap ${state.activeTab === index ? "builder-tab-active" : ""}`,
2987
+ onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
2988
+ const [index2, props2, state2] = qwik.useLexicalScope();
2989
+ if (index2 === state2.activeTab && props2.collapsible)
2990
+ state2.activeTab = -1;
2991
+ else
2992
+ state2.activeTab = index2;
2993
+ }, "Tabs_component_div_div_span_onClick_hSTBabAHGks", [
2994
+ index,
2995
+ props,
2996
+ state
2997
+ ]),
2998
+ style: getActiveTabStyle(props, state, index)
2999
+ }, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
3000
+ get parent() {
3001
+ return props.builderBlock.id;
3002
+ },
3003
+ path: `component.options.tabs.${index}.label`,
3004
+ get blocks() {
3005
+ return tab.label;
3006
+ },
3007
+ get context() {
3008
+ return props.builderContext;
3009
+ },
3010
+ get registeredComponents() {
3011
+ return props.builderComponents;
3012
+ },
3013
+ get linkComponent() {
3014
+ return props.builderLinkComponent;
3015
+ },
3016
+ [qwik._IMMUTABLE]: {
3017
+ blocks: qwik._wrapProp(tab, "label"),
3018
+ context: qwik._fnSignal((p0) => p0.builderContext, [
3019
+ props
3020
+ ], "p0.builderContext"),
3021
+ linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
3022
+ props
3023
+ ], "p0.builderLinkComponent"),
3024
+ parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
3025
+ props
3026
+ ], "p0.builderBlock.id"),
3027
+ registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
3028
+ props
3029
+ ], "p0.builderComponents")
3030
+ }
3031
+ }, 3, "6k_0"), 0, index);
3032
+ }), 1, null),
3033
+ activeTabContent(props, state, state.activeTab) ? /* @__PURE__ */ qwik._jsxQ("div", null, null, /* @__PURE__ */ qwik._jsxC(Blocks, {
3034
+ get parent() {
3035
+ return props.builderBlock.id;
3036
+ },
3037
+ get path() {
3038
+ return `component.options.tabs.${state.activeTab}.content`;
3039
+ },
3040
+ blocks: activeTabContent(props, state, state.activeTab),
3041
+ get context() {
3042
+ return props.builderContext;
3043
+ },
3044
+ get registeredComponents() {
3045
+ return props.builderComponents;
3046
+ },
3047
+ get linkComponent() {
3048
+ return props.builderLinkComponent;
3049
+ },
3050
+ [qwik._IMMUTABLE]: {
3051
+ context: qwik._fnSignal((p0) => p0.builderContext, [
3052
+ props
3053
+ ], "p0.builderContext"),
3054
+ linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
3055
+ props
3056
+ ], "p0.builderLinkComponent"),
3057
+ parent: qwik._fnSignal((p0) => p0.builderBlock.id, [
3058
+ props
3059
+ ], "p0.builderBlock.id"),
3060
+ path: qwik._fnSignal((p0) => `component.options.tabs.${p0.activeTab}.content`, [
3061
+ state
3062
+ ], "`component.options.tabs.${p0.activeTab}.content`"),
3063
+ registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
3064
+ props
3065
+ ], "p0.builderComponents")
3066
+ }
3067
+ }, 3, "6k_1"), 1, "6k_2") : null
3068
+ ], 1, "6k_3");
3069
+ }, "Tabs_component_MhWcxXy0lMY"));
2753
3070
  const componentInfo$8 = {
2754
3071
  name: "Text",
2755
3072
  static: true,
@@ -4029,36 +4346,42 @@ const getExtraComponents = () => [
4029
4346
  const getDefaultRegisteredComponents = () => [
4030
4347
  {
4031
4348
  component: Button,
4032
- ...componentInfo$f
4349
+ ...componentInfo$g
4033
4350
  },
4034
4351
  {
4035
4352
  component: Columns,
4036
- ...componentInfo$e
4353
+ ...componentInfo$f
4037
4354
  },
4038
4355
  {
4039
4356
  component: FragmentComponent,
4040
- ...componentInfo$d
4357
+ ...componentInfo$e
4041
4358
  },
4042
4359
  {
4043
4360
  component: Image,
4044
- ...componentInfo$c
4361
+ ...componentInfo$d
4045
4362
  },
4046
4363
  {
4047
4364
  component: SectionComponent,
4048
- ...componentInfo$b
4365
+ ...componentInfo$c
4049
4366
  },
4050
4367
  {
4051
4368
  component: Slot,
4052
- ...componentInfo$a
4369
+ ...componentInfo$b
4053
4370
  },
4054
4371
  {
4055
4372
  component: Symbol$1,
4056
- ...componentInfo$9
4373
+ ...componentInfo$a
4057
4374
  },
4058
4375
  {
4059
4376
  component: Text,
4060
4377
  ...componentInfo$8
4061
4378
  },
4379
+ ...[
4380
+ {
4381
+ component: Tabs,
4382
+ ...componentInfo$9
4383
+ }
4384
+ ],
4062
4385
  ...getExtraComponents()
4063
4386
  ];
4064
4387
  const createRegisterComponentMessage = (info) => ({
@@ -4504,7 +4827,7 @@ function isFromTrustedHost(trustedHosts, e) {
4504
4827
  const url = new URL(e.origin), hostname = url.hostname;
4505
4828
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
4506
4829
  }
4507
- const SDK_VERSION = "0.14.17";
4830
+ const SDK_VERSION = "0.14.19";
4508
4831
  const registry = {};
4509
4832
  function register(type, info) {
4510
4833
  let typeList = registry[type];
@@ -4687,7 +5010,75 @@ const subscribeToEditor = (model, callback, options) => {
4687
5010
  window.removeEventListener("message", listener);
4688
5011
  };
4689
5012
  };
4690
- const mergeNewRootState = function mergeNewRootState22(props, state, elementRef, newData) {
5013
+ const getCssFromFont = (font) => {
5014
+ var _a;
5015
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
5016
+ const name = family.split(",")[0];
5017
+ const url = font.fileUrl ?? ((_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular);
5018
+ let str = "";
5019
+ if (url && family && name)
5020
+ str += `
5021
+ @font-face {
5022
+ font-family: "${family}";
5023
+ src: local("${name}"), url('${url}') format('woff2');
5024
+ font-display: fallback;
5025
+ font-weight: 400;
5026
+ }
5027
+ `.trim();
5028
+ if (font.files)
5029
+ for (const weight in font.files) {
5030
+ const isNumber = String(Number(weight)) === weight;
5031
+ if (!isNumber)
5032
+ continue;
5033
+ const weightUrl = font.files[weight];
5034
+ if (weightUrl && weightUrl !== url)
5035
+ str += `
5036
+ @font-face {
5037
+ font-family: "${family}";
5038
+ src: url('${weightUrl}') format('woff2');
5039
+ font-display: fallback;
5040
+ font-weight: ${weight};
5041
+ }
5042
+ `.trim();
5043
+ }
5044
+ return str;
5045
+ };
5046
+ const getFontCss = ({ customFonts }) => {
5047
+ var _a;
5048
+ return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
5049
+ };
5050
+ const getCss = ({ cssCode, contentId }) => {
5051
+ if (!cssCode)
5052
+ return "";
5053
+ if (!contentId)
5054
+ return cssCode;
5055
+ return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
5056
+ };
5057
+ const DEFAULT_STYLES = `
5058
+ .builder-button {
5059
+ all: unset;
5060
+ }
5061
+
5062
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
5063
+ margin: 0;
5064
+ }
5065
+ .builder-text > p, .builder-text > .builder-paragraph {
5066
+ color: inherit;
5067
+ line-height: inherit;
5068
+ letter-spacing: inherit;
5069
+ font-weight: inherit;
5070
+ font-size: inherit;
5071
+ text-align: inherit;
5072
+ font-family: inherit;
5073
+ }
5074
+ `;
5075
+ const getDefaultStyles = (isNested) => {
5076
+ return !isNested ? DEFAULT_STYLES : "";
5077
+ };
5078
+ const getWrapperClassName = (variationId) => {
5079
+ return `variant-${variationId}`;
5080
+ };
5081
+ const mergeNewRootState = function mergeNewRootState22(props, state, showContentProps, elementRef, newData) {
4691
5082
  var _a, _b;
4692
5083
  const combinedState = {
4693
5084
  ...props.builderContextSignal.rootState,
@@ -4698,7 +5089,7 @@ const mergeNewRootState = function mergeNewRootState22(props, state, elementRef,
4698
5089
  else
4699
5090
  props.builderContextSignal.rootState = combinedState;
4700
5091
  };
4701
- const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
5092
+ const mergeNewContent = function mergeNewContent2(props, state, showContentProps, elementRef, newContent) {
4702
5093
  var _a, _b, _c, _d, _e;
4703
5094
  const newContentValue = {
4704
5095
  ...props.builderContextSignal.content,
@@ -4715,7 +5106,7 @@ const mergeNewContent = function mergeNewContent2(props, state, elementRef, newC
4715
5106
  };
4716
5107
  props.builderContextSignal.content = newContentValue;
4717
5108
  };
4718
- const processMessage = function processMessage2(props, state, elementRef, event) {
5109
+ const processMessage = function processMessage2(props, state, showContentProps, elementRef, event) {
4719
5110
  return createEditorListener({
4720
5111
  model: props.model,
4721
5112
  trustedHosts: props.trustedHosts,
@@ -4726,7 +5117,7 @@ const processMessage = function processMessage2(props, state, elementRef, event)
4726
5117
  if (!contentId || contentId !== ((_a = props.builderContextSignal.content) == null ? void 0 : _a.id))
4727
5118
  return;
4728
5119
  if (breakpoints)
4729
- mergeNewContent(props, state, elementRef, {
5120
+ mergeNewContent(props, state, showContentProps, elementRef, {
4730
5121
  meta: {
4731
5122
  breakpoints
4732
5123
  }
@@ -4736,12 +5127,12 @@ const processMessage = function processMessage2(props, state, elementRef, event)
4736
5127
  triggerAnimation(animation);
4737
5128
  },
4738
5129
  contentUpdate: (newContent) => {
4739
- mergeNewContent(props, state, elementRef, newContent);
5130
+ mergeNewContent(props, state, showContentProps, elementRef, newContent);
4740
5131
  }
4741
5132
  }
4742
5133
  })(event);
4743
5134
  };
4744
- const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
5135
+ const evaluateJsCode = function evaluateJsCode2(props, state, showContentProps, elementRef) {
4745
5136
  var _a, _b;
4746
5137
  const jsCode = (_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.jsCode;
4747
5138
  if (jsCode)
@@ -4757,7 +5148,7 @@ const evaluateJsCode = function evaluateJsCode2(props, state, elementRef) {
4757
5148
  enableCache: false
4758
5149
  });
4759
5150
  };
4760
- const onClick = function onClick22(props, state, elementRef, event) {
5151
+ const onClick = function onClick22(props, state, showContentProps, elementRef, event) {
4761
5152
  var _a, _b;
4762
5153
  if (props.builderContextSignal.content) {
4763
5154
  const variationId = (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
@@ -4775,7 +5166,7 @@ const onClick = function onClick22(props, state, elementRef, event) {
4775
5166
  if (!state.clicked)
4776
5167
  state.clicked = true;
4777
5168
  };
4778
- const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
5169
+ const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
4779
5170
  var _a, _b;
4780
5171
  const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
4781
5172
  Object.entries(requests).forEach(([key, url]) => {
@@ -4795,7 +5186,7 @@ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
4795
5186
  enableCache: true
4796
5187
  })));
4797
5188
  fetch$1(evaluatedUrl).then((response) => response.json()).then((json) => {
4798
- mergeNewRootState(props, state, elementRef, {
5189
+ mergeNewRootState(props, state, showContentProps, elementRef, {
4799
5190
  [key]: json
4800
5191
  });
4801
5192
  state.httpReqsData[key] = true;
@@ -4806,7 +5197,7 @@ const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
4806
5197
  });
4807
5198
  });
4808
5199
  };
4809
- const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
5200
+ const emitStateUpdate = function emitStateUpdate2(props, state, showContentProps, elementRef) {
4810
5201
  if (isEditing())
4811
5202
  window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
4812
5203
  detail: {
@@ -4818,7 +5209,17 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
4818
5209
  }));
4819
5210
  };
4820
5211
  const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5212
+ var _a, _b;
4821
5213
  qwik._jsxBranch();
5214
+ const showContentProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
5215
+ const [props2] = qwik.useLexicalScope();
5216
+ return props2.showContent ? {} : {
5217
+ hidden: true,
5218
+ "aria-hidden": true
5219
+ };
5220
+ }, "EnableEditor_component_showContentProps_useComputed_aHr3V0Y8sNs", [
5221
+ props
5222
+ ]));
4822
5223
  const elementRef = qwik.useSignal();
4823
5224
  const state = qwik.useStore({
4824
5225
  ContentWrapper: props.contentWrapper || "div",
@@ -4829,8 +5230,8 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4829
5230
  deep: true
4830
5231
  });
4831
5232
  qwik.useOn("initeditingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
4832
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
4833
- window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
5233
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
5234
+ window.addEventListener("message", processMessage.bind(null, props2, state2, showContentProps2, elementRef2));
4834
5235
  registerInsertMenu();
4835
5236
  setupBrowserForEditing({
4836
5237
  ...props2.locale ? {
@@ -4844,18 +5245,19 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4844
5245
  } : {}
4845
5246
  });
4846
5247
  Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
4847
- var _a;
5248
+ var _a2;
4848
5249
  const message = createRegisterComponentMessage(registeredComponent);
4849
- (_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
5250
+ (_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
4850
5251
  });
4851
- window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
5252
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, showContentProps2, elementRef2));
4852
5253
  }, "EnableEditor_component_useOn_Qs8c0yql2i0", [
4853
5254
  elementRef,
4854
5255
  props,
5256
+ showContentProps,
4855
5257
  state
4856
5258
  ]));
4857
5259
  qwik.useOn("initpreviewingbldr", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
4858
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5260
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4859
5261
  const searchParams = new URL(location.href).searchParams;
4860
5262
  const searchParamPreviewModel = searchParams.get("builder.preview");
4861
5263
  const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
@@ -4867,23 +5269,24 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4867
5269
  apiVersion: props2.builderContextSignal.apiVersion
4868
5270
  }).then((content) => {
4869
5271
  if (content)
4870
- mergeNewContent(props2, state2, elementRef2, content);
5272
+ mergeNewContent(props2, state2, showContentProps2, elementRef2, content);
4871
5273
  });
4872
5274
  }, "EnableEditor_component_useOn_1_F94YipmknvI", [
4873
5275
  elementRef,
4874
5276
  props,
5277
+ showContentProps,
4875
5278
  state
4876
5279
  ]));
4877
5280
  qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
4878
- var _a, _b, _c, _d;
5281
+ var _a2, _b2, _c, _d;
4879
5282
  if (isBrowser()) {
4880
5283
  if (isEditing()) {
4881
5284
  if (element)
4882
5285
  element.dispatchEvent(new CustomEvent("initeditingbldr"));
4883
5286
  }
4884
- const shouldTrackImpression = ((_a = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a.value) === "true";
5287
+ const shouldTrackImpression = ((_a2 = element.attributes.getNamedItem("shouldTrack")) == null ? void 0 : _a2.value) === "true";
4885
5288
  if (shouldTrackImpression) {
4886
- const variationId = (_b = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b.value;
5289
+ const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
4887
5290
  const contentId = (_c = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c.value;
4888
5291
  const apiKeyProp = (_d = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d.value;
4889
5292
  _track({
@@ -4902,80 +5305,87 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4902
5305
  }, "EnableEditor_component_useOn_2_FyR0YPSlJlw"));
4903
5306
  qwik.useContextProvider(builderContext, props.builderContextSignal);
4904
5307
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
4905
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5308
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4906
5309
  if (!props2.apiKey)
4907
5310
  logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
4908
5311
  evaluateJsCode(props2);
4909
- runHttpRequests(props2, state2, elementRef2);
5312
+ runHttpRequests(props2, state2, showContentProps2, elementRef2);
4910
5313
  emitStateUpdate(props2);
4911
5314
  }, "EnableEditor_component_useTask_Nb2VI04qp0M", [
4912
5315
  elementRef,
4913
5316
  props,
5317
+ showContentProps,
4914
5318
  state
4915
5319
  ]));
4916
5320
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4917
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5321
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4918
5322
  track2(() => props2.content);
4919
5323
  if (props2.content)
4920
- mergeNewContent(props2, state2, elementRef2, props2.content);
5324
+ mergeNewContent(props2, state2, showContentProps2, elementRef2, props2.content);
4921
5325
  }, "EnableEditor_component_useTask_1_m0y1Z9vk4eQ", [
4922
5326
  elementRef,
4923
5327
  props,
5328
+ showContentProps,
4924
5329
  state
4925
5330
  ]));
4926
5331
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4927
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5332
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4928
5333
  track2(() => {
4929
- var _a, _b;
4930
- return (_b = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.jsCode;
5334
+ var _a2, _b2;
5335
+ return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.jsCode;
4931
5336
  });
4932
5337
  evaluateJsCode(props2);
4933
5338
  }, "EnableEditor_component_useTask_2_xVyv0tDqZLs", [
4934
5339
  elementRef,
4935
5340
  props,
5341
+ showContentProps,
4936
5342
  state
4937
5343
  ]));
4938
5344
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4939
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5345
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4940
5346
  track2(() => {
4941
- var _a, _b;
4942
- return (_b = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests;
5347
+ var _a2, _b2;
5348
+ return (_b2 = (_a2 = props2.builderContextSignal.content) == null ? void 0 : _a2.data) == null ? void 0 : _b2.httpRequests;
4943
5349
  });
4944
- runHttpRequests(props2, state2, elementRef2);
5350
+ runHttpRequests(props2, state2, showContentProps2, elementRef2);
4945
5351
  }, "EnableEditor_component_useTask_3_bQ0e5LHZwWE", [
4946
5352
  elementRef,
4947
5353
  props,
5354
+ showContentProps,
4948
5355
  state
4949
5356
  ]));
4950
5357
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4951
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5358
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4952
5359
  track2(() => props2.builderContextSignal.rootState);
4953
5360
  emitStateUpdate(props2);
4954
5361
  }, "EnableEditor_component_useTask_4_moHYZG8uNVU", [
4955
5362
  elementRef,
4956
5363
  props,
5364
+ showContentProps,
4957
5365
  state
4958
5366
  ]));
4959
5367
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4960
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5368
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4961
5369
  track2(() => props2.data);
4962
5370
  if (props2.data)
4963
- mergeNewRootState(props2, state2, elementRef2, props2.data);
5371
+ mergeNewRootState(props2, state2, showContentProps2, elementRef2, props2.data);
4964
5372
  }, "EnableEditor_component_useTask_5_24QxS0r0KF8", [
4965
5373
  elementRef,
4966
5374
  props,
5375
+ showContentProps,
4967
5376
  state
4968
5377
  ]));
4969
5378
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
4970
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
5379
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
4971
5380
  track2(() => props2.locale);
4972
5381
  if (props2.locale)
4973
- mergeNewRootState(props2, state2, elementRef2, {
5382
+ mergeNewRootState(props2, state2, showContentProps2, elementRef2, {
4974
5383
  locale: props2.locale
4975
5384
  });
4976
5385
  }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
4977
5386
  elementRef,
4978
5387
  props,
5388
+ showContentProps,
4979
5389
  state
4980
5390
  ]));
4981
5391
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
@@ -4984,69 +5394,58 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
4984
5394
  return props.apiKey;
4985
5395
  },
4986
5396
  get contentId() {
4987
- var _a;
4988
- return (_a = props.builderContextSignal.content) == null ? void 0 : _a.id;
5397
+ var _a2;
5398
+ return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.id;
4989
5399
  },
4990
5400
  get variationId() {
4991
- var _a;
4992
- return (_a = props.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
5401
+ var _a2;
5402
+ return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.testVariationId;
4993
5403
  },
4994
5404
  onClick$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
4995
- const [elementRef2, props2, state2] = qwik.useLexicalScope();
4996
- return onClick(props2, state2, elementRef2, event);
5405
+ const [elementRef2, props2, showContentProps2, state2] = qwik.useLexicalScope();
5406
+ return onClick(props2, state2, showContentProps2, elementRef2, event);
4997
5407
  }, "EnableEditor_component__Fragment_onClick_b4nYT3DrjEk", [
4998
5408
  elementRef,
4999
5409
  props,
5410
+ showContentProps,
5000
5411
  state
5001
5412
  ]),
5002
5413
  ref: elementRef,
5003
5414
  shouldTrack: String(props.builderContextSignal.content && getDefaultCanTrack(props.canTrack)),
5004
5415
  get "builder-content-id"() {
5005
- var _a;
5006
- return (_a = props.builderContextSignal.content) == null ? void 0 : _a.id;
5416
+ var _a2;
5417
+ return (_a2 = props.builderContextSignal.content) == null ? void 0 : _a2.id;
5007
5418
  },
5008
5419
  get "builder-model"() {
5009
5420
  return props.model;
5010
5421
  },
5011
- ...props.showContent ? {} : {
5012
- hidden: true,
5013
- "aria-hidden": true
5014
- },
5422
+ ...showContentProps.value,
5015
5423
  ...props.contentWrapperProps,
5016
- get class() {
5017
- var _a, _b;
5018
- return `variant-${((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)}`;
5019
- },
5020
5424
  children: /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0"),
5425
+ class: getWrapperClassName(((_a = props.content) == null ? void 0 : _a.testVariationId) || ((_b = props.content) == null ? void 0 : _b.id)),
5021
5426
  [qwik._IMMUTABLE]: {
5022
5427
  apiKey: qwik._fnSignal((p0) => p0.apiKey, [
5023
5428
  props
5024
5429
  ], "p0.apiKey"),
5025
5430
  "builder-content-id": qwik._fnSignal((p0) => {
5026
- var _a;
5027
- return (_a = p0.builderContextSignal.content) == null ? void 0 : _a.id;
5431
+ var _a2;
5432
+ return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.id;
5028
5433
  }, [
5029
5434
  props
5030
5435
  ], "p0.builderContextSignal.content?.id"),
5031
5436
  "builder-model": qwik._fnSignal((p0) => p0.model, [
5032
5437
  props
5033
5438
  ], "p0.model"),
5034
- class: qwik._fnSignal((p0) => {
5035
- var _a, _b;
5036
- return `variant-${((_a = p0.content) == null ? void 0 : _a.testVariationId) || ((_b = p0.content) == null ? void 0 : _b.id)}`;
5037
- }, [
5038
- props
5039
- ], "`variant-${p0.content?.testVariationId||p0.content?.id}`"),
5040
5439
  contentId: qwik._fnSignal((p0) => {
5041
- var _a;
5042
- return (_a = p0.builderContextSignal.content) == null ? void 0 : _a.id;
5440
+ var _a2;
5441
+ return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.id;
5043
5442
  }, [
5044
5443
  props
5045
5444
  ], "p0.builderContextSignal.content?.id"),
5046
5445
  ref: qwik._IMMUTABLE,
5047
5446
  variationId: qwik._fnSignal((p0) => {
5048
- var _a;
5049
- return (_a = p0.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
5447
+ var _a2;
5448
+ return (_a2 = p0.builderContextSignal.content) == null ? void 0 : _a2.testVariationId;
5050
5449
  }, [
5051
5450
  props
5052
5451
  ], "p0.builderContextSignal.content?.testVariationId")
@@ -5054,71 +5453,6 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
5054
5453
  }, 0, "06_1") : null
5055
5454
  }, 1, "06_2");
5056
5455
  }, "EnableEditor_component_ko1mO8oaj8k"));
5057
- const getCssFromFont = (font) => {
5058
- var _a;
5059
- const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
5060
- const name = family.split(",")[0];
5061
- const url = font.fileUrl ?? ((_a = font == null ? void 0 : font.files) == null ? void 0 : _a.regular);
5062
- let str = "";
5063
- if (url && family && name)
5064
- str += `
5065
- @font-face {
5066
- font-family: "${family}";
5067
- src: local("${name}"), url('${url}') format('woff2');
5068
- font-display: fallback;
5069
- font-weight: 400;
5070
- }
5071
- `.trim();
5072
- if (font.files)
5073
- for (const weight in font.files) {
5074
- const isNumber = String(Number(weight)) === weight;
5075
- if (!isNumber)
5076
- continue;
5077
- const weightUrl = font.files[weight];
5078
- if (weightUrl && weightUrl !== url)
5079
- str += `
5080
- @font-face {
5081
- font-family: "${family}";
5082
- src: url('${weightUrl}') format('woff2');
5083
- font-display: fallback;
5084
- font-weight: ${weight};
5085
- }
5086
- `.trim();
5087
- }
5088
- return str;
5089
- };
5090
- const getFontCss = ({ customFonts }) => {
5091
- var _a;
5092
- return ((_a = customFonts == null ? void 0 : customFonts.map((font) => getCssFromFont(font))) == null ? void 0 : _a.join(" ")) || "";
5093
- };
5094
- const getCss = ({ cssCode, contentId }) => {
5095
- if (!cssCode)
5096
- return "";
5097
- if (!contentId)
5098
- return cssCode;
5099
- return (cssCode == null ? void 0 : cssCode.replace(/&/g, `div[builder-content-id="${contentId}"]`)) || "";
5100
- };
5101
- const DEFAULT_STYLES = `
5102
- .builder-button {
5103
- all: unset;
5104
- }
5105
-
5106
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
5107
- margin: 0;
5108
- }
5109
- .builder-text > p, .builder-text > .builder-paragraph {
5110
- color: inherit;
5111
- line-height: inherit;
5112
- letter-spacing: inherit;
5113
- font-weight: inherit;
5114
- font-size: inherit;
5115
- text-align: inherit;
5116
- font-family: inherit;
5117
- }
5118
- `;
5119
- const getDefaultStyles = (isNested) => {
5120
- return !isNested ? DEFAULT_STYLES : "";
5121
- };
5122
5456
  const ContentStyles = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5123
5457
  const state = qwik.useStore({
5124
5458
  injectedStyles: `
@@ -5723,7 +6057,7 @@ const fetchSymbolContent = async ({ builderContextValue, symbol }) => {
5723
6057
  });
5724
6058
  return void 0;
5725
6059
  };
5726
- const setContent = function setContent2(props, state) {
6060
+ const setContent = function setContent2(props, state, blocksWrapper, contentWrapper, className) {
5727
6061
  if (state.contentToUse)
5728
6062
  return;
5729
6063
  fetchSymbolContent({
@@ -5736,6 +6070,12 @@ const setContent = function setContent2(props, state) {
5736
6070
  };
5737
6071
  const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5738
6072
  var _a;
6073
+ const blocksWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
6074
+ return "div";
6075
+ }, "Symbol_component_blocksWrapper_useComputed_B5dlF985gMM"));
6076
+ const contentWrapper = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
6077
+ return "div";
6078
+ }, "Symbol_component_contentWrapper_useComputed_EvmPpPj8JTo"));
5739
6079
  const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
5740
6080
  var _a2, _b;
5741
6081
  const [props2] = qwik.useLexicalScope();
@@ -5752,10 +6092,13 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
5752
6092
  contentToUse: (_a = props.symbol) == null ? void 0 : _a.content
5753
6093
  });
5754
6094
  qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
5755
- const [props2, state2] = qwik.useLexicalScope();
6095
+ const [blocksWrapper2, className2, contentWrapper2, props2, state2] = qwik.useLexicalScope();
5756
6096
  track2(() => props2.symbol);
5757
6097
  setContent(props2, state2);
5758
6098
  }, "Symbol_component_useTask_NIAWAC1bMBo", [
6099
+ blocksWrapper,
6100
+ className,
6101
+ contentWrapper,
5759
6102
  props,
5760
6103
  state
5761
6104
  ]));
@@ -5797,8 +6140,12 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
5797
6140
  get linkComponent() {
5798
6141
  return props.builderLinkComponent;
5799
6142
  },
5800
- blocksWrapper: "div",
5801
- contentWrapper: "div",
6143
+ get blocksWrapper() {
6144
+ return blocksWrapper.value;
6145
+ },
6146
+ get contentWrapper() {
6147
+ return contentWrapper.value;
6148
+ },
5802
6149
  [qwik._IMMUTABLE]: {
5803
6150
  apiKey: qwik._fnSignal((p0) => p0.builderContext.apiKey, [
5804
6151
  props
@@ -5806,11 +6153,15 @@ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQ
5806
6153
  apiVersion: qwik._fnSignal((p0) => p0.builderContext.apiVersion, [
5807
6154
  props
5808
6155
  ], "p0.builderContext.apiVersion"),
5809
- blocksWrapper: qwik._IMMUTABLE,
6156
+ blocksWrapper: qwik._fnSignal((p0) => p0.value, [
6157
+ blocksWrapper
6158
+ ], "p0.value"),
5810
6159
  content: qwik._fnSignal((p0) => p0.contentToUse, [
5811
6160
  state
5812
6161
  ], "p0.contentToUse"),
5813
- contentWrapper: qwik._IMMUTABLE,
6162
+ contentWrapper: qwik._fnSignal((p0) => p0.value, [
6163
+ contentWrapper
6164
+ ], "p0.value"),
5814
6165
  context: qwik._fnSignal((p0) => {
5815
6166
  var _a2;
5816
6167
  return {