@builder.io/sdk-qwik 0.0.7 → 0.0.8

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.
Files changed (105) hide show
  1. package/lib/index.97024df8.js +80165 -0
  2. package/lib/index.d8c1e37f.cjs +80165 -0
  3. package/lib/index.qwik.cjs +2424 -0
  4. package/lib/index.qwik.mjs +2424 -0
  5. package/package.json +1 -1
  6. package/src/blocks/button/button.jsx +0 -197
  7. package/src/blocks/button/component-info.js +0 -41
  8. package/src/blocks/columns/columns.jsx +0 -267
  9. package/src/blocks/columns/component-info.js +0 -242
  10. package/src/blocks/custom-code/component-info.js +0 -31
  11. package/src/blocks/custom-code/custom-code.jsx +0 -130
  12. package/src/blocks/embed/component-info.js +0 -44
  13. package/src/blocks/embed/embed.jsx +0 -130
  14. package/src/blocks/embed/helpers.js +0 -9
  15. package/src/blocks/form/builder-blocks.jsx +0 -86
  16. package/src/blocks/form/component-info.js +0 -262
  17. package/src/blocks/form/form.jsx +0 -782
  18. package/src/blocks/fragment/component-info.js +0 -11
  19. package/src/blocks/fragment/fragment.jsx +0 -59
  20. package/src/blocks/image/component-info.js +0 -151
  21. package/src/blocks/image/image.helpers.js +0 -48
  22. package/src/blocks/image/image.jsx +0 -554
  23. package/src/blocks/img/component-info.js +0 -20
  24. package/src/blocks/img/img.jsx +0 -76
  25. package/src/blocks/input/component-info.js +0 -74
  26. package/src/blocks/input/input.jsx +0 -87
  27. package/src/blocks/raw-text/component-info.js +0 -16
  28. package/src/blocks/raw-text/raw-text.jsx +0 -53
  29. package/src/blocks/section/component-info.js +0 -49
  30. package/src/blocks/section/section.jsx +0 -97
  31. package/src/blocks/select/component-info.js +0 -59
  32. package/src/blocks/select/select.jsx +0 -149
  33. package/src/blocks/submit-button/component-info.js +0 -28
  34. package/src/blocks/submit-button/submit-button.jsx +0 -87
  35. package/src/blocks/symbol/component-info.js +0 -43
  36. package/src/blocks/symbol/symbol.jsx +0 -211
  37. package/src/blocks/text/component-info.js +0 -24
  38. package/src/blocks/text/text.jsx +0 -46
  39. package/src/blocks/textarea/component-info.js +0 -47
  40. package/src/blocks/textarea/textarea.jsx +0 -65
  41. package/src/blocks/util.js +0 -7
  42. package/src/blocks/video/component-info.js +0 -106
  43. package/src/blocks/video/video.jsx +0 -103
  44. package/src/components/render-block/block-styles.jsx +0 -174
  45. package/src/components/render-block/render-block.helpers.js +0 -23
  46. package/src/components/render-block/render-block.jsx +0 -733
  47. package/src/components/render-block/render-component.jsx +0 -245
  48. package/src/components/render-block/render-repeated-block.jsx +0 -104
  49. package/src/components/render-block/types.js +0 -0
  50. package/src/components/render-blocks.jsx +0 -387
  51. package/src/components/render-content/components/render-styles.jsx +0 -126
  52. package/src/components/render-content/index.js +0 -4
  53. package/src/components/render-content/render-content.jsx +0 -629
  54. package/src/components/render-inlined-styles.jsx +0 -141
  55. package/src/constants/builder-registered-components.js +0 -48
  56. package/src/constants/device-sizes.js +0 -21
  57. package/src/constants/target.js +0 -4
  58. package/src/context/builder.context.js +0 -5
  59. package/src/functions/camel-to-kebab-case.js +0 -4
  60. package/src/functions/convert-style-object.js +0 -6
  61. package/src/functions/evaluate.js +0 -28
  62. package/src/functions/event-handler-name.js +0 -7
  63. package/src/functions/get-block-actions.js +0 -23
  64. package/src/functions/get-block-component-options.js +0 -28
  65. package/src/functions/get-block-properties.js +0 -29
  66. package/src/functions/get-block-styles.js +0 -34
  67. package/src/functions/get-block-tag.js +0 -6
  68. package/src/functions/get-builder-search-params/fn.test.js +0 -13
  69. package/src/functions/get-builder-search-params/index.js +0 -33
  70. package/src/functions/get-content/ab-testing.js +0 -38
  71. package/src/functions/get-content/fn.test.js +0 -31
  72. package/src/functions/get-content/index.js +0 -96
  73. package/src/functions/get-content/types.js +0 -0
  74. package/src/functions/get-fetch.js +0 -34
  75. package/src/functions/get-global-this.js +0 -18
  76. package/src/functions/get-processed-block.js +0 -53
  77. package/src/functions/get-processed-block.test.js +0 -32
  78. package/src/functions/if-target.js +0 -15
  79. package/src/functions/is-browser.js +0 -6
  80. package/src/functions/is-editing.js +0 -7
  81. package/src/functions/is-iframe.js +0 -7
  82. package/src/functions/is-previewing.js +0 -14
  83. package/src/functions/on-change.js +0 -27
  84. package/src/functions/on-change.test.js +0 -19
  85. package/src/functions/register-component.js +0 -72
  86. package/src/functions/register.js +0 -29
  87. package/src/functions/sanitize-styles.js +0 -5
  88. package/src/functions/set-editor-settings.js +0 -15
  89. package/src/functions/set.js +0 -11
  90. package/src/functions/set.test.js +0 -16
  91. package/src/functions/track.js +0 -22
  92. package/src/functions/transform-block.js +0 -6
  93. package/src/helpers/css.js +0 -12
  94. package/src/helpers/flatten.js +0 -34
  95. package/src/index-helpers/blocks-exports.js +0 -22
  96. package/src/index-helpers/top-of-file.js +0 -4
  97. package/src/index.js +0 -10
  98. package/src/scripts/init-editing.js +0 -80
  99. package/src/types/builder-block.js +0 -0
  100. package/src/types/builder-content.js +0 -0
  101. package/src/types/components.js +0 -0
  102. package/src/types/deep-partial.js +0 -0
  103. package/src/types/element.js +0 -0
  104. package/src/types/targets.js +0 -0
  105. package/src/types/typescript.js +0 -0
@@ -0,0 +1,2424 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const qwik = require("@builder.io/qwik");
4
+ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
5
+ const TARGET = "qwik";
6
+ function isBrowser() {
7
+ return typeof window !== "undefined" && typeof document !== "undefined";
8
+ }
9
+ function isIframe() {
10
+ return isBrowser() && window.self !== window.top;
11
+ }
12
+ function isEditing() {
13
+ return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
14
+ }
15
+ const registry = {};
16
+ function register(type, info) {
17
+ let typeList = registry[type];
18
+ if (!typeList)
19
+ typeList = registry[type] = [];
20
+ typeList.push(info);
21
+ if (isBrowser()) {
22
+ const message = {
23
+ type: "builder.register",
24
+ data: {
25
+ type,
26
+ info
27
+ }
28
+ };
29
+ try {
30
+ parent.postMessage(message, "*");
31
+ if (parent !== window)
32
+ window.postMessage(message, "*");
33
+ } catch (err) {
34
+ console.debug("Could not postmessage", err);
35
+ }
36
+ }
37
+ }
38
+ var stdin_default = qwik.createContext("Builder");
39
+ const SIZES = {
40
+ small: {
41
+ min: 320,
42
+ default: 321,
43
+ max: 640
44
+ },
45
+ medium: {
46
+ min: 641,
47
+ default: 642,
48
+ max: 991
49
+ },
50
+ large: {
51
+ min: 990,
52
+ default: 991,
53
+ max: 1200
54
+ }
55
+ };
56
+ const getMaxWidthQueryForSize = (size) => `@media (max-width: ${SIZES[size].max}px)`;
57
+ function evaluate({ code, context, state, event }) {
58
+ if (code === "") {
59
+ console.warn("Skipping evaluation of empty code block.");
60
+ return;
61
+ }
62
+ const builder = {
63
+ isEditing: isEditing(),
64
+ isBrowser: isBrowser(),
65
+ isServer: !isBrowser()
66
+ };
67
+ const useReturn = !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
68
+ const useCode = useReturn ? `return (${code});` : code;
69
+ try {
70
+ return new Function("builder", "Builder", "state", "context", "event", useCode)(builder, builder, state, context, event);
71
+ } catch (e) {
72
+ console.warn("Builder custom code error: ", e);
73
+ }
74
+ }
75
+ const set = (obj, _path, value) => {
76
+ if (Object(obj) !== obj)
77
+ return obj;
78
+ const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
79
+ path.slice(0, -1).reduce(
80
+ (a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {},
81
+ obj
82
+ )[path[path.length - 1]] = value;
83
+ return obj;
84
+ };
85
+ function transformBlock(block) {
86
+ return block;
87
+ }
88
+ var __defProp$7 = Object.defineProperty;
89
+ var __defProps$5 = Object.defineProperties;
90
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
91
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
92
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
93
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
94
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, {
95
+ enumerable: true,
96
+ configurable: true,
97
+ writable: true,
98
+ value
99
+ }) : obj[key] = value;
100
+ var __spreadValues$7 = (a, b) => {
101
+ for (var prop in b || (b = {}))
102
+ if (__hasOwnProp$7.call(b, prop))
103
+ __defNormalProp$7(a, prop, b[prop]);
104
+ if (__getOwnPropSymbols$7) {
105
+ for (var prop of __getOwnPropSymbols$7(b))
106
+ if (__propIsEnum$7.call(b, prop))
107
+ __defNormalProp$7(a, prop, b[prop]);
108
+ }
109
+ return a;
110
+ };
111
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
112
+ const evaluateBindings = ({ block, context, state }) => {
113
+ if (!block.bindings)
114
+ return block;
115
+ const copied = __spreadProps$5(__spreadValues$7({}, block), {
116
+ properties: __spreadValues$7({}, block.properties),
117
+ actions: __spreadValues$7({}, block.actions)
118
+ });
119
+ for (const binding in block.bindings) {
120
+ const expression = block.bindings[binding];
121
+ const value = evaluate({
122
+ code: expression,
123
+ state,
124
+ context
125
+ });
126
+ set(copied, binding, value);
127
+ }
128
+ return copied;
129
+ };
130
+ function getProcessedBlock(options) {
131
+ const { state, context } = options;
132
+ const block = transformBlock(options.block);
133
+ if (evaluateBindings)
134
+ return evaluateBindings({
135
+ block,
136
+ state,
137
+ context
138
+ });
139
+ else
140
+ return block;
141
+ }
142
+ const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
143
+ const convertStyleMaptoCSS = (style) => {
144
+ const cssProps = Object.entries(style).map(([key, value]) => {
145
+ if (typeof value === "string")
146
+ return `${camelToKebabCase(key)}: ${value};`;
147
+ });
148
+ return cssProps.join("\n");
149
+ };
150
+ const RenderInlinedStyles = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
151
+ const state = {};
152
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
153
+ children: /* @__PURE__ */ jsxRuntime.jsx(state.tagName, {
154
+ children: props.styles
155
+ })
156
+ });
157
+ }, "RenderInlinedStyles_component_0sD5UmyM3Rg"));
158
+ const RenderInlinedStyles$1 = RenderInlinedStyles;
159
+ const useBlock$1 = function useBlock(props, state) {
160
+ return getProcessedBlock({
161
+ block: props.block,
162
+ state: props.context.state,
163
+ context: props.context.context,
164
+ evaluateBindings: true
165
+ });
166
+ };
167
+ const css = function css2(props, state) {
168
+ const styles = useBlock$1(props).responsiveStyles;
169
+ const largeStyles = styles?.large;
170
+ const mediumStyles = styles?.medium;
171
+ const smallStyles = styles?.small;
172
+ return `
173
+ ${largeStyles ? `.${useBlock$1(props).id} {${convertStyleMaptoCSS(largeStyles)}}` : ""}
174
+ ${mediumStyles ? `${getMaxWidthQueryForSize("medium")} {
175
+ .${useBlock$1(props).id} {${convertStyleMaptoCSS(mediumStyles)}}
176
+ }` : ""}
177
+ ${smallStyles ? `${getMaxWidthQueryForSize("small")} {
178
+ .${useBlock$1(props).id} {${convertStyleMaptoCSS(smallStyles)}}
179
+ }` : ""}
180
+ }`;
181
+ };
182
+ const BlockStyles = (props) => {
183
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
184
+ children: TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte" ? /* @__PURE__ */ jsxRuntime.jsx(RenderInlinedStyles$1, {
185
+ styles: css(props)
186
+ }) : null
187
+ });
188
+ };
189
+ const BlockStyles$1 = BlockStyles;
190
+ function capitalizeFirstLetter(string) {
191
+ return string.charAt(0).toUpperCase() + string.slice(1);
192
+ }
193
+ const getEventHandlerName = (key) => `on${capitalizeFirstLetter(key)}`;
194
+ function getBlockActions(options) {
195
+ var _a;
196
+ const obj = {};
197
+ const optionActions = (_a = options.block.actions) != null ? _a : {};
198
+ for (const key in optionActions) {
199
+ if (!optionActions.hasOwnProperty(key))
200
+ continue;
201
+ const value = optionActions[key];
202
+ obj[getEventHandlerName(key)] = (event) => evaluate({
203
+ code: value,
204
+ context: options.context,
205
+ state: options.state,
206
+ event
207
+ });
208
+ }
209
+ return obj;
210
+ }
211
+ var __defProp$6 = Object.defineProperty;
212
+ var __defProps$4 = Object.defineProperties;
213
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
214
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
215
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
216
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
217
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
218
+ enumerable: true,
219
+ configurable: true,
220
+ writable: true,
221
+ value
222
+ }) : obj[key] = value;
223
+ var __spreadValues$6 = (a, b) => {
224
+ for (var prop in b || (b = {}))
225
+ if (__hasOwnProp$6.call(b, prop))
226
+ __defNormalProp$6(a, prop, b[prop]);
227
+ if (__getOwnPropSymbols$6) {
228
+ for (var prop of __getOwnPropSymbols$6(b))
229
+ if (__propIsEnum$6.call(b, prop))
230
+ __defNormalProp$6(a, prop, b[prop]);
231
+ }
232
+ return a;
233
+ };
234
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
235
+ function getBlockComponentOptions(block) {
236
+ var _a;
237
+ return __spreadProps$4(__spreadValues$6(__spreadValues$6({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
238
+ builderBlock: block
239
+ });
240
+ }
241
+ var __defProp$5 = Object.defineProperty;
242
+ var __defProps$3 = Object.defineProperties;
243
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
244
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
245
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
246
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
247
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
248
+ enumerable: true,
249
+ configurable: true,
250
+ writable: true,
251
+ value
252
+ }) : obj[key] = value;
253
+ var __spreadValues$5 = (a, b) => {
254
+ for (var prop in b || (b = {}))
255
+ if (__hasOwnProp$5.call(b, prop))
256
+ __defNormalProp$5(a, prop, b[prop]);
257
+ if (__getOwnPropSymbols$5) {
258
+ for (var prop of __getOwnPropSymbols$5(b))
259
+ if (__propIsEnum$5.call(b, prop))
260
+ __defNormalProp$5(a, prop, b[prop]);
261
+ }
262
+ return a;
263
+ };
264
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
265
+ function getBlockProperties(block) {
266
+ var _a;
267
+ return __spreadProps$3(__spreadValues$5({}, block.properties), {
268
+ "builder-id": block.id,
269
+ class: [
270
+ block.id,
271
+ "builder-block",
272
+ block.class,
273
+ (_a = block.properties) == null ? void 0 : _a.class
274
+ ].filter(Boolean).join(" ")
275
+ });
276
+ }
277
+ const convertStyleObject = (obj) => {
278
+ return obj;
279
+ };
280
+ const sanitizeBlockStyles = (_styles) => {
281
+ };
282
+ var __defProp$4 = Object.defineProperty;
283
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
284
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
285
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
286
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
287
+ enumerable: true,
288
+ configurable: true,
289
+ writable: true,
290
+ value
291
+ }) : obj[key] = value;
292
+ var __spreadValues$4 = (a, b) => {
293
+ for (var prop in b || (b = {}))
294
+ if (__hasOwnProp$4.call(b, prop))
295
+ __defNormalProp$4(a, prop, b[prop]);
296
+ if (__getOwnPropSymbols$4) {
297
+ for (var prop of __getOwnPropSymbols$4(b))
298
+ if (__propIsEnum$4.call(b, prop))
299
+ __defNormalProp$4(a, prop, b[prop]);
300
+ }
301
+ return a;
302
+ };
303
+ function getBlockStyles(block) {
304
+ var _a, _b, _c, _d, _e;
305
+ const styles = __spreadValues$4(__spreadValues$4({}, convertStyleObject((_a = block.responsiveStyles) == null ? void 0 : _a.large)), block.styles);
306
+ if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium)
307
+ styles[getMaxWidthQueryForSize("medium")] = convertStyleObject((_c = block.responsiveStyles) == null ? void 0 : _c.medium);
308
+ if ((_d = block.responsiveStyles) == null ? void 0 : _d.small)
309
+ styles[getMaxWidthQueryForSize("small")] = convertStyleObject((_e = block.responsiveStyles) == null ? void 0 : _e.small);
310
+ sanitizeBlockStyles();
311
+ return styles;
312
+ }
313
+ function getBlockTag(block) {
314
+ return block.tagName || "div";
315
+ }
316
+ const EMPTY_HTML_ELEMENTS = [
317
+ "area",
318
+ "base",
319
+ "br",
320
+ "col",
321
+ "embed",
322
+ "hr",
323
+ "img",
324
+ "input",
325
+ "keygen",
326
+ "link",
327
+ "meta",
328
+ "param",
329
+ "source",
330
+ "track",
331
+ "wbr"
332
+ ];
333
+ const isEmptyHtmlElement = (tagName3) => {
334
+ return typeof tagName3 === "string" && EMPTY_HTML_ELEMENTS.includes(tagName3.toLowerCase());
335
+ };
336
+ const RenderComponent = (props) => {
337
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
338
+ children: props.componentRef ? /* @__PURE__ */ jsxRuntime.jsxs(props.componentRef, {
339
+ ...props.componentOptions,
340
+ children: [
341
+ (props.blockChildren || []).map((child) => {
342
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
343
+ block: child,
344
+ context: props.context
345
+ }, "render-block-" + child.id);
346
+ }),
347
+ (props.blockChildren || []).map((child) => {
348
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
349
+ block: child,
350
+ context: props.context
351
+ }, "block-style-" + child.id);
352
+ })
353
+ ]
354
+ }) : null
355
+ });
356
+ };
357
+ const RenderComponent$1 = RenderComponent;
358
+ const RenderRepeatedBlock = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
359
+ qwik.useContextProvider(stdin_default, qwik.useStore({
360
+ content: (() => {
361
+ return props.repeatContext.content;
362
+ })(),
363
+ state: (() => {
364
+ return props.repeatContext.state;
365
+ })(),
366
+ context: (() => {
367
+ return props.repeatContext.context;
368
+ })(),
369
+ apiKey: (() => {
370
+ return props.repeatContext.apiKey;
371
+ })(),
372
+ registeredComponents: (() => {
373
+ return props.repeatContext.registeredComponents;
374
+ })()
375
+ }));
376
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
377
+ block: props.block,
378
+ context: props.context
379
+ });
380
+ }, "RenderRepeatedBlock_component_fV0PdmPN990"));
381
+ const RenderRepeatedBlock$1 = RenderRepeatedBlock;
382
+ const component = function component2(props, state) {
383
+ const componentName = getProcessedBlock({
384
+ block: props.block,
385
+ state: props.context.state,
386
+ context: props.context.context,
387
+ evaluateBindings: false
388
+ }).component?.name;
389
+ if (!componentName)
390
+ return null;
391
+ const ref = props.context.registeredComponents[componentName];
392
+ if (!ref) {
393
+ console.warn(`
394
+ Could not find a registered component named "${componentName}".
395
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
396
+ return void 0;
397
+ } else
398
+ return ref;
399
+ };
400
+ const componentInfo$9 = function componentInfo(props, state) {
401
+ if (component(props)) {
402
+ const { component: _, ...info } = component(props);
403
+ return info;
404
+ } else
405
+ return void 0;
406
+ };
407
+ const componentRef = function componentRef2(props, state) {
408
+ return component(props)?.component;
409
+ };
410
+ const tagName = function tagName2(props, state) {
411
+ return getBlockTag(useBlock2(props));
412
+ };
413
+ const useBlock2 = function useBlock3(props, state) {
414
+ return repeatItemData(props) ? props.block : getProcessedBlock({
415
+ block: props.block,
416
+ state: props.context.state,
417
+ context: props.context.context,
418
+ evaluateBindings: true
419
+ });
420
+ };
421
+ const attributes = function attributes2(props, state) {
422
+ return {
423
+ ...getBlockProperties(useBlock2(props)),
424
+ ...getBlockActions({
425
+ block: useBlock2(props),
426
+ state: props.context.state,
427
+ context: props.context.context
428
+ }),
429
+ style: getBlockStyles(useBlock2(props))
430
+ };
431
+ };
432
+ const shouldWrap = function shouldWrap2(props, state) {
433
+ return !componentInfo$9(props)?.noWrap;
434
+ };
435
+ const componentOptions = function componentOptions2(props, state) {
436
+ return {
437
+ ...getBlockComponentOptions(useBlock2(props)),
438
+ ...shouldWrap(props) ? {} : {
439
+ attributes: attributes(props)
440
+ }
441
+ };
442
+ };
443
+ const renderComponentProps = function renderComponentProps2(props, state) {
444
+ return {
445
+ blockChildren: children(props),
446
+ componentRef: componentRef(props),
447
+ componentOptions: componentOptions(props)
448
+ };
449
+ };
450
+ const children = function children2(props, state) {
451
+ return useBlock2(props).children ?? [];
452
+ };
453
+ const childrenWithoutParentComponent = function childrenWithoutParentComponent2(props, state) {
454
+ const shouldRenderChildrenOutsideRef = !componentRef(props) && !repeatItemData(props);
455
+ return shouldRenderChildrenOutsideRef ? children(props) : [];
456
+ };
457
+ const repeatItemData = function repeatItemData2(props, state) {
458
+ const { repeat, ...blockWithoutRepeat } = props.block;
459
+ if (!repeat?.collection)
460
+ return void 0;
461
+ const itemsArray = evaluate({
462
+ code: repeat.collection,
463
+ state: props.context.state,
464
+ context: props.context.context
465
+ });
466
+ if (!Array.isArray(itemsArray))
467
+ return void 0;
468
+ const collectionName = repeat.collection.split(".").pop();
469
+ const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
470
+ const repeatArray = itemsArray.map(
471
+ (item, index) => ({
472
+ context: {
473
+ ...props.context,
474
+ state: {
475
+ ...props.context.state,
476
+ $index: index,
477
+ $item: item,
478
+ [itemNameToUse]: item,
479
+ [`$${itemNameToUse}Index`]: index
480
+ }
481
+ },
482
+ block: blockWithoutRepeat
483
+ })
484
+ );
485
+ return repeatArray;
486
+ };
487
+ const RenderBlock = (props) => {
488
+ const state = {};
489
+ state.tagName = tagName(props);
490
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
491
+ children: shouldWrap(props) ? !isEmptyHtmlElement(tagName(props)) ? /* @__PURE__ */ jsxRuntime.jsxs(state.tagName, {
492
+ ...attributes(props),
493
+ children: [
494
+ repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
495
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderRepeatedBlock$1, {
496
+ repeatContext: data.context,
497
+ block: data.block
498
+ }, index);
499
+ }) : null,
500
+ !repeatItemData(props) ? /* @__PURE__ */ jsxRuntime.jsx(RenderComponent$1, {
501
+ ...renderComponentProps(props)
502
+ }) : null,
503
+ (childrenWithoutParentComponent(props) || []).map((child) => {
504
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock, {
505
+ block: child,
506
+ context: props.context
507
+ }, "render-block-" + child.id);
508
+ }),
509
+ (childrenWithoutParentComponent(props) || []).map((child) => {
510
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
511
+ block: child,
512
+ context: props.context
513
+ }, "block-style-" + child.id);
514
+ })
515
+ ]
516
+ }) : /* @__PURE__ */ jsxRuntime.jsx(state.tagName, {
517
+ ...attributes(props)
518
+ }) : /* @__PURE__ */ jsxRuntime.jsx(RenderComponent$1, {
519
+ ...renderComponentProps(props),
520
+ context: props.context
521
+ })
522
+ });
523
+ };
524
+ const RenderBlock$1 = RenderBlock;
525
+ const className = function className2(props, state, builderContext) {
526
+ return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
527
+ };
528
+ const onClick$1 = function onClick(props, state, builderContext) {
529
+ if (isEditing() && !props.blocks?.length)
530
+ window.parent?.postMessage({
531
+ type: "builder.clickEmptyBlocks",
532
+ data: {
533
+ parentElementId: props.parent,
534
+ dataPath: props.path
535
+ }
536
+ }, "*");
537
+ };
538
+ const onMouseEnter = function onMouseEnter2(props, state, builderContext) {
539
+ if (isEditing() && !props.blocks?.length)
540
+ window.parent?.postMessage({
541
+ type: "builder.hoverEmptyBlocks",
542
+ data: {
543
+ parentElementId: props.parent,
544
+ dataPath: props.path
545
+ }
546
+ }, "*");
547
+ };
548
+ const RenderBlocks = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
549
+ qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES$2, "RenderBlocks_component_useStylesScoped_QNti2s7juQc"));
550
+ const builderContext = qwik.useContext(stdin_default);
551
+ const state = {};
552
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
553
+ class: className(props) + " div-RenderBlocks",
554
+ "builder-path": props.path,
555
+ "builder-parent-id": props.parent,
556
+ dataSet: {
557
+ class: className(props)
558
+ },
559
+ onClick$: qwik.inlinedQrl((event) => {
560
+ const [builderContext2, props2, state2] = qwik.useLexicalScope();
561
+ return onClick$1(props2);
562
+ }, "RenderBlocks_component_Host_onClick_81ErKSpyspw", [
563
+ builderContext,
564
+ props,
565
+ state
566
+ ]),
567
+ onMouseEnter$: qwik.inlinedQrl((event) => {
568
+ const [builderContext2, props2, state2] = qwik.useLexicalScope();
569
+ return onMouseEnter(props2);
570
+ }, "RenderBlocks_component_Host_onMouseEnter_h6rWG6KLkHE", [
571
+ builderContext,
572
+ props,
573
+ state
574
+ ]),
575
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
576
+ children: [
577
+ props.blocks ? (props.blocks || []).map((block) => {
578
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
579
+ block,
580
+ context: builderContext
581
+ }, "render-block-" + block.id);
582
+ }) : null,
583
+ props.blocks ? (props.blocks || []).map((block) => {
584
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
585
+ block,
586
+ context: builderContext
587
+ }, "block-style-" + block.id);
588
+ }) : null
589
+ ]
590
+ })
591
+ });
592
+ }, "RenderBlocks_component_SXGwmVyEM0s"), {
593
+ tagName: "div"
594
+ });
595
+ const RenderBlocks$1 = RenderBlocks;
596
+ const STYLES$2 = `.div-RenderBlocks {
597
+ display: flex;
598
+ flex-direction: column;
599
+ align-items: stretch; }`;
600
+ const getGutterSize = function getGutterSize2(props, state) {
601
+ return typeof props.space === "number" ? props.space || 0 : 20;
602
+ };
603
+ const getColumns = function getColumns2(props, state) {
604
+ return props.columns || [];
605
+ };
606
+ const getWidth = function getWidth2(props, state, index) {
607
+ const columns = getColumns(props);
608
+ return columns[index]?.width || 100 / columns.length;
609
+ };
610
+ const getColumnCssWidth = function getColumnCssWidth2(props, state, index) {
611
+ const columns = getColumns(props);
612
+ const gutterSize = getGutterSize(props);
613
+ const subtractWidth = gutterSize * (columns.length - 1) / columns.length;
614
+ return `calc(${getWidth(props, state, index)}% - ${subtractWidth}px)`;
615
+ };
616
+ const maybeApplyForTablet = function maybeApplyForTablet2(props, state, prop) {
617
+ const _stackColumnsAt = props.stackColumnsAt || "tablet";
618
+ return _stackColumnsAt === "tablet" ? prop : "inherit";
619
+ };
620
+ const columnsCssVars = function columnsCssVars2(props, state) {
621
+ const flexDir = props.stackColumnsAt === "never" ? "inherit" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
622
+ return {
623
+ "--flex-dir": flexDir,
624
+ "--flex-dir-tablet": maybeApplyForTablet(props, state, flexDir)
625
+ };
626
+ };
627
+ const columnCssVars = function columnCssVars2(props, state) {
628
+ const width = "100%";
629
+ const marginLeft = "0";
630
+ return {
631
+ "--column-width": width,
632
+ "--column-margin-left": marginLeft,
633
+ "--column-width-tablet": maybeApplyForTablet(props, state, width),
634
+ "--column-margin-left-tablet": maybeApplyForTablet(props, state, marginLeft)
635
+ };
636
+ };
637
+ const Columns = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
638
+ qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES$1, "Columns_component_useStylesScoped_704fWXyHORo"));
639
+ const state = {};
640
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
641
+ class: "builder-columns div-Columns",
642
+ style: columnsCssVars(props, state),
643
+ children: (props.columns || []).map((column, index) => {
644
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
645
+ class: "builder-column div-Columns-2",
646
+ style: {
647
+ width: getColumnCssWidth(props, state, index),
648
+ marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
649
+ ...columnCssVars(props, state)
650
+ },
651
+ children: /* @__PURE__ */ jsxRuntime.jsx(RenderBlocks$1, {
652
+ blocks: column.blocks
653
+ })
654
+ }, index);
655
+ })
656
+ });
657
+ }, "Columns_component_0PeVQGTMczc"), {
658
+ tagName: "div"
659
+ });
660
+ const Columns$1 = Columns;
661
+ const STYLES$1 = `.div-Columns {
662
+ display: flex;
663
+ align-items: stretch;
664
+ line-height: normal; }@media (max-width: 999px) { .div-Columns {
665
+ flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
666
+ flex-direction: var(--flex-dir); } }.div-Columns-2 {
667
+ flex-grow: 1; }@media (max-width: 999px) { .div-Columns-2 {
668
+ width: var(--column-width-tablet) !important;
669
+ margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
670
+ width: var(--column-width) !important;
671
+ margin-left: var(--column-margin-left) !important; } }`;
672
+ function removeProtocol(path) {
673
+ return path.replace(/http(s)?:/, "");
674
+ }
675
+ function updateQueryParam(uri = "", key, value) {
676
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
677
+ const separator = uri.indexOf("?") !== -1 ? "&" : "?";
678
+ if (uri.match(re))
679
+ return uri.replace(re, "$1" + key + "=" + encodeURIComponent(value) + "$2");
680
+ return uri + separator + key + "=" + encodeURIComponent(value);
681
+ }
682
+ function getShopifyImageUrl(src, size) {
683
+ if (!src || !(src == null ? void 0 : src.match(/cdn\.shopify\.com/)) || !size)
684
+ return src;
685
+ if (size === "master")
686
+ return removeProtocol(src);
687
+ const match = src.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
688
+ if (match) {
689
+ const prefix = src.split(match[0]);
690
+ const suffix = match[3];
691
+ const useSize = size.match("x") ? size : `${size}x`;
692
+ return removeProtocol(`${prefix[0]}_${useSize}${suffix}`);
693
+ }
694
+ return null;
695
+ }
696
+ function getSrcSet(url) {
697
+ if (!url)
698
+ return url;
699
+ const sizes = [
700
+ 100,
701
+ 200,
702
+ 400,
703
+ 800,
704
+ 1200,
705
+ 1600,
706
+ 2e3
707
+ ];
708
+ if (url.match(/builder\.io/)) {
709
+ let srcUrl = url;
710
+ const widthInSrc = Number(url.split("?width=")[1]);
711
+ if (!isNaN(widthInSrc))
712
+ srcUrl = `${srcUrl} ${widthInSrc}w`;
713
+ return sizes.filter(
714
+ (size) => size !== widthInSrc
715
+ ).map(
716
+ (size) => `${updateQueryParam(url, "width", size)} ${size}w`
717
+ ).concat([
718
+ srcUrl
719
+ ]).join(", ");
720
+ }
721
+ if (url.match(/cdn\.shopify\.com/))
722
+ return sizes.map(
723
+ (size) => [
724
+ getShopifyImageUrl(url, `${size}x${size}`),
725
+ size
726
+ ]
727
+ ).filter(
728
+ ([sizeUrl]) => !!sizeUrl
729
+ ).map(
730
+ ([sizeUrl, size]) => `${sizeUrl} ${size}w`
731
+ ).concat([
732
+ url
733
+ ]).join(", ");
734
+ return url;
735
+ }
736
+ const srcSetToUse = function srcSetToUse2(props, state) {
737
+ const imageToUse = props.image || props.src;
738
+ const url = imageToUse;
739
+ if (!url || !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
740
+ return props.srcset;
741
+ if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
742
+ if (!props.srcset.includes(props.image.split("?")[0])) {
743
+ console.debug("Removed given srcset");
744
+ return getSrcSet(url);
745
+ }
746
+ } else if (props.image && !props.srcset)
747
+ return getSrcSet(url);
748
+ return getSrcSet(url);
749
+ };
750
+ const webpSrcSet = function webpSrcSet2(props, state) {
751
+ if (srcSetToUse(props)?.match(/builder\.io/) && !props.noWebp)
752
+ return srcSetToUse(props).replace(/\?/g, "?format=webp&");
753
+ else
754
+ return "";
755
+ };
756
+ const Image = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
757
+ qwik.useStylesScopedQrl(qwik.inlinedQrl(STYLES, "Image_component_useStylesScoped_gRbO7w7SeZA"));
758
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
759
+ class: "div-Image",
760
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
761
+ children: [
762
+ /* @__PURE__ */ jsxRuntime.jsxs("picture", {
763
+ children: [
764
+ webpSrcSet(props) ? /* @__PURE__ */ jsxRuntime.jsx("source", {
765
+ type: "image/webp",
766
+ srcset: webpSrcSet(props)
767
+ }) : null,
768
+ /* @__PURE__ */ jsxRuntime.jsx("img", {
769
+ loading: "lazy",
770
+ alt: props.altText,
771
+ role: props.altText ? "presentation" : void 0,
772
+ style: {
773
+ objectPosition: props.backgroundSize || "center",
774
+ objectFit: props.backgroundSize || "cover"
775
+ },
776
+ class: "builder-image" + (props.className ? " " + props.className : "") + " img-Image",
777
+ src: props.image,
778
+ srcset: srcSetToUse(props),
779
+ sizes: props.sizes
780
+ }),
781
+ /* @__PURE__ */ jsxRuntime.jsx("source", {
782
+ srcset: srcSetToUse(props)
783
+ })
784
+ ]
785
+ }),
786
+ props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", {
787
+ class: "builder-image-sizer div-Image-2",
788
+ style: {
789
+ paddingTop: props.aspectRatio * 100 + "%"
790
+ }
791
+ }) : null,
792
+ props.builderBlock?.children?.length && props.fitContent ? /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {}) : null,
793
+ !props.fitContent ? /* @__PURE__ */ jsxRuntime.jsx("div", {
794
+ class: "div-Image-3",
795
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
796
+ }) : null
797
+ ]
798
+ })
799
+ });
800
+ }, "Image_component_y3S3Zox9wEo"), {
801
+ tagName: "div"
802
+ });
803
+ const Image$1 = Image;
804
+ const STYLES = `.div-Image {
805
+ position: relative; }.img-Image {
806
+ opacity: 1;
807
+ transition: opacity 0.2s ease-in-out;
808
+ position: absolute;
809
+ height: 100%;
810
+ width: 100%;
811
+ top: 0px;
812
+ left: 0px; }.div-Image-2 {
813
+ width: 100%;
814
+ pointer-events: none;
815
+ font-size: 0; }.div-Image-3 {
816
+ display: flex;
817
+ flex-direction: column;
818
+ align-items: stretch;
819
+ position: absolute;
820
+ top: 0;
821
+ left: 0;
822
+ width: 100%;
823
+ height: 100%; }`;
824
+ const Text = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
825
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
826
+ class: "builder-text",
827
+ dangerouslySetInnerHTML: props.text
828
+ });
829
+ }, "Text_component_ci0NVEdoK0Q"), {
830
+ tagName: "div"
831
+ });
832
+ const Text$1 = Text;
833
+ const videoProps = function videoProps2(props, state) {
834
+ return {
835
+ ...props.autoPlay === true ? {
836
+ autoPlay: true
837
+ } : {},
838
+ ...props.muted === true ? {
839
+ muted: true
840
+ } : {},
841
+ ...props.controls === true ? {
842
+ controls: true
843
+ } : {},
844
+ ...props.loop === true ? {
845
+ loop: true
846
+ } : {},
847
+ ...props.playsInline === true ? {
848
+ playsInline: true
849
+ } : {}
850
+ };
851
+ };
852
+ const Video = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
853
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
854
+ ...videoProps(props),
855
+ style: {
856
+ width: "100%",
857
+ height: "100%",
858
+ ...props.attributes?.style,
859
+ objectFit: props.fit,
860
+ objectPosition: props.position,
861
+ borderRadius: 1
862
+ },
863
+ src: props.video || "no-src",
864
+ poster: props.posterImage
865
+ });
866
+ }, "Video_component_O5sPuWlrTvk"), {
867
+ tagName: "video"
868
+ });
869
+ const Video$1 = Video;
870
+ const Button = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
871
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Fragment, {
872
+ children: props.link ? /* @__PURE__ */ jsxRuntime.jsx("a", {
873
+ role: "button",
874
+ ...props.attributes,
875
+ href: props.link,
876
+ target: props.openLinkInNewTab ? "_blank" : void 0,
877
+ children: props.text
878
+ }) : /* @__PURE__ */ jsxRuntime.jsx("span", {
879
+ ...props.attributes,
880
+ children: props.text
881
+ })
882
+ });
883
+ }, "Button_component_FtjCELjtKF4"));
884
+ const Button$1 = Button;
885
+ const componentInfo$8 = {
886
+ name: "Core:Button",
887
+ builtIn: true,
888
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
889
+ defaultStyles: {
890
+ appearance: "none",
891
+ paddingTop: "15px",
892
+ paddingBottom: "15px",
893
+ paddingLeft: "25px",
894
+ paddingRight: "25px",
895
+ backgroundColor: "#000000",
896
+ color: "white",
897
+ borderRadius: "4px",
898
+ textAlign: "center",
899
+ cursor: "pointer"
900
+ },
901
+ inputs: [
902
+ {
903
+ name: "text",
904
+ type: "text",
905
+ defaultValue: "Click me!",
906
+ bubble: true
907
+ },
908
+ {
909
+ name: "link",
910
+ type: "url",
911
+ bubble: true
912
+ },
913
+ {
914
+ name: "openLinkInNewTab",
915
+ type: "boolean",
916
+ defaultValue: false,
917
+ friendlyName: "Open link in new tab"
918
+ }
919
+ ],
920
+ static: true,
921
+ noWrap: true
922
+ };
923
+ function markSerializable(fn) {
924
+ fn.__qwik_serializable__ = true;
925
+ return fn;
926
+ }
927
+ const componentInfo$7 = {
928
+ name: "Columns",
929
+ builtIn: true,
930
+ inputs: [
931
+ {
932
+ name: "columns",
933
+ type: "array",
934
+ broadcast: true,
935
+ subFields: [
936
+ {
937
+ name: "blocks",
938
+ type: "array",
939
+ hideFromUI: true,
940
+ defaultValue: [
941
+ {
942
+ "@type": "@builder.io/sdk:Element",
943
+ responsiveStyles: {
944
+ large: {
945
+ display: "flex",
946
+ flexDirection: "column",
947
+ alignItems: "stretch",
948
+ flexShrink: "0",
949
+ position: "relative",
950
+ marginTop: "30px",
951
+ textAlign: "center",
952
+ lineHeight: "normal",
953
+ height: "auto",
954
+ minHeight: "20px",
955
+ minWidth: "20px",
956
+ overflow: "hidden"
957
+ }
958
+ },
959
+ component: {
960
+ name: "Image",
961
+ options: {
962
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
963
+ backgroundPosition: "center",
964
+ backgroundSize: "cover",
965
+ aspectRatio: 0.7004048582995948
966
+ }
967
+ }
968
+ },
969
+ {
970
+ "@type": "@builder.io/sdk:Element",
971
+ responsiveStyles: {
972
+ large: {
973
+ display: "flex",
974
+ flexDirection: "column",
975
+ alignItems: "stretch",
976
+ flexShrink: "0",
977
+ position: "relative",
978
+ marginTop: "30px",
979
+ textAlign: "center",
980
+ lineHeight: "normal",
981
+ height: "auto"
982
+ }
983
+ },
984
+ component: {
985
+ name: "Text",
986
+ options: {
987
+ text: "<p>Enter some text...</p>"
988
+ }
989
+ }
990
+ }
991
+ ]
992
+ },
993
+ {
994
+ name: "width",
995
+ type: "number",
996
+ hideFromUI: true,
997
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
998
+ },
999
+ {
1000
+ name: "link",
1001
+ type: "url",
1002
+ helperText: "Optionally set a url that clicking this column will link to"
1003
+ }
1004
+ ],
1005
+ defaultValue: [
1006
+ {
1007
+ blocks: [
1008
+ {
1009
+ "@type": "@builder.io/sdk:Element",
1010
+ responsiveStyles: {
1011
+ large: {
1012
+ display: "flex",
1013
+ flexDirection: "column",
1014
+ alignItems: "stretch",
1015
+ flexShrink: "0",
1016
+ position: "relative",
1017
+ marginTop: "30px",
1018
+ textAlign: "center",
1019
+ lineHeight: "normal",
1020
+ height: "auto",
1021
+ minHeight: "20px",
1022
+ minWidth: "20px",
1023
+ overflow: "hidden"
1024
+ }
1025
+ },
1026
+ component: {
1027
+ name: "Image",
1028
+ options: {
1029
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1030
+ backgroundPosition: "center",
1031
+ backgroundSize: "cover",
1032
+ aspectRatio: 0.7004048582995948
1033
+ }
1034
+ }
1035
+ },
1036
+ {
1037
+ "@type": "@builder.io/sdk:Element",
1038
+ responsiveStyles: {
1039
+ large: {
1040
+ display: "flex",
1041
+ flexDirection: "column",
1042
+ alignItems: "stretch",
1043
+ flexShrink: "0",
1044
+ position: "relative",
1045
+ marginTop: "30px",
1046
+ textAlign: "center",
1047
+ lineHeight: "normal",
1048
+ height: "auto"
1049
+ }
1050
+ },
1051
+ component: {
1052
+ name: "Text",
1053
+ options: {
1054
+ text: "<p>Enter some text...</p>"
1055
+ }
1056
+ }
1057
+ }
1058
+ ]
1059
+ },
1060
+ {
1061
+ blocks: [
1062
+ {
1063
+ "@type": "@builder.io/sdk:Element",
1064
+ responsiveStyles: {
1065
+ large: {
1066
+ display: "flex",
1067
+ flexDirection: "column",
1068
+ alignItems: "stretch",
1069
+ flexShrink: "0",
1070
+ position: "relative",
1071
+ marginTop: "30px",
1072
+ textAlign: "center",
1073
+ lineHeight: "normal",
1074
+ height: "auto",
1075
+ minHeight: "20px",
1076
+ minWidth: "20px",
1077
+ overflow: "hidden"
1078
+ }
1079
+ },
1080
+ component: {
1081
+ name: "Image",
1082
+ options: {
1083
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1084
+ backgroundPosition: "center",
1085
+ backgroundSize: "cover",
1086
+ aspectRatio: 0.7004048582995948
1087
+ }
1088
+ }
1089
+ },
1090
+ {
1091
+ "@type": "@builder.io/sdk:Element",
1092
+ responsiveStyles: {
1093
+ large: {
1094
+ display: "flex",
1095
+ flexDirection: "column",
1096
+ alignItems: "stretch",
1097
+ flexShrink: "0",
1098
+ position: "relative",
1099
+ marginTop: "30px",
1100
+ textAlign: "center",
1101
+ lineHeight: "normal",
1102
+ height: "auto"
1103
+ }
1104
+ },
1105
+ component: {
1106
+ name: "Text",
1107
+ options: {
1108
+ text: "<p>Enter some text...</p>"
1109
+ }
1110
+ }
1111
+ }
1112
+ ]
1113
+ }
1114
+ ],
1115
+ onChange: markSerializable((options) => {
1116
+ function clearWidths() {
1117
+ columns.forEach((col) => {
1118
+ col.delete("width");
1119
+ });
1120
+ }
1121
+ const columns = options.get("columns");
1122
+ if (Array.isArray(columns)) {
1123
+ const containsColumnWithWidth = !!columns.find(
1124
+ (col) => col.get("width")
1125
+ );
1126
+ if (containsColumnWithWidth) {
1127
+ const containsColumnWithoutWidth = !!columns.find(
1128
+ (col) => !col.get("width")
1129
+ );
1130
+ if (containsColumnWithoutWidth)
1131
+ clearWidths();
1132
+ else {
1133
+ const sumWidths = columns.reduce((memo, col) => {
1134
+ return memo + col.get("width");
1135
+ }, 0);
1136
+ const widthsDontAddUp = sumWidths !== 100;
1137
+ if (widthsDontAddUp)
1138
+ clearWidths();
1139
+ }
1140
+ }
1141
+ }
1142
+ })
1143
+ },
1144
+ {
1145
+ name: "space",
1146
+ type: "number",
1147
+ defaultValue: 20,
1148
+ helperText: "Size of gap between columns",
1149
+ advanced: true
1150
+ },
1151
+ {
1152
+ name: "stackColumnsAt",
1153
+ type: "string",
1154
+ defaultValue: "tablet",
1155
+ helperText: "Convert horizontal columns to vertical at what device size",
1156
+ enum: [
1157
+ "tablet",
1158
+ "mobile",
1159
+ "never"
1160
+ ],
1161
+ advanced: true
1162
+ },
1163
+ {
1164
+ name: "reverseColumnsWhenStacked",
1165
+ type: "boolean",
1166
+ defaultValue: false,
1167
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
1168
+ advanced: true
1169
+ }
1170
+ ]
1171
+ };
1172
+ const componentInfo$6 = {
1173
+ name: "Fragment",
1174
+ static: true,
1175
+ hidden: true,
1176
+ builtIn: true,
1177
+ canHaveChildren: true,
1178
+ noWrap: true
1179
+ };
1180
+ const FragmentComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1181
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
1182
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
1183
+ });
1184
+ }, "FragmentComponent_component_FJmqlA66Rjg"), {
1185
+ tagName: "span"
1186
+ });
1187
+ const Fragment = FragmentComponent;
1188
+ const componentInfo$5 = {
1189
+ name: "Image",
1190
+ static: true,
1191
+ builtIn: true,
1192
+ 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",
1193
+ defaultStyles: {
1194
+ position: "relative",
1195
+ minHeight: "20px",
1196
+ minWidth: "20px",
1197
+ overflow: "hidden"
1198
+ },
1199
+ canHaveChildren: true,
1200
+ inputs: [
1201
+ {
1202
+ name: "image",
1203
+ type: "file",
1204
+ bubble: true,
1205
+ allowedFileTypes: [
1206
+ "jpeg",
1207
+ "jpg",
1208
+ "png",
1209
+ "svg"
1210
+ ],
1211
+ required: true,
1212
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1213
+ onChange: markSerializable((options) => {
1214
+ const DEFAULT_ASPECT_RATIO = 0.7041;
1215
+ options.delete("srcset");
1216
+ options.delete("noWebp");
1217
+ function loadImage(url, timeout = 6e4) {
1218
+ return new Promise((resolve, reject) => {
1219
+ const img = document.createElement("img");
1220
+ let loaded = false;
1221
+ img.onload = () => {
1222
+ loaded = true;
1223
+ resolve(img);
1224
+ };
1225
+ img.addEventListener("error", (event) => {
1226
+ console.warn("Image load failed", event.error);
1227
+ reject(event.error);
1228
+ });
1229
+ img.src = url;
1230
+ setTimeout(() => {
1231
+ if (!loaded)
1232
+ reject(new Error("Image load timed out"));
1233
+ }, timeout);
1234
+ });
1235
+ }
1236
+ function round(num) {
1237
+ return Math.round(num * 1e3) / 1e3;
1238
+ }
1239
+ const value = options.get("image");
1240
+ const aspectRatio = options.get("aspectRatio");
1241
+ fetch(value).then(
1242
+ (res) => res.blob()
1243
+ ).then((blob) => {
1244
+ if (blob.type.includes("svg"))
1245
+ options.set("noWebp", true);
1246
+ });
1247
+ if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO))
1248
+ return loadImage(value).then((img) => {
1249
+ const possiblyUpdatedAspectRatio = options.get("aspectRatio");
1250
+ if (options.get("image") === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
1251
+ if (img.width && img.height) {
1252
+ options.set("aspectRatio", round(img.height / img.width));
1253
+ options.set("height", img.height);
1254
+ options.set("width", img.width);
1255
+ }
1256
+ }
1257
+ });
1258
+ })
1259
+ },
1260
+ {
1261
+ name: "backgroundSize",
1262
+ type: "text",
1263
+ defaultValue: "cover",
1264
+ enum: [
1265
+ {
1266
+ label: "contain",
1267
+ value: "contain",
1268
+ helperText: "The image should never get cropped"
1269
+ },
1270
+ {
1271
+ label: "cover",
1272
+ value: "cover",
1273
+ helperText: "The image should fill it's box, cropping when needed"
1274
+ }
1275
+ ]
1276
+ },
1277
+ {
1278
+ name: "backgroundPosition",
1279
+ type: "text",
1280
+ defaultValue: "center",
1281
+ enum: [
1282
+ "center",
1283
+ "top",
1284
+ "left",
1285
+ "right",
1286
+ "bottom",
1287
+ "top left",
1288
+ "top right",
1289
+ "bottom left",
1290
+ "bottom right"
1291
+ ]
1292
+ },
1293
+ {
1294
+ name: "altText",
1295
+ type: "string",
1296
+ helperText: "Text to display when the user has images off"
1297
+ },
1298
+ {
1299
+ name: "height",
1300
+ type: "number",
1301
+ hideFromUI: true
1302
+ },
1303
+ {
1304
+ name: "width",
1305
+ type: "number",
1306
+ hideFromUI: true
1307
+ },
1308
+ {
1309
+ name: "sizes",
1310
+ type: "string",
1311
+ hideFromUI: true
1312
+ },
1313
+ {
1314
+ name: "srcset",
1315
+ type: "string",
1316
+ hideFromUI: true
1317
+ },
1318
+ {
1319
+ name: "lazy",
1320
+ type: "boolean",
1321
+ defaultValue: true,
1322
+ hideFromUI: true
1323
+ },
1324
+ {
1325
+ name: "fitContent",
1326
+ type: "boolean",
1327
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1328
+ defaultValue: true
1329
+ },
1330
+ {
1331
+ name: "aspectRatio",
1332
+ type: "number",
1333
+ helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
1334
+ advanced: true,
1335
+ defaultValue: 0.7041
1336
+ }
1337
+ ]
1338
+ };
1339
+ const componentInfo$4 = {
1340
+ name: "Core:Section",
1341
+ static: true,
1342
+ builtIn: true,
1343
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1344
+ inputs: [
1345
+ {
1346
+ name: "maxWidth",
1347
+ type: "number",
1348
+ defaultValue: 1200
1349
+ },
1350
+ {
1351
+ name: "lazyLoad",
1352
+ type: "boolean",
1353
+ defaultValue: false,
1354
+ advanced: true,
1355
+ description: "Only render this section when in view"
1356
+ }
1357
+ ],
1358
+ defaultStyles: {
1359
+ paddingLeft: "20px",
1360
+ paddingRight: "20px",
1361
+ paddingTop: "50px",
1362
+ paddingBottom: "50px",
1363
+ marginTop: "0px",
1364
+ width: "100vw",
1365
+ marginLeft: "calc(50% - 50vw)"
1366
+ },
1367
+ canHaveChildren: true,
1368
+ defaultChildren: [
1369
+ {
1370
+ "@type": "@builder.io/sdk:Element",
1371
+ responsiveStyles: {
1372
+ large: {
1373
+ textAlign: "center"
1374
+ }
1375
+ },
1376
+ component: {
1377
+ name: "Text",
1378
+ options: {
1379
+ text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
1380
+ }
1381
+ }
1382
+ }
1383
+ ]
1384
+ };
1385
+ const SectionComponent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1386
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
1387
+ ...props.attributes,
1388
+ style: (() => {
1389
+ props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : void 0;
1390
+ })(),
1391
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
1392
+ });
1393
+ }, "SectionComponent_component_m1CcjCwgHug"), {
1394
+ tagName: "section"
1395
+ });
1396
+ const Section = SectionComponent;
1397
+ const componentInfo$3 = {
1398
+ name: "Symbol",
1399
+ noWrap: true,
1400
+ static: true,
1401
+ builtIn: true,
1402
+ inputs: [
1403
+ {
1404
+ name: "symbol",
1405
+ type: "uiSymbol"
1406
+ },
1407
+ {
1408
+ name: "dataOnly",
1409
+ helperText: "Make this a data symbol that doesn't display any UI",
1410
+ type: "boolean",
1411
+ defaultValue: false,
1412
+ advanced: true,
1413
+ hideFromUI: true
1414
+ },
1415
+ {
1416
+ name: "inheritState",
1417
+ helperText: "Inherit the parent component state and data",
1418
+ type: "boolean",
1419
+ defaultValue: false,
1420
+ advanced: true
1421
+ },
1422
+ {
1423
+ name: "renderToLiquid",
1424
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1425
+ type: "boolean",
1426
+ defaultValue: false,
1427
+ advanced: true,
1428
+ hideFromUI: true
1429
+ },
1430
+ {
1431
+ name: "useChildren",
1432
+ hideFromUI: true,
1433
+ type: "boolean"
1434
+ }
1435
+ ]
1436
+ };
1437
+ const componentInfo$2 = {
1438
+ name: "Text",
1439
+ static: true,
1440
+ builtIn: true,
1441
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
1442
+ inputs: [
1443
+ {
1444
+ name: "text",
1445
+ type: "html",
1446
+ required: true,
1447
+ autoFocus: true,
1448
+ bubble: true,
1449
+ defaultValue: "Enter some text..."
1450
+ }
1451
+ ],
1452
+ defaultStyles: {
1453
+ lineHeight: "normal",
1454
+ height: "auto",
1455
+ textAlign: "center"
1456
+ }
1457
+ };
1458
+ const componentInfo$1 = {
1459
+ name: "Video",
1460
+ canHaveChildren: true,
1461
+ builtIn: true,
1462
+ defaultStyles: {
1463
+ minHeight: "20px",
1464
+ minWidth: "20px"
1465
+ },
1466
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
1467
+ inputs: [
1468
+ {
1469
+ name: "video",
1470
+ type: "file",
1471
+ allowedFileTypes: [
1472
+ "mp4"
1473
+ ],
1474
+ bubble: true,
1475
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
1476
+ required: true
1477
+ },
1478
+ {
1479
+ name: "posterImage",
1480
+ type: "file",
1481
+ allowedFileTypes: [
1482
+ "jpeg",
1483
+ "png"
1484
+ ],
1485
+ helperText: "Image to show before the video plays"
1486
+ },
1487
+ {
1488
+ name: "autoPlay",
1489
+ type: "boolean",
1490
+ defaultValue: true
1491
+ },
1492
+ {
1493
+ name: "controls",
1494
+ type: "boolean",
1495
+ defaultValue: false
1496
+ },
1497
+ {
1498
+ name: "muted",
1499
+ type: "boolean",
1500
+ defaultValue: true
1501
+ },
1502
+ {
1503
+ name: "loop",
1504
+ type: "boolean",
1505
+ defaultValue: true
1506
+ },
1507
+ {
1508
+ name: "playsInline",
1509
+ type: "boolean",
1510
+ defaultValue: true
1511
+ },
1512
+ {
1513
+ name: "fit",
1514
+ type: "text",
1515
+ defaultValue: "cover",
1516
+ enum: [
1517
+ "contain",
1518
+ "cover",
1519
+ "fill",
1520
+ "auto"
1521
+ ]
1522
+ },
1523
+ {
1524
+ name: "fitContent",
1525
+ type: "boolean",
1526
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1527
+ defaultValue: true,
1528
+ advanced: true
1529
+ },
1530
+ {
1531
+ name: "position",
1532
+ type: "text",
1533
+ defaultValue: "center",
1534
+ enum: [
1535
+ "center",
1536
+ "top",
1537
+ "left",
1538
+ "right",
1539
+ "bottom",
1540
+ "top left",
1541
+ "top right",
1542
+ "bottom left",
1543
+ "bottom right"
1544
+ ]
1545
+ },
1546
+ {
1547
+ name: "height",
1548
+ type: "number",
1549
+ advanced: true
1550
+ },
1551
+ {
1552
+ name: "width",
1553
+ type: "number",
1554
+ advanced: true
1555
+ },
1556
+ {
1557
+ name: "aspectRatio",
1558
+ type: "number",
1559
+ advanced: true,
1560
+ defaultValue: 0.7004048582995948
1561
+ },
1562
+ {
1563
+ name: "lazyLoad",
1564
+ type: "boolean",
1565
+ helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1566
+ defaultValue: true,
1567
+ advanced: true
1568
+ }
1569
+ ]
1570
+ };
1571
+ const componentInfo2 = {
1572
+ name: "Embed",
1573
+ static: true,
1574
+ builtIn: true,
1575
+ inputs: [
1576
+ {
1577
+ name: "url",
1578
+ type: "url",
1579
+ required: true,
1580
+ defaultValue: "",
1581
+ helperText: "e.g. enter a youtube url, google map, etc",
1582
+ onChange: markSerializable((options) => {
1583
+ const url = options.get("url");
1584
+ if (url) {
1585
+ options.set("content", "Loading...");
1586
+ const apiKey = "ae0e60e78201a3f2b0de4b";
1587
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then(
1588
+ (res) => res.json()
1589
+ ).then((data) => {
1590
+ if (options.get("url") === url) {
1591
+ if (data.html)
1592
+ options.set("content", data.html);
1593
+ else
1594
+ options.set("content", "Invalid url, please try another");
1595
+ }
1596
+ }).catch((_err) => {
1597
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
1598
+ });
1599
+ } else
1600
+ options.delete("content");
1601
+ })
1602
+ },
1603
+ {
1604
+ name: "content",
1605
+ type: "html",
1606
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1607
+ hideFromUI: true
1608
+ }
1609
+ ]
1610
+ };
1611
+ const SCRIPT_MIME_TYPES = [
1612
+ "text/javascript",
1613
+ "application/javascript",
1614
+ "application/ecmascript"
1615
+ ];
1616
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
1617
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
1618
+ const scripts = elem.getElementsByTagName("script");
1619
+ for (let i = 0; i < scripts.length; i++) {
1620
+ const script = scripts[i];
1621
+ if (script.src && !state.scriptsInserted.includes(script.src)) {
1622
+ state.scriptsInserted.push(script.src);
1623
+ const newScript = document.createElement("script");
1624
+ newScript.async = true;
1625
+ newScript.src = script.src;
1626
+ document.head.appendChild(newScript);
1627
+ } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
1628
+ try {
1629
+ state.scriptsRun.push(script.innerText);
1630
+ new Function(script.innerText)();
1631
+ } catch (error) {
1632
+ console.warn("`Embed`: Error running script:", error);
1633
+ }
1634
+ }
1635
+ };
1636
+ const Embed = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1637
+ const elem = qwik.useRef();
1638
+ const state = qwik.useStore({
1639
+ scriptsInserted: [],
1640
+ scriptsRun: [],
1641
+ ranInitFn: false
1642
+ });
1643
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
1644
+ const [elem2, props2, state2] = qwik.useLexicalScope();
1645
+ state2 && track2(state2, "ranInitFn");
1646
+ if (elem2 && !state2.ranInitFn) {
1647
+ state2.ranInitFn = true;
1648
+ findAndRunScripts(props2, state2, elem2);
1649
+ }
1650
+ }, "Embed_component_useWatch_XE41s3iNuto", [
1651
+ elem,
1652
+ props,
1653
+ state
1654
+ ]));
1655
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
1656
+ class: "builder-embed",
1657
+ ref: elem,
1658
+ dangerouslySetInnerHTML: props.content
1659
+ });
1660
+ }, "Embed_component_CP6B8Y76ylw"), {
1661
+ tagName: "div"
1662
+ });
1663
+ const embed = Embed;
1664
+ var __defProp$3 = Object.defineProperty;
1665
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1666
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1667
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1668
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
1669
+ enumerable: true,
1670
+ configurable: true,
1671
+ writable: true,
1672
+ value
1673
+ }) : obj[key] = value;
1674
+ var __spreadValues$3 = (a, b) => {
1675
+ for (var prop in b || (b = {}))
1676
+ if (__hasOwnProp$3.call(b, prop))
1677
+ __defNormalProp$3(a, prop, b[prop]);
1678
+ if (__getOwnPropSymbols$3) {
1679
+ for (var prop of __getOwnPropSymbols$3(b))
1680
+ if (__propIsEnum$3.call(b, prop))
1681
+ __defNormalProp$3(a, prop, b[prop]);
1682
+ }
1683
+ return a;
1684
+ };
1685
+ const getDefaultRegisteredComponents = () => [
1686
+ __spreadValues$3({
1687
+ component: Columns$1
1688
+ }, componentInfo$7),
1689
+ __spreadValues$3({
1690
+ component: Image$1
1691
+ }, componentInfo$5),
1692
+ __spreadValues$3({
1693
+ component: Text$1
1694
+ }, componentInfo$2),
1695
+ __spreadValues$3({
1696
+ component: Video$1
1697
+ }, componentInfo$1),
1698
+ __spreadValues$3({
1699
+ component: Symbol$2
1700
+ }, componentInfo$3),
1701
+ __spreadValues$3({
1702
+ component: Button$1
1703
+ }, componentInfo$8),
1704
+ __spreadValues$3({
1705
+ component: Section
1706
+ }, componentInfo$4),
1707
+ __spreadValues$3({
1708
+ component: Fragment
1709
+ }, componentInfo$6),
1710
+ __spreadValues$3({
1711
+ component: embed
1712
+ }, componentInfo2)
1713
+ ];
1714
+ var __defProp$2 = Object.defineProperty;
1715
+ var __defProps$2 = Object.defineProperties;
1716
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1717
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1718
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1719
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1720
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
1721
+ enumerable: true,
1722
+ configurable: true,
1723
+ writable: true,
1724
+ value
1725
+ }) : obj[key] = value;
1726
+ var __spreadValues$2 = (a, b) => {
1727
+ for (var prop in b || (b = {}))
1728
+ if (__hasOwnProp$2.call(b, prop))
1729
+ __defNormalProp$2(a, prop, b[prop]);
1730
+ if (__getOwnPropSymbols$2) {
1731
+ for (var prop of __getOwnPropSymbols$2(b))
1732
+ if (__propIsEnum$2.call(b, prop))
1733
+ __defNormalProp$2(a, prop, b[prop]);
1734
+ }
1735
+ return a;
1736
+ };
1737
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1738
+ function flatten(object, path = null, separator = ".") {
1739
+ return Object.keys(object).reduce((acc, key) => {
1740
+ const value = object[key];
1741
+ const newPath = [
1742
+ path,
1743
+ key
1744
+ ].filter(Boolean).join(separator);
1745
+ const isObject = [
1746
+ typeof value === "object",
1747
+ value !== null,
1748
+ !(Array.isArray(value) && value.length === 0)
1749
+ ].every(Boolean);
1750
+ return isObject ? __spreadValues$2(__spreadValues$2({}, acc), flatten(value, newPath, separator)) : __spreadProps$2(__spreadValues$2({}, acc), {
1751
+ [newPath]: value
1752
+ });
1753
+ }, {});
1754
+ }
1755
+ const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
1756
+ const convertSearchParamsToQueryObject = (searchParams) => {
1757
+ const options = {};
1758
+ searchParams.forEach((value, key) => {
1759
+ options[key] = value;
1760
+ });
1761
+ return options;
1762
+ };
1763
+ const getBuilderSearchParams = (options) => {
1764
+ const newOptions = {};
1765
+ Object.keys(options).forEach((key) => {
1766
+ if (key.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
1767
+ const trimmedKey = key.replace(BUILDER_SEARCHPARAMS_PREFIX, "");
1768
+ newOptions[trimmedKey] = options[key];
1769
+ }
1770
+ });
1771
+ return newOptions;
1772
+ };
1773
+ const getBuilderSearchParamsFromWindow = () => {
1774
+ if (!isBrowser())
1775
+ return {};
1776
+ const searchParams = new URLSearchParams(window.location.search);
1777
+ return getBuilderSearchParams(convertSearchParamsToQueryObject(searchParams));
1778
+ };
1779
+ const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
1780
+ function getGlobalThis() {
1781
+ if (typeof globalThis !== "undefined")
1782
+ return globalThis;
1783
+ if (typeof window !== "undefined")
1784
+ return window;
1785
+ if (typeof global !== "undefined")
1786
+ return global;
1787
+ if (typeof self !== "undefined")
1788
+ return self;
1789
+ return null;
1790
+ }
1791
+ var __async$1 = (__this, __arguments, generator) => {
1792
+ return new Promise((resolve, reject) => {
1793
+ var fulfilled = (value) => {
1794
+ try {
1795
+ step(generator.next(value));
1796
+ } catch (e) {
1797
+ reject(e);
1798
+ }
1799
+ };
1800
+ var rejected = (value) => {
1801
+ try {
1802
+ step(generator.throw(value));
1803
+ } catch (e) {
1804
+ reject(e);
1805
+ }
1806
+ };
1807
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1808
+ step((generator = generator.apply(__this, __arguments)).next());
1809
+ });
1810
+ };
1811
+ function getFetch() {
1812
+ return __async$1(this, null, function* () {
1813
+ const globalFetch = getGlobalThis().fetch;
1814
+ if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1815
+ const nodeFetch = Promise.resolve().then(() => require("./index.d8c1e37f.cjs")).then(
1816
+ (d) => d.default
1817
+ );
1818
+ return nodeFetch.default || nodeFetch;
1819
+ }
1820
+ return globalFetch.default || globalFetch;
1821
+ });
1822
+ }
1823
+ const handleABTesting = (item, testGroups) => {
1824
+ if (item.variations && Object.keys(item.variations).length) {
1825
+ const testGroup = item.id ? testGroups[item.id] : void 0;
1826
+ const variationValue = testGroup ? item.variations[testGroup] : void 0;
1827
+ if (testGroup && variationValue) {
1828
+ item.data = variationValue.data;
1829
+ item.testVariationId = variationValue.id;
1830
+ item.testVariationName = variationValue.name;
1831
+ } else {
1832
+ let n = 0;
1833
+ const random = Math.random();
1834
+ let set2 = false;
1835
+ for (const id in item.variations) {
1836
+ const variation = item.variations[id];
1837
+ const testRatio = variation.testRatio;
1838
+ n += testRatio;
1839
+ if (random < n) {
1840
+ const variationName = variation.name || (variation.id === item.id ? "Default variation" : "");
1841
+ set2 = true;
1842
+ Object.assign(item, {
1843
+ data: variation.data,
1844
+ testVariationId: variation.id,
1845
+ testVariationName: variationName
1846
+ });
1847
+ }
1848
+ }
1849
+ if (!set2)
1850
+ Object.assign(item, {
1851
+ testVariationId: item.id,
1852
+ testVariationName: "Default"
1853
+ });
1854
+ }
1855
+ }
1856
+ };
1857
+ var __defProp$1 = Object.defineProperty;
1858
+ var __defProps$1 = Object.defineProperties;
1859
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1860
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1861
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1862
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1863
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
1864
+ enumerable: true,
1865
+ configurable: true,
1866
+ writable: true,
1867
+ value
1868
+ }) : obj[key] = value;
1869
+ var __spreadValues$1 = (a, b) => {
1870
+ for (var prop in b || (b = {}))
1871
+ if (__hasOwnProp$1.call(b, prop))
1872
+ __defNormalProp$1(a, prop, b[prop]);
1873
+ if (__getOwnPropSymbols$1) {
1874
+ for (var prop of __getOwnPropSymbols$1(b))
1875
+ if (__propIsEnum$1.call(b, prop))
1876
+ __defNormalProp$1(a, prop, b[prop]);
1877
+ }
1878
+ return a;
1879
+ };
1880
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1881
+ var __async = (__this, __arguments, generator) => {
1882
+ return new Promise((resolve, reject) => {
1883
+ var fulfilled = (value) => {
1884
+ try {
1885
+ step(generator.next(value));
1886
+ } catch (e) {
1887
+ reject(e);
1888
+ }
1889
+ };
1890
+ var rejected = (value) => {
1891
+ try {
1892
+ step(generator.throw(value));
1893
+ } catch (e) {
1894
+ reject(e);
1895
+ }
1896
+ };
1897
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1898
+ step((generator = generator.apply(__this, __arguments)).next());
1899
+ });
1900
+ };
1901
+ const fetch$ = getFetch();
1902
+ function getContent(options) {
1903
+ return __async(this, null, function* () {
1904
+ return (yield getAllContent(__spreadProps$1(__spreadValues$1({}, options), {
1905
+ limit: 1
1906
+ }))).results[0] || null;
1907
+ });
1908
+ }
1909
+ const generateContentUrl = (options) => {
1910
+ const { limit = 1, userAttributes, query, noTraverse = false, model, apiKey } = options;
1911
+ const url = new URL(`https://cdn.builder.io/api/v2/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}`);
1912
+ const queryOptions = __spreadValues$1(__spreadValues$1({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
1913
+ const flattened = flatten(queryOptions);
1914
+ for (const key in flattened)
1915
+ url.searchParams.set(key, String(flattened[key]));
1916
+ if (userAttributes)
1917
+ url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
1918
+ if (query) {
1919
+ const flattened2 = flatten({
1920
+ query
1921
+ });
1922
+ for (const key in flattened2)
1923
+ url.searchParams.set(key, JSON.stringify(flattened2[key]));
1924
+ }
1925
+ return url;
1926
+ };
1927
+ function getAllContent(options) {
1928
+ return __async(this, null, function* () {
1929
+ const url = generateContentUrl(options);
1930
+ const fetch2 = yield fetch$;
1931
+ const content = yield fetch2(url.href).then(
1932
+ (res) => res.json()
1933
+ );
1934
+ if (options.testGroups)
1935
+ for (const item of content.results)
1936
+ handleABTesting(item, options.testGroups);
1937
+ return content;
1938
+ });
1939
+ }
1940
+ function isPreviewing() {
1941
+ if (!isBrowser())
1942
+ return false;
1943
+ if (isEditing())
1944
+ return false;
1945
+ return Boolean(location.search.indexOf("builder.preview=") !== -1);
1946
+ }
1947
+ var __defProp = Object.defineProperty;
1948
+ var __defProps = Object.defineProperties;
1949
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1950
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
1951
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
1952
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
1953
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
1954
+ enumerable: true,
1955
+ configurable: true,
1956
+ writable: true,
1957
+ value
1958
+ }) : obj[key] = value;
1959
+ var __spreadValues = (a, b) => {
1960
+ for (var prop in b || (b = {}))
1961
+ if (__hasOwnProp.call(b, prop))
1962
+ __defNormalProp(a, prop, b[prop]);
1963
+ if (__getOwnPropSymbols) {
1964
+ for (var prop of __getOwnPropSymbols(b))
1965
+ if (__propIsEnum.call(b, prop))
1966
+ __defNormalProp(a, prop, b[prop]);
1967
+ }
1968
+ return a;
1969
+ };
1970
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1971
+ var __objRest = (source, exclude) => {
1972
+ var target = {};
1973
+ for (var prop in source)
1974
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
1975
+ target[prop] = source[prop];
1976
+ if (source != null && __getOwnPropSymbols) {
1977
+ for (var prop of __getOwnPropSymbols(source))
1978
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
1979
+ target[prop] = source[prop];
1980
+ }
1981
+ return target;
1982
+ };
1983
+ const components = [];
1984
+ function registerComponent(component3, info) {
1985
+ components.push(__spreadValues({
1986
+ component: component3
1987
+ }, info));
1988
+ console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.");
1989
+ return component3;
1990
+ }
1991
+ const createRegisterComponentMessage = (_a) => {
1992
+ var info = __objRest(_a, [
1993
+ "component"
1994
+ ]);
1995
+ return {
1996
+ type: "builder.registerComponent",
1997
+ data: prepareComponentInfoToSend(info)
1998
+ };
1999
+ };
2000
+ const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
2001
+ const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
2002
+ const serializeFn = (fnValue) => {
2003
+ const fnStr = fnValue.toString().trim();
2004
+ const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
2005
+ return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
2006
+ };
2007
+ const prepareComponentInfoToSend = (_c) => {
2008
+ var { inputs } = _c, info = __objRest(_c, [
2009
+ "inputs"
2010
+ ]);
2011
+ return __spreadProps(__spreadValues({}, fastClone(info)), {
2012
+ inputs: inputs == null ? void 0 : inputs.map(
2013
+ (input) => Object.entries(input).reduce(
2014
+ (acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
2015
+ [key]: serializeValue(value)
2016
+ }),
2017
+ {}
2018
+ )
2019
+ )
2020
+ });
2021
+ };
2022
+ function track(event, properties) {
2023
+ if (isEditing())
2024
+ return;
2025
+ if (!(isBrowser() || TARGET === "reactNative"))
2026
+ return;
2027
+ return fetch(`https://builder.io/api/v1/track`, {
2028
+ method: "POST",
2029
+ body: JSON.stringify({
2030
+ events: [
2031
+ {
2032
+ type: event,
2033
+ data: properties
2034
+ }
2035
+ ]
2036
+ }),
2037
+ headers: {
2038
+ "content-type": "application/json"
2039
+ },
2040
+ mode: "cors"
2041
+ });
2042
+ }
2043
+ const getCssFromFont = function getCssFromFont2(props, state, font) {
2044
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
2045
+ const name = family.split(",")[0];
2046
+ const url = font.fileUrl ?? font?.files?.regular;
2047
+ let str = "";
2048
+ if (url && family && name)
2049
+ str += `
2050
+ @font-face {
2051
+ font-family: "${family}";
2052
+ src: local("${name}"), url('${url}') format('woff2');
2053
+ font-display: fallback;
2054
+ font-weight: 400;
2055
+ }
2056
+ `.trim();
2057
+ if (font.files)
2058
+ for (const weight in font.files) {
2059
+ const isNumber = String(Number(weight)) === weight;
2060
+ if (!isNumber)
2061
+ continue;
2062
+ const weightUrl = font.files[weight];
2063
+ if (weightUrl && weightUrl !== url)
2064
+ str += `
2065
+ @font-face {
2066
+ font-family: "${family}";
2067
+ src: url('${weightUrl}') format('woff2');
2068
+ font-display: fallback;
2069
+ font-weight: ${weight};
2070
+ }
2071
+ `.trim();
2072
+ }
2073
+ return str;
2074
+ };
2075
+ const getFontCss = function getFontCss2(props, state, { customFonts }) {
2076
+ return customFonts?.map(
2077
+ (font) => getCssFromFont(props, state, font)
2078
+ )?.join(" ") || "";
2079
+ };
2080
+ const injectedStyles = function injectedStyles2(props, state) {
2081
+ return `
2082
+ ${props.cssCode || ""}
2083
+ ${getFontCss(props, state, {
2084
+ customFonts: props.customFonts
2085
+ })}`;
2086
+ };
2087
+ const RenderContentStyles = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
2088
+ const state = {};
2089
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderInlinedStyles$1, {
2090
+ styles: injectedStyles(props, state)
2091
+ });
2092
+ }, "RenderContentStyles_component_32XAr483K2o"));
2093
+ const RenderContentStyles$1 = RenderContentStyles;
2094
+ const useContent = function useContent2(props, state) {
2095
+ const mergedContent = {
2096
+ ...props.content,
2097
+ ...state.overrideContent,
2098
+ data: {
2099
+ ...props.content?.data,
2100
+ ...props.data,
2101
+ ...state.overrideContent?.data
2102
+ }
2103
+ };
2104
+ return mergedContent;
2105
+ };
2106
+ const contentState = function contentState2(props, state) {
2107
+ return {
2108
+ ...props.content?.data?.state,
2109
+ ...props.data,
2110
+ ...state.overrideState
2111
+ };
2112
+ };
2113
+ const contextContext = function contextContext2(props, state) {
2114
+ return props.context || {};
2115
+ };
2116
+ const allRegisteredComponents = function allRegisteredComponents2(props, state) {
2117
+ const allComponentsArray = [
2118
+ ...getDefaultRegisteredComponents(),
2119
+ ...components,
2120
+ ...props.customComponents || []
2121
+ ];
2122
+ const allComponents = allComponentsArray.reduce(
2123
+ (acc, curr) => ({
2124
+ ...acc,
2125
+ [curr.name]: curr
2126
+ }),
2127
+ {}
2128
+ );
2129
+ return allComponents;
2130
+ };
2131
+ const processMessage = function processMessage2(props, state, event) {
2132
+ const { data } = event;
2133
+ if (data)
2134
+ switch (data.type) {
2135
+ case "builder.contentUpdate": {
2136
+ const messageContent = data.data;
2137
+ const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
2138
+ const contentData = messageContent.data;
2139
+ if (key === props.model)
2140
+ state.overrideContent = contentData;
2141
+ break;
2142
+ }
2143
+ }
2144
+ };
2145
+ const evaluateJsCode = function evaluateJsCode2(props, state) {
2146
+ const jsCode = useContent(props, state)?.data?.jsCode;
2147
+ if (jsCode)
2148
+ evaluate({
2149
+ code: jsCode,
2150
+ context: contextContext(props),
2151
+ state: contentState(props, state)
2152
+ });
2153
+ };
2154
+ const httpReqsData = function httpReqsData2(props, state) {
2155
+ return {};
2156
+ };
2157
+ const onClick2 = function onClick3(props, state, _event) {
2158
+ if (useContent(props, state) && props.canTrack !== false)
2159
+ track("click", {
2160
+ contentId: useContent(props, state).id
2161
+ });
2162
+ };
2163
+ const evalExpression = function evalExpression2(props, state, expression) {
2164
+ return expression.replace(
2165
+ /{{([^}]+)}}/g,
2166
+ (_match, group) => evaluate({
2167
+ code: group,
2168
+ context: contextContext(props),
2169
+ state: contentState(props, state)
2170
+ })
2171
+ );
2172
+ };
2173
+ const handleRequest = function handleRequest2(props, state, { url, key }) {
2174
+ const fetchAndSetState = async () => {
2175
+ const fetch2 = await getFetch();
2176
+ const response = await fetch2(url);
2177
+ const json = await response.json();
2178
+ const newOverrideState = {
2179
+ ...state.overrideState,
2180
+ [key]: json
2181
+ };
2182
+ state.overrideState = newOverrideState;
2183
+ };
2184
+ fetchAndSetState();
2185
+ };
2186
+ const runHttpRequests = function runHttpRequests2(props, state) {
2187
+ const requests = useContent(props, state)?.data?.httpRequests ?? {};
2188
+ Object.entries(requests).forEach(([key, url]) => {
2189
+ if (url && (!httpReqsData()[key] || isEditing())) {
2190
+ const evaluatedUrl = evalExpression(props, state, url);
2191
+ handleRequest(props, state, {
2192
+ url: evaluatedUrl,
2193
+ key
2194
+ });
2195
+ }
2196
+ });
2197
+ };
2198
+ const emitStateUpdate = function emitStateUpdate2(props, state) {
2199
+ if (isEditing())
2200
+ window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
2201
+ detail: {
2202
+ state: contentState(props, state),
2203
+ ref: {
2204
+ name: props.model
2205
+ }
2206
+ }
2207
+ }));
2208
+ };
2209
+ const shouldRenderContentStyles = function shouldRenderContentStyles2(props, state) {
2210
+ return Boolean((useContent(props, state)?.data?.cssCode || useContent(props, state)?.data?.customFonts?.length) && TARGET !== "reactNative");
2211
+ };
2212
+ const RenderContent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
2213
+ const hostElement = qwik.useHostElement();
2214
+ const state = qwik.useStore({
2215
+ overrideContent: null,
2216
+ update: 0,
2217
+ overrideState: {}
2218
+ });
2219
+ qwik.useContextProvider(stdin_default, qwik.useStore({
2220
+ content: (() => {
2221
+ return useContent(props, state);
2222
+ })(),
2223
+ state: (() => {
2224
+ return contentState(props, state);
2225
+ })(),
2226
+ context: (() => {
2227
+ return contextContext(props);
2228
+ })(),
2229
+ apiKey: (() => {
2230
+ return props.apiKey;
2231
+ })(),
2232
+ registeredComponents: (() => {
2233
+ return allRegisteredComponents(props);
2234
+ })()
2235
+ }));
2236
+ qwik.useClientEffectQrl(qwik.inlinedQrl(() => {
2237
+ const [hostElement2, props2, state2] = qwik.useLexicalScope();
2238
+ if (isBrowser()) {
2239
+ if (isEditing()) {
2240
+ qwik._useMutableProps(hostElement2, true);
2241
+ Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
2242
+ const message = createRegisterComponentMessage(registeredComponent);
2243
+ window.parent?.postMessage(message, "*");
2244
+ });
2245
+ window.addEventListener("message", processMessage.bind(null, props2, state2));
2246
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2247
+ }
2248
+ if (useContent(props2, state2) && props2.canTrack !== false)
2249
+ track("impression", {
2250
+ contentId: useContent(props2, state2).id
2251
+ });
2252
+ if (isPreviewing()) {
2253
+ const searchParams = new URL(location.href).searchParams;
2254
+ if (props2.model && searchParams.get("builder.preview") === props2.model) {
2255
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
2256
+ if (previewApiKey)
2257
+ getContent({
2258
+ model: props2.model,
2259
+ apiKey: previewApiKey
2260
+ }).then((content) => {
2261
+ if (content)
2262
+ state2.overrideContent = content;
2263
+ });
2264
+ }
2265
+ }
2266
+ evaluateJsCode(props2, state2);
2267
+ runHttpRequests(props2, state2);
2268
+ emitStateUpdate(props2, state2);
2269
+ }
2270
+ }, "RenderContent_component_useClientEffect_ntruwSC9lSo", [
2271
+ hostElement,
2272
+ props,
2273
+ state
2274
+ ]));
2275
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track1 }) => {
2276
+ const [props2, state2] = qwik.useLexicalScope();
2277
+ state2.useContent?.data && track1(state2.useContent?.data, "jsCode");
2278
+ evaluateJsCode(props2, state2);
2279
+ }, "RenderContent_component_useWatch_1P0ujLQOmzc", [
2280
+ props,
2281
+ state
2282
+ ]));
2283
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
2284
+ const [props2, state2] = qwik.useLexicalScope();
2285
+ state2.useContent?.data && track2(state2.useContent?.data, "httpRequests");
2286
+ runHttpRequests(props2, state2);
2287
+ }, "RenderContent_component_useWatch_1_0hAcn4V2AZw", [
2288
+ props,
2289
+ state
2290
+ ]));
2291
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track3 }) => {
2292
+ const [props2, state2] = qwik.useLexicalScope();
2293
+ state2 && track3(state2, "contentState");
2294
+ emitStateUpdate(props2, state2);
2295
+ }, "RenderContent_component_useWatch_2_t2n8zpl4mRs", [
2296
+ props,
2297
+ state
2298
+ ]));
2299
+ qwik.useCleanupQrl(qwik.inlinedQrl(() => {
2300
+ const [props2, state2] = qwik.useLexicalScope();
2301
+ if (isBrowser()) {
2302
+ window.removeEventListener("message", processMessage.bind(null, props2, state2));
2303
+ window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2304
+ }
2305
+ }, "RenderContent_component_useCleanup_sGf1npb03WA", [
2306
+ props,
2307
+ state
2308
+ ]));
2309
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
2310
+ children: useContent(props, state) ? /* @__PURE__ */ jsxRuntime.jsxs("div", {
2311
+ onClick$: qwik.inlinedQrl((event) => {
2312
+ const [props2, state2] = qwik.useLexicalScope();
2313
+ return onClick2(props2, state2);
2314
+ }, "RenderContent_component__Fragment_div_onClick_76e3rL00UYE", [
2315
+ props,
2316
+ state
2317
+ ]),
2318
+ "builder-content-id": useContent(props, state)?.id,
2319
+ children: [
2320
+ shouldRenderContentStyles(props, state) ? /* @__PURE__ */ jsxRuntime.jsx(RenderContentStyles$1, {
2321
+ cssCode: useContent(props, state)?.data?.cssCode,
2322
+ customFonts: useContent(props, state)?.data?.customFonts
2323
+ }) : null,
2324
+ /* @__PURE__ */ jsxRuntime.jsx(RenderBlocks$1, {
2325
+ blocks: useContent(props, state)?.data?.blocks
2326
+ })
2327
+ ]
2328
+ }) : null
2329
+ });
2330
+ }, "RenderContent_component_I00xF3zGD1I"));
2331
+ const RenderContent$1 = RenderContent;
2332
+ const Symbol$1 = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
2333
+ const builderContext = qwik.useContext(stdin_default);
2334
+ const state = qwik.useStore({
2335
+ className: "builder-symbol",
2336
+ content: null
2337
+ });
2338
+ qwik.useClientEffectQrl(qwik.inlinedQrl(() => {
2339
+ const [props2, state2] = qwik.useLexicalScope();
2340
+ state2.content = props2.symbol?.content;
2341
+ }, "Symbol_component_useClientEffect_nexfMR52XGY", [
2342
+ props,
2343
+ state
2344
+ ]));
2345
+ qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
2346
+ const [builderContext2, props2, state2] = qwik.useLexicalScope();
2347
+ props2.symbol && track2(props2.symbol, "content");
2348
+ props2.symbol && track2(props2.symbol, "model");
2349
+ props2.symbol && track2(props2.symbol, "entry");
2350
+ state2 && track2(state2, "content");
2351
+ const symbolToUse = props2.symbol;
2352
+ if (symbolToUse && !symbolToUse.content && !state2.content && symbolToUse.model)
2353
+ getContent({
2354
+ model: symbolToUse.model,
2355
+ apiKey: builderContext2.apiKey,
2356
+ query: {
2357
+ id: symbolToUse.entry
2358
+ }
2359
+ }).then((response) => {
2360
+ state2.content = response;
2361
+ });
2362
+ }, "Symbol_component_useWatch_cKXWtr2eEjY", [
2363
+ builderContext,
2364
+ props,
2365
+ state
2366
+ ]));
2367
+ return /* @__PURE__ */ jsxRuntime.jsx(qwik.Host, {
2368
+ ...props.attributes,
2369
+ dataSet: {
2370
+ class: state.className
2371
+ },
2372
+ class: state.className,
2373
+ children: /* @__PURE__ */ jsxRuntime.jsx(RenderContent$1, {
2374
+ apiKey: builderContext.apiKey,
2375
+ context: builderContext.context,
2376
+ customComponents: Object.values(builderContext.registeredComponents),
2377
+ data: {
2378
+ ...props.symbol?.data,
2379
+ ...builderContext.state,
2380
+ ...props.symbol?.content?.data?.state
2381
+ },
2382
+ model: props.symbol?.model,
2383
+ content: state.content
2384
+ })
2385
+ });
2386
+ }, "Symbol_component_Dn8mGpai87I"), {
2387
+ tagName: "div"
2388
+ });
2389
+ const Symbol$2 = Symbol$1;
2390
+ const settings = {};
2391
+ function setEditorSettings(newSettings) {
2392
+ if (isBrowser()) {
2393
+ Object.assign(settings, newSettings);
2394
+ const message = {
2395
+ type: "builder.settingsChange",
2396
+ data: settings
2397
+ };
2398
+ parent.postMessage(message, "*");
2399
+ }
2400
+ }
2401
+ exports.Button = Button$1;
2402
+ exports.Columns = Columns$1;
2403
+ exports.Fragment = Fragment;
2404
+ exports.Image = Image$1;
2405
+ exports.RenderBlocks = RenderBlocks$1;
2406
+ exports.RenderContent = RenderContent$1;
2407
+ exports.Section = Section;
2408
+ exports.Symbol = Symbol$2;
2409
+ exports.Text = Text$1;
2410
+ exports.Video = Video$1;
2411
+ exports.components = components;
2412
+ exports.convertSearchParamsToQueryObject = convertSearchParamsToQueryObject;
2413
+ exports.createRegisterComponentMessage = createRegisterComponentMessage;
2414
+ exports.generateContentUrl = generateContentUrl;
2415
+ exports.getAllContent = getAllContent;
2416
+ exports.getBuilderSearchParams = getBuilderSearchParams;
2417
+ exports.getBuilderSearchParamsFromWindow = getBuilderSearchParamsFromWindow;
2418
+ exports.getContent = getContent;
2419
+ exports.isEditing = isEditing;
2420
+ exports.isPreviewing = isPreviewing;
2421
+ exports.normalizeSearchParams = normalizeSearchParams;
2422
+ exports.register = register;
2423
+ exports.registerComponent = registerComponent;
2424
+ exports.setEditorSettings = setEditorSettings;