@builder.io/sdk-react-nextjs 0.6.2-0 → 0.6.3

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 (41) hide show
  1. package/README.md +1 -1
  2. package/lib/browser/USE_CLIENT_BUNDLE-7df521d2.mjs +620 -0
  3. package/lib/browser/USE_CLIENT_BUNDLE-ba140db3.js +23 -0
  4. package/lib/browser/USE_SERVER_BUNDLE-4eda8de6.mjs +11 -0
  5. package/lib/{edge/USE_SERVER_BUNDLE-dc7c843d.js → browser/USE_SERVER_BUNDLE-7d2b1f4f.js} +1 -1
  6. package/lib/browser/bundle-a1b650c9.js +76 -0
  7. package/lib/browser/{bundle-b0c14a2f.mjs → bundle-c727cf36.mjs} +420 -378
  8. package/lib/browser/index.cjs +1 -1
  9. package/lib/browser/index.mjs +14 -14
  10. package/lib/edge/USE_CLIENT_BUNDLE-88bd3402.mjs +620 -0
  11. package/lib/edge/USE_CLIENT_BUNDLE-c1e8e1b1.js +23 -0
  12. package/lib/edge/USE_SERVER_BUNDLE-6554eb5e.mjs +11 -0
  13. package/lib/{node/USE_SERVER_BUNDLE-e7c2df57.js → edge/USE_SERVER_BUNDLE-b339a170.js} +1 -1
  14. package/lib/edge/bundle-56d2ffe3.js +96 -0
  15. package/lib/edge/{bundle-e2e962a8.mjs → bundle-75be1e37.mjs} +1764 -1722
  16. package/lib/edge/index.cjs +1 -1
  17. package/lib/edge/index.mjs +14 -14
  18. package/lib/node/USE_CLIENT_BUNDLE-7df521d2.mjs +620 -0
  19. package/lib/node/USE_CLIENT_BUNDLE-ba140db3.js +23 -0
  20. package/lib/node/USE_SERVER_BUNDLE-4eda8de6.mjs +11 -0
  21. package/lib/{browser/USE_SERVER_BUNDLE-e7c2df57.js → node/USE_SERVER_BUNDLE-7d2b1f4f.js} +1 -1
  22. package/lib/node/bundle-a1b650c9.js +76 -0
  23. package/lib/node/{bundle-b0c14a2f.mjs → bundle-c727cf36.mjs} +420 -378
  24. package/lib/node/index.cjs +1 -1
  25. package/lib/node/index.mjs +14 -14
  26. package/package.json +1 -1
  27. package/types/constants/sdk-version.d.ts +1 -1
  28. package/types/functions/fetch-builder-props.d.ts +13 -0
  29. package/types/types/components.d.ts +0 -1
  30. package/lib/browser/USE_CLIENT_BUNDLE-778eeeb3.js +0 -23
  31. package/lib/browser/USE_CLIENT_BUNDLE-a73198a1.mjs +0 -664
  32. package/lib/browser/USE_SERVER_BUNDLE-80e10cfe.mjs +0 -11
  33. package/lib/browser/bundle-c3b66b2f.js +0 -76
  34. package/lib/edge/USE_CLIENT_BUNDLE-777b23e5.mjs +0 -664
  35. package/lib/edge/USE_CLIENT_BUNDLE-7b4d63a6.js +0 -23
  36. package/lib/edge/USE_SERVER_BUNDLE-2c7d68ff.mjs +0 -11
  37. package/lib/edge/bundle-8124c323.js +0 -96
  38. package/lib/node/USE_CLIENT_BUNDLE-778eeeb3.js +0 -23
  39. package/lib/node/USE_CLIENT_BUNDLE-a73198a1.mjs +0 -664
  40. package/lib/node/USE_SERVER_BUNDLE-80e10cfe.mjs +0 -11
  41. package/lib/node/bundle-c3b66b2f.js +0 -76
@@ -1,664 +0,0 @@
1
- "use client";
2
- import { jsxs as I, Fragment as b, jsx as t } from "react/jsx-runtime";
3
- import { useState as k, useRef as M, useEffect as v, createContext as X } from "react";
4
- import { g as Y, I as Z, c as F, a as $, b as B, d as D, e as L, f as z, i as w, h as N, j as p, l as ee, k as j, r as te, s as ne, m as ie, _ as H, n as Q, o as ae, p as ce, q as oe } from "./bundle-e2e962a8.mjs";
5
- import { p as le } from "./USE_SERVER_BUNDLE-2c7d68ff.mjs";
6
- import { useRouter as re } from "next/navigation";
7
- function he(e) {
8
- return /* @__PURE__ */ I(b, { children: [
9
- e.link ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(
10
- "a",
11
- {
12
- role: "button",
13
- ...e.attributes,
14
- href: e.link,
15
- target: e.openLinkInNewTab ? "_blank" : void 0,
16
- children: e.text
17
- }
18
- ) }) : /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(
19
- "button",
20
- {
21
- ...e.attributes,
22
- style: e.attributes.style,
23
- className: e.attributes.className + " button-3e7bc8b2",
24
- children: e.text
25
- }
26
- ) }),
27
- /* @__PURE__ */ t("style", { children: `.button-3e7bc8b2 {
28
- all: unset;
29
- }` })
30
- ] });
31
- }
32
- function ge(e) {
33
- const [n, m] = k(
34
- () => Y({
35
- block: e.block,
36
- localState: e.context.localState,
37
- rootState: e.context.rootState,
38
- rootSetState: e.context.rootSetState,
39
- context: e.context.context,
40
- shouldEvaluateBindings: !0
41
- })
42
- );
43
- function y() {
44
- return F(n.hide) ? !n.hide : F(n.show) ? n.show : !0;
45
- }
46
- function a() {
47
- var R;
48
- const l = n.responsiveStyles, g = e.context.content, S = $(
49
- ((R = g == null ? void 0 : g.meta) == null ? void 0 : R.breakpoints) || {}
50
- ), h = l == null ? void 0 : l.large, c = l == null ? void 0 : l.medium, u = l == null ? void 0 : l.small, f = n.id;
51
- if (!f)
52
- return "";
53
- const C = h ? B({
54
- className: f,
55
- styles: h
56
- }) : "", E = c ? B({
57
- className: f,
58
- styles: c,
59
- mediaQuery: D(
60
- "medium",
61
- S
62
- )
63
- }) : "", P = u ? B({
64
- className: f,
65
- styles: u,
66
- mediaQuery: D(
67
- "small",
68
- S
69
- )
70
- }) : "";
71
- return [C, E, P].join(" ");
72
- }
73
- return /* @__PURE__ */ t(b, { children: a() && y() ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(Z, { styles: a() }) }) : null });
74
- }
75
- function Se(e) {
76
- return /* @__PURE__ */ t(
77
- e.Wrapper,
78
- {
79
- ...e.wrapperProps,
80
- attributes: {
81
- ...L({
82
- block: e.block,
83
- context: e.context
84
- }),
85
- ...z({
86
- block: e.block,
87
- rootState: e.context.rootState,
88
- rootSetState: e.context.rootSetState,
89
- localState: e.context.localState,
90
- context: e.context.context
91
- })
92
- },
93
- children: e.children
94
- }
95
- );
96
- }
97
- function xe(e) {
98
- return /* @__PURE__ */ I(b, { children: [
99
- " ",
100
- e.hasChildren ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ I(
101
- e.Wrapper,
102
- {
103
- ...L({
104
- block: e.block,
105
- context: e.context
106
- }),
107
- ...z({
108
- block: e.block,
109
- rootState: e.context.rootState,
110
- rootSetState: e.context.rootSetState,
111
- localState: e.context.localState,
112
- context: e.context.context,
113
- stripPrefix: !0
114
- }),
115
- children: [
116
- " ",
117
- e.children,
118
- " "
119
- ]
120
- }
121
- ) }) : /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(
122
- e.Wrapper,
123
- {
124
- ...L({
125
- block: e.block,
126
- context: e.context
127
- }),
128
- ...z({
129
- block: e.block,
130
- rootState: e.context.rootState,
131
- rootSetState: e.context.rootSetState,
132
- localState: e.context.localState,
133
- context: e.context.context,
134
- stripPrefix: !0
135
- })
136
- }
137
- ) }),
138
- " "
139
- ] });
140
- }
141
- function ke(e) {
142
- function n() {
143
- var a;
144
- return "builder-blocks" + ((a = e.blocks) != null && a.length ? "" : " no-blocks");
145
- }
146
- function m() {
147
- var a, l;
148
- w() && !((a = e.blocks) != null && a.length) && ((l = window.parent) == null || l.postMessage(
149
- {
150
- type: "builder.clickEmptyBlocks",
151
- data: {
152
- parentElementId: e.parent,
153
- dataPath: e.path
154
- }
155
- },
156
- "*"
157
- ));
158
- }
159
- function y() {
160
- var a, l;
161
- w() && !((a = e.blocks) != null && a.length) && ((l = window.parent) == null || l.postMessage(
162
- {
163
- type: "builder.hoverEmptyBlocks",
164
- data: {
165
- parentElementId: e.parent,
166
- dataPath: e.path
167
- }
168
- },
169
- "*"
170
- ));
171
- }
172
- return /* @__PURE__ */ I(b, { children: [
173
- /* @__PURE__ */ t(
174
- "div",
175
- {
176
- className: n() + " div-5821bd52",
177
- "builder-path": e.path,
178
- "builder-parent-id": e.parent,
179
- style: e.styleProp,
180
- onClick: (a) => m(),
181
- onMouseEnter: (a) => y(),
182
- onKeyPress: (a) => m(),
183
- children: e.children
184
- }
185
- ),
186
- /* @__PURE__ */ t("style", { children: `.div-5821bd52 {
187
- display: flex;
188
- flex-direction: column;
189
- align-items: stretch;
190
- }` })
191
- ] });
192
- }
193
- function ye(e) {
194
- return /* @__PURE__ */ t("span", { children: e.children });
195
- }
196
- function ve(e) {
197
- var a, l, g, S;
198
- function n() {
199
- var u;
200
- const c = e.image || e.src;
201
- if (!c || // We can auto add srcset for cdn.builder.io and shopify
202
- // images, otherwise you can supply this prop manually
203
- !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
204
- return e.srcset;
205
- if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
206
- if (!e.srcset.includes(e.image.split("?")[0]))
207
- return console.debug("Removed given srcset"), N(c);
208
- } else if (e.image && !e.srcset)
209
- return N(c);
210
- return N(c);
211
- }
212
- function m() {
213
- var h;
214
- return (h = n == null ? void 0 : n()) != null && h.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
215
- }
216
- function y() {
217
- const h = {
218
- position: "absolute",
219
- height: "100%",
220
- width: "100%",
221
- left: "0px",
222
- top: "0px"
223
- };
224
- return e.aspectRatio ? h : void 0;
225
- }
226
- return /* @__PURE__ */ I(b, { children: [
227
- /* @__PURE__ */ I(b, { children: [
228
- /* @__PURE__ */ I("picture", { children: [
229
- m() ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t("source", { type: "image/webp", srcSet: m() }) }) : null,
230
- /* @__PURE__ */ t(
231
- "img",
232
- {
233
- loading: "lazy",
234
- alt: e.altText,
235
- role: e.altText ? "presentation" : void 0,
236
- style: {
237
- objectPosition: e.backgroundPosition || "center",
238
- objectFit: e.backgroundSize || "cover",
239
- ...y()
240
- },
241
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
242
- src: e.image,
243
- srcSet: n(),
244
- sizes: e.sizes
245
- }
246
- )
247
- ] }),
248
- e.aspectRatio && !((l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent) ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(
249
- "div",
250
- {
251
- className: "builder-image-sizer div-ef11a6be",
252
- style: {
253
- paddingTop: e.aspectRatio * 100 + "%"
254
- }
255
- }
256
- ) }) : null,
257
- (S = (g = e.builderBlock) == null ? void 0 : g.children) != null && S.length && e.fitContent ? /* @__PURE__ */ t(b, { children: e.children }) : null,
258
- !e.fitContent && e.children ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
259
- ] }),
260
- /* @__PURE__ */ t("style", { children: `.img-ef11a6be {
261
- opacity: 1;
262
- transition: opacity 0.2s ease-in-out;
263
- }.div-ef11a6be {
264
- width: 100%;
265
- pointer-events: none;
266
- font-size: 0;
267
- }.div-ef11a6be-2 {
268
- display: flex;
269
- flex-direction: column;
270
- align-items: stretch;
271
- position: absolute;
272
- top: 0;
273
- left: 0;
274
- width: 100%;
275
- height: 100%;
276
- }` })
277
- ] });
278
- }
279
- function Ce(e) {
280
- return /* @__PURE__ */ t(
281
- "section",
282
- {
283
- ...e.attributes,
284
- style: {
285
- width: "100%",
286
- alignSelf: "stretch",
287
- flexGrow: 1,
288
- boxSizing: "border-box",
289
- maxWidth: e.maxWidth || 1200,
290
- display: "flex",
291
- flexDirection: "column",
292
- alignItems: "stretch",
293
- marginLeft: "auto",
294
- marginRight: "auto"
295
- },
296
- children: e.children
297
- }
298
- );
299
- }
300
- function Ie(e) {
301
- var y;
302
- function n() {
303
- return {
304
- ...e.autoPlay === !0 ? {
305
- autoPlay: !0
306
- } : {},
307
- ...e.muted === !0 ? {
308
- muted: !0
309
- } : {},
310
- ...e.controls === !0 ? {
311
- controls: !0
312
- } : {},
313
- ...e.loop === !0 ? {
314
- loop: !0
315
- } : {},
316
- ...e.playsInline === !0 ? {
317
- playsInline: !0
318
- } : {}
319
- };
320
- }
321
- function m() {
322
- return {
323
- ...e.attributes,
324
- ...n()
325
- };
326
- }
327
- return /* @__PURE__ */ t(
328
- "video",
329
- {
330
- ...m(),
331
- preload: e.preload || "metadata",
332
- style: {
333
- width: "100%",
334
- height: "100%",
335
- ...(y = e.attributes) == null ? void 0 : y.style,
336
- objectFit: e.fit,
337
- objectPosition: e.position,
338
- // Hack to get object fit to work as expected and
339
- // not have the video overflow
340
- borderRadius: 1
341
- },
342
- src: e.video || "no-src",
343
- poster: e.posterImage
344
- }
345
- );
346
- }
347
- function we(e) {
348
- const n = M(null), [m, y] = k(() => []), [a, l] = k(() => []), [g, S] = k(() => !1);
349
- function h() {
350
- if (!n.current || !n.current.getElementsByTagName)
351
- return;
352
- const c = n.current.getElementsByTagName("script");
353
- for (let u = 0; u < c.length; u++) {
354
- const f = c[u];
355
- if (f.src && !m.includes(f.src)) {
356
- m.push(f.src);
357
- const C = document.createElement("script");
358
- C.async = !0, C.src = f.src, document.head.appendChild(C);
359
- } else if (p(f) && !a.includes(f.innerText))
360
- try {
361
- a.push(f.innerText), new Function(f.innerText)();
362
- } catch (C) {
363
- console.warn("`Embed`: Error running script:", C);
364
- }
365
- }
366
- }
367
- return v(() => {
368
- n.current && !g && (S(!0), h());
369
- }, [n.current, g]), /* @__PURE__ */ t(
370
- "div",
371
- {
372
- className: "builder-embed",
373
- ref: n,
374
- dangerouslySetInnerHTML: { __html: e.content }
375
- }
376
- );
377
- }
378
- function Ee(e) {
379
- return /* @__PURE__ */ t(
380
- "img",
381
- {
382
- style: {
383
- objectFit: e.backgroundSize || "cover",
384
- objectPosition: e.backgroundPosition || "center"
385
- },
386
- alt: e.altText,
387
- src: e.imgSrc || e.image,
388
- ...e.attributes
389
- },
390
- w() && e.imgSrc || "default-key"
391
- );
392
- }
393
- function Re(e) {
394
- const n = M(null), [m, y] = k(() => []), [a, l] = k(() => []);
395
- function g() {
396
- if (n.current && n.current.getElementsByTagName && typeof window < "u") {
397
- const S = n.current.getElementsByTagName("script");
398
- for (let h = 0; h < S.length; h++) {
399
- const c = S[h];
400
- if (c.src) {
401
- if (m.includes(c.src))
402
- continue;
403
- m.push(c.src);
404
- const u = document.createElement("script");
405
- u.async = !0, u.src = c.src, document.head.appendChild(u);
406
- } else if (!c.type || [
407
- "text/javascript",
408
- "application/javascript",
409
- "application/ecmascript"
410
- ].includes(c.type)) {
411
- if (a.includes(c.innerText))
412
- continue;
413
- try {
414
- a.push(c.innerText), new Function(c.innerText)();
415
- } catch (u) {
416
- console.warn("`CustomCode`: Error running script:", u);
417
- }
418
- }
419
- }
420
- }
421
- }
422
- return v(() => {
423
- g();
424
- }, []), /* @__PURE__ */ t(
425
- "div",
426
- {
427
- ref: n,
428
- className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
429
- dangerouslySetInnerHTML: { __html: e.code }
430
- }
431
- );
432
- }
433
- const se = X({
434
- content: null,
435
- context: {},
436
- localState: void 0,
437
- rootSetState() {
438
- },
439
- rootState: {},
440
- apiKey: null,
441
- apiVersion: void 0,
442
- componentInfos: {},
443
- inheritedStyles: {}
444
- });
445
- function Te(e) {
446
- var q, K, _, A, U;
447
- const n = M(null), [m, y] = k(
448
- () => F(e.canTrack) ? e.canTrack : !0
449
- ), [a, l] = k(() => 0);
450
- function g(i) {
451
- var o, s, d, x, V;
452
- const r = {
453
- ...e.builderContextSignal.content,
454
- ...i,
455
- data: {
456
- ...(o = e.builderContextSignal.content) == null ? void 0 : o.data,
457
- ...i == null ? void 0 : i.data
458
- },
459
- meta: {
460
- ...(s = e.builderContextSignal.content) == null ? void 0 : s.meta,
461
- ...i == null ? void 0 : i.meta,
462
- breakpoints: ((d = i == null ? void 0 : i.meta) == null ? void 0 : d.breakpoints) || ((V = (x = e.builderContextSignal.content) == null ? void 0 : x.meta) == null ? void 0 : V.breakpoints)
463
- }
464
- };
465
- le({
466
- value: r,
467
- key: r.id
468
- }).then(() => {
469
- G.refresh();
470
- });
471
- }
472
- k(() => 0);
473
- const [S, h] = k(
474
- () => !1
475
- );
476
- function c(i) {
477
- var o;
478
- const { data: r } = i;
479
- if (r)
480
- switch (r.type) {
481
- case "builder.configureSdk": {
482
- const s = r.data, { breakpoints: d, contentId: x } = s;
483
- if (!x || x !== ((o = e.builderContextSignal.content) == null ? void 0 : o.id))
484
- return;
485
- d && g({
486
- meta: {
487
- breakpoints: d
488
- }
489
- }), l(a + 1);
490
- break;
491
- }
492
- case "builder.contentUpdate": {
493
- const s = r.data, d = s.key || s.alias || s.entry || s.modelName, x = s.data;
494
- d === e.model && (g(x), l(a + 1));
495
- break;
496
- }
497
- }
498
- }
499
- function u() {
500
- var r, o;
501
- const i = (o = (r = e.builderContextSignal.content) == null ? void 0 : r.data) == null ? void 0 : o.jsCode;
502
- i && Q({
503
- code: i,
504
- context: e.context || {},
505
- localState: void 0,
506
- rootState: e.builderContextSignal.rootState,
507
- rootSetState: e.builderContextSignal.rootSetState
508
- });
509
- }
510
- const [f, C] = k(() => ({})), [E, P] = k(() => !1);
511
- function R(i) {
512
- var r, o;
513
- if (e.builderContextSignal.content) {
514
- const s = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, d = (o = e.builderContextSignal.content) == null ? void 0 : o.id;
515
- H({
516
- type: "click",
517
- canTrack: m,
518
- contentId: d,
519
- apiKey: e.apiKey,
520
- variationId: s !== d ? s : void 0,
521
- ...ae(i),
522
- unique: !E
523
- });
524
- }
525
- E || P(!0);
526
- }
527
- function J(i) {
528
- return i.replace(
529
- /{{([^}]+)}}/g,
530
- (r, o) => Q({
531
- code: o,
532
- context: e.context || {},
533
- localState: void 0,
534
- rootState: e.builderContextSignal.rootState,
535
- rootSetState: e.builderContextSignal.rootSetState
536
- })
537
- );
538
- }
539
- function O({ url: i, key: r }) {
540
- oe(i).then((o) => o.json()).then((o) => {
541
- var d, x;
542
- const s = {
543
- ...e.builderContextSignal.rootState,
544
- [r]: o
545
- };
546
- (x = (d = e.builderContextSignal).rootSetState) == null || x.call(d, s), f[r] = !0;
547
- }).catch((o) => {
548
- console.error("error fetching dynamic data", i, o);
549
- });
550
- }
551
- function W() {
552
- var r, o;
553
- const i = ((o = (r = e.builderContextSignal.content) == null ? void 0 : r.data) == null ? void 0 : o.httpRequests) ?? {};
554
- Object.entries(i).forEach(([s, d]) => {
555
- if (d && (!f[s] || w())) {
556
- const x = J(d);
557
- O({
558
- url: x,
559
- key: s
560
- });
561
- }
562
- });
563
- }
564
- function T() {
565
- w() && window.dispatchEvent(
566
- new CustomEvent(
567
- "builder:component:stateChange",
568
- {
569
- detail: {
570
- state: ce(e.builderContextSignal.rootState),
571
- ref: {
572
- name: e.model
573
- }
574
- }
575
- }
576
- )
577
- );
578
- }
579
- const G = re();
580
- return v(() => {
581
- var i, r;
582
- if (e.apiKey || ee.error(
583
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
584
- ), j()) {
585
- if (w() && (l(a + 1), window.addEventListener("message", c), te(), ne({
586
- ...e.locale ? {
587
- locale: e.locale
588
- } : {},
589
- ...e.includeRefs ? {
590
- includeRefs: e.includeRefs
591
- } : {},
592
- ...e.enrich ? {
593
- enrich: e.enrich
594
- } : {}
595
- }), Object.values(
596
- e.builderContextSignal.componentInfos
597
- ).forEach((o) => {
598
- var d;
599
- const s = ie(o);
600
- (d = window.parent) == null || d.postMessage(s, "*");
601
- }), window.addEventListener(
602
- "builder:component:stateChangeListenerActivated",
603
- T
604
- )), e.builderContextSignal.content) {
605
- const o = (i = e.builderContextSignal.content) == null ? void 0 : i.testVariationId, s = (r = e.builderContextSignal.content) == null ? void 0 : r.id;
606
- H({
607
- type: "impression",
608
- canTrack: m,
609
- contentId: s,
610
- apiKey: e.apiKey,
611
- variationId: o !== s ? o : void 0
612
- });
613
- }
614
- u(), W(), T();
615
- }
616
- }, []), v(() => {
617
- }, [e.content]), v(() => {
618
- j() && (window.removeEventListener("message", c), window.addEventListener("message", c));
619
- }, [S]), v(() => {
620
- u();
621
- }, [
622
- (K = (q = e.builderContextSignal.content) == null ? void 0 : q.data) == null ? void 0 : K.jsCode,
623
- e.builderContextSignal.rootState
624
- ]), v(() => {
625
- W();
626
- }, [(A = (_ = e.builderContextSignal.content) == null ? void 0 : _.data) == null ? void 0 : A.httpRequests]), v(() => {
627
- T();
628
- }, [e.builderContextSignal.rootState]), v(() => () => {
629
- j() && (window.removeEventListener("message", c), window.removeEventListener(
630
- "builder:component:stateChangeListenerActivated",
631
- T
632
- ));
633
- }, []), /* @__PURE__ */ t(se.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(
634
- "div",
635
- {
636
- ref: n,
637
- onClick: (i) => R(i),
638
- "builder-content-id": (U = e.builderContextSignal.content) == null ? void 0 : U.id,
639
- "builder-model": e.model,
640
- ...e.showContent ? {} : {
641
- hidden: !0,
642
- "aria-hidden": !0
643
- },
644
- className: e.classNameProp,
645
- children: e.children
646
- },
647
- a
648
- ) }) : null });
649
- }
650
- export {
651
- ge as B,
652
- Re as C,
653
- we as E,
654
- ye as F,
655
- Se as I,
656
- Ce as S,
657
- Ie as V,
658
- xe as a,
659
- ke as b,
660
- he as c,
661
- ve as d,
662
- Ee as e,
663
- Te as f
664
- };
@@ -1,23 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),l=require("react"),n=require("./bundle-8124c323.js"),z=require("./USE_SERVER_BUNDLE-dc7c843d.js"),M=require("next/navigation");function _(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3e7bc8b2",children:e.text})}),t.jsx("style",{children:`.button-3e7bc8b2 {
2
- all: unset;
3
- }`})]})}function A(e){const[i,S]=l.useState(()=>n.getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}));function y(){return n.checkIsDefined(i.hide)?!i.hide:n.checkIsDefined(i.show)?i.show:!0}function a(){var E;const s=i.responsiveStyles,h=e.context.content,b=n.getSizesForBreakpoints(((E=h==null?void 0:h.meta)==null?void 0:E.breakpoints)||{}),x=s==null?void 0:s.large,o=s==null?void 0:s.medium,g=s==null?void 0:s.small,f=i.id;if(!f)return"";const v=x?n.createCssClass({className:f,styles:x}):"",C=o?n.createCssClass({className:f,styles:o,mediaQuery:n.getMaxWidthQueryForSize("medium",b)}):"",I=g?n.createCssClass({className:f,styles:g,mediaQuery:n.getMaxWidthQueryForSize("small",b)}):"";return[v,C,I].join(" ")}return t.jsx(t.Fragment,{children:a()&&y()?t.jsx(t.Fragment,{children:t.jsx(n.InlinedStyles,{styles:a()})}):null})}function U(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}function D(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function K(e){function i(){var a;return"builder-blocks"+((a=e.blocks)!=null&&a.length?"":" no-blocks")}function S(){var a,s;n.isEditing()&&!((a=e.blocks)!=null&&a.length)&&((s=window.parent)==null||s.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function y(){var a,s;n.isEditing()&&!((a=e.blocks)!=null&&a.length)&&((s=window.parent)==null||s.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:i()+" div-5821bd52","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:a=>S(),onMouseEnter:a=>y(),onKeyPress:a=>S(),children:e.children}),t.jsx("style",{children:`.div-5821bd52 {
4
- display: flex;
5
- flex-direction: column;
6
- align-items: stretch;
7
- }`})]})}function V(e){return t.jsx("span",{children:e.children})}function H(e){var a,s,h,b;function i(){var g;const o=e.image||e.src;if(!o||!(o.match(/builder\.io/)||o.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((g=e.image)!=null&&g.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),n.getSrcSet(o)}else if(e.image&&!e.srcset)return n.getSrcSet(o);return n.getSrcSet(o)}function S(){var x;return(x=i==null?void 0:i())!=null&&x.match(/builder\.io/)&&!e.noWebp?i().replace(/\?/g,"?format=webp&"):""}function y(){const x={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?x:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[S()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:S()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...y()},className:"builder-image"+(e.className?" "+e.className:"")+" img-ef11a6be",src:e.image,srcSet:i(),sizes:e.sizes})]}),e.aspectRatio&&!((s=(a=e.builderBlock)==null?void 0:a.children)!=null&&s.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-ef11a6be",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(b=(h=e.builderBlock)==null?void 0:h.children)!=null&&b.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-ef11a6be-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-ef11a6be {
8
- opacity: 1;
9
- transition: opacity 0.2s ease-in-out;
10
- }.div-ef11a6be {
11
- width: 100%;
12
- pointer-events: none;
13
- font-size: 0;
14
- }.div-ef11a6be-2 {
15
- display: flex;
16
- flex-direction: column;
17
- align-items: stretch;
18
- position: absolute;
19
- top: 0;
20
- left: 0;
21
- width: 100%;
22
- height: 100%;
23
- }`})]})}function Q(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function J(e){var y;function i(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function S(){return{...e.attributes,...i()}}return t.jsx("video",{...S(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(y=e.attributes)==null?void 0:y.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage})}function O(e){const i=l.useRef(null),[S,y]=l.useState(()=>[]),[a,s]=l.useState(()=>[]),[h,b]=l.useState(()=>!1);function x(){if(!i.current||!i.current.getElementsByTagName)return;const o=i.current.getElementsByTagName("script");for(let g=0;g<o.length;g++){const f=o[g];if(f.src&&!S.includes(f.src)){S.push(f.src);const v=document.createElement("script");v.async=!0,v.src=f.src,document.head.appendChild(v)}else if(n.isJsScript(f)&&!a.includes(f.innerText))try{a.push(f.innerText),new Function(f.innerText)()}catch(v){console.warn("`Embed`: Error running script:",v)}}}return l.useEffect(()=>{i.current&&!h&&(b(!0),x())},[i.current,h]),t.jsx("div",{className:"builder-embed",ref:i,dangerouslySetInnerHTML:{__html:e.content}})}function G(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},n.isEditing()&&e.imgSrc||"default-key")}function X(e){const i=l.useRef(null),[S,y]=l.useState(()=>[]),[a,s]=l.useState(()=>[]);function h(){if(i.current&&i.current.getElementsByTagName&&typeof window<"u"){const b=i.current.getElementsByTagName("script");for(let x=0;x<b.length;x++){const o=b[x];if(o.src){if(S.includes(o.src))continue;S.push(o.src);const g=document.createElement("script");g.async=!0,g.src=o.src,document.head.appendChild(g)}else if(!o.type||["text/javascript","application/javascript","application/ecmascript"].includes(o.type)){if(a.includes(o.innerText))continue;try{a.push(o.innerText),new Function(o.innerText)()}catch(g){console.warn("`CustomCode`: Error running script:",g)}}}}}return l.useEffect(()=>{h()},[]),t.jsx("div",{ref:i,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Y=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Z(e){var w,B,F,P,T;const i=l.useRef(null),[S,y]=l.useState(()=>n.checkIsDefined(e.canTrack)?e.canTrack:!0),[a,s]=l.useState(()=>0);function h(c){var r,u,m,k,N;const d={...e.builderContextSignal.content,...c,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...c==null?void 0:c.data},meta:{...(u=e.builderContextSignal.content)==null?void 0:u.meta,...c==null?void 0:c.meta,breakpoints:((m=c==null?void 0:c.meta)==null?void 0:m.breakpoints)||((N=(k=e.builderContextSignal.content)==null?void 0:k.meta)==null?void 0:N.breakpoints)}};z.postPreviewContent({value:d,key:d.id}).then(()=>{W.refresh()})}l.useState(()=>0);const[b,x]=l.useState(()=>!1);function o(c){var r;const{data:d}=c;if(d)switch(d.type){case"builder.configureSdk":{const u=d.data,{breakpoints:m,contentId:k}=u;if(!k||k!==((r=e.builderContextSignal.content)==null?void 0:r.id))return;m&&h({meta:{breakpoints:m}}),s(a+1);break}case"builder.contentUpdate":{const u=d.data,m=u.key||u.alias||u.entry||u.modelName,k=u.data;m===e.model&&(h(k),s(a+1));break}}}function g(){var d,r;const c=(r=(d=e.builderContextSignal.content)==null?void 0:d.data)==null?void 0:r.jsCode;c&&n.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[f,v]=l.useState(()=>({})),[C,I]=l.useState(()=>!1);function E(c){var d,r;if(e.builderContextSignal.content){const u=(d=e.builderContextSignal.content)==null?void 0:d.testVariationId,m=(r=e.builderContextSignal.content)==null?void 0:r.id;n._track({type:"click",canTrack:S,contentId:m,apiKey:e.apiKey,variationId:u!==m?u:void 0,...n.getInteractionPropertiesForEvent(c),unique:!C})}C||I(!0)}function q(c){return c.replace(/{{([^}]+)}}/g,(d,r)=>n.evaluate({code:r,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function L({url:c,key:d}){n.fetch(c).then(r=>r.json()).then(r=>{var m,k;const u={...e.builderContextSignal.rootState,[d]:r};(k=(m=e.builderContextSignal).rootSetState)==null||k.call(m,u),f[d]=!0}).catch(r=>{console.error("error fetching dynamic data",c,r)})}function R(){var d,r;const c=((r=(d=e.builderContextSignal.content)==null?void 0:d.data)==null?void 0:r.httpRequests)??{};Object.entries(c).forEach(([u,m])=>{if(m&&(!f[u]||n.isEditing())){const k=q(m);L({url:k,key:u})}})}function j(){n.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:n.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const W=M.useRouter();return l.useEffect(()=>{var c,d;if(e.apiKey||n.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),n.isBrowser()){if(n.isEditing()&&(s(a+1),window.addEventListener("message",o),n.registerInsertMenu(),n.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(r=>{var m;const u=n.createRegisterComponentMessage(r);(m=window.parent)==null||m.postMessage(u,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",j)),e.builderContextSignal.content){const r=(c=e.builderContextSignal.content)==null?void 0:c.testVariationId,u=(d=e.builderContextSignal.content)==null?void 0:d.id;n._track({type:"impression",canTrack:S,contentId:u,apiKey:e.apiKey,variationId:r!==u?r:void 0})}g(),R(),j()}},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{n.isBrowser()&&(window.removeEventListener("message",o),window.addEventListener("message",o))},[b]),l.useEffect(()=>{g()},[(B=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:B.jsCode,e.builderContextSignal.rootState]),l.useEffect(()=>{R()},[(P=(F=e.builderContextSignal.content)==null?void 0:F.data)==null?void 0:P.httpRequests]),l.useEffect(()=>{j()},[e.builderContextSignal.rootState]),l.useEffect(()=>()=>{n.isBrowser()&&(window.removeEventListener("message",o),window.removeEventListener("builder:component:stateChangeListenerActivated",j))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:t.jsx("div",{ref:i,onClick:c=>E(c),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp,children:e.children},a)}):null})}exports.BlockStyles=A;exports.BlockWrapper=D;exports.BlocksWrapper=K;exports.Button=_;exports.CustomCode=X;exports.Embed=O;exports.EnableEditor=Z;exports.FragmentComponent=V;exports.Image=H;exports.ImgComponent=G;exports.InteractiveElement=U;exports.SectionComponent=Q;exports.Video=J;