@builder.io/sdk-react-nextjs 0.14.29 → 0.14.30

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 (100) hide show
  1. package/lib/browser/blocks-exports.cjs +188 -0
  2. package/lib/browser/blocks-exports.mjs +2812 -0
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +25 -26
  5. package/lib/browser/init.cjs +8 -0
  6. package/lib/browser/init.mjs +60 -0
  7. package/lib/browser/server-entry-24a8bb57.js +720 -0
  8. package/lib/browser/server-entry-6927b611.cjs +2 -0
  9. package/lib/browser/server-entry.cjs +1 -0
  10. package/lib/browser/server-entry.mjs +16 -0
  11. package/lib/edge/blocks-exports.cjs +208 -0
  12. package/lib/edge/{bundle-f748b05a.js → blocks-exports.mjs} +2381 -2401
  13. package/lib/edge/index.cjs +1 -1
  14. package/lib/edge/index.mjs +25 -26
  15. package/lib/edge/init.cjs +8 -0
  16. package/lib/edge/init.mjs +60 -0
  17. package/lib/edge/server-entry-24a8bb57.js +720 -0
  18. package/lib/edge/server-entry-6927b611.cjs +2 -0
  19. package/lib/edge/server-entry.cjs +1 -0
  20. package/lib/edge/server-entry.mjs +16 -0
  21. package/lib/node/blocks-exports.cjs +188 -0
  22. package/lib/node/blocks-exports.mjs +2788 -0
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +23 -23
  25. package/lib/node/init.cjs +1 -0
  26. package/lib/node/init.mjs +13 -0
  27. package/lib/node/node-runtime-39bc20c5.cjs +48 -0
  28. package/lib/node/node-runtime-bf50fca0.js +167 -0
  29. package/lib/node/server-entry-3cc55723.js +720 -0
  30. package/lib/node/server-entry-8112afc1.cjs +2 -0
  31. package/lib/node/server-entry.cjs +1 -0
  32. package/lib/node/server-entry.mjs +16 -0
  33. package/package.json +14 -9
  34. package/types/cjs/blocks/BaseText.d.ts +6 -0
  35. package/types/cjs/blocks/raw-text/component-info.d.ts +2 -0
  36. package/types/cjs/blocks/raw-text/index.d.ts +1 -0
  37. package/types/cjs/blocks/raw-text/raw-text.d.ts +7 -0
  38. package/types/cjs/blocks/textarea/component-info.d.ts +2 -0
  39. package/types/cjs/blocks/textarea/index.d.ts +1 -0
  40. package/types/cjs/blocks/textarea/textarea.d.ts +13 -0
  41. package/types/cjs/components/content/index.d.ts +1 -0
  42. package/types/cjs/components/error-boundary.d.ts +11 -0
  43. package/types/cjs/constants/sdk-name.d.ts +1 -0
  44. package/types/cjs/constants/sdk-version.d.ts +1 -1
  45. package/types/cjs/functions/apply-patch-with-mutation.d.ts +10 -0
  46. package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  47. package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  48. package/types/cjs/functions/evaluate/edge-runtime/index.d.ts +1 -0
  49. package/types/cjs/functions/evaluate/node-runtime/index.d.ts +1 -0
  50. package/types/cjs/functions/evaluate/node-runtime/init.d.ts +13 -0
  51. package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  52. package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  53. package/types/cjs/functions/evaluate/placeholder-runtime.d.ts +2 -0
  54. package/types/cjs/functions/extract-css-var-default-value.d.ts +1 -0
  55. package/types/cjs/functions/is-edge-runtime.d.ts +4 -0
  56. package/types/cjs/functions/on-change.d.ts +7 -0
  57. package/types/cjs/helpers/omit.d.ts +1 -0
  58. package/types/cjs/helpers/time.d.ts +1 -0
  59. package/types/esm/blocks/BaseText.d.ts +6 -0
  60. package/types/esm/blocks/raw-text/component-info.d.ts +2 -0
  61. package/types/esm/blocks/raw-text/index.d.ts +1 -0
  62. package/types/esm/blocks/raw-text/raw-text.d.ts +7 -0
  63. package/types/esm/blocks/textarea/component-info.d.ts +2 -0
  64. package/types/esm/blocks/textarea/index.d.ts +1 -0
  65. package/types/esm/blocks/textarea/textarea.d.ts +13 -0
  66. package/types/esm/components/content/index.d.ts +1 -0
  67. package/types/esm/components/error-boundary.d.ts +11 -0
  68. package/types/esm/constants/sdk-name.d.ts +1 -0
  69. package/types/esm/constants/sdk-version.d.ts +1 -1
  70. package/types/esm/functions/apply-patch-with-mutation.d.ts +10 -0
  71. package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  72. package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  73. package/types/esm/functions/evaluate/edge-runtime/index.d.ts +1 -0
  74. package/types/esm/functions/evaluate/node-runtime/index.d.ts +1 -0
  75. package/types/esm/functions/evaluate/node-runtime/init.d.ts +13 -0
  76. package/types/esm/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  77. package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  78. package/types/esm/functions/evaluate/placeholder-runtime.d.ts +2 -0
  79. package/types/esm/functions/extract-css-var-default-value.d.ts +1 -0
  80. package/types/esm/functions/is-edge-runtime.d.ts +4 -0
  81. package/types/esm/functions/on-change.d.ts +7 -0
  82. package/types/esm/helpers/omit.d.ts +1 -0
  83. package/types/esm/helpers/time.d.ts +1 -0
  84. package/lib/browser/USE_CLIENT_BUNDLE-2675ec3a.js +0 -703
  85. package/lib/browser/USE_CLIENT_BUNDLE-d62c0e9f.cjs +0 -21
  86. package/lib/browser/USE_SERVER_BUNDLE-22146bcb.cjs +0 -1
  87. package/lib/browser/USE_SERVER_BUNDLE-a878761a.js +0 -11
  88. package/lib/browser/bundle-4aca3c04.cjs +0 -169
  89. package/lib/browser/bundle-9acde1f6.js +0 -2832
  90. package/lib/edge/USE_CLIENT_BUNDLE-744a0d92.js +0 -703
  91. package/lib/edge/USE_CLIENT_BUNDLE-ad07ada0.cjs +0 -21
  92. package/lib/edge/USE_SERVER_BUNDLE-50d2bf59.cjs +0 -1
  93. package/lib/edge/USE_SERVER_BUNDLE-d2138019.js +0 -11
  94. package/lib/edge/bundle-6770809f.cjs +0 -189
  95. package/lib/node/USE_CLIENT_BUNDLE-2f8a2b0f.cjs +0 -21
  96. package/lib/node/USE_CLIENT_BUNDLE-bdfd3683.js +0 -703
  97. package/lib/node/USE_SERVER_BUNDLE-786cc2c7.cjs +0 -1
  98. package/lib/node/USE_SERVER_BUNDLE-a6561926.js +0 -11
  99. package/lib/node/bundle-8b02f7d4.cjs +0 -216
  100. package/lib/node/bundle-ca4c205c.js +0 -2953
@@ -1,2832 +0,0 @@
1
- import { jsx as l, Fragment as C, jsxs as R } from "react/jsx-runtime";
2
- import "react";
3
- import { LRUCache as Fe } from "lru-cache";
4
- import { I as Le, B as Ue, a as De, D as _e, C as Me, E as je, b as He, V as Ke, c as ze, F as qe, d as Ye, S as Ge, e as Je } from "./USE_CLIENT_BUNDLE-2675ec3a.js";
5
- import "next/navigation";
6
- const Qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), go = (e) => typeof e == "string" && Qe.has(e.toLowerCase()), x = "rsc", M = () => {
7
- switch (x) {
8
- case "react":
9
- case "reactNative":
10
- case "rsc":
11
- return "className";
12
- case "svelte":
13
- case "vue":
14
- case "solid":
15
- case "qwik":
16
- case "angular":
17
- return "class";
18
- }
19
- };
20
- function Xe(e) {
21
- var t;
22
- return {
23
- ...(t = e.component) == null ? void 0 : t.options,
24
- ...e.options
25
- };
26
- }
27
- const P = "[Builder.io]: ", I = {
28
- log: (...e) => console.log(P, ...e),
29
- error: (...e) => console.error(P, ...e),
30
- warn: (...e) => console.warn(P, ...e),
31
- debug: (...e) => console.debug(P, ...e)
32
- };
33
- function k() {
34
- return typeof window < "u" && typeof document < "u";
35
- }
36
- const Ze = (e) => {
37
- const t = {};
38
- return e.forEach((n, o) => {
39
- t[o] = n;
40
- }), t;
41
- }, ue = (e) => e instanceof URLSearchParams ? Ze(e) : e, me = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
42
- function et() {
43
- return k() && window.self !== window.top;
44
- }
45
- function fe(e) {
46
- return et() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
47
- me(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
48
- }
49
- const tt = () => {
50
- if (k()) {
51
- const e = new URL(location.href);
52
- return e.pathname === "" && (e.pathname = "/"), e;
53
- } else
54
- return console.warn("Cannot get location for tracking in non-browser environment"), null;
55
- }, nt = () => typeof navigator == "object" && navigator.userAgent || "", he = () => {
56
- const e = nt(), t = {
57
- Android() {
58
- return e.match(/Android/i);
59
- },
60
- BlackBerry() {
61
- return e.match(/BlackBerry/i);
62
- },
63
- iOS() {
64
- return e.match(/iPhone|iPod/i);
65
- },
66
- Opera() {
67
- return e.match(/Opera Mini/i);
68
- },
69
- Windows() {
70
- return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
71
- },
72
- any() {
73
- return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || x === "reactNative";
74
- }
75
- }, n = e.match(/Tablet|iPad/i), o = tt();
76
- return {
77
- urlPath: o == null ? void 0 : o.pathname,
78
- host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
79
- device: n ? "tablet" : t.any() ? "mobile" : "desktop"
80
- };
81
- }, ot = ({
82
- builder: e,
83
- context: t,
84
- event: n,
85
- state: o
86
- }) => Object.entries({
87
- state: o,
88
- Builder: e,
89
- // legacy
90
- builder: e,
91
- context: t,
92
- event: n
93
- }), it = () => ({
94
- isEditing: fe(),
95
- isBrowser: k(),
96
- isServer: !k(),
97
- getUserAttributes: () => he()
98
- }), rt = (e, {
99
- isExpression: t = !0
100
- }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, Q = ({
101
- code: e,
102
- builder: t,
103
- context: n,
104
- event: o,
105
- localState: i,
106
- rootSetState: r,
107
- rootState: a
108
- }) => {
109
- const s = ot({
110
- builder: t,
111
- context: n,
112
- event: o,
113
- state: pe({
114
- rootState: a,
115
- localState: i,
116
- rootSetState: r
117
- })
118
- });
119
- return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
120
- };
121
- function pe({
122
- rootState: e,
123
- localState: t,
124
- rootSetState: n
125
- }) {
126
- return new Proxy(e, {
127
- get: (o, i) => {
128
- if (t && i in t)
129
- return t[i];
130
- const r = o[i];
131
- return typeof r == "object" && r !== null ? pe({
132
- rootState: r,
133
- localState: void 0,
134
- rootSetState: n ? (a) => {
135
- o[i] = a, n(o);
136
- } : void 0
137
- }) : r;
138
- },
139
- set: (o, i, r) => {
140
- if (t && i in t)
141
- throw new Error("Writing to local state is not allowed as it is read-only.");
142
- return o[i] = r, n == null || n(o), !0;
143
- }
144
- });
145
- }
146
- const T = (e) => e != null;
147
- function at() {
148
- var e;
149
- return typeof process < "u" && T((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
150
- }
151
- const st = () => {
152
- var o;
153
- if (!at())
154
- return !1;
155
- const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
156
- return e && t && !n ? (I.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
157
- }, ct = (e) => (k() || st(), Q(e)), j = class A {
158
- static getCacheKey(t) {
159
- return JSON.stringify({
160
- ...t,
161
- // replace the event with a random number to break cache
162
- // thats because we can't serialize the event object due to circular refs in DOM node refs.
163
- event: t.event ? Math.random() : void 0
164
- });
165
- }
166
- static getCachedValue(t) {
167
- return A.cache.get(t);
168
- }
169
- static setCachedValue(t, n) {
170
- A.cache.size > 20 && A.cache.delete(A.cache.keys().next().value), A.cache.set(t, {
171
- value: n
172
- });
173
- }
174
- };
175
- j.cacheLimit = 20;
176
- j.cache = /* @__PURE__ */ new Map();
177
- let B = j;
178
- function H({
179
- code: e,
180
- context: t,
181
- localState: n,
182
- rootState: o,
183
- rootSetState: i,
184
- event: r,
185
- isExpression: a = !0,
186
- enableCache: s
187
- }) {
188
- if (e === "")
189
- return;
190
- const c = {
191
- code: rt(e, {
192
- isExpression: a
193
- }),
194
- builder: it(),
195
- context: t,
196
- event: r,
197
- rootSetState: i,
198
- rootState: o,
199
- localState: n
200
- };
201
- if (s) {
202
- const u = B.getCacheKey(c), h = B.getCachedValue(u);
203
- if (h)
204
- return h.value;
205
- }
206
- try {
207
- const u = ct(c);
208
- if (s) {
209
- const h = B.getCacheKey(c);
210
- B.setCachedValue(h, u);
211
- }
212
- return u;
213
- } catch (u) {
214
- I.error("Failed code evaluation: " + u.message, {
215
- code: e
216
- });
217
- return;
218
- }
219
- }
220
- const O = (e) => JSON.parse(JSON.stringify(e)), lt = (e, t, n) => {
221
- if (Object(e) !== e)
222
- return e;
223
- const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
224
- return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
225
- };
226
- const dt = ({
227
- block: e,
228
- context: t,
229
- localState: n,
230
- rootState: o,
231
- rootSetState: i
232
- }) => {
233
- if (!e.bindings)
234
- return e;
235
- const r = O(e), a = {
236
- ...r,
237
- properties: {
238
- ...r.properties
239
- },
240
- actions: {
241
- ...r.actions
242
- }
243
- };
244
- for (const s in e.bindings) {
245
- const c = e.bindings[s], u = H({
246
- code: c,
247
- localState: n,
248
- rootState: o,
249
- rootSetState: i,
250
- context: t,
251
- enableCache: !0
252
- });
253
- lt(a, s, u);
254
- }
255
- return a;
256
- };
257
- function N({
258
- block: e,
259
- context: t,
260
- shouldEvaluateBindings: n,
261
- localState: o,
262
- rootState: i,
263
- rootSetState: r
264
- }) {
265
- const a = e;
266
- return n ? dt({
267
- block: a,
268
- localState: o,
269
- rootState: i,
270
- rootSetState: r,
271
- context: t
272
- }) : a;
273
- }
274
- const K = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "", ge = (e) => Object.entries(e).map(([n, o]) => {
275
- if (typeof o == "string")
276
- return `${K(n)}: ${o};`;
277
- }).filter(T), ut = (e) => ge(e).join(`
278
- `), V = ({
279
- mediaQuery: e,
280
- className: t,
281
- styles: n
282
- }) => {
283
- const o = `.${t} {
284
- ${ut(n)}
285
- }`;
286
- return e ? `${e} {
287
- ${o}
288
- }` : o;
289
- };
290
- function mt({
291
- style: e
292
- }) {
293
- return e;
294
- }
295
- const ft = ({
296
- block: e,
297
- context: t
298
- }) => be(mt({
299
- style: e.style || {},
300
- context: t,
301
- block: e
302
- }));
303
- function be(e) {
304
- switch (x) {
305
- case "svelte":
306
- case "vue":
307
- case "solid":
308
- case "angular":
309
- return ge(e).join(" ");
310
- case "qwik":
311
- case "reactNative":
312
- case "react":
313
- case "rsc":
314
- return e;
315
- }
316
- }
317
- const ht = ({
318
- block: e,
319
- context: t,
320
- registeredComponents: n
321
- }) => {
322
- var r;
323
- const o = (r = N({
324
- block: e,
325
- localState: t.localState,
326
- rootState: t.rootState,
327
- rootSetState: t.rootSetState,
328
- context: t.context,
329
- shouldEvaluateBindings: !1
330
- }).component) == null ? void 0 : r.name;
331
- if (!o)
332
- return null;
333
- const i = n[o];
334
- if (i)
335
- return i;
336
- console.warn(`
337
- Could not find a registered component named "${o}".
338
- If you registered it, is the file that registered it imported by the file that needs to render it?`);
339
- }, pt = ({
340
- block: e,
341
- context: t
342
- }) => {
343
- const {
344
- repeat: n,
345
- ...o
346
- } = e;
347
- if (!(n != null && n.collection))
348
- return;
349
- const i = H({
350
- code: n.collection,
351
- localState: t.localState,
352
- rootState: t.rootState,
353
- rootSetState: t.rootSetState,
354
- context: t.context,
355
- enableCache: !0
356
- });
357
- if (!Array.isArray(i))
358
- return;
359
- const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
360
- return i.map((c, u) => ({
361
- context: {
362
- ...t,
363
- localState: {
364
- ...t.localState,
365
- $index: u,
366
- $item: c,
367
- [a]: c,
368
- [`$${a}Index`]: u
369
- }
370
- },
371
- block: o
372
- }));
373
- }, gt = (e, t) => e && (e.isRSC && x === "rsc" || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
374
- builderLinkComponent: t
375
- } : {}, bt = (e, t) => e && (e.isRSC && x === "rsc" || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
376
- builderComponents: t
377
- } : {}, yt = (e, t) => e && (e.isRSC && x === "rsc" || x === "reactNative" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Image", "Video"].includes(e.name)) ? {
378
- builderBlock: t
379
- } : {}, St = (e, t) => e && (e.isRSC && x === "rsc" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Slot"].includes(e.name)) ? {
380
- builderContext: t
381
- } : {}, ye = {
382
- small: {
383
- min: 320,
384
- default: 321,
385
- max: 640
386
- },
387
- medium: {
388
- min: 641,
389
- default: 642,
390
- max: 991
391
- },
392
- large: {
393
- min: 990,
394
- default: 991,
395
- max: 1200
396
- }
397
- }, X = (e, t = ye) => `@media (max-width: ${t[e].max}px)`, Se = ({
398
- small: e,
399
- medium: t
400
- }) => {
401
- const n = O(ye);
402
- if (!e || !t)
403
- return n;
404
- const o = Math.floor(e / 2);
405
- n.small = {
406
- max: e,
407
- min: o,
408
- default: o + 1
409
- };
410
- const i = n.small.max + 1;
411
- n.medium = {
412
- max: t,
413
- min: i,
414
- default: i + 1
415
- };
416
- const r = n.medium.max + 1;
417
- return n.large = {
418
- max: 2e3,
419
- // TODO: decide upper limit
420
- min: r,
421
- default: r + 1
422
- }, n;
423
- };
424
- function $(e) {
425
- return /* @__PURE__ */ l(
426
- "style",
427
- {
428
- dangerouslySetInnerHTML: { __html: e.styles },
429
- "data-id": e.id
430
- }
431
- );
432
- }
433
- function vt(e) {
434
- const t = function() {
435
- const i = N({
436
- block: e.block,
437
- localState: e.context.localState,
438
- rootState: e.context.rootState,
439
- rootSetState: e.context.rootSetState,
440
- context: e.context.context,
441
- shouldEvaluateBindings: !0
442
- });
443
- return T(i.hide) ? !i.hide : T(i.show) ? i.show : !0;
444
- }, n = function() {
445
- var m, p, y;
446
- const i = N({
447
- block: e.block,
448
- localState: e.context.localState,
449
- rootState: e.context.rootState,
450
- rootSetState: e.context.rootSetState,
451
- context: e.context.context,
452
- shouldEvaluateBindings: !0
453
- }), r = i.responsiveStyles, a = e.context.content, s = Se(
454
- ((m = a == null ? void 0 : a.meta) == null ? void 0 : m.breakpoints) || {}
455
- ), c = r == null ? void 0 : r.large, u = r == null ? void 0 : r.medium, h = r == null ? void 0 : r.small, d = i.id;
456
- if (!d)
457
- return "";
458
- const f = c ? V({
459
- className: d,
460
- styles: c
461
- }) : "", g = u ? V({
462
- className: d,
463
- styles: u,
464
- mediaQuery: X(
465
- "medium",
466
- s
467
- )
468
- }) : "", v = h ? V({
469
- className: d,
470
- styles: h,
471
- mediaQuery: X(
472
- "small",
473
- s
474
- )
475
- }) : "", b = i.animations && i.animations.find((S) => S.trigger === "hover");
476
- let E = "";
477
- if (b) {
478
- const S = ((y = (p = b.steps) == null ? void 0 : p[1]) == null ? void 0 : y.styles) || {};
479
- E = V({
480
- className: `${d}:hover`,
481
- styles: {
482
- ...S,
483
- transition: `all ${b.duration}s ${K(
484
- b.easing
485
- )}`,
486
- transitionDelay: b.delay ? `${b.delay}s` : "0s"
487
- }
488
- }) || "";
489
- }
490
- return [
491
- f,
492
- g,
493
- v,
494
- E
495
- ].join(" ");
496
- };
497
- return /* @__PURE__ */ l(C, { children: n() && t() ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l($, { id: "builderio-block", styles: n() }) }) : null });
498
- }
499
- function kt(e) {
500
- return e.charAt(0).toUpperCase() + e.slice(1);
501
- }
502
- const xt = (e) => `on${kt(e)}`, Ct = (e, t) => (n) => H({
503
- code: e,
504
- context: t.context,
505
- localState: t.localState,
506
- rootState: t.rootState,
507
- rootSetState: t.rootSetState,
508
- event: n,
509
- isExpression: !1,
510
- enableCache: !0
511
- });
512
- function bo(e) {
513
- const t = {}, n = e.block.actions ?? {};
514
- for (const o in n) {
515
- if (!n.hasOwnProperty(o))
516
- continue;
517
- const i = n[o];
518
- let r = xt(o);
519
- if (e.stripPrefix)
520
- switch (x) {
521
- case "vue":
522
- r = r.replace("v-on:", "");
523
- break;
524
- case "svelte":
525
- r = r.replace("on:", "");
526
- break;
527
- }
528
- t[r] = Ct(i, e);
529
- }
530
- return t;
531
- }
532
- function wt({
533
- properties: e
534
- }) {
535
- return e;
536
- }
537
- const It = (e) => ({
538
- href: e.href
539
- });
540
- function Tt({
541
- block: e,
542
- context: t
543
- }) {
544
- var o;
545
- const n = {
546
- ...It(e),
547
- ...e.properties,
548
- "builder-id": e.id,
549
- style: ft({
550
- block: e,
551
- context: t
552
- }),
553
- [M()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
554
- };
555
- return wt({
556
- properties: n,
557
- context: t,
558
- block: e
559
- });
560
- }
561
- const Et = ({
562
- componentOptions: e,
563
- builderBlock: t,
564
- context: n,
565
- componentRef: o,
566
- includeBlockProps: i,
567
- isInteractive: r,
568
- contextValue: a
569
- }) => {
570
- const s = {
571
- ...e,
572
- /**
573
- * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
574
- * component itself directly. Otherwise, they are provided to the wrapper element.
575
- */
576
- ...i ? {
577
- attributes: Tt({
578
- block: t,
579
- context: a
580
- })
581
- } : {}
582
- };
583
- return r ? {
584
- Wrapper: o,
585
- block: t,
586
- context: n,
587
- wrapperProps: e,
588
- includeBlockProps: i
589
- } : s;
590
- };
591
- function Z(e) {
592
- var n;
593
- const t = e.isInteractive ? Le : e.componentRef;
594
- return /* @__PURE__ */ l(C, { children: e.componentRef ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
595
- t,
596
- {
597
- ...Et({
598
- componentOptions: e.componentOptions,
599
- builderBlock: e.builderBlock,
600
- context: e.context,
601
- componentRef: e.componentRef,
602
- linkComponent: e.linkComponent,
603
- includeBlockProps: e.includeBlockProps,
604
- isInteractive: e.isInteractive,
605
- contextValue: e.context
606
- }),
607
- children: (n = e.blockChildren) == null ? void 0 : n.map((o) => /* @__PURE__ */ l(
608
- F,
609
- {
610
- block: o,
611
- context: e.context,
612
- registeredComponents: e.registeredComponents,
613
- linkComponent: e.linkComponent
614
- },
615
- o.id
616
- ))
617
- }
618
- ) }) : null });
619
- }
620
- function Rt(e) {
621
- const t = e.repeatContext;
622
- return /* @__PURE__ */ l(
623
- F,
624
- {
625
- block: e.block,
626
- context: t,
627
- registeredComponents: e.registeredComponents,
628
- linkComponent: e.linkComponent
629
- }
630
- );
631
- }
632
- function F(e) {
633
- var c, u, h;
634
- const t = function() {
635
- return ht({
636
- block: e.block,
637
- context: e.context,
638
- registeredComponents: e.registeredComponents
639
- });
640
- }, n = function() {
641
- return pt({
642
- block: e.block,
643
- context: e.context
644
- });
645
- }, o = function() {
646
- var f;
647
- return (f = e.block.repeat) != null && f.collection ? e.block : N({
648
- block: e.block,
649
- localState: e.context.localState,
650
- rootState: e.context.rootState,
651
- rootSetState: e.context.rootSetState,
652
- context: e.context.context,
653
- shouldEvaluateBindings: !0
654
- });
655
- }, i = function() {
656
- var g;
657
- return e.block.tagName === "a" || ((g = o().properties) == null ? void 0 : g.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
658
- }, r = function() {
659
- var v, b;
660
- if ((v = e.block.repeat) != null && v.collection)
661
- return !!((b = n()) != null && b.length);
662
- const f = "hide" in o() ? o().hide : !1;
663
- return ("show" in o() ? o().show : !0) && !f;
664
- }, a = function() {
665
- var g;
666
- return !((g = t()) != null && g.component) && !n() ? o().children ?? [] : [];
667
- }, s = function() {
668
- var f, g, v;
669
- return {
670
- blockChildren: o().children ?? [],
671
- componentRef: (f = t()) == null ? void 0 : f.component,
672
- componentOptions: {
673
- ...Xe(o()),
674
- ...yt(t(), o()),
675
- ...St(t(), e.context),
676
- ...gt(t(), e.linkComponent),
677
- ...bt(
678
- t(),
679
- e.registeredComponents
680
- )
681
- },
682
- context: e.context,
683
- linkComponent: e.linkComponent,
684
- registeredComponents: e.registeredComponents,
685
- builderBlock: o(),
686
- includeBlockProps: ((g = t()) == null ? void 0 : g.noWrap) === !0,
687
- isInteractive: !((v = t()) != null && v.isRSC)
688
- };
689
- };
690
- return /* @__PURE__ */ l(C, { children: r() ? /* @__PURE__ */ R(C, { children: [
691
- /* @__PURE__ */ l(vt, { block: e.block, context: e.context }),
692
- (c = t()) != null && c.noWrap ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
693
- Z,
694
- {
695
- componentRef: s().componentRef,
696
- componentOptions: s().componentOptions,
697
- blockChildren: s().blockChildren,
698
- context: s().context,
699
- registeredComponents: s().registeredComponents,
700
- linkComponent: s().linkComponent,
701
- builderBlock: s().builderBlock,
702
- includeBlockProps: s().includeBlockProps,
703
- isInteractive: s().isInteractive
704
- }
705
- ) }) : /* @__PURE__ */ l(C, { children: n() ? /* @__PURE__ */ l(C, { children: (h = n()) == null ? void 0 : h.map((d, f) => /* @__PURE__ */ l(
706
- Rt,
707
- {
708
- repeatContext: d.context,
709
- block: d.block,
710
- registeredComponents: e.registeredComponents,
711
- linkComponent: e.linkComponent
712
- },
713
- f
714
- )) }) : /* @__PURE__ */ R(
715
- Ue,
716
- {
717
- Wrapper: i(),
718
- block: o(),
719
- context: e.context,
720
- children: [
721
- /* @__PURE__ */ l(
722
- Z,
723
- {
724
- componentRef: s().componentRef,
725
- componentOptions: s().componentOptions,
726
- blockChildren: s().blockChildren,
727
- context: s().context,
728
- registeredComponents: s().registeredComponents,
729
- linkComponent: s().linkComponent,
730
- builderBlock: s().builderBlock,
731
- includeBlockProps: s().includeBlockProps,
732
- isInteractive: s().isInteractive
733
- }
734
- ),
735
- (u = a()) == null ? void 0 : u.map((d) => /* @__PURE__ */ l(
736
- F,
737
- {
738
- block: d,
739
- registeredComponents: e.registeredComponents,
740
- linkComponent: e.linkComponent,
741
- context: e.context
742
- },
743
- d.id
744
- ))
745
- ]
746
- }
747
- ) })
748
- ] }) : null });
749
- }
750
- function z(e) {
751
- var t, n, o;
752
- return /* @__PURE__ */ l(
753
- De,
754
- {
755
- blocks: e.blocks,
756
- parent: e.parent,
757
- path: e.path,
758
- styleProp: e.styleProp,
759
- BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
760
- BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
761
- children: e.blocks ? /* @__PURE__ */ l(C, { children: (o = e.blocks) == null ? void 0 : o.map((i) => /* @__PURE__ */ l(
762
- F,
763
- {
764
- block: i,
765
- linkComponent: e.linkComponent,
766
- context: e.context,
767
- registeredComponents: e.registeredComponents
768
- },
769
- i.id
770
- )) }) : null
771
- }
772
- );
773
- }
774
- const At = (e) => `builder-columns ${e}-breakpoints`;
775
- function Pt(e) {
776
- var b, E;
777
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(p) {
778
- return p.link ? e.builderLinkComponent || "a" : "div";
779
- }, r = function(p) {
780
- var y;
781
- return ((y = n[p]) == null ? void 0 : y.width) || 100 / n.length;
782
- }, a = function(p) {
783
- const y = t * (n.length - 1) / n.length;
784
- return `calc(${r(p)}% - ${y}px)`;
785
- }, s = function({
786
- stackedStyle: p,
787
- desktopStyle: y
788
- }) {
789
- return o === "tablet" ? p : y;
790
- }, c = function({
791
- stackedStyle: p,
792
- desktopStyle: y
793
- }) {
794
- return o === "never" ? y : p;
795
- }, u = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", h = function() {
796
- return {
797
- "--flex-dir": u,
798
- "--flex-dir-tablet": s({
799
- stackedStyle: u,
800
- desktopStyle: "row"
801
- })
802
- };
803
- }, d = function(p) {
804
- const y = p === 0 ? 0 : t, S = a(p), w = `${y}px`, G = "100%", J = 0;
805
- return {
806
- ...{
807
- display: "flex",
808
- flexDirection: "column",
809
- alignItems: "stretch"
810
- },
811
- width: S,
812
- ["marginLeft"]: w,
813
- "--column-width-mobile": c({
814
- stackedStyle: G,
815
- desktopStyle: S
816
- }),
817
- "--column-margin-left-mobile": c({
818
- stackedStyle: J,
819
- desktopStyle: w
820
- }),
821
- "--column-width-tablet": s({
822
- stackedStyle: G,
823
- desktopStyle: S
824
- }),
825
- "--column-margin-left-tablet": s({
826
- stackedStyle: J,
827
- desktopStyle: w
828
- })
829
- };
830
- }, f = function(p) {
831
- var S, w;
832
- return Se(
833
- ((w = (S = e.builderContext.content) == null ? void 0 : S.meta) == null ? void 0 : w.breakpoints) || {}
834
- )[p].max;
835
- }, g = function() {
836
- return `
837
- @media (max-width: ${f("medium")}px) {
838
- .${e.builderBlock.id}-breakpoints {
839
- flex-direction: var(--flex-dir-tablet);
840
- align-items: stretch;
841
- }
842
-
843
- .${e.builderBlock.id}-breakpoints > .builder-column {
844
- width: var(--column-width-tablet) !important;
845
- margin-left: var(--column-margin-left-tablet) !important;
846
- }
847
- }
848
-
849
- @media (max-width: ${f("small")}px) {
850
- .${e.builderBlock.id}-breakpoints {
851
- flex-direction: var(--flex-dir);
852
- align-items: stretch;
853
- }
854
-
855
- .${e.builderBlock.id}-breakpoints > .builder-column {
856
- width: var(--column-width-mobile) !important;
857
- margin-left: var(--column-margin-left-mobile) !important;
858
- }
859
- },
860
- `;
861
- }, v = function(p, y) {
862
- return {
863
- ...p.link ? {
864
- href: p.link
865
- } : {},
866
- [M()]: "builder-column",
867
- style: be(d(y))
868
- };
869
- };
870
- return /* @__PURE__ */ R(C, { children: [
871
- /* @__PURE__ */ R(
872
- "div",
873
- {
874
- className: At((b = e.builderBlock) == null ? void 0 : b.id) + " div-eeca3604",
875
- style: h(),
876
- children: [
877
- /* @__PURE__ */ l($, { id: "builderio-columns", styles: g() }),
878
- (E = e.columns) == null ? void 0 : E.map((m, p) => /* @__PURE__ */ l(
879
- _e,
880
- {
881
- TagName: i(m),
882
- actionAttributes: {},
883
- attributes: v(m, p),
884
- children: /* @__PURE__ */ l(
885
- z,
886
- {
887
- path: `component.options.columns.${p}.blocks`,
888
- parent: e.builderBlock.id,
889
- styleProp: {
890
- flexGrow: "1"
891
- },
892
- context: e.builderContext,
893
- registeredComponents: e.builderComponents,
894
- linkComponent: e.builderLinkComponent,
895
- blocks: m.blocks
896
- }
897
- )
898
- },
899
- p
900
- ))
901
- ]
902
- }
903
- ),
904
- /* @__PURE__ */ l("style", { children: `.div-eeca3604 {
905
- display: flex;
906
- line-height: normal;
907
- }` })
908
- ] });
909
- }
910
- function ee(e) {
911
- return e.replace(/http(s)?:/, "");
912
- }
913
- function Bt(e = "", t, n) {
914
- const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
915
- return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
916
- }
917
- function Vt(e, t) {
918
- if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
919
- return e;
920
- if (t === "master")
921
- return ee(e);
922
- const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
923
- if (n) {
924
- const o = e.split(n[0]), i = n[3], r = t.match("x") ? t : `${t}x`;
925
- return ee(`${o[0]}_${r}${i}`);
926
- }
927
- return null;
928
- }
929
- function yo(e) {
930
- if (!e)
931
- return e;
932
- const t = [100, 200, 400, 800, 1200, 1600, 2e3];
933
- if (e.match(/builder\.io/)) {
934
- let n = e;
935
- const o = Number(e.split("?width=")[1]);
936
- return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${Bt(e, "width", i)} ${i}w`).concat([n]).join(", ");
937
- }
938
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Vt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
939
- }
940
- const Wt = (e) => {
941
- if (e === "localhost" || e === "127.0.0.1")
942
- return e;
943
- const t = e.split(".");
944
- return t.length > 2 ? t.slice(1).join(".") : e;
945
- }, ve = ({
946
- name: e,
947
- canTrack: t
948
- }) => {
949
- var n;
950
- try {
951
- return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
952
- } catch (o) {
953
- I.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
954
- return;
955
- }
956
- }, ke = async (e) => ve(e), Nt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(T).join("; "), Ot = [["secure", ""], ["SameSite", "None"]], $t = ({
957
- name: e,
958
- value: t,
959
- expires: n
960
- }) => {
961
- const i = (k() ? location.protocol === "https:" : !0) ? Ot : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", Wt(window.location.hostname)], ...i];
962
- return Nt(a);
963
- }, xe = async ({
964
- name: e,
965
- value: t,
966
- expires: n,
967
- canTrack: o
968
- }) => {
969
- try {
970
- if (!o)
971
- return;
972
- const i = $t({
973
- name: e,
974
- value: t,
975
- expires: n
976
- });
977
- document.cookie = i;
978
- } catch (i) {
979
- I.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
980
- }
981
- }, Ft = "builder.tests", q = (e) => `${Ft}.${e}`, Lt = ({
982
- contentId: e
983
- }) => ke({
984
- name: q(e),
985
- canTrack: !0
986
- }), Ut = ({
987
- contentId: e
988
- }) => ve({
989
- name: q(e),
990
- canTrack: !0
991
- }), Dt = ({
992
- contentId: e,
993
- value: t
994
- }) => xe({
995
- name: q(e),
996
- value: t,
997
- canTrack: !0
998
- }), Ce = (e) => T(e.id) && T(e.variations) && Object.keys(e.variations).length > 0, _t = ({
999
- id: e,
1000
- variations: t
1001
- }) => {
1002
- var i;
1003
- let n = 0;
1004
- const o = Math.random();
1005
- for (const r in t) {
1006
- const a = (i = t[r]) == null ? void 0 : i.testRatio;
1007
- if (n += a, o < n)
1008
- return r;
1009
- }
1010
- return e;
1011
- }, we = (e) => {
1012
- const t = _t(e);
1013
- return Dt({
1014
- contentId: e.id,
1015
- value: t
1016
- }).catch((n) => {
1017
- I.error("could not store A/B test variation: ", n);
1018
- }), t;
1019
- }, Ie = ({
1020
- item: e,
1021
- testGroupId: t
1022
- }) => {
1023
- const n = e.variations[t];
1024
- return t === e.id || // handle edge-case where `testGroupId` points to non-existing variation
1025
- !n ? {
1026
- testVariationId: e.id,
1027
- testVariationName: "Default"
1028
- } : {
1029
- data: n.data,
1030
- testVariationId: n.id,
1031
- testVariationName: n.name || (n.id === e.id ? "Default" : "")
1032
- };
1033
- }, Mt = ({
1034
- item: e,
1035
- canTrack: t
1036
- }) => {
1037
- if (!t)
1038
- return e;
1039
- if (!e)
1040
- return;
1041
- if (!Ce(e))
1042
- return e;
1043
- const n = Ut({
1044
- contentId: e.id
1045
- }) || we({
1046
- variations: e.variations,
1047
- id: e.id
1048
- }), o = Ie({
1049
- item: e,
1050
- testGroupId: n
1051
- });
1052
- return {
1053
- ...e,
1054
- ...o
1055
- };
1056
- }, jt = async ({
1057
- item: e,
1058
- canTrack: t
1059
- }) => {
1060
- if (!t || !Ce(e))
1061
- return e;
1062
- const o = await Lt({
1063
- contentId: e.id
1064
- }) || we({
1065
- variations: e.variations,
1066
- id: e.id
1067
- }), i = Ie({
1068
- item: e,
1069
- testGroupId: o
1070
- });
1071
- return {
1072
- ...e,
1073
- ...i
1074
- };
1075
- }, L = (e) => T(e) ? e : !0, Ht = {
1076
- name: "Core:Button",
1077
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1078
- defaultStyles: {
1079
- // TODO: make min width more intuitive and set one
1080
- appearance: "none",
1081
- paddingTop: "15px",
1082
- paddingBottom: "15px",
1083
- paddingLeft: "25px",
1084
- paddingRight: "25px",
1085
- backgroundColor: "#000000",
1086
- color: "white",
1087
- borderRadius: "4px",
1088
- textAlign: "center",
1089
- cursor: "pointer"
1090
- },
1091
- inputs: [{
1092
- name: "text",
1093
- type: "text",
1094
- defaultValue: "Click me!",
1095
- bubble: !0
1096
- }, {
1097
- name: "link",
1098
- type: "url",
1099
- bubble: !0
1100
- }, {
1101
- name: "openLinkInNewTab",
1102
- type: "boolean",
1103
- defaultValue: !1,
1104
- friendlyName: "Open link in new tab"
1105
- }],
1106
- static: !0,
1107
- noWrap: !0
1108
- }, Kt = {
1109
- // TODO: ways to statically preprocess JSON for references, functions, etc
1110
- name: "Columns",
1111
- isRSC: !0,
1112
- inputs: [{
1113
- name: "columns",
1114
- type: "array",
1115
- broadcast: !0,
1116
- subFields: [{
1117
- name: "blocks",
1118
- type: "array",
1119
- hideFromUI: !0,
1120
- defaultValue: [{
1121
- "@type": "@builder.io/sdk:Element",
1122
- responsiveStyles: {
1123
- large: {
1124
- display: "flex",
1125
- flexDirection: "column",
1126
- alignItems: "stretch",
1127
- flexShrink: "0",
1128
- position: "relative",
1129
- marginTop: "30px",
1130
- textAlign: "center",
1131
- lineHeight: "normal",
1132
- height: "auto",
1133
- minHeight: "20px",
1134
- minWidth: "20px",
1135
- overflow: "hidden"
1136
- }
1137
- },
1138
- component: {
1139
- name: "Image",
1140
- options: {
1141
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1142
- backgroundPosition: "center",
1143
- backgroundSize: "cover",
1144
- aspectRatio: 0.7004048582995948
1145
- }
1146
- }
1147
- }, {
1148
- "@type": "@builder.io/sdk:Element",
1149
- responsiveStyles: {
1150
- large: {
1151
- display: "flex",
1152
- flexDirection: "column",
1153
- alignItems: "stretch",
1154
- flexShrink: "0",
1155
- position: "relative",
1156
- marginTop: "30px",
1157
- textAlign: "center",
1158
- lineHeight: "normal",
1159
- height: "auto"
1160
- }
1161
- },
1162
- component: {
1163
- name: "Text",
1164
- options: {
1165
- text: "<p>Enter some text...</p>"
1166
- }
1167
- }
1168
- }]
1169
- }, {
1170
- name: "width",
1171
- type: "number",
1172
- hideFromUI: !0,
1173
- helperText: "Width %, e.g. set to 50 to fill half of the space"
1174
- }, {
1175
- name: "link",
1176
- type: "url",
1177
- helperText: "Optionally set a url that clicking this column will link to"
1178
- }],
1179
- defaultValue: [{
1180
- blocks: [{
1181
- "@type": "@builder.io/sdk:Element",
1182
- responsiveStyles: {
1183
- large: {
1184
- display: "flex",
1185
- flexDirection: "column",
1186
- alignItems: "stretch",
1187
- flexShrink: "0",
1188
- position: "relative",
1189
- marginTop: "30px",
1190
- textAlign: "center",
1191
- lineHeight: "normal",
1192
- height: "auto",
1193
- minHeight: "20px",
1194
- minWidth: "20px",
1195
- overflow: "hidden"
1196
- }
1197
- },
1198
- component: {
1199
- name: "Image",
1200
- options: {
1201
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1202
- backgroundPosition: "center",
1203
- backgroundSize: "cover",
1204
- aspectRatio: 0.7004048582995948
1205
- }
1206
- }
1207
- }, {
1208
- "@type": "@builder.io/sdk:Element",
1209
- responsiveStyles: {
1210
- large: {
1211
- display: "flex",
1212
- flexDirection: "column",
1213
- alignItems: "stretch",
1214
- flexShrink: "0",
1215
- position: "relative",
1216
- marginTop: "30px",
1217
- textAlign: "center",
1218
- lineHeight: "normal",
1219
- height: "auto"
1220
- }
1221
- },
1222
- component: {
1223
- name: "Text",
1224
- options: {
1225
- text: "<p>Enter some text...</p>"
1226
- }
1227
- }
1228
- }]
1229
- }, {
1230
- blocks: [{
1231
- "@type": "@builder.io/sdk:Element",
1232
- responsiveStyles: {
1233
- large: {
1234
- display: "flex",
1235
- flexDirection: "column",
1236
- alignItems: "stretch",
1237
- flexShrink: "0",
1238
- position: "relative",
1239
- marginTop: "30px",
1240
- textAlign: "center",
1241
- lineHeight: "normal",
1242
- height: "auto",
1243
- minHeight: "20px",
1244
- minWidth: "20px",
1245
- overflow: "hidden"
1246
- }
1247
- },
1248
- component: {
1249
- name: "Image",
1250
- options: {
1251
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1252
- backgroundPosition: "center",
1253
- backgroundSize: "cover",
1254
- aspectRatio: 0.7004048582995948
1255
- }
1256
- }
1257
- }, {
1258
- "@type": "@builder.io/sdk:Element",
1259
- responsiveStyles: {
1260
- large: {
1261
- display: "flex",
1262
- flexDirection: "column",
1263
- alignItems: "stretch",
1264
- flexShrink: "0",
1265
- position: "relative",
1266
- marginTop: "30px",
1267
- textAlign: "center",
1268
- lineHeight: "normal",
1269
- height: "auto"
1270
- }
1271
- },
1272
- component: {
1273
- name: "Text",
1274
- options: {
1275
- text: "<p>Enter some text...</p>"
1276
- }
1277
- }
1278
- }]
1279
- }],
1280
- onChange: (e) => {
1281
- function t() {
1282
- n.forEach((o) => {
1283
- o.delete("width");
1284
- });
1285
- }
1286
- const n = e.get("columns");
1287
- Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
1288
- }
1289
- }, {
1290
- name: "space",
1291
- type: "number",
1292
- defaultValue: 20,
1293
- helperText: "Size of gap between columns",
1294
- advanced: !0
1295
- }, {
1296
- name: "stackColumnsAt",
1297
- type: "string",
1298
- defaultValue: "tablet",
1299
- helperText: "Convert horizontal columns to vertical at what device size",
1300
- enum: ["tablet", "mobile", "never"],
1301
- advanced: !0
1302
- }, {
1303
- name: "reverseColumnsWhenStacked",
1304
- type: "boolean",
1305
- defaultValue: !1,
1306
- helperText: "When stacking columns for mobile devices, reverse the ordering",
1307
- advanced: !0
1308
- }]
1309
- }, zt = {
1310
- name: "Fragment",
1311
- static: !0,
1312
- hidden: !0,
1313
- canHaveChildren: !0,
1314
- noWrap: !0
1315
- }, qt = {
1316
- name: "Image",
1317
- static: !0,
1318
- 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",
1319
- defaultStyles: {
1320
- position: "relative",
1321
- minHeight: "20px",
1322
- minWidth: "20px",
1323
- overflow: "hidden"
1324
- },
1325
- canHaveChildren: !0,
1326
- inputs: [{
1327
- name: "image",
1328
- type: "file",
1329
- bubble: !0,
1330
- allowedFileTypes: ["jpeg", "jpg", "png", "svg", "webp"],
1331
- required: !0,
1332
- defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1333
- onChange: (e) => {
1334
- e.delete("srcset"), e.delete("noWebp");
1335
- function n(a, s = 6e4) {
1336
- return new Promise((c, u) => {
1337
- const h = document.createElement("img");
1338
- let d = !1;
1339
- h.onload = () => {
1340
- d = !0, c(h);
1341
- }, h.addEventListener("error", (f) => {
1342
- console.warn("Image load failed", f.error), u(f.error);
1343
- }), h.src = a, setTimeout(() => {
1344
- d || u(new Error("Image load timed out"));
1345
- }, s);
1346
- });
1347
- }
1348
- function o(a) {
1349
- return Math.round(a * 1e3) / 1e3;
1350
- }
1351
- const i = e.get("image"), r = e.get("aspectRatio");
1352
- if (fetch(i).then((a) => a.blob()).then((a) => {
1353
- a.type.includes("svg") && e.set("noWebp", !0);
1354
- }), i && (!r || r === 0.7041))
1355
- return n(i).then((a) => {
1356
- const s = e.get("aspectRatio");
1357
- e.get("image") === i && (!s || s === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1358
- });
1359
- }
1360
- }, {
1361
- name: "backgroundSize",
1362
- type: "text",
1363
- defaultValue: "cover",
1364
- enum: [{
1365
- label: "contain",
1366
- value: "contain",
1367
- helperText: "The image should never get cropped"
1368
- }, {
1369
- label: "cover",
1370
- value: "cover",
1371
- helperText: "The image should fill it's box, cropping when needed"
1372
- }]
1373
- }, {
1374
- name: "backgroundPosition",
1375
- type: "text",
1376
- defaultValue: "center",
1377
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1378
- }, {
1379
- name: "altText",
1380
- type: "string",
1381
- helperText: "Text to display when the user has images off"
1382
- }, {
1383
- name: "height",
1384
- type: "number",
1385
- hideFromUI: !0
1386
- }, {
1387
- name: "width",
1388
- type: "number",
1389
- hideFromUI: !0
1390
- }, {
1391
- name: "sizes",
1392
- type: "string",
1393
- hideFromUI: !0
1394
- }, {
1395
- name: "srcset",
1396
- type: "string",
1397
- hideFromUI: !0
1398
- }, {
1399
- name: "lazy",
1400
- type: "boolean",
1401
- defaultValue: !0,
1402
- hideFromUI: !0
1403
- }, {
1404
- name: "fitContent",
1405
- type: "boolean",
1406
- helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1407
- defaultValue: !0
1408
- }, {
1409
- name: "highPriority",
1410
- type: "boolean",
1411
- advanced: !0,
1412
- helperText: "Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."
1413
- }, {
1414
- name: "aspectRatio",
1415
- type: "number",
1416
- 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",
1417
- advanced: !0,
1418
- defaultValue: 0.7041
1419
- }]
1420
- }, Yt = {
1421
- name: "Core:Section",
1422
- static: !0,
1423
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1424
- inputs: [{
1425
- name: "maxWidth",
1426
- type: "number",
1427
- defaultValue: 1200
1428
- }, {
1429
- name: "lazyLoad",
1430
- type: "boolean",
1431
- defaultValue: !1,
1432
- advanced: !0,
1433
- description: "Only render this section when in view"
1434
- }],
1435
- defaultStyles: {
1436
- paddingLeft: "20px",
1437
- paddingRight: "20px",
1438
- paddingTop: "50px",
1439
- paddingBottom: "50px",
1440
- marginTop: "0px",
1441
- width: "100vw",
1442
- marginLeft: "calc(50% - 50vw)"
1443
- },
1444
- canHaveChildren: !0,
1445
- defaultChildren: [{
1446
- "@type": "@builder.io/sdk:Element",
1447
- responsiveStyles: {
1448
- large: {
1449
- textAlign: "center"
1450
- }
1451
- },
1452
- component: {
1453
- name: "Text",
1454
- options: {
1455
- 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>"
1456
- }
1457
- }
1458
- }]
1459
- }, Gt = {
1460
- name: "Slot",
1461
- isRSC: !0,
1462
- description: "Allow child blocks to be inserted into this content when used as a Symbol",
1463
- docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
1464
- image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
1465
- // Maybe wrap this for canHaveChildren so bind children to this hm
1466
- inputs: [{
1467
- name: "name",
1468
- type: "string",
1469
- required: !0,
1470
- defaultValue: "children"
1471
- }]
1472
- };
1473
- function Jt(e) {
1474
- var t, n, o;
1475
- return /* @__PURE__ */ l(
1476
- "div",
1477
- {
1478
- style: {
1479
- pointerEvents: "auto"
1480
- },
1481
- ...!((t = e.builderContext.context) != null && t.symbolId) && {
1482
- "builder-slot": e.name
1483
- },
1484
- children: /* @__PURE__ */ l(
1485
- z,
1486
- {
1487
- parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1488
- path: `symbol.data.${e.name}`,
1489
- context: e.builderContext,
1490
- blocks: (o = e.builderContext.rootState) == null ? void 0 : o[e.name]
1491
- }
1492
- )
1493
- }
1494
- );
1495
- }
1496
- const Qt = {
1497
- name: "Symbol",
1498
- noWrap: !0,
1499
- static: !0,
1500
- isRSC: !0,
1501
- inputs: [{
1502
- name: "symbol",
1503
- type: "uiSymbol"
1504
- }, {
1505
- name: "dataOnly",
1506
- helperText: "Make this a data symbol that doesn't display any UI",
1507
- type: "boolean",
1508
- defaultValue: !1,
1509
- advanced: !0,
1510
- hideFromUI: !0
1511
- }, {
1512
- name: "inheritState",
1513
- helperText: "Inherit the parent component state and data",
1514
- type: "boolean",
1515
- defaultValue: !1,
1516
- advanced: !0
1517
- }, {
1518
- name: "renderToLiquid",
1519
- helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1520
- type: "boolean",
1521
- defaultValue: !1,
1522
- advanced: !0,
1523
- hideFromUI: !0
1524
- }, {
1525
- name: "useChildren",
1526
- hideFromUI: !0,
1527
- type: "boolean"
1528
- }]
1529
- }, Xt = {
1530
- name: "Text",
1531
- static: !0,
1532
- isRSC: !0,
1533
- 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",
1534
- inputs: [{
1535
- name: "text",
1536
- type: "html",
1537
- required: !0,
1538
- autoFocus: !0,
1539
- bubble: !0,
1540
- defaultValue: "Enter some text..."
1541
- }],
1542
- defaultStyles: {
1543
- lineHeight: "normal",
1544
- height: "auto",
1545
- textAlign: "center"
1546
- }
1547
- };
1548
- function Zt(e) {
1549
- var t;
1550
- return /* @__PURE__ */ l(
1551
- "div",
1552
- {
1553
- className: "builder-text",
1554
- dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
1555
- style: {
1556
- outline: "none"
1557
- }
1558
- }
1559
- );
1560
- }
1561
- const en = {
1562
- name: "Custom Code",
1563
- static: !0,
1564
- requiredPermissions: ["editCode"],
1565
- inputs: [{
1566
- name: "code",
1567
- type: "html",
1568
- required: !0,
1569
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1570
- code: !0
1571
- }, {
1572
- name: "replaceNodes",
1573
- type: "boolean",
1574
- helperText: "Preserve server rendered dom nodes",
1575
- advanced: !0
1576
- }, {
1577
- name: "scriptsClientOnly",
1578
- type: "boolean",
1579
- defaultValue: !1,
1580
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1581
- advanced: !0
1582
- }]
1583
- }, tn = {
1584
- name: "Embed",
1585
- static: !0,
1586
- inputs: [{
1587
- name: "url",
1588
- type: "url",
1589
- required: !0,
1590
- defaultValue: "",
1591
- helperText: "e.g. enter a youtube url, google map, etc",
1592
- onChange: (e) => {
1593
- const t = e.get("url");
1594
- if (t) {
1595
- e.set("content", "Loading...");
1596
- const n = _iframelyApiKey;
1597
- return fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=${n}`).then((o) => o.json()).then((o) => {
1598
- e.get("url") === t && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
1599
- }).catch((o) => {
1600
- e.set("content", "There was an error embedding this URL, please try again or another URL");
1601
- });
1602
- } else
1603
- e.delete("content");
1604
- }
1605
- }, {
1606
- name: "content",
1607
- type: "html",
1608
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1609
- hideFromUI: !0
1610
- }]
1611
- }, nn = ["text/javascript", "application/javascript", "application/ecmascript"], So = (e) => nn.includes(e.type), on = {
1612
- // friendlyName?
1613
- name: "Raw:Img",
1614
- hideFromInsertMenu: !0,
1615
- 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",
1616
- inputs: [{
1617
- name: "image",
1618
- bubble: !0,
1619
- type: "file",
1620
- allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1621
- required: !0
1622
- }],
1623
- noWrap: !0,
1624
- static: !0
1625
- }, rn = {
1626
- name: "Video",
1627
- canHaveChildren: !0,
1628
- defaultStyles: {
1629
- minHeight: "20px",
1630
- minWidth: "20px"
1631
- },
1632
- 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",
1633
- inputs: [{
1634
- name: "video",
1635
- type: "file",
1636
- allowedFileTypes: ["mp4"],
1637
- bubble: !0,
1638
- defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
1639
- required: !0
1640
- }, {
1641
- name: "posterImage",
1642
- type: "file",
1643
- allowedFileTypes: ["jpeg", "png"],
1644
- helperText: "Image to show before the video plays"
1645
- }, {
1646
- name: "autoPlay",
1647
- type: "boolean",
1648
- defaultValue: !0
1649
- }, {
1650
- name: "controls",
1651
- type: "boolean",
1652
- defaultValue: !1
1653
- }, {
1654
- name: "muted",
1655
- type: "boolean",
1656
- defaultValue: !0
1657
- }, {
1658
- name: "loop",
1659
- type: "boolean",
1660
- defaultValue: !0
1661
- }, {
1662
- name: "playsInline",
1663
- type: "boolean",
1664
- defaultValue: !0
1665
- }, {
1666
- name: "fit",
1667
- type: "text",
1668
- defaultValue: "cover",
1669
- enum: ["contain", "cover", "fill", "auto"]
1670
- }, {
1671
- name: "preload",
1672
- type: "text",
1673
- defaultValue: "metadata",
1674
- enum: ["auto", "metadata", "none"]
1675
- }, {
1676
- name: "fitContent",
1677
- type: "boolean",
1678
- helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1679
- defaultValue: !0,
1680
- advanced: !0
1681
- }, {
1682
- name: "position",
1683
- type: "text",
1684
- defaultValue: "center",
1685
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1686
- }, {
1687
- name: "height",
1688
- type: "number",
1689
- advanced: !0
1690
- }, {
1691
- name: "width",
1692
- type: "number",
1693
- advanced: !0
1694
- }, {
1695
- name: "aspectRatio",
1696
- type: "number",
1697
- advanced: !0,
1698
- defaultValue: 0.7004048582995948
1699
- }, {
1700
- name: "lazyLoad",
1701
- type: "boolean",
1702
- helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1703
- defaultValue: !0,
1704
- advanced: !0
1705
- }]
1706
- }, an = () => [{
1707
- component: Me,
1708
- ...en
1709
- }, {
1710
- component: je,
1711
- ...tn
1712
- }, {
1713
- component: He,
1714
- ...on
1715
- }, {
1716
- component: Ke,
1717
- ...rn
1718
- }], te = () => [{
1719
- component: ze,
1720
- ...Ht
1721
- }, {
1722
- component: Pt,
1723
- ...Kt
1724
- }, {
1725
- component: qe,
1726
- ...zt
1727
- }, {
1728
- component: Ye,
1729
- ...qt
1730
- }, {
1731
- component: Ge,
1732
- ...Yt
1733
- }, {
1734
- component: Jt,
1735
- ...Gt
1736
- }, {
1737
- component: so,
1738
- ...Qt
1739
- }, {
1740
- component: Zt,
1741
- ...Xt
1742
- }, ...an()], vo = (e) => ({
1743
- type: "builder.registerComponent",
1744
- data: U(e)
1745
- }), sn = (e) => {
1746
- const t = e.toString().trim();
1747
- return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1748
- }, cn = (e) => typeof e == "function" ? sn(e) : O(e), U = ({
1749
- inputs: e,
1750
- ...t
1751
- }) => ({
1752
- ...O(t),
1753
- inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
1754
- ...o,
1755
- [i]: cn(r)
1756
- }), {}))
1757
- }), ln = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1758
- function getAndSetVariantId() {
1759
- function setCookie(name, value, days) {
1760
- let expires = '';
1761
- if (days) {
1762
- const date = new Date();
1763
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
1764
- expires = '; expires=' + date.toUTCString();
1765
- }
1766
- document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
1767
- }
1768
- function getCookie(name) {
1769
- const nameEQ = name + '=';
1770
- const ca = document.cookie.split(';');
1771
- for (let i = 0; i < ca.length; i++) {
1772
- let c = ca[i];
1773
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
1774
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
1775
- }
1776
- return null;
1777
- }
1778
- const cookieName = \`builder.tests.\${contentId}\`;
1779
- const variantInCookie = getCookie(cookieName);
1780
- const availableIDs = variants.map(vr => vr.id).concat(contentId);
1781
- if (variantInCookie && availableIDs.includes(variantInCookie)) {
1782
- return variantInCookie;
1783
- }
1784
- let n = 0;
1785
- const random = Math.random();
1786
- for (let i = 0; i < variants.length; i++) {
1787
- const variant = variants[i];
1788
- const testRatio = variant.testRatio;
1789
- n += testRatio;
1790
- if (random < n) {
1791
- setCookie(cookieName, variant.id);
1792
- return variant.id;
1793
- }
1794
- }
1795
- setCookie(cookieName, contentId);
1796
- return contentId;
1797
- }
1798
- const winningVariantId = getAndSetVariantId();
1799
- const styleEl = document.currentScript?.previousElementSibling;
1800
- if (isHydrationTarget) {
1801
- styleEl.remove();
1802
- const thisScriptEl = document.currentScript;
1803
- thisScriptEl?.remove();
1804
- } else {
1805
- const newStyleStr = variants.concat({
1806
- id: contentId
1807
- }).filter(variant => variant.id !== winningVariantId).map(value => {
1808
- return \`.variant-\${value.id} { display: none; }
1809
- \`;
1810
- }).join('');
1811
- styleEl.innerHTML = newStyleStr;
1812
- }
1813
- }`, dn = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1814
- if (!navigator.cookieEnabled) {
1815
- return;
1816
- }
1817
- function getCookie(name) {
1818
- const nameEQ = name + '=';
1819
- const ca = document.cookie.split(';');
1820
- for (let i = 0; i < ca.length; i++) {
1821
- let c = ca[i];
1822
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
1823
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
1824
- }
1825
- return null;
1826
- }
1827
- const cookieName = \`builder.tests.\${defaultContentId}\`;
1828
- const winningVariant = getCookie(cookieName);
1829
- const parentDiv = document.currentScript?.parentElement;
1830
- const isDefaultContent = variantContentId === defaultContentId;
1831
- const isWinningVariant = winningVariant === variantContentId;
1832
- if (isWinningVariant && !isDefaultContent) {
1833
- parentDiv?.removeAttribute('hidden');
1834
- parentDiv?.removeAttribute('aria-hidden');
1835
- } else if (!isWinningVariant && isDefaultContent) {
1836
- parentDiv?.setAttribute('hidden', 'true');
1837
- parentDiv?.setAttribute('aria-hidden', 'true');
1838
- }
1839
- if (isHydrationTarget) {
1840
- if (!isWinningVariant) {
1841
- parentDiv?.remove();
1842
- }
1843
- const thisScriptEl = document.currentScript;
1844
- thisScriptEl?.remove();
1845
- }
1846
- return;
1847
- }`, Te = "builderIoAbTest", Ee = "builderIoRenderContent", W = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1848
- ...t,
1849
- testVariationId: t.id,
1850
- id: e == null ? void 0 : e.id
1851
- })), un = ({
1852
- canTrack: e,
1853
- content: t
1854
- }) => !(!(W(t).length > 0) || !e || k()), mn = (e) => e === "react" || e === "reactNative", Re = mn(x), fn = () => `
1855
- window.${Te} = ${ln}
1856
- window.${Ee} = ${dn}
1857
- `, hn = (e, t) => `
1858
- window.${Te}(
1859
- "${t}",${JSON.stringify(e)}, ${Re}
1860
- )`, pn = ({
1861
- contentId: e,
1862
- variationId: t
1863
- }) => `window.${Ee}(
1864
- "${t}", "${e}", ${Re}
1865
- )`;
1866
- function D(e) {
1867
- return /* @__PURE__ */ l(
1868
- "script",
1869
- {
1870
- dangerouslySetInnerHTML: { __html: e.scriptStr },
1871
- "data-id": e.id
1872
- }
1873
- );
1874
- }
1875
- const gn = (e) => {
1876
- const t = e.get("preview"), n = e.get("overrides." + t);
1877
- return n || I.warn("No previewed ID found in search params."), n;
1878
- };
1879
- function bn() {
1880
- globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Fe({
1881
- max: 500,
1882
- // how long to live in ms
1883
- ttl: 1e3 * 60 * 5
1884
- }));
1885
- }
1886
- function yn(e) {
1887
- bn();
1888
- const t = gn(e);
1889
- return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
1890
- }
1891
- function Sn() {
1892
- return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
1893
- }
1894
- function vn() {
1895
- const e = Sn().fetch;
1896
- if (typeof e > "u")
1897
- throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
1898
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
1899
- return e;
1900
- }
1901
- const kn = vn();
1902
- function _(e, t = null, n = ".") {
1903
- return Object.keys(e).reduce((o, i) => {
1904
- const r = e[i], a = [t, i].filter(Boolean).join(n);
1905
- return [typeof r == "object", r !== null, !(Array.isArray(r) && r.length === 0)].every(Boolean) ? {
1906
- ...o,
1907
- ..._(r, a, n)
1908
- } : {
1909
- ...o,
1910
- [a]: r
1911
- };
1912
- }, {});
1913
- }
1914
- function Ae(e, t, n = {}) {
1915
- for (const o in e) {
1916
- const i = e[o], r = t ? t + "." + o : o;
1917
- i && typeof i == "object" && !Array.isArray(i) && !Object.keys(i).find((a) => a.startsWith("$")) ? Ae(i, r, n) : n[r] = i;
1918
- }
1919
- return n;
1920
- }
1921
- const xn = "v3", ne = "builder.", Cn = "options.", Pe = (e) => {
1922
- if (!e)
1923
- return {};
1924
- const t = ue(e), n = {};
1925
- return Object.keys(t).forEach((o) => {
1926
- if (o.startsWith(ne)) {
1927
- const i = o.replace(ne, "").replace(Cn, "");
1928
- n[i] = t[o];
1929
- }
1930
- }), n;
1931
- }, wn = () => {
1932
- if (!k())
1933
- return {};
1934
- const e = new URLSearchParams(window.location.search);
1935
- return Pe(e);
1936
- }, oe = (e) => typeof e == "number" && !isNaN(e) && e >= 0, Y = (e) => {
1937
- const {
1938
- limit: t = 30,
1939
- userAttributes: n,
1940
- query: o,
1941
- model: i,
1942
- apiKey: r,
1943
- enrich: a,
1944
- locale: s,
1945
- apiVersion: c = xn,
1946
- fields: u,
1947
- omit: h,
1948
- offset: d,
1949
- cacheSeconds: f,
1950
- staleCacheSeconds: g,
1951
- sort: v,
1952
- includeUnpublished: b
1953
- } = e;
1954
- if (!r)
1955
- throw new Error("Missing API key");
1956
- if (!["v3"].includes(c))
1957
- throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
1958
- const E = t !== 1, m = new URL(`https://cdn.builder.io/api/${c}/content/${i}`);
1959
- if (m.searchParams.set("apiKey", r), m.searchParams.set("limit", String(t)), m.searchParams.set("noTraverse", String(E)), m.searchParams.set("includeRefs", String(!0)), s && m.searchParams.set("locale", s), a && m.searchParams.set("enrich", String(a)), m.searchParams.set("omit", h || "meta.componentsUsed"), u && m.searchParams.set("fields", u), Number.isFinite(d) && d > -1 && m.searchParams.set("offset", String(Math.floor(d))), typeof b == "boolean" && m.searchParams.set("includeUnpublished", String(b)), f && oe(f) && m.searchParams.set("cacheSeconds", String(f)), g && oe(g) && m.searchParams.set("staleCacheSeconds", String(g)), v) {
1960
- const S = _({
1961
- sort: v
1962
- });
1963
- for (const w in S)
1964
- m.searchParams.set(w, JSON.stringify(S[w]));
1965
- }
1966
- const p = {
1967
- ...wn(),
1968
- ...ue(e.options || {})
1969
- }, y = _(p);
1970
- for (const S in y)
1971
- m.searchParams.set(S, String(y[S]));
1972
- if (n && m.searchParams.set("userAttributes", JSON.stringify(n)), o) {
1973
- const S = Ae({
1974
- query: o
1975
- });
1976
- for (const w in S)
1977
- m.searchParams.set(w, JSON.stringify(S[w]));
1978
- }
1979
- return m;
1980
- }, In = (e) => "results" in e;
1981
- async function Be(e) {
1982
- const t = await Rn({
1983
- ...e,
1984
- limit: 1
1985
- });
1986
- return t && t[0] || null;
1987
- }
1988
- const Tn = async (e) => {
1989
- const t = Y(e);
1990
- return await (await (e.fetch ?? kn)(t.href, e.fetchOptions)).json();
1991
- }, En = async (e, t, n = Y(e)) => {
1992
- const o = L(e.canTrack);
1993
- if (n.search.includes("preview=")) {
1994
- const r = [];
1995
- for (const a of t.results) {
1996
- const s = yn(n.searchParams);
1997
- r.push(s || a);
1998
- }
1999
- t.results = r;
2000
- }
2001
- if (!o || !(k() || x === "reactNative"))
2002
- return t.results;
2003
- try {
2004
- const r = [];
2005
- for (const a of t.results)
2006
- r.push(await jt({
2007
- item: a,
2008
- canTrack: o
2009
- }));
2010
- t.results = r;
2011
- } catch (r) {
2012
- I.error("Could not process A/B tests. ", r);
2013
- }
2014
- return t.results;
2015
- };
2016
- async function Rn(e) {
2017
- try {
2018
- const t = Y(e), n = await Tn(e);
2019
- return In(n) ? En(e, n) : (I.error("Error fetching data. ", {
2020
- url: t,
2021
- content: n,
2022
- options: e
2023
- }), null);
2024
- } catch (t) {
2025
- return I.error("Error fetching data. ", t), null;
2026
- }
2027
- }
2028
- function ko(e) {
2029
- const t = e || (k() ? window.location.search : void 0);
2030
- return t ? me(t).indexOf("builder.preview=") !== -1 : !1;
2031
- }
2032
- function An() {
2033
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
2034
- const t = Math.random() * 16 | 0;
2035
- return (e == "x" ? t : t & 3 | 8).toString(16);
2036
- });
2037
- }
2038
- function Ve() {
2039
- return An().replace(/-/g, "");
2040
- }
2041
- const We = "builderSessionId", Pn = async ({
2042
- canTrack: e
2043
- }) => {
2044
- if (!e)
2045
- return;
2046
- const t = await ke({
2047
- name: We,
2048
- canTrack: e
2049
- });
2050
- if (T(t))
2051
- return t;
2052
- {
2053
- const n = Bn();
2054
- return Vn({
2055
- id: n,
2056
- canTrack: e
2057
- }), n;
2058
- }
2059
- }, Bn = () => Ve(), Vn = ({
2060
- id: e,
2061
- canTrack: t
2062
- }) => xe({
2063
- name: We,
2064
- value: e,
2065
- canTrack: t
2066
- }), Ne = () => k() && typeof localStorage < "u" ? localStorage : void 0, Wn = ({
2067
- key: e,
2068
- canTrack: t
2069
- }) => {
2070
- var n;
2071
- try {
2072
- return t ? (n = Ne()) == null ? void 0 : n.getItem(e) : void 0;
2073
- } catch (o) {
2074
- console.debug("[LocalStorage] GET error: ", o);
2075
- return;
2076
- }
2077
- }, Nn = ({
2078
- key: e,
2079
- canTrack: t,
2080
- value: n
2081
- }) => {
2082
- var o;
2083
- try {
2084
- t && ((o = Ne()) == null || o.setItem(e, n));
2085
- } catch (i) {
2086
- console.debug("[LocalStorage] SET error: ", i);
2087
- }
2088
- }, Oe = "builderVisitorId", On = ({
2089
- canTrack: e
2090
- }) => {
2091
- if (!e)
2092
- return;
2093
- const t = Wn({
2094
- key: Oe,
2095
- canTrack: e
2096
- });
2097
- if (T(t))
2098
- return t;
2099
- {
2100
- const n = $n();
2101
- return Fn({
2102
- id: n,
2103
- canTrack: e
2104
- }), n;
2105
- }
2106
- }, $n = () => Ve(), Fn = ({
2107
- id: e,
2108
- canTrack: t
2109
- }) => Nn({
2110
- key: Oe,
2111
- value: e,
2112
- canTrack: t
2113
- }), Ln = async ({
2114
- canTrack: e
2115
- }) => {
2116
- if (!e)
2117
- return {
2118
- visitorId: void 0,
2119
- sessionId: void 0
2120
- };
2121
- const t = await Pn({
2122
- canTrack: e
2123
- }), n = On({
2124
- canTrack: e
2125
- });
2126
- return {
2127
- sessionId: t,
2128
- visitorId: n
2129
- };
2130
- }, Un = async ({
2131
- type: e,
2132
- canTrack: t,
2133
- apiKey: n,
2134
- metadata: o,
2135
- ...i
2136
- }) => ({
2137
- type: e,
2138
- data: {
2139
- ...i,
2140
- metadata: {
2141
- url: location.href,
2142
- ...o
2143
- },
2144
- ...await Ln({
2145
- canTrack: t
2146
- }),
2147
- userAttributes: he(),
2148
- ownerId: n
2149
- }
2150
- });
2151
- async function Dn(e) {
2152
- if (!e.apiKey) {
2153
- I.error("Missing API key for track call. Please provide your API key.");
2154
- return;
2155
- }
2156
- if (e.canTrack && !fe() && (k() || x === "reactNative"))
2157
- return fetch("https://cdn.builder.io/api/v1/track", {
2158
- method: "POST",
2159
- body: JSON.stringify({
2160
- events: [await Un(e)]
2161
- }),
2162
- headers: {
2163
- "content-type": "application/json"
2164
- },
2165
- mode: "cors"
2166
- }).catch((t) => {
2167
- console.error("Failed to track: ", t);
2168
- });
2169
- }
2170
- const xo = (e) => Dn({
2171
- ...e,
2172
- canTrack: !0
2173
- });
2174
- function ie(e) {
2175
- return Math.round(e * 1e3) / 1e3;
2176
- }
2177
- const _n = (e, t, n = !0) => {
2178
- if (!(e instanceof HTMLElement))
2179
- return null;
2180
- let o = n ? e : e.parentElement;
2181
- do {
2182
- if (!o)
2183
- return null;
2184
- if (t(o))
2185
- return o;
2186
- } while (o = o.parentElement);
2187
- return null;
2188
- }, Mn = (e) => _n(e, (t) => {
2189
- const n = t.getAttribute("builder-id") || t.id;
2190
- return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2191
- }), re = ({
2192
- event: e,
2193
- target: t
2194
- }) => {
2195
- const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, r = ie(o / n.width), a = ie(i / n.height);
2196
- return {
2197
- x: r,
2198
- y: a
2199
- };
2200
- }, Co = (e) => {
2201
- const t = e.target, n = t && Mn(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2202
- return {
2203
- targetBuilderElement: o || void 0,
2204
- metadata: {
2205
- targetOffset: t ? re({
2206
- event: e,
2207
- target: t
2208
- }) : void 0,
2209
- builderTargetOffset: n ? re({
2210
- event: e,
2211
- target: n
2212
- }) : void 0,
2213
- builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
2214
- }
2215
- };
2216
- }, jn = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
2217
- function $e(e, t) {
2218
- if (!t.origin.startsWith("http") && !t.origin.startsWith("https"))
2219
- return !1;
2220
- const n = new URL(t.origin), o = n.hostname;
2221
- return (e || jn).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
2222
- }
2223
- const Hn = "0.14.29", ae = {};
2224
- function Kn(e, t) {
2225
- let n = ae[e];
2226
- if (n || (n = ae[e] = []), n.push(t), k()) {
2227
- const o = {
2228
- type: "builder.register",
2229
- data: {
2230
- type: e,
2231
- info: t
2232
- }
2233
- };
2234
- try {
2235
- parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
2236
- } catch (i) {
2237
- console.debug("Could not postmessage", i);
2238
- }
2239
- }
2240
- }
2241
- const wo = () => {
2242
- Kn("insertMenu", {
2243
- name: "_default",
2244
- default: !0,
2245
- items: [{
2246
- name: "Box"
2247
- }, {
2248
- name: "Text"
2249
- }, {
2250
- name: "Image"
2251
- }, {
2252
- name: "Columns"
2253
- }, {
2254
- name: "Core:Section"
2255
- }, {
2256
- name: "Core:Button"
2257
- }, {
2258
- name: "Embed"
2259
- }, {
2260
- name: "Custom Code"
2261
- }]
2262
- });
2263
- };
2264
- let se = !1;
2265
- const zn = (e = {}) => {
2266
- var t, n;
2267
- se || (se = !0, k() && ((t = window.parent) == null || t.postMessage({
2268
- type: "builder.sdkInfo",
2269
- data: {
2270
- target: x,
2271
- version: Hn,
2272
- supportsPatchUpdates: !1,
2273
- // Supports builder-model="..." attribute which is needed to
2274
- // scope our '+ add block' button styling
2275
- supportsAddBlockScoping: !0,
2276
- supportsCustomBreakpoints: !0
2277
- }
2278
- }, "*"), (n = window.parent) == null || n.postMessage({
2279
- type: "builder.updateContent",
2280
- data: {
2281
- options: e
2282
- }
2283
- }, "*"), window.addEventListener("message", (o) => {
2284
- var r, a;
2285
- if (!$e(e.trustedHosts, o))
2286
- return;
2287
- const {
2288
- data: i
2289
- } = o;
2290
- if (i != null && i.type)
2291
- switch (i.type) {
2292
- case "builder.evaluate": {
2293
- const s = i.data.text, c = i.data.arguments || [], u = i.data.id, h = new Function(s);
2294
- let d, f = null;
2295
- try {
2296
- d = h.apply(null, c);
2297
- } catch (g) {
2298
- f = g;
2299
- }
2300
- f ? (r = window.parent) == null || r.postMessage({
2301
- type: "builder.evaluateError",
2302
- data: {
2303
- id: u,
2304
- error: f.message
2305
- }
2306
- }, "*") : d && typeof d.then == "function" ? d.then((g) => {
2307
- var v;
2308
- (v = window.parent) == null || v.postMessage({
2309
- type: "builder.evaluateResult",
2310
- data: {
2311
- id: u,
2312
- result: g
2313
- }
2314
- }, "*");
2315
- }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2316
- type: "builder.evaluateResult",
2317
- data: {
2318
- result: d,
2319
- id: u
2320
- }
2321
- }, "*");
2322
- break;
2323
- }
2324
- }
2325
- })));
2326
- }, qn = ({
2327
- model: e,
2328
- trustedHosts: t,
2329
- callbacks: n
2330
- }) => (o) => {
2331
- if (!$e(t, o))
2332
- return;
2333
- const {
2334
- data: i
2335
- } = o;
2336
- if (i)
2337
- switch (i.type) {
2338
- case "builder.configureSdk": {
2339
- n.configureSdk(i.data);
2340
- break;
2341
- }
2342
- case "builder.triggerAnimation": {
2343
- n.animation(i.data);
2344
- break;
2345
- }
2346
- case "builder.contentUpdate": {
2347
- const r = i.data, a = r.key || r.alias || r.entry || r.modelName, s = r.data;
2348
- a === e && n.contentUpdate(s);
2349
- break;
2350
- }
2351
- }
2352
- }, Io = (e, t, n) => {
2353
- if (!k)
2354
- return I.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
2355
- };
2356
- zn();
2357
- const o = qn({
2358
- callbacks: {
2359
- contentUpdate: t,
2360
- animation: () => {
2361
- },
2362
- configureSdk: () => {
2363
- }
2364
- },
2365
- model: e,
2366
- trustedHosts: n == null ? void 0 : n.trustedHosts
2367
- });
2368
- return window.addEventListener("message", o), () => {
2369
- window.removeEventListener("message", o);
2370
- };
2371
- };
2372
- function ce(e, ...t) {
2373
- const n = Object(e);
2374
- for (let o = 1; o < arguments.length; o++) {
2375
- const i = arguments[o];
2376
- if (i != null)
2377
- for (const r in i)
2378
- Object.prototype.hasOwnProperty.call(i, r) && (n[r] = i[r]);
2379
- }
2380
- return n;
2381
- }
2382
- function Yn(e) {
2383
- console.warn(`Cannot animate element: element with ID ${e} not found!`);
2384
- }
2385
- function Gn(e, t) {
2386
- const n = Jn(e), o = getComputedStyle(t), i = e.steps[0].styles, r = e.steps[e.steps.length - 1].styles, a = [i, r];
2387
- for (const s of a)
2388
- for (const c of n)
2389
- c in s || (s[c] = o[c]);
2390
- }
2391
- function Jn(e) {
2392
- const t = [];
2393
- for (const n of e.steps)
2394
- for (const o in n.styles)
2395
- t.indexOf(o) === -1 && t.push(o);
2396
- return t;
2397
- }
2398
- function To(e) {
2399
- const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
2400
- if (!t.length) {
2401
- Yn(e.elementId || e.id || "");
2402
- return;
2403
- }
2404
- Array.from(t).forEach((n) => {
2405
- Gn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ce(n.style, e.steps[0].styles), setTimeout(() => {
2406
- n.style.transition = `all ${e.duration}s ${K(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ce(n.style, e.steps[1].styles), setTimeout(() => {
2407
- n.style.transition = "", n.style.transitionDelay = "";
2408
- }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
2409
- });
2410
- });
2411
- }
2412
- const Qn = (e) => {
2413
- var r;
2414
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
2415
- let i = "";
2416
- if (o && t && n && (i += `
2417
- @font-face {
2418
- font-family: "${t}";
2419
- src: local("${n}"), url('${o}') format('woff2');
2420
- font-display: fallback;
2421
- font-weight: 400;
2422
- }
2423
- `.trim()), e.files)
2424
- for (const a in e.files) {
2425
- if (!(String(Number(a)) === a))
2426
- continue;
2427
- const c = e.files[a];
2428
- c && c !== o && (i += `
2429
- @font-face {
2430
- font-family: "${t}";
2431
- src: url('${c}') format('woff2');
2432
- font-display: fallback;
2433
- font-weight: ${a};
2434
- }
2435
- `.trim());
2436
- }
2437
- return i;
2438
- }, Xn = ({
2439
- customFonts: e
2440
- }) => {
2441
- var t;
2442
- return ((t = e == null ? void 0 : e.map((n) => Qn(n))) == null ? void 0 : t.join(" ")) || "";
2443
- }, Zn = ({
2444
- cssCode: e,
2445
- contentId: t
2446
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", eo = `
2447
- .builder-button {
2448
- all: unset;
2449
- }
2450
-
2451
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2452
- margin: 0;
2453
- }
2454
- .builder-text > p, .builder-text > .builder-paragraph {
2455
- color: inherit;
2456
- line-height: inherit;
2457
- letter-spacing: inherit;
2458
- font-weight: inherit;
2459
- font-size: inherit;
2460
- text-align: inherit;
2461
- font-family: inherit;
2462
- }
2463
- `, to = (e) => e ? "" : eo, Eo = (e) => `variant-${e}`;
2464
- function no(e) {
2465
- const t = `
2466
- ${Zn({
2467
- cssCode: e.cssCode,
2468
- contentId: e.contentId
2469
- })}
2470
- ${Xn({
2471
- customFonts: e.customFonts
2472
- })}
2473
- ${to(e.isNestedRender)}
2474
- `.trim();
2475
- return /* @__PURE__ */ l($, { id: "builderio-content", styles: t });
2476
- }
2477
- const oo = ({
2478
- content: e,
2479
- data: t,
2480
- locale: n
2481
- }) => {
2482
- var r, a, s;
2483
- const o = {}, i = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
2484
- return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
2485
- c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
2486
- }), {
2487
- ...o,
2488
- ...i,
2489
- ...t,
2490
- ...n ? {
2491
- locale: n
2492
- } : {}
2493
- };
2494
- }, io = ({
2495
- content: e,
2496
- data: t
2497
- }) => e ? {
2498
- ...e,
2499
- data: {
2500
- ...e == null ? void 0 : e.data,
2501
- ...t
2502
- },
2503
- meta: e == null ? void 0 : e.meta
2504
- } : void 0;
2505
- function le(e) {
2506
- var i, r, a, s, c, u, h, d, f;
2507
- const t = pn({
2508
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2509
- variationId: (i = e.content) == null ? void 0 : i.testVariationId,
2510
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2511
- contentId: (r = e.content) == null ? void 0 : r.id
2512
- }), n = [
2513
- ...te(),
2514
- ...e.customComponents || []
2515
- ].reduce(
2516
- (g, { component: v, ...b }) => ({
2517
- ...g,
2518
- [b.name]: {
2519
- component: v,
2520
- ...U(b)
2521
- }
2522
- }),
2523
- {}
2524
- ), o = {
2525
- content: io({
2526
- content: e.content,
2527
- data: e.data
2528
- }),
2529
- localState: void 0,
2530
- rootState: oo({
2531
- content: e.content,
2532
- data: e.data,
2533
- locale: e.locale
2534
- }),
2535
- rootSetState: void 0,
2536
- context: e.context || {},
2537
- canTrack: e.canTrack,
2538
- apiKey: e.apiKey,
2539
- apiVersion: e.apiVersion,
2540
- componentInfos: [
2541
- ...te(),
2542
- ...e.customComponents || []
2543
- ].reduce(
2544
- (g, { component: v, ...b }) => ({
2545
- ...g,
2546
- [b.name]: U(b)
2547
- }),
2548
- {}
2549
- ),
2550
- inheritedStyles: {},
2551
- BlocksWrapper: e.blocksWrapper || "div",
2552
- BlocksWrapperProps: e.blocksWrapperProps || {}
2553
- };
2554
- return /* @__PURE__ */ R(
2555
- Je,
2556
- {
2557
- content: e.content,
2558
- data: e.data,
2559
- model: e.model,
2560
- context: e.context,
2561
- apiKey: e.apiKey,
2562
- canTrack: e.canTrack,
2563
- locale: e.locale,
2564
- enrich: e.enrich,
2565
- showContent: e.showContent,
2566
- builderContextSignal: o,
2567
- contentWrapper: e.contentWrapper,
2568
- contentWrapperProps: e.contentWrapperProps,
2569
- trustedHosts: e.trustedHosts,
2570
- children: [
2571
- e.isSsrAbTest ? /* @__PURE__ */ l(
2572
- D,
2573
- {
2574
- id: "builderio-variant-visibility",
2575
- scriptStr: t
2576
- }
2577
- ) : null,
2578
- /* @__PURE__ */ l(
2579
- no,
2580
- {
2581
- isNestedRender: e.isNestedRender,
2582
- contentId: (a = o.content) == null ? void 0 : a.id,
2583
- cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2584
- customFonts: (h = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : h.customFonts
2585
- }
2586
- ),
2587
- /* @__PURE__ */ l(
2588
- z,
2589
- {
2590
- blocks: (f = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : f.blocks,
2591
- context: o,
2592
- registeredComponents: n,
2593
- linkComponent: e.linkComponent
2594
- }
2595
- )
2596
- ]
2597
- }
2598
- );
2599
- }
2600
- function ro(e) {
2601
- var r;
2602
- const t = un({
2603
- canTrack: L(e.canTrack),
2604
- content: e.content
2605
- }), n = function() {
2606
- var s;
2607
- return hn(
2608
- W(e.content).map((c) => ({
2609
- id: c.testVariationId,
2610
- testRatio: c.testRatio
2611
- })),
2612
- ((s = e.content) == null ? void 0 : s.id) || ""
2613
- );
2614
- }, o = function() {
2615
- return W(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
2616
- }, i = function() {
2617
- var s;
2618
- return t ? {
2619
- ...e.content,
2620
- testVariationId: (s = e.content) == null ? void 0 : s.id
2621
- } : Mt({
2622
- item: e.content,
2623
- canTrack: L(e.canTrack)
2624
- });
2625
- };
2626
- return /* @__PURE__ */ R(C, { children: [
2627
- !e.isNestedRender && x !== "reactNative" ? /* @__PURE__ */ l(
2628
- D,
2629
- {
2630
- id: "builderio-init-variants-fns",
2631
- scriptStr: fn()
2632
- }
2633
- ) : null,
2634
- t ? /* @__PURE__ */ R(C, { children: [
2635
- /* @__PURE__ */ l(
2636
- $,
2637
- {
2638
- id: "builderio-variants",
2639
- styles: o()
2640
- }
2641
- ),
2642
- /* @__PURE__ */ l(
2643
- D,
2644
- {
2645
- id: "builderio-variants-visibility",
2646
- scriptStr: n()
2647
- }
2648
- ),
2649
- (r = W(e.content)) == null ? void 0 : r.map((a) => /* @__PURE__ */ l(
2650
- le,
2651
- {
2652
- isNestedRender: e.isNestedRender,
2653
- content: a,
2654
- showContent: !1,
2655
- model: e.model,
2656
- data: e.data,
2657
- context: e.context,
2658
- apiKey: e.apiKey,
2659
- apiVersion: e.apiVersion,
2660
- customComponents: e.customComponents,
2661
- linkComponent: e.linkComponent,
2662
- canTrack: e.canTrack,
2663
- locale: e.locale,
2664
- enrich: e.enrich,
2665
- isSsrAbTest: t,
2666
- blocksWrapper: e.blocksWrapper,
2667
- blocksWrapperProps: e.blocksWrapperProps,
2668
- contentWrapper: e.contentWrapper,
2669
- contentWrapperProps: e.contentWrapperProps,
2670
- trustedHosts: e.trustedHosts
2671
- },
2672
- a.testVariationId
2673
- ))
2674
- ] }) : null,
2675
- /* @__PURE__ */ l(
2676
- le,
2677
- {
2678
- isNestedRender: e.isNestedRender,
2679
- content: i(),
2680
- showContent: !0,
2681
- model: e.model,
2682
- data: e.data,
2683
- context: e.context,
2684
- apiKey: e.apiKey,
2685
- apiVersion: e.apiVersion,
2686
- customComponents: e.customComponents,
2687
- linkComponent: e.linkComponent,
2688
- canTrack: e.canTrack,
2689
- locale: e.locale,
2690
- enrich: e.enrich,
2691
- isSsrAbTest: t,
2692
- blocksWrapper: e.blocksWrapper,
2693
- blocksWrapperProps: e.blocksWrapperProps,
2694
- contentWrapper: e.contentWrapper,
2695
- contentWrapperProps: e.contentWrapperProps,
2696
- trustedHosts: e.trustedHosts
2697
- }
2698
- )
2699
- ] });
2700
- }
2701
- const ao = async ({
2702
- builderContextValue: e,
2703
- symbol: t
2704
- }) => {
2705
- if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
2706
- (e != null && e.apiKey))
2707
- return Be({
2708
- model: t.model,
2709
- apiKey: e.apiKey,
2710
- apiVersion: e.apiVersion,
2711
- ...(t == null ? void 0 : t.entry) && {
2712
- query: {
2713
- id: t.entry
2714
- }
2715
- }
2716
- }).catch((n) => {
2717
- I.error("Could not fetch symbol content: ", n);
2718
- });
2719
- };
2720
- async function so(e) {
2721
- var r, a, s, c, u;
2722
- const t = function() {
2723
- return "div";
2724
- }, n = function() {
2725
- return "div";
2726
- }, o = function() {
2727
- var d, f;
2728
- return [
2729
- e.attributes[M()],
2730
- "builder-symbol",
2731
- (d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
2732
- (f = e.symbol) != null && f.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2733
- ].filter(Boolean).join(" ");
2734
- }, i = ((r = e.symbol) == null ? void 0 : r.content) || await ao({
2735
- symbol: e.symbol,
2736
- builderContextValue: e.builderContext
2737
- });
2738
- return /* @__PURE__ */ l("div", { ...e.attributes, className: o(), children: /* @__PURE__ */ l(
2739
- ro,
2740
- {
2741
- isNestedRender: !0,
2742
- apiVersion: e.builderContext.apiVersion,
2743
- apiKey: e.builderContext.apiKey,
2744
- context: {
2745
- ...e.builderContext.context,
2746
- symbolId: (a = e.builderBlock) == null ? void 0 : a.id
2747
- },
2748
- customComponents: Object.values(e.builderComponents),
2749
- data: {
2750
- ...(s = e.symbol) == null ? void 0 : s.data,
2751
- ...e.builderContext.localState,
2752
- ...(c = i == null ? void 0 : i.data) == null ? void 0 : c.state
2753
- },
2754
- canTrack: e.builderContext.canTrack,
2755
- model: (u = e.symbol) == null ? void 0 : u.model,
2756
- content: i,
2757
- linkComponent: e.builderLinkComponent,
2758
- blocksWrapper: t(),
2759
- contentWrapper: n()
2760
- }
2761
- ) });
2762
- }
2763
- const de = {};
2764
- function Ro(e) {
2765
- if (k()) {
2766
- Object.assign(de, e);
2767
- const t = {
2768
- type: "builder.settingsChange",
2769
- data: de
2770
- };
2771
- parent.postMessage(t, "*");
2772
- }
2773
- }
2774
- const Ao = async (e) => {
2775
- var o, i, r;
2776
- const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
2777
- ...e,
2778
- apiKey: e.apiKey,
2779
- model: e.model || "page",
2780
- userAttributes: {
2781
- ...e.userAttributes,
2782
- ...t ? {
2783
- urlPath: t
2784
- } : {}
2785
- },
2786
- options: Pe(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
2787
- };
2788
- return {
2789
- apiKey: n.apiKey,
2790
- model: n.model,
2791
- content: await Be(n)
2792
- };
2793
- };
2794
- export {
2795
- Pe as A,
2796
- z as B,
2797
- Pt as C,
2798
- xo as D,
2799
- Io as E,
2800
- Ao as F,
2801
- En as G,
2802
- Rn as H,
2803
- so as S,
2804
- Zt as T,
2805
- Dn as _,
2806
- Tt as a,
2807
- bo as b,
2808
- fe as c,
2809
- yo as d,
2810
- So as e,
2811
- k as f,
2812
- M as g,
2813
- L as h,
2814
- go as i,
2815
- ko as j,
2816
- Eo as k,
2817
- I as l,
2818
- qn as m,
2819
- H as n,
2820
- Co as o,
2821
- kn as p,
2822
- O as q,
2823
- wo as r,
2824
- zn as s,
2825
- To as t,
2826
- vo as u,
2827
- Be as v,
2828
- bn as w,
2829
- ro as x,
2830
- Kn as y,
2831
- Ro as z
2832
- };