@builder.io/sdk-qwik 0.7.3 → 0.7.5

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.
@@ -3950,8 +3950,9 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
3950
3950
  props
3951
3951
  ]));
3952
3952
  const processedBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3953
- const [props2, repeatItem2] = qwik.useLexicalScope();
3954
- return repeatItem2.value ? props2.block : getProcessedBlock({
3953
+ var _a2;
3954
+ const [props2] = qwik.useLexicalScope();
3955
+ return ((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) ? props2.block : getProcessedBlock({
3955
3956
  block: props2.block,
3956
3957
  localState: props2.context.localState,
3957
3958
  rootState: props2.context.rootState,
@@ -3960,8 +3961,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
3960
3961
  shouldEvaluateBindings: true
3961
3962
  });
3962
3963
  }, "Block_component_processedBlock_useComputed_ESKw0l5FcBc", [
3963
- props,
3964
- repeatItem
3964
+ props
3965
3965
  ]));
3966
3966
  const Tag = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3967
3967
  const [props2] = qwik.useLexicalScope();
@@ -3970,14 +3970,19 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
3970
3970
  props
3971
3971
  ]));
3972
3972
  const canShowBlock = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3973
- const [processedBlock2] = qwik.useLexicalScope();
3973
+ var _a2, _b;
3974
+ const [processedBlock2, props2, repeatItem2] = qwik.useLexicalScope();
3974
3975
  if ("hide" in processedBlock2.value)
3975
3976
  return !processedBlock2.value.hide;
3976
3977
  if ("show" in processedBlock2.value)
3977
3978
  return processedBlock2.value.show;
3979
+ if (((_a2 = props2.block.repeat) == null ? void 0 : _a2.collection) && !((_b = repeatItem2.value) == null ? void 0 : _b.length))
3980
+ return false;
3978
3981
  return true;
3979
3982
  }, "Block_component_canShowBlock_useComputed_NJEFz8ICF08", [
3980
- processedBlock
3983
+ processedBlock,
3984
+ props,
3985
+ repeatItem
3981
3986
  ]));
3982
3987
  const childrenWithoutParentComponent = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3983
3988
  var _a2;
@@ -5806,6 +5811,8 @@ const componentInfo = {
5806
5811
  ]
5807
5812
  };
5808
5813
  const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5814
+ var _a, _b, _c, _d, _e, _f, _g;
5815
+ qwik._jsxBranch();
5809
5816
  const videoProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
5810
5817
  const [props2] = qwik.useLexicalScope();
5811
5818
  return {
@@ -5829,43 +5836,83 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
5829
5836
  props
5830
5837
  ]));
5831
5838
  const spreadProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
5832
- const [props2, videoProps2] = qwik.useLexicalScope();
5839
+ const [videoProps2] = qwik.useLexicalScope();
5833
5840
  return {
5834
- ...props2.attributes,
5835
5841
  ...videoProps2.value
5836
5842
  };
5837
5843
  }, "Video_component_spreadProps_useComputed_ZdLsx18NYH4", [
5838
- props,
5839
5844
  videoProps
5840
5845
  ]));
5841
- return /* @__PURE__ */ qwik._jsxS("video", {
5842
- ...spreadProps.value
5843
- }, {
5844
- poster: qwik._fnSignal((p0) => p0.posterImage, [
5845
- props
5846
- ], "p0.posterImage"),
5847
- preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
5848
- props
5849
- ], 'p0.preload||"metadata"'),
5850
- src: qwik._fnSignal((p0) => p0.video || "no-src", [
5851
- props
5852
- ], 'p0.video||"no-src"'),
5853
- style: qwik._fnSignal((p0) => {
5854
- var _a;
5855
- return {
5846
+ return /* @__PURE__ */ qwik._jsxQ("div", null, {
5847
+ style: {
5848
+ position: "relative"
5849
+ }
5850
+ }, [
5851
+ /* @__PURE__ */ qwik._jsxS("video", {
5852
+ ...spreadProps.value,
5853
+ children: !props.lazyLoad ? /* @__PURE__ */ qwik._jsxQ("source", null, {
5854
+ src: qwik._fnSignal((p0) => p0.video, [
5855
+ props
5856
+ ], "p0.video"),
5857
+ type: "video/mp4"
5858
+ }, null, 3, "j7_0") : null,
5859
+ style: {
5856
5860
  width: "100%",
5857
5861
  height: "100%",
5858
- ...(_a = p0.attributes) == null ? void 0 : _a.style,
5859
- objectFit: p0.fit,
5860
- objectPosition: p0.position,
5862
+ ...(_a = props.attributes) == null ? void 0 : _a.style,
5863
+ objectFit: props.fit,
5864
+ objectPosition: props.position,
5861
5865
  // Hack to get object fit to work as expected and
5862
5866
  // not have the video overflow
5863
- borderRadius: 1
5864
- };
5865
- }, [
5866
- props
5867
- ], '{width:"100%",height:"100%",...p0.attributes?.style,objectFit:p0.fit,objectPosition:p0.position,borderRadius:1}')
5868
- }, 0, "j7_0");
5867
+ zIndex: 2,
5868
+ borderRadius: "1px",
5869
+ ...props.aspectRatio ? {
5870
+ position: "absolute"
5871
+ } : null
5872
+ }
5873
+ }, {
5874
+ class: "builder-video",
5875
+ poster: qwik._fnSignal((p0) => p0.posterImage, [
5876
+ props
5877
+ ], "p0.posterImage"),
5878
+ preload: qwik._fnSignal((p0) => p0.preload || "metadata", [
5879
+ props
5880
+ ], 'p0.preload||"metadata"'),
5881
+ src: qwik._fnSignal((p0) => p0.video || "no-src", [
5882
+ props
5883
+ ], 'p0.video||"no-src"')
5884
+ }, 0, null),
5885
+ props.aspectRatio && !(props.fitContent && ((_c = (_b = props.builderBlock) == null ? void 0 : _b.children) == null ? void 0 : _c.length)) ? /* @__PURE__ */ qwik._jsxQ("div", null, {
5886
+ style: qwik._fnSignal((p0) => ({
5887
+ width: "100%",
5888
+ paddingTop: p0.aspectRatio * 100 + "%",
5889
+ pointerEvents: "none",
5890
+ fontSize: "0px"
5891
+ }), [
5892
+ props
5893
+ ], '{width:"100%",paddingTop:p0.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}')
5894
+ }, null, 3, "j7_1") : null,
5895
+ ((_e = (_d = props.builderBlock) == null ? void 0 : _d.children) == null ? void 0 : _e.length) && props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
5896
+ style: {
5897
+ display: "flex",
5898
+ flexDirection: "column",
5899
+ alignItems: "stretch"
5900
+ }
5901
+ }, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_2"), 1, "j7_3") : null,
5902
+ ((_g = (_f = props.builderBlock) == null ? void 0 : _f.children) == null ? void 0 : _g.length) && !props.fitContent ? /* @__PURE__ */ qwik._jsxQ("div", null, {
5903
+ style: {
5904
+ pointerEvents: "none",
5905
+ display: "flex",
5906
+ flexDirection: "column",
5907
+ alignItems: "stretch",
5908
+ position: "absolute",
5909
+ top: "0",
5910
+ left: "0",
5911
+ width: "100%",
5912
+ height: "100%"
5913
+ }
5914
+ }, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
5915
+ ], 1, "j7_6");
5869
5916
  }, "Video_component_qdcTZflYyoQ"));
5870
5917
  const getDefaultRegisteredComponents = () => [
5871
5918
  {
@@ -5931,12 +5978,16 @@ const serializeComponentInfo = ({ inputs, ...info }) => ({
5931
5978
  [key]: serializeValue(value)
5932
5979
  }), {}))
5933
5980
  });
5981
+ const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
5982
+ const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
5983
+ const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
5984
+ const UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent";
5934
5985
  const getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => ({
5935
5986
  ...variant,
5936
5987
  testVariationId: variant.id,
5937
5988
  id: content == null ? void 0 : content.id
5938
5989
  }));
5939
- const checkShouldRunVariants = ({ canTrack, content }) => {
5990
+ const checkShouldRenderVariants = ({ canTrack, content }) => {
5940
5991
  const hasVariants = getVariants(content).length > 0;
5941
5992
  if (!hasVariants)
5942
5993
  return false;
@@ -5946,131 +5997,27 @@ const checkShouldRunVariants = ({ canTrack, content }) => {
5946
5997
  return false;
5947
5998
  return true;
5948
5999
  };
5949
- function bldrAbTest(contentId, variants, isHydrationTarget2) {
5950
- var _a;
5951
- function getAndSetVariantId2() {
5952
- function setCookie2(name, value, days) {
5953
- let expires = "";
5954
- if (days) {
5955
- const date = /* @__PURE__ */ new Date();
5956
- date.setTime(date.getTime() + days * 864e5);
5957
- expires = "; expires=" + date.toUTCString();
5958
- }
5959
- document.cookie = name + "=" + (value || "") + expires + "; path=/; Secure; SameSite=None";
5960
- }
5961
- function getCookie2(name) {
5962
- const nameEQ = name + "=";
5963
- const ca2 = document.cookie.split(";");
5964
- for (let i = 0; i < ca2.length; i++) {
5965
- let c = ca2[i];
5966
- while (c.charAt(0) === " ")
5967
- c = c.substring(1, c.length);
5968
- if (c.indexOf(nameEQ) === 0)
5969
- return c.substring(nameEQ.length, c.length);
5970
- }
5971
- return null;
5972
- }
5973
- const cookieName = `builder.tests.${contentId}`;
5974
- const variantInCookie = getCookie2(cookieName);
5975
- const availableIDs = variants.map((vr) => vr.id).concat(contentId);
5976
- if (variantInCookie && availableIDs.includes(variantInCookie))
5977
- return variantInCookie;
5978
- let n = 0;
5979
- const random = Math.random();
5980
- for (let i = 0; i < variants.length; i++) {
5981
- const variant = variants[i];
5982
- const testRatio = variant.testRatio;
5983
- n += testRatio;
5984
- if (random < n) {
5985
- setCookie2(cookieName, variant.id);
5986
- return variant.id;
5987
- }
5988
- }
5989
- setCookie2(cookieName, contentId);
5990
- return contentId;
5991
- }
5992
- const winningVariantId = getAndSetVariantId2();
5993
- const styleEl = (_a = document.currentScript) == null ? void 0 : _a.previousElementSibling;
5994
- if (isHydrationTarget2) {
5995
- styleEl.remove();
5996
- const thisScriptEl = document.currentScript;
5997
- thisScriptEl == null ? void 0 : thisScriptEl.remove();
5998
- } else {
5999
- const newStyleStr = variants.concat({
6000
- id: contentId
6001
- }).filter((variant) => variant.id !== winningVariantId).map((value) => {
6002
- return `.variant-${value.id} { display: none; }
6003
- `;
6004
- }).join("");
6005
- styleEl.innerHTML = newStyleStr;
6006
- }
6007
- }
6008
- function bldrCntntScrpt(variantContentId, defaultContentId, isHydrationTarget2) {
6009
- var _a;
6010
- if (!navigator.cookieEnabled)
6011
- return;
6012
- function getCookie2(name) {
6013
- const nameEQ = name + "=";
6014
- const ca2 = document.cookie.split(";");
6015
- for (let i = 0; i < ca2.length; i++) {
6016
- let c = ca2[i];
6017
- while (c.charAt(0) === " ")
6018
- c = c.substring(1, c.length);
6019
- if (c.indexOf(nameEQ) === 0)
6020
- return c.substring(nameEQ.length, c.length);
6021
- }
6022
- return null;
6023
- }
6024
- const cookieName = `builder.tests.${defaultContentId}`;
6025
- const variantId = getCookie2(cookieName);
6026
- const parentDiv = (_a = document.currentScript) == null ? void 0 : _a.parentElement;
6027
- const variantIsDefaultContent = variantContentId === defaultContentId;
6028
- if (variantId === variantContentId) {
6029
- if (variantIsDefaultContent)
6030
- return;
6031
- parentDiv == null ? void 0 : parentDiv.removeAttribute("hidden");
6032
- parentDiv == null ? void 0 : parentDiv.removeAttribute("aria-hidden");
6033
- } else {
6034
- if (variantIsDefaultContent) {
6035
- if (isHydrationTarget2)
6036
- parentDiv == null ? void 0 : parentDiv.remove();
6037
- else {
6038
- parentDiv == null ? void 0 : parentDiv.setAttribute("hidden", "true");
6039
- parentDiv == null ? void 0 : parentDiv.setAttribute("aria-hidden", "true");
6040
- }
6041
- }
6042
- return;
6043
- }
6044
- return;
6045
- }
6046
6000
  const getIsHydrationTarget = (target) => target === "react" || target === "reactNative";
6047
6001
  const isHydrationTarget = getIsHydrationTarget(TARGET);
6048
- const AB_TEST_FN_NAME = "builderIoAbTest";
6049
- const CONTENT_FN_NAME = "builderIoRenderContent";
6050
- const getScriptString = () => {
6051
- const fnStr = bldrAbTest.toString().replace(/\s+/g, " ");
6052
- const fnStr2 = bldrCntntScrpt.toString().replace(/\s+/g, " ");
6053
- return `
6054
- window.${AB_TEST_FN_NAME} = ${fnStr}
6055
- window.${CONTENT_FN_NAME} = ${fnStr2}
6002
+ const getScriptString = () => `
6003
+ window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
6004
+ window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
6056
6005
  `;
6057
- };
6058
- const getVariantsScriptString = (variants, contentId) => {
6059
- return `
6060
- window.${AB_TEST_FN_NAME}("${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget})`;
6061
- };
6062
- const getRenderContentScriptString = ({ contentId, variationId }) => {
6063
- return `
6064
- window.${CONTENT_FN_NAME}("${variationId}", "${contentId}", ${isHydrationTarget})`;
6065
- };
6006
+ const getUpdateCookieAndStylesScript = (variants, contentId) => `
6007
+ window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
6008
+ "${contentId}",${JSON.stringify(variants)}, ${isHydrationTarget}
6009
+ )`;
6010
+ const getUpdateVariantVisibilityScript = ({ contentId, variationId }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
6011
+ "${variationId}", "${contentId}", ${isHydrationTarget}
6012
+ )`;
6066
6013
  const InlinedScript = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
6067
6014
  return /* @__PURE__ */ qwik._jsxQ("script", null, {
6068
6015
  dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.scriptStr, [
6069
6016
  props
6070
6017
  ], "p0.scriptStr"),
6071
- id: qwik._fnSignal((p0) => p0.id, [
6018
+ id: qwik._fnSignal((p0) => p0.id || "", [
6072
6019
  props
6073
- ], "p0.id")
6020
+ ], 'p0.id||""')
6074
6021
  }, null, 3, "WO_0");
6075
6022
  }, "InlinedScript_component_hwThBdhA8rw"));
6076
6023
  function getGlobalThis() {
@@ -6450,7 +6397,7 @@ const getInteractionPropertiesForEvent = (event) => {
6450
6397
  }
6451
6398
  };
6452
6399
  };
6453
- const SDK_VERSION = "0.7.3";
6400
+ const SDK_VERSION = "0.7.5";
6454
6401
  const registry = {};
6455
6402
  function register(type, info) {
6456
6403
  let typeList = registry[type];
@@ -6708,7 +6655,7 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
6708
6655
  }));
6709
6656
  };
6710
6657
  const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
6711
- var _a, _b, _c;
6658
+ var _a, _b, _c, _d, _e;
6712
6659
  qwik._jsxBranch();
6713
6660
  const elementRef = qwik.useSignal();
6714
6661
  const state = qwik.useStore({
@@ -6768,7 +6715,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6768
6715
  state
6769
6716
  ]));
6770
6717
  qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
6771
- var _a2, _b2, _c2, _d;
6718
+ var _a2, _b2, _c2, _d2;
6772
6719
  if (isBrowser()) {
6773
6720
  if (isEditing() && element)
6774
6721
  element.dispatchEvent(new CustomEvent("initeditingbldr"));
@@ -6776,7 +6723,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6776
6723
  if (shouldTrackImpression) {
6777
6724
  const variationId = (_b2 = element.attributes.getNamedItem("variationId")) == null ? void 0 : _b2.value;
6778
6725
  const contentId = (_c2 = element.attributes.getNamedItem("contentId")) == null ? void 0 : _c2.value;
6779
- const apiKeyProp = (_d = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d.value;
6726
+ const apiKeyProp = (_d2 = element.attributes.getNamedItem("apiKey")) == null ? void 0 : _d2.value;
6780
6727
  _track({
6781
6728
  type: "impression",
6782
6729
  canTrack: true,
@@ -6874,7 +6821,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6874
6821
  hidden: true,
6875
6822
  "aria-hidden": true
6876
6823
  },
6877
- class: props.classNameProp
6824
+ class: `variant-${((_d = props.content) == null ? void 0 : _d.testVariationId) || ((_e = props.content) == null ? void 0 : _e.id)}`
6878
6825
  }, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "06_0")) : null
6879
6826
  }, 1, "06_1");
6880
6827
  }, "EnableEditor_component_ko1mO8oaj8k"));
@@ -6961,22 +6908,19 @@ ${getFontCss({
6961
6908
  const getContextStateInitialValue = ({ content, data, locale }) => {
6962
6909
  var _a, _b, _c;
6963
6910
  const defaultValues = {};
6964
- (_b = (_a = content == null ? void 0 : content.data) == null ? void 0 : _a.inputs) == null ? void 0 : _b.forEach((input) => {
6965
- var _a2;
6966
- if (input.name && input.defaultValue !== void 0 && ((_a2 = content == null ? void 0 : content.data) == null ? void 0 : _a2.state) && content.data.state[input.name] === void 0)
6911
+ const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
6912
+ (_c = (_b = content == null ? void 0 : content.data) == null ? void 0 : _b.inputs) == null ? void 0 : _c.forEach((input) => {
6913
+ if (input.name && input.defaultValue !== void 0)
6967
6914
  defaultValues[input.name] = input.defaultValue;
6968
6915
  });
6969
- const stateToUse = {
6970
- ...(_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state,
6916
+ return {
6917
+ ...defaultValues,
6918
+ ...initialState,
6971
6919
  ...data,
6972
6920
  ...locale ? {
6973
6921
  locale
6974
6922
  } : {}
6975
6923
  };
6976
- return {
6977
- ...defaultValues,
6978
- ...stateToUse
6979
- };
6980
6924
  };
6981
6925
  const getContentInitialValue = ({ content, data }) => {
6982
6926
  return !content ? void 0 : {
@@ -7038,7 +6982,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
7038
6982
  ...serializeComponentInfo(info)
7039
6983
  }
7040
6984
  }), {}),
7041
- scriptStr: getRenderContentScriptString({
6985
+ scriptStr: getUpdateVariantVisibilityScript({
7042
6986
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
7043
6987
  variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
7044
6988
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
@@ -7075,9 +7019,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
7075
7019
  get enrich() {
7076
7020
  return props.enrich;
7077
7021
  },
7078
- get classNameProp() {
7079
- return props.classNameProp;
7080
- },
7081
7022
  get showContent() {
7082
7023
  return props.showContent;
7083
7024
  },
@@ -7166,9 +7107,6 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
7166
7107
  canTrack: qwik._fnSignal((p0) => p0.canTrack, [
7167
7108
  props
7168
7109
  ], "p0.canTrack"),
7169
- classNameProp: qwik._fnSignal((p0) => p0.classNameProp, [
7170
- props
7171
- ], "p0.classNameProp"),
7172
7110
  content: qwik._fnSignal((p0) => p0.content, [
7173
7111
  props
7174
7112
  ], "p0.content"),
@@ -7196,19 +7134,19 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
7196
7134
  const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
7197
7135
  qwik._jsxBranch();
7198
7136
  const state = qwik.useStore({
7199
- shouldRenderVariants: checkShouldRunVariants({
7137
+ shouldRenderVariants: checkShouldRenderVariants({
7200
7138
  canTrack: getDefaultCanTrack(props.canTrack),
7201
7139
  content: props.content
7202
7140
  })
7203
7141
  });
7204
- const variantScriptStr = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
7142
+ const updateCookieAndStylesScriptStr = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
7205
7143
  var _a;
7206
7144
  const [props2] = qwik.useLexicalScope();
7207
- return getVariantsScriptString(getVariants(props2.content).map((value) => ({
7145
+ return getUpdateCookieAndStylesScript(getVariants(props2.content).map((value) => ({
7208
7146
  id: value.testVariationId,
7209
7147
  testRatio: value.testRatio
7210
7148
  })), ((_a = props2.content) == null ? void 0 : _a.id) || "");
7211
- }, "ContentVariants_component_variantScriptStr_useComputed_ldWqWafT8Ww", [
7149
+ }, "ContentVariants_component_updateCookieAndStylesScriptStr_useComputed_FtJXWpnoDYg", [
7212
7150
  props
7213
7151
  ]));
7214
7152
  const hideVariantsStyleString = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
@@ -7265,11 +7203,11 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
7265
7203
  }, 3, "XM_1"),
7266
7204
  /* @__PURE__ */ qwik._jsxC(InlinedScript, {
7267
7205
  get scriptStr() {
7268
- return variantScriptStr.value;
7206
+ return updateCookieAndStylesScriptStr.value;
7269
7207
  },
7270
7208
  [qwik._IMMUTABLE]: {
7271
7209
  scriptStr: qwik._fnSignal((p0) => p0.value, [
7272
- variantScriptStr
7210
+ updateCookieAndStylesScriptStr
7273
7211
  ], "p0.value")
7274
7212
  }
7275
7213
  }, 3, "XM_2"),
@@ -7277,9 +7215,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
7277
7215
  return /* @__PURE__ */ qwik._jsxC(ContentComponent, {
7278
7216
  content: variant,
7279
7217
  showContent: false,
7280
- get classNameProp() {
7281
- return void 0;
7282
- },
7283
7218
  get model() {
7284
7219
  return props.model;
7285
7220
  },
@@ -7323,7 +7258,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
7323
7258
  canTrack: qwik._fnSignal((p0) => p0.canTrack, [
7324
7259
  props
7325
7260
  ], "p0.canTrack"),
7326
- classNameProp: qwik._IMMUTABLE,
7327
7261
  context: qwik._fnSignal((p0) => p0.context, [
7328
7262
  props
7329
7263
  ], "p0.context"),
@@ -7358,10 +7292,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
7358
7292
  get content() {
7359
7293
  return defaultContent.value;
7360
7294
  },
7361
- get classNameProp() {
7362
- var _a;
7363
- return `variant-${(_a = props.content) == null ? void 0 : _a.id}`;
7364
- },
7365
7295
  showContent: true,
7366
7296
  get model() {
7367
7297
  return props.model;
@@ -7406,12 +7336,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
7406
7336
  canTrack: qwik._fnSignal((p0) => p0.canTrack, [
7407
7337
  props
7408
7338
  ], "p0.canTrack"),
7409
- classNameProp: qwik._fnSignal((p0) => {
7410
- var _a;
7411
- return `variant-${(_a = p0.content) == null ? void 0 : _a.id}`;
7412
- }, [
7413
- props
7414
- ], "`variant-${p0.content?.id}`"),
7415
7339
  content: qwik._fnSignal((p0) => p0.value, [
7416
7340
  defaultContent
7417
7341
  ], "p0.value"),