@builder.io/sdk-react 1.0.15 → 1.0.17
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.
- package/lib/browser/blocks-exports.cjs +21 -21
- package/lib/browser/blocks-exports.mjs +542 -527
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-3d9c0013.js → server-entry-064a8b7f.js} +1 -1
- package/lib/browser/{server-entry-60192a70.cjs → server-entry-a7b75909.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-8cf047ac.cjs → blocks-1f59d1c0.cjs} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-874a3da2.js → blocks-fe027bf7.js} +10 -4
- package/lib/edge/{button-e8062d3a.cjs → button-36ac5d97.cjs} +1 -1
- package/lib/edge/{button-f921801d.js → button-8fdd068a.js} +2 -2
- package/lib/edge/{columns-cd3277d0.cjs → columns-36bdc015.cjs} +2 -2
- package/lib/edge/{columns-3d6fd99f.js → columns-4f789807.js} +27 -27
- package/lib/edge/content-variants-87f99284.cjs +134 -0
- package/lib/edge/{content-variants-716e35d3.js → content-variants-a26825d5.js} +282 -273
- package/lib/edge/{form-ed39d763.js → form-004ab04e.js} +3 -3
- package/lib/edge/{form-9e4155f9.cjs → form-6b599bb9.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-97c37936.cjs → get-class-prop-name-522545c4.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-63df96dc.js → get-class-prop-name-ee5eac9d.js} +1 -1
- package/lib/edge/{img-60cd5cd5.js → img-5d36c59d.js} +1 -1
- package/lib/edge/{img-4c6f100c.cjs → img-d311451e.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-cf3adf1f.js → input-211240f4.js} +1 -1
- package/lib/edge/{input-2d8eb4bc.cjs → input-34a4e538.cjs} +1 -1
- package/lib/edge/{select-8e2ef3ed.cjs → select-a425b313.cjs} +1 -1
- package/lib/edge/{select-03974bcf.js → select-e592f42a.js} +1 -1
- package/lib/edge/{server-entry-1263a732.cjs → server-entry-04a076eb.cjs} +1 -1
- package/lib/edge/{server-entry-24e90a71.js → server-entry-633c4fab.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-972c3844.cjs → slot-1547b467.cjs} +1 -1
- package/lib/edge/{slot-1408ceff.js → slot-20e9bd0c.js} +3 -3
- package/lib/edge/{symbol-781970fe.cjs → symbol-441a42f8.cjs} +1 -1
- package/lib/edge/{symbol-80a11943.js → symbol-8aa6a69b.js} +2 -2
- package/lib/node/blocks-exports.cjs +11 -11
- package/lib/node/blocks-exports.mjs +482 -467
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-016a36f7.js → server-entry-a2617044.js} +1 -1
- package/lib/node/{server-entry-71df0c38.cjs → server-entry-e66a06c7.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/content-variants/helpers.d.ts +1 -1
- package/types/components/inlined-script.d.ts +1 -1
- package/types/components/inlined-styles.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/content-variants-23991643.cjs +0 -134
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
var N = Object.defineProperty;
|
|
3
|
-
var
|
|
4
|
-
var F = (e, t, n) => (
|
|
3
|
+
var $ = (e, t, n) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var F = (e, t, n) => ($(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-
|
|
6
|
+
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-a2617044.js";
|
|
7
7
|
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
8
8
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
9
9
|
function DynamicRenderer(e) {
|
|
@@ -72,9 +72,9 @@ const getFunctionArguments = ({
|
|
|
72
72
|
builder: e,
|
|
73
73
|
context: t,
|
|
74
74
|
event: n,
|
|
75
|
-
state:
|
|
75
|
+
state: i
|
|
76
76
|
}) => Object.entries({
|
|
77
|
-
state:
|
|
77
|
+
state: i,
|
|
78
78
|
Builder: e,
|
|
79
79
|
// legacy
|
|
80
80
|
builder: e,
|
|
@@ -91,18 +91,18 @@ const getFunctionArguments = ({
|
|
|
91
91
|
code: e,
|
|
92
92
|
builder: t,
|
|
93
93
|
context: n,
|
|
94
|
-
event:
|
|
95
|
-
localState:
|
|
94
|
+
event: i,
|
|
95
|
+
localState: o,
|
|
96
96
|
rootSetState: a,
|
|
97
97
|
rootState: r
|
|
98
98
|
}) => {
|
|
99
99
|
const s = getFunctionArguments({
|
|
100
100
|
builder: t,
|
|
101
101
|
context: n,
|
|
102
|
-
event:
|
|
102
|
+
event: i,
|
|
103
103
|
state: flattenState({
|
|
104
104
|
rootState: r,
|
|
105
|
-
localState:
|
|
105
|
+
localState: o,
|
|
106
106
|
rootSetState: a
|
|
107
107
|
})
|
|
108
108
|
});
|
|
@@ -114,30 +114,30 @@ function flattenState({
|
|
|
114
114
|
rootSetState: n
|
|
115
115
|
}) {
|
|
116
116
|
return new Proxy(e, {
|
|
117
|
-
get: (
|
|
118
|
-
if (t &&
|
|
119
|
-
return t[
|
|
120
|
-
const a = o
|
|
117
|
+
get: (i, o) => {
|
|
118
|
+
if (t && o in t)
|
|
119
|
+
return t[o];
|
|
120
|
+
const a = i[o];
|
|
121
121
|
return typeof a == "object" && a !== null ? flattenState({
|
|
122
122
|
rootState: a,
|
|
123
123
|
localState: void 0,
|
|
124
124
|
rootSetState: n ? (r) => {
|
|
125
|
-
o
|
|
125
|
+
i[o] = r, n(i);
|
|
126
126
|
} : void 0
|
|
127
127
|
}) : a;
|
|
128
128
|
},
|
|
129
|
-
set: (
|
|
130
|
-
if (t &&
|
|
129
|
+
set: (i, o, a) => {
|
|
130
|
+
if (t && o in t)
|
|
131
131
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
132
|
-
return o
|
|
132
|
+
return i[o] = a, n == null || n(i), !0;
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
const set = (e, t, n) => {
|
|
137
137
|
if (Object(e) !== e)
|
|
138
138
|
return e;
|
|
139
|
-
const
|
|
140
|
-
return
|
|
139
|
+
const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
140
|
+
return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
|
|
141
141
|
}, noop = () => {
|
|
142
142
|
};
|
|
143
143
|
let safeDynamicRequire = noop;
|
|
@@ -175,7 +175,7 @@ var refToProxy = (obj) => {
|
|
|
175
175
|
code: e,
|
|
176
176
|
args: t
|
|
177
177
|
}) => {
|
|
178
|
-
const n = t.map(([
|
|
178
|
+
const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
|
|
179
179
|
return `
|
|
180
180
|
${REF_TO_PROXY_FN}
|
|
181
181
|
${n}
|
|
@@ -200,42 +200,42 @@ output;
|
|
|
200
200
|
code: e,
|
|
201
201
|
builder: t,
|
|
202
202
|
context: n,
|
|
203
|
-
event:
|
|
204
|
-
localState:
|
|
203
|
+
event: i,
|
|
204
|
+
localState: o,
|
|
205
205
|
rootSetState: a,
|
|
206
206
|
rootState: r
|
|
207
207
|
}) => {
|
|
208
208
|
const s = safeDynamicRequire("isolated-vm"), c = fastClone({
|
|
209
209
|
...r,
|
|
210
|
-
...
|
|
210
|
+
...o
|
|
211
211
|
}), l = getFunctionArguments({
|
|
212
212
|
builder: t,
|
|
213
213
|
context: n,
|
|
214
|
-
event:
|
|
214
|
+
event: i,
|
|
215
215
|
state: c
|
|
216
|
-
}),
|
|
216
|
+
}), u = getIsolateContext(), m = u.global;
|
|
217
217
|
m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
|
|
218
218
|
console.log(...y);
|
|
219
|
-
}), m.setSync(BUILDER_SET_STATE_NAME, function(y,
|
|
220
|
-
set(r, y,
|
|
221
|
-
}), l.forEach(([y,
|
|
222
|
-
const k = typeof
|
|
219
|
+
}), m.setSync(BUILDER_SET_STATE_NAME, function(y, p) {
|
|
220
|
+
set(r, y, p), a == null || a(r);
|
|
221
|
+
}), l.forEach(([y, p]) => {
|
|
222
|
+
const k = typeof p == "object" ? new s.Reference(
|
|
223
223
|
// workaround: methods with default values for arguments is not being cloned over
|
|
224
224
|
y === "builder" ? {
|
|
225
|
-
...
|
|
226
|
-
getUserAttributes: () =>
|
|
227
|
-
} :
|
|
225
|
+
...p,
|
|
226
|
+
getUserAttributes: () => p.getUserAttributes()
|
|
227
|
+
} : p
|
|
228
228
|
) : null;
|
|
229
229
|
m.setSync(getSyncValName(y), k);
|
|
230
230
|
}), m.setSync(INJECTED_IVM_GLOBAL, s);
|
|
231
231
|
const g = processCode({
|
|
232
232
|
code: e,
|
|
233
233
|
args: l
|
|
234
|
-
}),
|
|
234
|
+
}), h = u.evalSync(g);
|
|
235
235
|
try {
|
|
236
|
-
return JSON.parse(
|
|
236
|
+
return JSON.parse(h);
|
|
237
237
|
} catch {
|
|
238
|
-
return
|
|
238
|
+
return h;
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
function isNodeRuntime() {
|
|
@@ -243,12 +243,12 @@ function isNodeRuntime() {
|
|
|
243
243
|
return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
244
244
|
}
|
|
245
245
|
const shouldForceBrowserRuntimeInNode = () => {
|
|
246
|
-
var
|
|
246
|
+
var i;
|
|
247
247
|
if (!isNodeRuntime())
|
|
248
248
|
return !1;
|
|
249
|
-
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (
|
|
249
|
+
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
|
|
250
250
|
return e && t && !n ? (logger.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;
|
|
251
|
-
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e),
|
|
251
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), P = class P {
|
|
252
252
|
static getCacheKey(t) {
|
|
253
253
|
return JSON.stringify({
|
|
254
254
|
...t,
|
|
@@ -258,22 +258,22 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
static getCachedValue(t) {
|
|
261
|
-
return
|
|
261
|
+
return P.cache.get(t);
|
|
262
262
|
}
|
|
263
263
|
static setCachedValue(t, n) {
|
|
264
|
-
|
|
264
|
+
P.cache.size > 20 && P.cache.delete(P.cache.keys().next().value), P.cache.set(t, {
|
|
265
265
|
value: n
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
|
-
F(
|
|
270
|
-
let EvalCache =
|
|
269
|
+
F(P, "cacheLimit", 20), F(P, "cache", /* @__PURE__ */ new Map());
|
|
270
|
+
let EvalCache = P;
|
|
271
271
|
function evaluate({
|
|
272
272
|
code: e,
|
|
273
273
|
context: t,
|
|
274
274
|
localState: n,
|
|
275
|
-
rootState:
|
|
276
|
-
rootSetState:
|
|
275
|
+
rootState: i,
|
|
276
|
+
rootSetState: o,
|
|
277
277
|
event: a,
|
|
278
278
|
isExpression: r = !0,
|
|
279
279
|
enableCache: s
|
|
@@ -289,20 +289,20 @@ function evaluate({
|
|
|
289
289
|
builder: getBuilderGlobals(),
|
|
290
290
|
context: t,
|
|
291
291
|
event: a,
|
|
292
|
-
rootSetState:
|
|
293
|
-
rootState:
|
|
292
|
+
rootSetState: o,
|
|
293
|
+
rootState: i,
|
|
294
294
|
localState: n
|
|
295
295
|
};
|
|
296
296
|
if (s) {
|
|
297
|
-
const l = EvalCache.getCacheKey(c),
|
|
298
|
-
if (
|
|
299
|
-
return
|
|
297
|
+
const l = EvalCache.getCacheKey(c), u = EvalCache.getCachedValue(l);
|
|
298
|
+
if (u)
|
|
299
|
+
return u.value;
|
|
300
300
|
}
|
|
301
301
|
try {
|
|
302
302
|
const l = chooseBrowserOrServerEval(c);
|
|
303
303
|
if (s) {
|
|
304
|
-
const
|
|
305
|
-
EvalCache.setCachedValue(
|
|
304
|
+
const u = EvalCache.getCacheKey(c);
|
|
305
|
+
EvalCache.setCachedValue(u, l);
|
|
306
306
|
}
|
|
307
307
|
return l;
|
|
308
308
|
} catch (l) {
|
|
@@ -319,8 +319,8 @@ const evaluateBindings = ({
|
|
|
319
319
|
block: e,
|
|
320
320
|
context: t,
|
|
321
321
|
localState: n,
|
|
322
|
-
rootState:
|
|
323
|
-
rootSetState:
|
|
322
|
+
rootState: i,
|
|
323
|
+
rootSetState: o
|
|
324
324
|
}) => {
|
|
325
325
|
if (!e.bindings)
|
|
326
326
|
return e;
|
|
@@ -337,8 +337,8 @@ const evaluateBindings = ({
|
|
|
337
337
|
const c = e.bindings[s], l = evaluate({
|
|
338
338
|
code: c,
|
|
339
339
|
localState: n,
|
|
340
|
-
rootState:
|
|
341
|
-
rootSetState:
|
|
340
|
+
rootState: i,
|
|
341
|
+
rootSetState: o,
|
|
342
342
|
context: t,
|
|
343
343
|
enableCache: !0
|
|
344
344
|
});
|
|
@@ -350,38 +350,38 @@ function getProcessedBlock({
|
|
|
350
350
|
block: e,
|
|
351
351
|
context: t,
|
|
352
352
|
shouldEvaluateBindings: n,
|
|
353
|
-
localState:
|
|
354
|
-
rootState:
|
|
353
|
+
localState: i,
|
|
354
|
+
rootState: o,
|
|
355
355
|
rootSetState: a
|
|
356
356
|
}) {
|
|
357
357
|
const r = e;
|
|
358
358
|
return n ? evaluateBindings({
|
|
359
359
|
block: r,
|
|
360
|
-
localState:
|
|
361
|
-
rootState:
|
|
360
|
+
localState: i,
|
|
361
|
+
rootState: o,
|
|
362
362
|
rootSetState: a,
|
|
363
363
|
context: t
|
|
364
364
|
}) : r;
|
|
365
365
|
}
|
|
366
366
|
function throttle(e, t, n = {}) {
|
|
367
|
-
let
|
|
367
|
+
let i, o, a, r = null, s = 0;
|
|
368
368
|
const c = function() {
|
|
369
|
-
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(
|
|
369
|
+
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
|
|
370
370
|
};
|
|
371
371
|
return function() {
|
|
372
372
|
const l = Date.now();
|
|
373
373
|
!s && n.leading === !1 && (s = l);
|
|
374
|
-
const
|
|
375
|
-
return
|
|
374
|
+
const u = t - (l - s);
|
|
375
|
+
return i = this, o = arguments, u <= 0 || u > t ? (r && (clearTimeout(r), r = null), s = l, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(c, u)), a;
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
378
|
function assign(e, ...t) {
|
|
379
379
|
const n = Object(e);
|
|
380
|
-
for (let
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
for (const a in
|
|
384
|
-
Object.prototype.hasOwnProperty.call(
|
|
380
|
+
for (let i = 1; i < arguments.length; i++) {
|
|
381
|
+
const o = arguments[i];
|
|
382
|
+
if (o != null)
|
|
383
|
+
for (const a in o)
|
|
384
|
+
Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
|
|
385
385
|
}
|
|
386
386
|
return n;
|
|
387
387
|
}
|
|
@@ -404,16 +404,16 @@ function warnElementNotPresent(e) {
|
|
|
404
404
|
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
405
405
|
}
|
|
406
406
|
function augmentAnimation(e, t) {
|
|
407
|
-
const n = getAllStylesUsed(e),
|
|
407
|
+
const n = getAllStylesUsed(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
|
|
408
408
|
for (const s of r)
|
|
409
409
|
for (const c of n)
|
|
410
|
-
c in s || (s[c] =
|
|
410
|
+
c in s || (s[c] = i[c]);
|
|
411
411
|
}
|
|
412
412
|
function getAllStylesUsed(e) {
|
|
413
413
|
const t = [];
|
|
414
414
|
for (const n of e.steps)
|
|
415
|
-
for (const
|
|
416
|
-
t.indexOf(
|
|
415
|
+
for (const i in n.styles)
|
|
416
|
+
t.indexOf(i) === -1 && t.push(i);
|
|
417
417
|
return t;
|
|
418
418
|
}
|
|
419
419
|
function triggerAnimation(e) {
|
|
@@ -438,12 +438,12 @@ function bindHoverAnimation(e) {
|
|
|
438
438
|
}
|
|
439
439
|
Array.from(t).forEach((n) => {
|
|
440
440
|
augmentAnimation(e, n);
|
|
441
|
-
const
|
|
441
|
+
const i = e.steps[0].styles, o = e.steps[1].styles;
|
|
442
442
|
function a() {
|
|
443
|
-
assign(n.style,
|
|
443
|
+
assign(n.style, i);
|
|
444
444
|
}
|
|
445
445
|
function r() {
|
|
446
|
-
assign(n.style,
|
|
446
|
+
assign(n.style, o);
|
|
447
447
|
}
|
|
448
448
|
a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
|
|
449
449
|
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
@@ -458,19 +458,19 @@ function bindScrollInViewAnimation(e) {
|
|
|
458
458
|
}
|
|
459
459
|
Array.from(t).forEach((n) => {
|
|
460
460
|
augmentAnimation(e, n);
|
|
461
|
-
let
|
|
461
|
+
let i = !1, o = !1;
|
|
462
462
|
function a() {
|
|
463
|
-
!
|
|
463
|
+
!i && s(n) ? (i = !0, o = !0, setTimeout(() => {
|
|
464
464
|
assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
|
|
465
|
-
|
|
465
|
+
o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
|
|
466
466
|
}, (e.duration + (e.delay || 0)) * 1e3 + 100);
|
|
467
|
-
})) : e.repeat &&
|
|
467
|
+
})) : e.repeat && i && !o && !s(n) && (i = !1, assign(n.style, e.steps[0].styles));
|
|
468
468
|
}
|
|
469
469
|
const r = throttle(a, 200, {
|
|
470
470
|
leading: !1
|
|
471
471
|
});
|
|
472
|
-
function s(
|
|
473
|
-
const m =
|
|
472
|
+
function s(u) {
|
|
473
|
+
const m = u.getBoundingClientRect(), g = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * g;
|
|
474
474
|
return m.bottom > y && m.top < g - y;
|
|
475
475
|
}
|
|
476
476
|
const c = e.steps[0].styles;
|
|
@@ -485,21 +485,21 @@ function bindScrollInViewAnimation(e) {
|
|
|
485
485
|
}), a();
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n,
|
|
489
|
-
if (typeof
|
|
490
|
-
return `${camelToKebabCase(n)}: ${
|
|
488
|
+
const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
|
|
489
|
+
if (typeof i == "string")
|
|
490
|
+
return `${camelToKebabCase(n)}: ${i};`;
|
|
491
491
|
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
492
492
|
`), createCssClass = ({
|
|
493
493
|
mediaQuery: e,
|
|
494
494
|
className: t,
|
|
495
495
|
styles: n
|
|
496
496
|
}) => {
|
|
497
|
-
const
|
|
497
|
+
const i = `.${t} {
|
|
498
498
|
${convertStyleMapToCSS(n)}
|
|
499
499
|
}`;
|
|
500
500
|
return e ? `${e} {
|
|
501
|
-
${
|
|
502
|
-
}` :
|
|
501
|
+
${i}
|
|
502
|
+
}` : i;
|
|
503
503
|
};
|
|
504
504
|
function transformStyleProperty({
|
|
505
505
|
style: e
|
|
@@ -533,7 +533,7 @@ const getComponent = ({
|
|
|
533
533
|
registeredComponents: n
|
|
534
534
|
}) => {
|
|
535
535
|
var a;
|
|
536
|
-
const
|
|
536
|
+
const i = (a = getProcessedBlock({
|
|
537
537
|
block: e,
|
|
538
538
|
localState: t.localState,
|
|
539
539
|
rootState: t.rootState,
|
|
@@ -541,13 +541,13 @@ const getComponent = ({
|
|
|
541
541
|
context: t.context,
|
|
542
542
|
shouldEvaluateBindings: !1
|
|
543
543
|
}).component) == null ? void 0 : a.name;
|
|
544
|
-
if (!
|
|
544
|
+
if (!i)
|
|
545
545
|
return null;
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
return
|
|
546
|
+
const o = n[i];
|
|
547
|
+
if (o)
|
|
548
|
+
return o;
|
|
549
549
|
console.warn(`
|
|
550
|
-
Could not find a registered component named "${
|
|
550
|
+
Could not find a registered component named "${i}".
|
|
551
551
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
552
552
|
}, getRepeatItemData = ({
|
|
553
553
|
block: e,
|
|
@@ -555,11 +555,11 @@ const getComponent = ({
|
|
|
555
555
|
}) => {
|
|
556
556
|
const {
|
|
557
557
|
repeat: n,
|
|
558
|
-
...
|
|
558
|
+
...i
|
|
559
559
|
} = e;
|
|
560
560
|
if (!(n != null && n.collection))
|
|
561
561
|
return;
|
|
562
|
-
const
|
|
562
|
+
const o = evaluate({
|
|
563
563
|
code: n.collection,
|
|
564
564
|
localState: t.localState,
|
|
565
565
|
rootState: t.rootState,
|
|
@@ -567,10 +567,10 @@ const getComponent = ({
|
|
|
567
567
|
context: t.context,
|
|
568
568
|
enableCache: !0
|
|
569
569
|
});
|
|
570
|
-
if (!Array.isArray(
|
|
570
|
+
if (!Array.isArray(o))
|
|
571
571
|
return;
|
|
572
572
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
573
|
-
return
|
|
573
|
+
return o.map((c, l) => ({
|
|
574
574
|
context: {
|
|
575
575
|
...t,
|
|
576
576
|
localState: {
|
|
@@ -581,7 +581,7 @@ const getComponent = ({
|
|
|
581
581
|
[`$${r}Index`]: l
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
|
-
block:
|
|
584
|
+
block: i
|
|
585
585
|
}));
|
|
586
586
|
}, SIZES = {
|
|
587
587
|
small: {
|
|
@@ -606,17 +606,17 @@ const getComponent = ({
|
|
|
606
606
|
const n = fastClone(SIZES);
|
|
607
607
|
if (!e || !t)
|
|
608
608
|
return n;
|
|
609
|
-
const
|
|
609
|
+
const i = Math.floor(e / 2);
|
|
610
610
|
n.small = {
|
|
611
611
|
max: e,
|
|
612
|
-
min:
|
|
613
|
-
default:
|
|
612
|
+
min: i,
|
|
613
|
+
default: i + 1
|
|
614
614
|
};
|
|
615
|
-
const
|
|
615
|
+
const o = n.small.max + 1;
|
|
616
616
|
n.medium = {
|
|
617
617
|
max: t,
|
|
618
|
-
min:
|
|
619
|
-
default:
|
|
618
|
+
min: o,
|
|
619
|
+
default: o + 1
|
|
620
620
|
};
|
|
621
621
|
const a = n.medium.max + 1;
|
|
622
622
|
return n.large = {
|
|
@@ -627,11 +627,17 @@ const getComponent = ({
|
|
|
627
627
|
}, n;
|
|
628
628
|
};
|
|
629
629
|
function InlinedStyles(e) {
|
|
630
|
-
return /* @__PURE__ */ jsx(
|
|
630
|
+
return /* @__PURE__ */ jsx(
|
|
631
|
+
"style",
|
|
632
|
+
{
|
|
633
|
+
dangerouslySetInnerHTML: { __html: e.styles },
|
|
634
|
+
"data-id": e.id
|
|
635
|
+
}
|
|
636
|
+
);
|
|
631
637
|
}
|
|
632
638
|
function BlockStyles(e) {
|
|
633
639
|
function t() {
|
|
634
|
-
const
|
|
640
|
+
const i = getProcessedBlock({
|
|
635
641
|
block: e.block,
|
|
636
642
|
localState: e.context.localState,
|
|
637
643
|
rootState: e.context.rootState,
|
|
@@ -639,43 +645,43 @@ function BlockStyles(e) {
|
|
|
639
645
|
context: e.context.context,
|
|
640
646
|
shouldEvaluateBindings: !0
|
|
641
647
|
});
|
|
642
|
-
return checkIsDefined(
|
|
648
|
+
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
643
649
|
}
|
|
644
650
|
function n() {
|
|
645
651
|
var y;
|
|
646
|
-
const
|
|
652
|
+
const i = getProcessedBlock({
|
|
647
653
|
block: e.block,
|
|
648
654
|
localState: e.context.localState,
|
|
649
655
|
rootState: e.context.rootState,
|
|
650
656
|
rootSetState: e.context.rootSetState,
|
|
651
657
|
context: e.context.context,
|
|
652
658
|
shouldEvaluateBindings: !0
|
|
653
|
-
}),
|
|
659
|
+
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
654
660
|
((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
|
|
655
|
-
), s =
|
|
656
|
-
if (!
|
|
661
|
+
), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, u = i.id;
|
|
662
|
+
if (!u)
|
|
657
663
|
return "";
|
|
658
664
|
const m = s ? createCssClass({
|
|
659
|
-
className:
|
|
665
|
+
className: u,
|
|
660
666
|
styles: s
|
|
661
667
|
}) : "", g = c ? createCssClass({
|
|
662
|
-
className:
|
|
668
|
+
className: u,
|
|
663
669
|
styles: c,
|
|
664
670
|
mediaQuery: getMaxWidthQueryForSize(
|
|
665
671
|
"medium",
|
|
666
672
|
r
|
|
667
673
|
)
|
|
668
|
-
}) : "",
|
|
669
|
-
className:
|
|
674
|
+
}) : "", h = l ? createCssClass({
|
|
675
|
+
className: u,
|
|
670
676
|
styles: l,
|
|
671
677
|
mediaQuery: getMaxWidthQueryForSize(
|
|
672
678
|
"small",
|
|
673
679
|
r
|
|
674
680
|
)
|
|
675
681
|
}) : "";
|
|
676
|
-
return [m, g,
|
|
682
|
+
return [m, g, h].join(" ");
|
|
677
683
|
}
|
|
678
|
-
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
684
|
+
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
|
|
679
685
|
}
|
|
680
686
|
function capitalizeFirstLetter(e) {
|
|
681
687
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
@@ -691,13 +697,13 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
|
|
|
691
697
|
enableCache: !0
|
|
692
698
|
});
|
|
693
699
|
function getBlockActions(e) {
|
|
694
|
-
var
|
|
695
|
-
const t = {}, n = (
|
|
696
|
-
for (const
|
|
697
|
-
if (!n.hasOwnProperty(
|
|
700
|
+
var i;
|
|
701
|
+
const t = {}, n = (i = e.block.actions) != null ? i : {};
|
|
702
|
+
for (const o in n) {
|
|
703
|
+
if (!n.hasOwnProperty(o))
|
|
698
704
|
continue;
|
|
699
|
-
const a = n[
|
|
700
|
-
let r = getEventHandlerName(
|
|
705
|
+
const a = n[o];
|
|
706
|
+
let r = getEventHandlerName(o);
|
|
701
707
|
if (e.stripPrefix)
|
|
702
708
|
switch (TARGET) {
|
|
703
709
|
case "vue":
|
|
@@ -723,7 +729,7 @@ function getBlockProperties({
|
|
|
723
729
|
block: e,
|
|
724
730
|
context: t
|
|
725
731
|
}) {
|
|
726
|
-
var
|
|
732
|
+
var i;
|
|
727
733
|
const n = {
|
|
728
734
|
...extractRelevantRootBlockProperties(e),
|
|
729
735
|
...e.properties,
|
|
@@ -732,7 +738,7 @@ function getBlockProperties({
|
|
|
732
738
|
block: e,
|
|
733
739
|
context: t
|
|
734
740
|
}),
|
|
735
|
-
[getClassPropName()]: [e.id, "builder-block", e.class, (
|
|
741
|
+
[getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
|
|
736
742
|
};
|
|
737
743
|
return transformBlockProperties({
|
|
738
744
|
properties: n,
|
|
@@ -787,8 +793,8 @@ const getWrapperProps = ({
|
|
|
787
793
|
componentOptions: e,
|
|
788
794
|
builderBlock: t,
|
|
789
795
|
context: n,
|
|
790
|
-
componentRef:
|
|
791
|
-
includeBlockProps:
|
|
796
|
+
componentRef: i,
|
|
797
|
+
includeBlockProps: o,
|
|
792
798
|
isInteractive: a,
|
|
793
799
|
contextValue: r
|
|
794
800
|
}) => {
|
|
@@ -798,7 +804,7 @@ const getWrapperProps = ({
|
|
|
798
804
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
799
805
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
800
806
|
*/
|
|
801
|
-
...
|
|
807
|
+
...o ? {
|
|
802
808
|
attributes: getBlockProperties({
|
|
803
809
|
block: t,
|
|
804
810
|
context: r
|
|
@@ -806,15 +812,15 @@ const getWrapperProps = ({
|
|
|
806
812
|
} : {}
|
|
807
813
|
};
|
|
808
814
|
return a ? {
|
|
809
|
-
Wrapper:
|
|
815
|
+
Wrapper: i,
|
|
810
816
|
block: t,
|
|
811
817
|
context: n,
|
|
812
818
|
wrapperProps: e,
|
|
813
|
-
includeBlockProps:
|
|
819
|
+
includeBlockProps: o
|
|
814
820
|
} : s;
|
|
815
821
|
};
|
|
816
822
|
function ComponentRef(e) {
|
|
817
|
-
var
|
|
823
|
+
var i;
|
|
818
824
|
const [t, n] = useState(
|
|
819
825
|
() => e.isInteractive ? InteractiveElement : e.componentRef
|
|
820
826
|
);
|
|
@@ -831,15 +837,15 @@ function ComponentRef(e) {
|
|
|
831
837
|
isInteractive: e.isInteractive,
|
|
832
838
|
contextValue: e.context
|
|
833
839
|
}),
|
|
834
|
-
children: (
|
|
840
|
+
children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ jsx(
|
|
835
841
|
Block,
|
|
836
842
|
{
|
|
837
|
-
block:
|
|
843
|
+
block: o,
|
|
838
844
|
context: e.context,
|
|
839
845
|
registeredComponents: e.registeredComponents,
|
|
840
846
|
linkComponent: e.linkComponent
|
|
841
847
|
},
|
|
842
|
-
|
|
848
|
+
o.id
|
|
843
849
|
))
|
|
844
850
|
}
|
|
845
851
|
) }) : null });
|
|
@@ -857,7 +863,7 @@ function RepeatedBlock(e) {
|
|
|
857
863
|
) });
|
|
858
864
|
}
|
|
859
865
|
function Block(e) {
|
|
860
|
-
var c, l,
|
|
866
|
+
var c, l, u;
|
|
861
867
|
function t() {
|
|
862
868
|
return getComponent({
|
|
863
869
|
block: e.block,
|
|
@@ -871,7 +877,7 @@ function Block(e) {
|
|
|
871
877
|
context: e.context
|
|
872
878
|
});
|
|
873
879
|
}
|
|
874
|
-
function
|
|
880
|
+
function i() {
|
|
875
881
|
var m;
|
|
876
882
|
return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
|
|
877
883
|
block: e.block,
|
|
@@ -882,49 +888,49 @@ function Block(e) {
|
|
|
882
888
|
shouldEvaluateBindings: !0
|
|
883
889
|
});
|
|
884
890
|
}
|
|
885
|
-
function
|
|
891
|
+
function o() {
|
|
886
892
|
var g;
|
|
887
|
-
return e.block.tagName === "a" || ((g =
|
|
893
|
+
return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
888
894
|
}
|
|
889
895
|
function a() {
|
|
890
|
-
var
|
|
891
|
-
if ((
|
|
896
|
+
var h, y;
|
|
897
|
+
if ((h = e.block.repeat) != null && h.collection)
|
|
892
898
|
return !!((y = n == null ? void 0 : n()) != null && y.length);
|
|
893
|
-
const m = "hide" in
|
|
894
|
-
return ("show" in
|
|
899
|
+
const m = "hide" in i() ? i().hide : !1;
|
|
900
|
+
return ("show" in i() ? i().show : !0) && !m;
|
|
895
901
|
}
|
|
896
902
|
function r() {
|
|
897
|
-
var g,
|
|
898
|
-
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (
|
|
903
|
+
var g, h;
|
|
904
|
+
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (h = i().children) != null ? h : [] : [];
|
|
899
905
|
}
|
|
900
906
|
function s() {
|
|
901
|
-
var m, g,
|
|
907
|
+
var m, g, h, y, p, k, T, S, C, E, I;
|
|
902
908
|
return {
|
|
903
|
-
blockChildren: (m =
|
|
909
|
+
blockChildren: (m = i().children) != null ? m : [],
|
|
904
910
|
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
905
911
|
componentOptions: {
|
|
906
|
-
...getBlockComponentOptions(
|
|
912
|
+
...getBlockComponentOptions(i()),
|
|
907
913
|
builderContext: e.context,
|
|
908
|
-
...((
|
|
914
|
+
...((h = t == null ? void 0 : t()) == null ? void 0 : h.name) === "Core:Button" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
|
|
909
915
|
builderLinkComponent: e.linkComponent
|
|
910
916
|
} : {},
|
|
911
|
-
...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((
|
|
917
|
+
...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
|
|
912
918
|
builderComponents: e.registeredComponents
|
|
913
919
|
} : {}
|
|
914
920
|
},
|
|
915
921
|
context: e.context,
|
|
916
922
|
linkComponent: e.linkComponent,
|
|
917
923
|
registeredComponents: e.registeredComponents,
|
|
918
|
-
builderBlock:
|
|
924
|
+
builderBlock: i(),
|
|
919
925
|
includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
|
|
920
926
|
isInteractive: !((I = t == null ? void 0 : t()) != null && I.isRSC)
|
|
921
927
|
};
|
|
922
928
|
}
|
|
923
929
|
return useEffect(() => {
|
|
924
|
-
const m =
|
|
930
|
+
const m = i().id, g = i().animations;
|
|
925
931
|
g && m && bindAnimations(
|
|
926
|
-
g.filter((
|
|
927
|
-
...
|
|
932
|
+
g.filter((h) => h.trigger !== "hover").map((h) => ({
|
|
933
|
+
...h,
|
|
928
934
|
elementId: m
|
|
929
935
|
}))
|
|
930
936
|
);
|
|
@@ -943,7 +949,7 @@ function Block(e) {
|
|
|
943
949
|
includeBlockProps: s().includeBlockProps,
|
|
944
950
|
isInteractive: s().isInteractive
|
|
945
951
|
}
|
|
946
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
952
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (u = n()) == null ? void 0 : u.map((m, g) => /* @__PURE__ */ jsx(
|
|
947
953
|
RepeatedBlock,
|
|
948
954
|
{
|
|
949
955
|
repeatContext: m.context,
|
|
@@ -955,8 +961,8 @@ function Block(e) {
|
|
|
955
961
|
)) }) : /* @__PURE__ */ jsxs(
|
|
956
962
|
BlockWrapper,
|
|
957
963
|
{
|
|
958
|
-
Wrapper:
|
|
959
|
-
block:
|
|
964
|
+
Wrapper: o(),
|
|
965
|
+
block: i(),
|
|
960
966
|
context: e.context,
|
|
961
967
|
linkComponent: e.linkComponent,
|
|
962
968
|
children: [
|
|
@@ -991,12 +997,12 @@ function Block(e) {
|
|
|
991
997
|
}
|
|
992
998
|
function BlocksWrapper(e) {
|
|
993
999
|
function t() {
|
|
994
|
-
var
|
|
995
|
-
return "builder-blocks" + ((
|
|
1000
|
+
var o;
|
|
1001
|
+
return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
|
|
996
1002
|
}
|
|
997
1003
|
function n() {
|
|
998
|
-
var
|
|
999
|
-
isEditing() && !((
|
|
1004
|
+
var o, a;
|
|
1005
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
1000
1006
|
{
|
|
1001
1007
|
type: "builder.clickEmptyBlocks",
|
|
1002
1008
|
data: {
|
|
@@ -1007,9 +1013,9 @@ function BlocksWrapper(e) {
|
|
|
1007
1013
|
"*"
|
|
1008
1014
|
));
|
|
1009
1015
|
}
|
|
1010
|
-
function
|
|
1011
|
-
var
|
|
1012
|
-
isEditing() && !((
|
|
1016
|
+
function i() {
|
|
1017
|
+
var o, a;
|
|
1018
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
1013
1019
|
{
|
|
1014
1020
|
type: "builder.hoverEmptyBlocks",
|
|
1015
1021
|
data: {
|
|
@@ -1028,9 +1034,9 @@ function BlocksWrapper(e) {
|
|
|
1028
1034
|
"builder-path": e.path,
|
|
1029
1035
|
"builder-parent-id": e.parent,
|
|
1030
1036
|
style: e.styleProp,
|
|
1031
|
-
onClick: (
|
|
1032
|
-
onMouseEnter: (
|
|
1033
|
-
onKeyPress: (
|
|
1037
|
+
onClick: (o) => n(),
|
|
1038
|
+
onMouseEnter: (o) => i(),
|
|
1039
|
+
onKeyPress: (o) => n(),
|
|
1034
1040
|
...e.BlocksWrapperProps,
|
|
1035
1041
|
children: e.children
|
|
1036
1042
|
}
|
|
@@ -1043,7 +1049,7 @@ function BlocksWrapper(e) {
|
|
|
1043
1049
|
] });
|
|
1044
1050
|
}
|
|
1045
1051
|
function Blocks(e) {
|
|
1046
|
-
var
|
|
1052
|
+
var i, o, a;
|
|
1047
1053
|
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
1048
1054
|
return /* @__PURE__ */ jsx(
|
|
1049
1055
|
BlocksWrapper,
|
|
@@ -1052,8 +1058,8 @@ function Blocks(e) {
|
|
|
1052
1058
|
parent: e.parent,
|
|
1053
1059
|
path: e.path,
|
|
1054
1060
|
styleProp: e.styleProp,
|
|
1055
|
-
BlocksWrapper: ((
|
|
1056
|
-
BlocksWrapperProps: ((
|
|
1061
|
+
BlocksWrapper: ((i = e.context) == null ? void 0 : i.BlocksWrapper) || t.BlocksWrapper,
|
|
1062
|
+
BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || t.BlocksWrapperProps,
|
|
1057
1063
|
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
|
|
1058
1064
|
Block,
|
|
1059
1065
|
{
|
|
@@ -1071,33 +1077,33 @@ function Columns(e) {
|
|
|
1071
1077
|
var T;
|
|
1072
1078
|
const [t, n] = useState(
|
|
1073
1079
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
1074
|
-
), [
|
|
1080
|
+
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
1075
1081
|
() => e.stackColumnsAt || "tablet"
|
|
1076
1082
|
);
|
|
1077
|
-
function s(
|
|
1083
|
+
function s(S) {
|
|
1078
1084
|
var C;
|
|
1079
|
-
return ((C =
|
|
1085
|
+
return ((C = i[S]) == null ? void 0 : C.width) || 100 / i.length;
|
|
1080
1086
|
}
|
|
1081
|
-
function c(
|
|
1082
|
-
const C = t * (
|
|
1083
|
-
return `calc(${s(
|
|
1087
|
+
function c(S) {
|
|
1088
|
+
const C = t * (i.length - 1) / i.length;
|
|
1089
|
+
return `calc(${s(S)}% - ${C}px)`;
|
|
1084
1090
|
}
|
|
1085
1091
|
function l({
|
|
1086
|
-
stackedStyle:
|
|
1092
|
+
stackedStyle: S,
|
|
1087
1093
|
desktopStyle: C
|
|
1088
1094
|
}) {
|
|
1089
|
-
return a === "tablet" ?
|
|
1095
|
+
return a === "tablet" ? S : C;
|
|
1090
1096
|
}
|
|
1091
|
-
function
|
|
1092
|
-
stackedStyle:
|
|
1097
|
+
function u({
|
|
1098
|
+
stackedStyle: S,
|
|
1093
1099
|
desktopStyle: C
|
|
1094
1100
|
}) {
|
|
1095
|
-
return a === "never" ? C :
|
|
1101
|
+
return a === "never" ? C : S;
|
|
1096
1102
|
}
|
|
1097
1103
|
const [m, g] = useState(
|
|
1098
1104
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
1099
1105
|
);
|
|
1100
|
-
function
|
|
1106
|
+
function h() {
|
|
1101
1107
|
return {
|
|
1102
1108
|
"--flex-dir": m,
|
|
1103
1109
|
"--flex-dir-tablet": l({
|
|
@@ -1106,8 +1112,8 @@ function Columns(e) {
|
|
|
1106
1112
|
})
|
|
1107
1113
|
};
|
|
1108
1114
|
}
|
|
1109
|
-
function y(
|
|
1110
|
-
const C =
|
|
1115
|
+
function y(S) {
|
|
1116
|
+
const C = S === 0 ? 0 : t, E = c(S), I = `${C}px`, B = "100%", j = 0;
|
|
1111
1117
|
return {
|
|
1112
1118
|
...{
|
|
1113
1119
|
display: "flex",
|
|
@@ -1116,33 +1122,33 @@ function Columns(e) {
|
|
|
1116
1122
|
},
|
|
1117
1123
|
width: E,
|
|
1118
1124
|
["marginLeft"]: I,
|
|
1119
|
-
"--column-width-mobile":
|
|
1120
|
-
stackedStyle:
|
|
1125
|
+
"--column-width-mobile": u({
|
|
1126
|
+
stackedStyle: B,
|
|
1121
1127
|
desktopStyle: E
|
|
1122
1128
|
}),
|
|
1123
|
-
"--column-margin-left-mobile":
|
|
1124
|
-
stackedStyle:
|
|
1129
|
+
"--column-margin-left-mobile": u({
|
|
1130
|
+
stackedStyle: j,
|
|
1125
1131
|
desktopStyle: I
|
|
1126
1132
|
}),
|
|
1127
1133
|
"--column-width-tablet": l({
|
|
1128
|
-
stackedStyle:
|
|
1134
|
+
stackedStyle: B,
|
|
1129
1135
|
desktopStyle: E
|
|
1130
1136
|
}),
|
|
1131
1137
|
"--column-margin-left-tablet": l({
|
|
1132
|
-
stackedStyle:
|
|
1138
|
+
stackedStyle: j,
|
|
1133
1139
|
desktopStyle: I
|
|
1134
1140
|
})
|
|
1135
1141
|
};
|
|
1136
1142
|
}
|
|
1137
|
-
function S
|
|
1143
|
+
function p(S) {
|
|
1138
1144
|
var E, I;
|
|
1139
1145
|
return getSizesForBreakpoints(
|
|
1140
1146
|
((I = (E = e.builderContext.content) == null ? void 0 : E.meta) == null ? void 0 : I.breakpoints) || {}
|
|
1141
|
-
)[
|
|
1147
|
+
)[S].max;
|
|
1142
1148
|
}
|
|
1143
1149
|
function k() {
|
|
1144
1150
|
return `
|
|
1145
|
-
@media (max-width: ${
|
|
1151
|
+
@media (max-width: ${p("medium")}px) {
|
|
1146
1152
|
.${e.builderBlock.id}-breakpoints {
|
|
1147
1153
|
flex-direction: var(--flex-dir-tablet);
|
|
1148
1154
|
align-items: stretch;
|
|
@@ -1154,7 +1160,7 @@ function Columns(e) {
|
|
|
1154
1160
|
}
|
|
1155
1161
|
}
|
|
1156
1162
|
|
|
1157
|
-
@media (max-width: ${
|
|
1163
|
+
@media (max-width: ${p("small")}px) {
|
|
1158
1164
|
.${e.builderBlock.id}-breakpoints {
|
|
1159
1165
|
flex-direction: var(--flex-dir);
|
|
1160
1166
|
align-items: stretch;
|
|
@@ -1171,18 +1177,18 @@ function Columns(e) {
|
|
|
1171
1177
|
/* @__PURE__ */ jsxs(
|
|
1172
1178
|
"div",
|
|
1173
1179
|
{
|
|
1174
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
1175
|
-
style:
|
|
1180
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,
|
|
1181
|
+
style: h(),
|
|
1176
1182
|
children: [
|
|
1177
|
-
/* @__PURE__ */ jsx(InlinedStyles, { styles: k() }),
|
|
1178
|
-
(T = e.columns) == null ? void 0 : T.map((
|
|
1183
|
+
/* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: k() }),
|
|
1184
|
+
(T = e.columns) == null ? void 0 : T.map((S, C) => /* @__PURE__ */ jsx(
|
|
1179
1185
|
DynamicRenderer,
|
|
1180
1186
|
{
|
|
1181
|
-
TagName:
|
|
1187
|
+
TagName: S.link ? e.builderLinkComponent || "a" : "div",
|
|
1182
1188
|
actionAttributes: {},
|
|
1183
1189
|
attributes: {
|
|
1184
|
-
...
|
|
1185
|
-
href:
|
|
1190
|
+
...S.link ? {
|
|
1191
|
+
href: S.link
|
|
1186
1192
|
} : {},
|
|
1187
1193
|
[getClassPropName()]: "builder-column",
|
|
1188
1194
|
style: mapStyleObjToStrIfNeeded(y(C))
|
|
@@ -1198,7 +1204,7 @@ function Columns(e) {
|
|
|
1198
1204
|
context: e.builderContext,
|
|
1199
1205
|
registeredComponents: e.builderComponents,
|
|
1200
1206
|
linkComponent: e.builderLinkComponent,
|
|
1201
|
-
blocks:
|
|
1207
|
+
blocks: S.blocks
|
|
1202
1208
|
}
|
|
1203
1209
|
)
|
|
1204
1210
|
},
|
|
@@ -1207,7 +1213,7 @@ function Columns(e) {
|
|
|
1207
1213
|
]
|
|
1208
1214
|
}
|
|
1209
1215
|
),
|
|
1210
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
1216
|
+
/* @__PURE__ */ jsx("style", { children: `.div-003f4b1c {
|
|
1211
1217
|
display: flex;
|
|
1212
1218
|
line-height: normal;
|
|
1213
1219
|
}` })
|
|
@@ -1220,8 +1226,8 @@ function removeProtocol(e) {
|
|
|
1220
1226
|
return e.replace(/http(s)?:/, "");
|
|
1221
1227
|
}
|
|
1222
1228
|
function updateQueryParam(e = "", t, n) {
|
|
1223
|
-
const
|
|
1224
|
-
return e.match(
|
|
1229
|
+
const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
|
|
1230
|
+
return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
|
|
1225
1231
|
}
|
|
1226
1232
|
function getShopifyImageUrl(e, t) {
|
|
1227
1233
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
@@ -1230,8 +1236,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
1230
1236
|
return removeProtocol(e);
|
|
1231
1237
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
1232
1238
|
if (n) {
|
|
1233
|
-
const
|
|
1234
|
-
return removeProtocol(`${
|
|
1239
|
+
const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
|
|
1240
|
+
return removeProtocol(`${i[0]}_${a}${o}`);
|
|
1235
1241
|
}
|
|
1236
1242
|
return null;
|
|
1237
1243
|
}
|
|
@@ -1241,21 +1247,21 @@ function getSrcSet(e) {
|
|
|
1241
1247
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
1242
1248
|
if (e.match(/builder\.io/)) {
|
|
1243
1249
|
let n = e;
|
|
1244
|
-
const
|
|
1245
|
-
return isNaN(
|
|
1250
|
+
const i = Number(e.split("?width=")[1]);
|
|
1251
|
+
return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
|
|
1246
1252
|
}
|
|
1247
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n,
|
|
1253
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
|
|
1248
1254
|
}
|
|
1249
1255
|
function Image(e) {
|
|
1250
|
-
var
|
|
1256
|
+
var o, a, r, s;
|
|
1251
1257
|
function t() {
|
|
1252
|
-
var
|
|
1258
|
+
var u;
|
|
1253
1259
|
const l = e.image || e.src;
|
|
1254
1260
|
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
1255
1261
|
// images, otherwise you can supply this prop manually
|
|
1256
1262
|
!(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
|
|
1257
1263
|
return e.srcset;
|
|
1258
|
-
if (e.srcset && ((
|
|
1264
|
+
if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
|
|
1259
1265
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1260
1266
|
return console.debug("Removed given srcset"), getSrcSet(l);
|
|
1261
1267
|
} else if (e.image && !e.srcset)
|
|
@@ -1266,7 +1272,7 @@ function Image(e) {
|
|
|
1266
1272
|
var c;
|
|
1267
1273
|
return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1268
1274
|
}
|
|
1269
|
-
function
|
|
1275
|
+
function i() {
|
|
1270
1276
|
const c = {
|
|
1271
1277
|
position: "absolute",
|
|
1272
1278
|
height: "100%",
|
|
@@ -1289,7 +1295,7 @@ function Image(e) {
|
|
|
1289
1295
|
style: {
|
|
1290
1296
|
objectPosition: e.backgroundPosition || "center",
|
|
1291
1297
|
objectFit: e.backgroundSize || "cover",
|
|
1292
|
-
...
|
|
1298
|
+
...i()
|
|
1293
1299
|
},
|
|
1294
1300
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
1295
1301
|
src: e.image,
|
|
@@ -1298,7 +1304,7 @@ function Image(e) {
|
|
|
1298
1304
|
}
|
|
1299
1305
|
)
|
|
1300
1306
|
] }),
|
|
1301
|
-
e.aspectRatio && !((a = (
|
|
1307
|
+
e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(
|
|
1302
1308
|
"div",
|
|
1303
1309
|
{
|
|
1304
1310
|
className: "builder-image-sizer div-a0c95e8c",
|
|
@@ -1557,12 +1563,12 @@ const componentInfo$f = {
|
|
|
1557
1563
|
}],
|
|
1558
1564
|
onChange: (e) => {
|
|
1559
1565
|
function t() {
|
|
1560
|
-
n.forEach((
|
|
1561
|
-
|
|
1566
|
+
n.forEach((i) => {
|
|
1567
|
+
i.delete("width");
|
|
1562
1568
|
});
|
|
1563
1569
|
}
|
|
1564
1570
|
const n = e.get("columns");
|
|
1565
|
-
Array.isArray(n) && n.find((
|
|
1571
|
+
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
|
|
1566
1572
|
}
|
|
1567
1573
|
}, {
|
|
1568
1574
|
name: "space",
|
|
@@ -1612,27 +1618,27 @@ const componentInfo$f = {
|
|
|
1612
1618
|
e.delete("srcset"), e.delete("noWebp");
|
|
1613
1619
|
function n(r, s = 6e4) {
|
|
1614
1620
|
return new Promise((c, l) => {
|
|
1615
|
-
const
|
|
1621
|
+
const u = document.createElement("img");
|
|
1616
1622
|
let m = !1;
|
|
1617
|
-
|
|
1618
|
-
m = !0, c(
|
|
1619
|
-
},
|
|
1623
|
+
u.onload = () => {
|
|
1624
|
+
m = !0, c(u);
|
|
1625
|
+
}, u.addEventListener("error", (g) => {
|
|
1620
1626
|
console.warn("Image load failed", g.error), l(g.error);
|
|
1621
|
-
}),
|
|
1627
|
+
}), u.src = r, setTimeout(() => {
|
|
1622
1628
|
m || l(new Error("Image load timed out"));
|
|
1623
1629
|
}, s);
|
|
1624
1630
|
});
|
|
1625
1631
|
}
|
|
1626
|
-
function
|
|
1632
|
+
function i(r) {
|
|
1627
1633
|
return Math.round(r * 1e3) / 1e3;
|
|
1628
1634
|
}
|
|
1629
|
-
const
|
|
1630
|
-
if (fetch(
|
|
1635
|
+
const o = e.get("image"), a = e.get("aspectRatio");
|
|
1636
|
+
if (fetch(o).then((r) => r.blob()).then((r) => {
|
|
1631
1637
|
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1632
|
-
}),
|
|
1633
|
-
return n(
|
|
1638
|
+
}), o && (!a || a === 0.7041))
|
|
1639
|
+
return n(o).then((r) => {
|
|
1634
1640
|
const s = e.get("aspectRatio");
|
|
1635
|
-
e.get("image") ===
|
|
1641
|
+
e.get("image") === o && (!s || s === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
|
|
1636
1642
|
});
|
|
1637
1643
|
}
|
|
1638
1644
|
}, {
|
|
@@ -1744,7 +1750,7 @@ const componentInfo$f = {
|
|
|
1744
1750
|
}]
|
|
1745
1751
|
};
|
|
1746
1752
|
function Slot(e) {
|
|
1747
|
-
var t, n,
|
|
1753
|
+
var t, n, i;
|
|
1748
1754
|
return /* @__PURE__ */ jsx(
|
|
1749
1755
|
"div",
|
|
1750
1756
|
{
|
|
@@ -1760,7 +1766,7 @@ function Slot(e) {
|
|
|
1760
1766
|
parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
|
|
1761
1767
|
path: `symbol.data.${e.name}`,
|
|
1762
1768
|
context: e.builderContext,
|
|
1763
|
-
blocks: (
|
|
1769
|
+
blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
|
|
1764
1770
|
}
|
|
1765
1771
|
)
|
|
1766
1772
|
}
|
|
@@ -1855,7 +1861,7 @@ const componentInfo$7 = {
|
|
|
1855
1861
|
}]
|
|
1856
1862
|
};
|
|
1857
1863
|
function CustomCode(e) {
|
|
1858
|
-
const t = useRef(null), [n,
|
|
1864
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1859
1865
|
return useEffect(() => {
|
|
1860
1866
|
var s;
|
|
1861
1867
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
|
|
@@ -1867,19 +1873,19 @@ function CustomCode(e) {
|
|
|
1867
1873
|
if (n.includes(l.src))
|
|
1868
1874
|
continue;
|
|
1869
1875
|
n.push(l.src);
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1876
|
+
const u = document.createElement("script");
|
|
1877
|
+
u.async = !0, u.src = l.src, document.head.appendChild(u);
|
|
1872
1878
|
} else if (!l.type || [
|
|
1873
1879
|
"text/javascript",
|
|
1874
1880
|
"application/javascript",
|
|
1875
1881
|
"application/ecmascript"
|
|
1876
1882
|
].includes(l.type)) {
|
|
1877
|
-
if (
|
|
1883
|
+
if (o.includes(l.innerText))
|
|
1878
1884
|
continue;
|
|
1879
1885
|
try {
|
|
1880
|
-
|
|
1881
|
-
} catch (
|
|
1882
|
-
console.warn("`CustomCode`: Error running script:",
|
|
1886
|
+
o.push(l.innerText), new Function(l.innerText)();
|
|
1887
|
+
} catch (u) {
|
|
1888
|
+
console.warn("`CustomCode`: Error running script:", u);
|
|
1883
1889
|
}
|
|
1884
1890
|
}
|
|
1885
1891
|
}
|
|
@@ -1904,9 +1910,9 @@ const componentInfo$6 = {
|
|
|
1904
1910
|
onChange: (e) => {
|
|
1905
1911
|
const t = e.get("url");
|
|
1906
1912
|
if (t)
|
|
1907
|
-
return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((
|
|
1908
|
-
e.get("url") === t && (
|
|
1909
|
-
}).catch((
|
|
1913
|
+
return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((i) => i.json()).then((i) => {
|
|
1914
|
+
e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
|
|
1915
|
+
}).catch((i) => {
|
|
1910
1916
|
e.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
1911
1917
|
});
|
|
1912
1918
|
e.delete("content");
|
|
@@ -1919,20 +1925,20 @@ const componentInfo$6 = {
|
|
|
1919
1925
|
}]
|
|
1920
1926
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1921
1927
|
function Embed(e) {
|
|
1922
|
-
const t = useRef(null), [n,
|
|
1928
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
|
|
1923
1929
|
function c() {
|
|
1924
1930
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1925
1931
|
return;
|
|
1926
1932
|
const l = t.current.getElementsByTagName("script");
|
|
1927
|
-
for (let
|
|
1928
|
-
const m = l[
|
|
1933
|
+
for (let u = 0; u < l.length; u++) {
|
|
1934
|
+
const m = l[u];
|
|
1929
1935
|
if (m.src && !n.includes(m.src)) {
|
|
1930
1936
|
n.push(m.src);
|
|
1931
1937
|
const g = document.createElement("script");
|
|
1932
1938
|
g.async = !0, g.src = m.src, document.head.appendChild(g);
|
|
1933
|
-
} else if (isJsScript(m) && !
|
|
1939
|
+
} else if (isJsScript(m) && !o.includes(m.innerText))
|
|
1934
1940
|
try {
|
|
1935
|
-
|
|
1941
|
+
o.push(m.innerText), new Function(m.innerText)();
|
|
1936
1942
|
} catch (g) {
|
|
1937
1943
|
console.warn("`Embed`: Error running script:", g);
|
|
1938
1944
|
}
|
|
@@ -2184,116 +2190,116 @@ const componentInfo$5 = {
|
|
|
2184
2190
|
const e = process.env.NODE_ENV || "production";
|
|
2185
2191
|
return validEnvList.includes(e) ? e : "production";
|
|
2186
2192
|
}, get = (e, t, n) => {
|
|
2187
|
-
const
|
|
2188
|
-
return
|
|
2193
|
+
const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, a) => o != null ? o[a] : o, e);
|
|
2194
|
+
return i === void 0 || i === e ? n : i;
|
|
2189
2195
|
};
|
|
2190
2196
|
function FormComponent(e) {
|
|
2191
2197
|
var m, g;
|
|
2192
|
-
const t = useRef(null), [n,
|
|
2193
|
-
function c(
|
|
2194
|
-
var
|
|
2198
|
+
const t = useRef(null), [n, i] = useState(() => "unsubmitted"), [o, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2199
|
+
function c(h) {
|
|
2200
|
+
var p, k;
|
|
2195
2201
|
const y = {
|
|
2196
2202
|
...e.builderContext.rootState,
|
|
2197
|
-
...
|
|
2203
|
+
...h
|
|
2198
2204
|
};
|
|
2199
|
-
e.builderContext.rootSetState ? (k = (
|
|
2205
|
+
e.builderContext.rootSetState ? (k = (p = e.builderContext).rootSetState) == null || k.call(p, y) : e.builderContext.rootState = y;
|
|
2200
2206
|
}
|
|
2201
2207
|
function l() {
|
|
2202
2208
|
return isEditing() && e.previewState || n;
|
|
2203
2209
|
}
|
|
2204
|
-
function
|
|
2205
|
-
var
|
|
2210
|
+
function u(h) {
|
|
2211
|
+
var p;
|
|
2206
2212
|
const y = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
2207
2213
|
if (e.sendSubmissionsTo === "zapier")
|
|
2208
|
-
|
|
2214
|
+
h.preventDefault();
|
|
2209
2215
|
else if (y) {
|
|
2210
2216
|
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
2211
|
-
|
|
2217
|
+
h.preventDefault();
|
|
2212
2218
|
return;
|
|
2213
2219
|
}
|
|
2214
|
-
|
|
2215
|
-
const k =
|
|
2216
|
-
let
|
|
2220
|
+
h.preventDefault();
|
|
2221
|
+
const k = h.currentTarget, T = e.customHeaders || {};
|
|
2222
|
+
let S;
|
|
2217
2223
|
const C = new FormData(k), E = Array.from(
|
|
2218
|
-
|
|
2219
|
-
).filter((
|
|
2224
|
+
h.currentTarget.querySelectorAll("input,select,textarea")
|
|
2225
|
+
).filter((d) => !!d.name).map((d) => {
|
|
2220
2226
|
let f;
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2223
|
-
if (
|
|
2224
|
-
if (
|
|
2225
|
-
return f =
|
|
2226
|
-
key:
|
|
2227
|
+
const v = d.name;
|
|
2228
|
+
if (d instanceof HTMLInputElement)
|
|
2229
|
+
if (d.type === "radio") {
|
|
2230
|
+
if (d.checked)
|
|
2231
|
+
return f = d.name, {
|
|
2232
|
+
key: v,
|
|
2227
2233
|
value: f
|
|
2228
2234
|
};
|
|
2229
|
-
} else if (
|
|
2230
|
-
f =
|
|
2231
|
-
else if (
|
|
2232
|
-
const
|
|
2233
|
-
isNaN(
|
|
2235
|
+
} else if (d.type === "checkbox")
|
|
2236
|
+
f = d.checked;
|
|
2237
|
+
else if (d.type === "number" || d.type === "range") {
|
|
2238
|
+
const b = d.valueAsNumber;
|
|
2239
|
+
isNaN(b) || (f = b);
|
|
2234
2240
|
} else
|
|
2235
|
-
|
|
2241
|
+
d.type === "file" ? f = d.files : f = d.value;
|
|
2236
2242
|
else
|
|
2237
|
-
f =
|
|
2243
|
+
f = d.value;
|
|
2238
2244
|
return {
|
|
2239
|
-
key:
|
|
2245
|
+
key: v,
|
|
2240
2246
|
value: f
|
|
2241
2247
|
};
|
|
2242
2248
|
});
|
|
2243
2249
|
let I = e.contentType;
|
|
2244
|
-
if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value:
|
|
2245
|
-
(
|
|
2250
|
+
if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value: d }) => {
|
|
2251
|
+
(d instanceof File || Array.isArray(d) && d[0] instanceof File || d instanceof FileList) && (I = "multipart/form-data");
|
|
2246
2252
|
}), I !== "application/json")
|
|
2247
|
-
|
|
2253
|
+
S = C;
|
|
2248
2254
|
else {
|
|
2249
|
-
const
|
|
2250
|
-
Array.from(E).forEach(({ value: f, key:
|
|
2251
|
-
set(
|
|
2252
|
-
}),
|
|
2255
|
+
const d = {};
|
|
2256
|
+
Array.from(E).forEach(({ value: f, key: v }) => {
|
|
2257
|
+
set(d, v, f);
|
|
2258
|
+
}), S = JSON.stringify(d);
|
|
2253
2259
|
}
|
|
2254
|
-
I && I !== "multipart/form-data" && (y && ((
|
|
2255
|
-
const
|
|
2256
|
-
if (t.current && (t.current.dispatchEvent(
|
|
2260
|
+
I && I !== "multipart/form-data" && (y && ((p = e.action) != null && p.includes("zapier.com")) || (T["content-type"] = I));
|
|
2261
|
+
const B = new CustomEvent("presubmit", { detail: { body: S } });
|
|
2262
|
+
if (t.current && (t.current.dispatchEvent(B), B.defaultPrevented))
|
|
2257
2263
|
return;
|
|
2258
|
-
|
|
2259
|
-
const
|
|
2264
|
+
i("sending");
|
|
2265
|
+
const j = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2260
2266
|
e.sendSubmissionsToEmail || ""
|
|
2261
2267
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
2262
2268
|
fetch(
|
|
2263
|
-
e.sendSubmissionsTo === "email" ?
|
|
2264
|
-
{ body:
|
|
2269
|
+
e.sendSubmissionsTo === "email" ? j : e.action,
|
|
2270
|
+
{ body: S, headers: T, method: e.method || "post" }
|
|
2265
2271
|
).then(
|
|
2266
|
-
async (
|
|
2272
|
+
async (d) => {
|
|
2267
2273
|
let f;
|
|
2268
|
-
const
|
|
2269
|
-
if (
|
|
2270
|
-
let
|
|
2271
|
-
|
|
2274
|
+
const v = d.headers.get("content-type");
|
|
2275
|
+
if (v && v.indexOf("application/json") !== -1 ? f = await d.json() : f = await d.text(), !d.ok && e.errorMessagePath) {
|
|
2276
|
+
let b = get(f, e.errorMessagePath);
|
|
2277
|
+
b && (typeof b != "string" && (b = JSON.stringify(b)), s(b), c({ formErrorMessage: b }));
|
|
2272
2278
|
}
|
|
2273
|
-
if (a(f),
|
|
2274
|
-
const
|
|
2275
|
-
detail: { res:
|
|
2279
|
+
if (a(f), i(d.ok ? "success" : "error"), d.ok) {
|
|
2280
|
+
const b = new CustomEvent("submit:success", {
|
|
2281
|
+
detail: { res: d, body: f }
|
|
2276
2282
|
});
|
|
2277
2283
|
if (t.current) {
|
|
2278
|
-
if (t.current.dispatchEvent(
|
|
2284
|
+
if (t.current.dispatchEvent(b), b.defaultPrevented)
|
|
2279
2285
|
return;
|
|
2280
2286
|
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2281
2287
|
}
|
|
2282
2288
|
if (e.successUrl)
|
|
2283
2289
|
if (t.current) {
|
|
2284
|
-
const
|
|
2290
|
+
const x = new CustomEvent("route", {
|
|
2285
2291
|
detail: { url: e.successUrl }
|
|
2286
2292
|
});
|
|
2287
|
-
t.current.dispatchEvent(
|
|
2293
|
+
t.current.dispatchEvent(x), x.defaultPrevented || (location.href = e.successUrl);
|
|
2288
2294
|
} else
|
|
2289
2295
|
location.href = e.successUrl;
|
|
2290
2296
|
}
|
|
2291
2297
|
},
|
|
2292
|
-
(
|
|
2298
|
+
(d) => {
|
|
2293
2299
|
const f = new CustomEvent("submit:error", {
|
|
2294
|
-
detail: { error:
|
|
2300
|
+
detail: { error: d }
|
|
2295
2301
|
});
|
|
2296
|
-
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(
|
|
2302
|
+
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(d), i("error"));
|
|
2297
2303
|
}
|
|
2298
2304
|
);
|
|
2299
2305
|
}
|
|
@@ -2308,13 +2314,13 @@ function FormComponent(e) {
|
|
|
2308
2314
|
action: !e.sendWithJs && e.action,
|
|
2309
2315
|
method: e.method,
|
|
2310
2316
|
name: e.name,
|
|
2311
|
-
onSubmit: (
|
|
2317
|
+
onSubmit: (h) => u(h),
|
|
2312
2318
|
...e.attributes,
|
|
2313
2319
|
children: [
|
|
2314
|
-
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((
|
|
2320
|
+
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((h, y) => /* @__PURE__ */ jsx(
|
|
2315
2321
|
Block,
|
|
2316
2322
|
{
|
|
2317
|
-
block:
|
|
2323
|
+
block: h,
|
|
2318
2324
|
context: e.builderContext,
|
|
2319
2325
|
registeredComponents: e.builderComponents,
|
|
2320
2326
|
linkComponent: e.builderLinkComponent
|
|
@@ -2337,7 +2343,7 @@ function FormComponent(e) {
|
|
|
2337
2343
|
context: e.builderContext
|
|
2338
2344
|
}
|
|
2339
2345
|
) : null,
|
|
2340
|
-
l() === "error" &&
|
|
2346
|
+
l() === "error" && o ? /* @__PURE__ */ jsx("pre", { className: "builder-form-error-text pre-31bf8a14", children: JSON.stringify(o, null, 2) }) : null,
|
|
2341
2347
|
l() === "success" ? /* @__PURE__ */ jsx(
|
|
2342
2348
|
Blocks,
|
|
2343
2349
|
{
|
|
@@ -2620,7 +2626,7 @@ const componentInfo = {
|
|
|
2620
2626
|
}]
|
|
2621
2627
|
};
|
|
2622
2628
|
function Video(e) {
|
|
2623
|
-
var
|
|
2629
|
+
var i, o, a, r, s, c, l;
|
|
2624
2630
|
function t() {
|
|
2625
2631
|
return {
|
|
2626
2632
|
...e.autoPlay === !0 ? {
|
|
@@ -2661,7 +2667,7 @@ function Video(e) {
|
|
|
2661
2667
|
style: {
|
|
2662
2668
|
width: "100%",
|
|
2663
2669
|
height: "100%",
|
|
2664
|
-
...(
|
|
2670
|
+
...(i = e.attributes) == null ? void 0 : i.style,
|
|
2665
2671
|
objectFit: e.fit,
|
|
2666
2672
|
objectPosition: e.position,
|
|
2667
2673
|
// Hack to get object fit to work as expected and
|
|
@@ -2677,7 +2683,7 @@ function Video(e) {
|
|
|
2677
2683
|
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
2678
2684
|
}
|
|
2679
2685
|
),
|
|
2680
|
-
e.aspectRatio && !(e.fitContent && ((a = (
|
|
2686
|
+
e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(
|
|
2681
2687
|
"div",
|
|
2682
2688
|
{
|
|
2683
2689
|
style: {
|
|
@@ -2865,7 +2871,7 @@ const getExtraComponents = () => [{
|
|
|
2865
2871
|
})), checkShouldRenderVariants = ({
|
|
2866
2872
|
canTrack: e,
|
|
2867
2873
|
content: t
|
|
2868
|
-
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET),
|
|
2874
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getInitVariantsFnsScriptString = () => `
|
|
2869
2875
|
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2870
2876
|
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2871
2877
|
`, getUpdateCookieAndStylesScript = (e, t) => `
|
|
@@ -2882,7 +2888,7 @@ function InlinedScript(e) {
|
|
|
2882
2888
|
"script",
|
|
2883
2889
|
{
|
|
2884
2890
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
2885
|
-
id: e.id
|
|
2891
|
+
"data-id": e.id
|
|
2886
2892
|
}
|
|
2887
2893
|
);
|
|
2888
2894
|
}
|
|
@@ -2892,13 +2898,13 @@ function round(e) {
|
|
|
2892
2898
|
const findParentElement = (e, t, n = !0) => {
|
|
2893
2899
|
if (!(e instanceof HTMLElement))
|
|
2894
2900
|
return null;
|
|
2895
|
-
let
|
|
2901
|
+
let i = n ? e : e.parentElement;
|
|
2896
2902
|
do {
|
|
2897
|
-
if (!
|
|
2903
|
+
if (!i)
|
|
2898
2904
|
return null;
|
|
2899
|
-
if (t(
|
|
2900
|
-
return
|
|
2901
|
-
} while (
|
|
2905
|
+
if (t(i))
|
|
2906
|
+
return i;
|
|
2907
|
+
} while (i = i.parentElement);
|
|
2902
2908
|
return null;
|
|
2903
2909
|
}, findBuilderParent = (e) => findParentElement(e, (t) => {
|
|
2904
2910
|
const n = t.getAttribute("builder-id") || t.id;
|
|
@@ -2907,15 +2913,15 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2907
2913
|
event: e,
|
|
2908
2914
|
target: t
|
|
2909
2915
|
}) => {
|
|
2910
|
-
const n = t.getBoundingClientRect(),
|
|
2916
|
+
const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
|
|
2911
2917
|
return {
|
|
2912
2918
|
x: a,
|
|
2913
2919
|
y: r
|
|
2914
2920
|
};
|
|
2915
2921
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
2916
|
-
const t = e.target, n = t && findBuilderParent(t),
|
|
2922
|
+
const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2917
2923
|
return {
|
|
2918
|
-
targetBuilderElement:
|
|
2924
|
+
targetBuilderElement: i || void 0,
|
|
2919
2925
|
metadata: {
|
|
2920
2926
|
targetOffset: t ? computeOffset({
|
|
2921
2927
|
event: e,
|
|
@@ -2925,58 +2931,58 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2925
2931
|
event: e,
|
|
2926
2932
|
target: n
|
|
2927
2933
|
}) : void 0,
|
|
2928
|
-
builderElementIndex: n &&
|
|
2934
|
+
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2929
2935
|
}
|
|
2930
2936
|
};
|
|
2931
2937
|
};
|
|
2932
2938
|
function EnableEditor(e) {
|
|
2933
|
-
var T,
|
|
2939
|
+
var T, S, C, E, I, B, j;
|
|
2934
2940
|
const t = useRef(null);
|
|
2935
|
-
function n(
|
|
2936
|
-
var
|
|
2941
|
+
function n(d) {
|
|
2942
|
+
var v, b;
|
|
2937
2943
|
const f = {
|
|
2938
2944
|
...e.builderContextSignal.rootState,
|
|
2939
|
-
...
|
|
2945
|
+
...d
|
|
2940
2946
|
};
|
|
2941
|
-
e.builderContextSignal.rootSetState ? (
|
|
2942
|
-
...
|
|
2947
|
+
e.builderContextSignal.rootSetState ? (b = (v = e.builderContextSignal).rootSetState) == null || b.call(v, f) : e.setBuilderContextSignal((x) => ({
|
|
2948
|
+
...x,
|
|
2943
2949
|
rootState: f
|
|
2944
2950
|
}));
|
|
2945
2951
|
}
|
|
2946
|
-
function
|
|
2947
|
-
var
|
|
2952
|
+
function i(d) {
|
|
2953
|
+
var v, b, x, w, A;
|
|
2948
2954
|
const f = {
|
|
2949
2955
|
...e.builderContextSignal.content,
|
|
2950
|
-
...
|
|
2956
|
+
...d,
|
|
2951
2957
|
data: {
|
|
2952
|
-
...(
|
|
2953
|
-
...
|
|
2958
|
+
...(v = e.builderContextSignal.content) == null ? void 0 : v.data,
|
|
2959
|
+
...d == null ? void 0 : d.data
|
|
2954
2960
|
},
|
|
2955
2961
|
meta: {
|
|
2956
|
-
...(
|
|
2957
|
-
...
|
|
2958
|
-
breakpoints: ((
|
|
2962
|
+
...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
|
|
2963
|
+
...d == null ? void 0 : d.meta,
|
|
2964
|
+
breakpoints: ((x = d == null ? void 0 : d.meta) == null ? void 0 : x.breakpoints) || ((A = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : A.breakpoints)
|
|
2959
2965
|
}
|
|
2960
2966
|
};
|
|
2961
|
-
e.setBuilderContextSignal((
|
|
2962
|
-
...
|
|
2967
|
+
e.setBuilderContextSignal((R) => ({
|
|
2968
|
+
...R,
|
|
2963
2969
|
content: f
|
|
2964
2970
|
}));
|
|
2965
2971
|
}
|
|
2966
|
-
const [
|
|
2972
|
+
const [o, a] = useState(
|
|
2967
2973
|
() => e.contentWrapper || "div"
|
|
2968
2974
|
);
|
|
2969
|
-
function r(
|
|
2975
|
+
function r(d) {
|
|
2970
2976
|
return createEditorListener({
|
|
2971
2977
|
model: e.model,
|
|
2972
2978
|
trustedHosts: e.trustedHosts,
|
|
2973
2979
|
callbacks: {
|
|
2974
2980
|
configureSdk: (f) => {
|
|
2975
|
-
var
|
|
2976
|
-
const { breakpoints:
|
|
2977
|
-
!
|
|
2981
|
+
var x;
|
|
2982
|
+
const { breakpoints: v, contentId: b } = f;
|
|
2983
|
+
!b || b !== ((x = e.builderContextSignal.content) == null ? void 0 : x.id) || v && i({
|
|
2978
2984
|
meta: {
|
|
2979
|
-
breakpoints:
|
|
2985
|
+
breakpoints: v
|
|
2980
2986
|
}
|
|
2981
2987
|
});
|
|
2982
2988
|
},
|
|
@@ -2984,16 +2990,16 @@ function EnableEditor(e) {
|
|
|
2984
2990
|
triggerAnimation(f);
|
|
2985
2991
|
},
|
|
2986
2992
|
contentUpdate: (f) => {
|
|
2987
|
-
|
|
2993
|
+
i(f);
|
|
2988
2994
|
}
|
|
2989
2995
|
}
|
|
2990
|
-
})(
|
|
2996
|
+
})(d);
|
|
2991
2997
|
}
|
|
2992
2998
|
function s() {
|
|
2993
|
-
var f,
|
|
2994
|
-
const
|
|
2995
|
-
|
|
2996
|
-
code:
|
|
2999
|
+
var f, v;
|
|
3000
|
+
const d = (v = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : v.jsCode;
|
|
3001
|
+
d && evaluate({
|
|
3002
|
+
code: d,
|
|
2997
3003
|
context: e.context || {},
|
|
2998
3004
|
localState: void 0,
|
|
2999
3005
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -3004,61 +3010,52 @@ function EnableEditor(e) {
|
|
|
3004
3010
|
enableCache: !1
|
|
3005
3011
|
});
|
|
3006
3012
|
}
|
|
3007
|
-
const [c, l] = useState(() => ({})), [
|
|
3008
|
-
function
|
|
3009
|
-
var f,
|
|
3013
|
+
const [c, l] = useState(() => ({})), [u, m] = useState(() => ({})), [g, h] = useState(() => !1);
|
|
3014
|
+
function y(d) {
|
|
3015
|
+
var f, v;
|
|
3010
3016
|
if (e.builderContextSignal.content) {
|
|
3011
|
-
const
|
|
3017
|
+
const b = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, x = (v = e.builderContextSignal.content) == null ? void 0 : v.id;
|
|
3012
3018
|
_track({
|
|
3013
3019
|
type: "click",
|
|
3014
3020
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3015
|
-
contentId:
|
|
3021
|
+
contentId: x,
|
|
3016
3022
|
apiKey: e.apiKey,
|
|
3017
|
-
variationId:
|
|
3018
|
-
...getInteractionPropertiesForEvent(
|
|
3019
|
-
unique: !
|
|
3023
|
+
variationId: b !== x ? b : void 0,
|
|
3024
|
+
...getInteractionPropertiesForEvent(d),
|
|
3025
|
+
unique: !g
|
|
3020
3026
|
});
|
|
3021
3027
|
}
|
|
3022
|
-
|
|
3023
|
-
}
|
|
3024
|
-
function b(u) {
|
|
3025
|
-
return u.replace(
|
|
3026
|
-
/{{([^}]+)}}/g,
|
|
3027
|
-
(f, p) => String(
|
|
3028
|
-
evaluate({
|
|
3029
|
-
code: p,
|
|
3030
|
-
context: e.context || {},
|
|
3031
|
-
localState: void 0,
|
|
3032
|
-
rootState: e.builderContextSignal.rootState,
|
|
3033
|
-
rootSetState: e.builderContextSignal.rootSetState,
|
|
3034
|
-
enableCache: !0
|
|
3035
|
-
})
|
|
3036
|
-
)
|
|
3037
|
-
);
|
|
3028
|
+
g || h(!0);
|
|
3038
3029
|
}
|
|
3039
|
-
function
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3030
|
+
function p() {
|
|
3031
|
+
var f, v, b;
|
|
3032
|
+
const d = (b = (v = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : v.httpRequests) != null ? b : {};
|
|
3033
|
+
Object.entries(d).forEach(([x, w]) => {
|
|
3034
|
+
if (!w || u[x] || c[x] && !isEditing())
|
|
3035
|
+
return;
|
|
3036
|
+
u[x] = !0;
|
|
3037
|
+
const A = w.replace(
|
|
3038
|
+
/{{([^}]+)}}/g,
|
|
3039
|
+
(R, V) => String(
|
|
3040
|
+
evaluate({
|
|
3041
|
+
code: V,
|
|
3042
|
+
context: e.context || {},
|
|
3043
|
+
localState: void 0,
|
|
3044
|
+
rootState: e.builderContextSignal.rootState,
|
|
3045
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
3046
|
+
enableCache: !0
|
|
3047
|
+
})
|
|
3048
|
+
)
|
|
3049
|
+
);
|
|
3050
|
+
fetch$1(A).then((R) => R.json()).then((R) => {
|
|
3051
|
+
n({
|
|
3052
|
+
[x]: R
|
|
3053
|
+
}), c[x] = !0;
|
|
3054
|
+
}).catch((R) => {
|
|
3055
|
+
console.error("error fetching dynamic data", w, R);
|
|
3056
|
+
}).finally(() => {
|
|
3057
|
+
u[x] = !1;
|
|
3058
|
+
});
|
|
3062
3059
|
});
|
|
3063
3060
|
}
|
|
3064
3061
|
function k() {
|
|
@@ -3077,7 +3074,7 @@ function EnableEditor(e) {
|
|
|
3077
3074
|
);
|
|
3078
3075
|
}
|
|
3079
3076
|
return useEffect(() => {
|
|
3080
|
-
var
|
|
3077
|
+
var d, f;
|
|
3081
3078
|
if (isBrowser()) {
|
|
3082
3079
|
if (isEditing() && (window.addEventListener("message", r), registerInsertMenu(), setupBrowserForEditing({
|
|
3083
3080
|
...e.locale ? {
|
|
@@ -3091,46 +3088,46 @@ function EnableEditor(e) {
|
|
|
3091
3088
|
} : {}
|
|
3092
3089
|
}), Object.values(
|
|
3093
3090
|
e.builderContextSignal.componentInfos
|
|
3094
|
-
).forEach((
|
|
3091
|
+
).forEach((b) => {
|
|
3095
3092
|
var w;
|
|
3096
|
-
const
|
|
3097
|
-
(w = window.parent) == null || w.postMessage(
|
|
3093
|
+
const x = createRegisterComponentMessage(b);
|
|
3094
|
+
(w = window.parent) == null || w.postMessage(x, "*");
|
|
3098
3095
|
}), window.addEventListener(
|
|
3099
3096
|
"builder:component:stateChangeListenerActivated",
|
|
3100
3097
|
k
|
|
3101
3098
|
)), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
3102
|
-
const
|
|
3099
|
+
const b = (d = e.builderContextSignal.content) == null ? void 0 : d.testVariationId, x = (f = e.builderContextSignal.content) == null ? void 0 : f.id, w = e.apiKey;
|
|
3103
3100
|
_track({
|
|
3104
3101
|
type: "impression",
|
|
3105
3102
|
canTrack: !0,
|
|
3106
|
-
contentId:
|
|
3103
|
+
contentId: x,
|
|
3107
3104
|
apiKey: w,
|
|
3108
|
-
variationId:
|
|
3105
|
+
variationId: b !== x ? b : void 0
|
|
3109
3106
|
});
|
|
3110
3107
|
}
|
|
3111
3108
|
if (isPreviewing()) {
|
|
3112
|
-
const
|
|
3113
|
-
`builder.preview.${
|
|
3114
|
-
),
|
|
3115
|
-
|
|
3109
|
+
const b = new URL(location.href).searchParams, x = b.get("builder.preview"), w = b.get(
|
|
3110
|
+
`builder.preview.${x}`
|
|
3111
|
+
), A = b.get("apiKey") || b.get("builder.space");
|
|
3112
|
+
x === e.model && A === e.apiKey && (!e.content || w === e.content.id) && fetchOneEntry({
|
|
3116
3113
|
model: e.model,
|
|
3117
3114
|
apiKey: e.apiKey,
|
|
3118
3115
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3119
|
-
}).then((
|
|
3120
|
-
|
|
3116
|
+
}).then((R) => {
|
|
3117
|
+
R && i(R);
|
|
3121
3118
|
});
|
|
3122
3119
|
}
|
|
3123
3120
|
}
|
|
3124
3121
|
}, []), useEffect(() => {
|
|
3125
3122
|
e.apiKey || logger.error(
|
|
3126
3123
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3127
|
-
), s(),
|
|
3124
|
+
), s(), p(), k();
|
|
3128
3125
|
}, []), useEffect(() => {
|
|
3129
|
-
e.content &&
|
|
3126
|
+
e.content && i(e.content);
|
|
3130
3127
|
}, [e.content]), useEffect(() => {
|
|
3131
3128
|
s();
|
|
3132
|
-
}, [(
|
|
3133
|
-
|
|
3129
|
+
}, [(S = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : S.jsCode]), useEffect(() => {
|
|
3130
|
+
p();
|
|
3134
3131
|
}, [(E = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : E.httpRequests]), useEffect(() => {
|
|
3135
3132
|
k();
|
|
3136
3133
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
@@ -3145,10 +3142,10 @@ function EnableEditor(e) {
|
|
|
3145
3142
|
k
|
|
3146
3143
|
));
|
|
3147
3144
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(
|
|
3148
|
-
|
|
3145
|
+
o,
|
|
3149
3146
|
{
|
|
3150
3147
|
ref: t,
|
|
3151
|
-
onClick: (
|
|
3148
|
+
onClick: (d) => y(d),
|
|
3152
3149
|
"builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
|
|
3153
3150
|
"builder-model": e.model,
|
|
3154
3151
|
...e.showContent ? {} : {
|
|
@@ -3156,19 +3153,19 @@ function EnableEditor(e) {
|
|
|
3156
3153
|
"aria-hidden": !0
|
|
3157
3154
|
},
|
|
3158
3155
|
...e.contentWrapperProps,
|
|
3159
|
-
className: `variant-${((
|
|
3156
|
+
className: `variant-${((B = e.content) == null ? void 0 : B.testVariationId) || ((j = e.content) == null ? void 0 : j.id)}`,
|
|
3160
3157
|
children: e.children
|
|
3161
3158
|
}
|
|
3162
3159
|
) : null });
|
|
3163
3160
|
}
|
|
3164
3161
|
const getCssFromFont = (e) => {
|
|
3165
3162
|
var a, r;
|
|
3166
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0],
|
|
3167
|
-
let
|
|
3168
|
-
if (
|
|
3163
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
|
|
3164
|
+
let o = "";
|
|
3165
|
+
if (i && t && n && (o += `
|
|
3169
3166
|
@font-face {
|
|
3170
3167
|
font-family: "${t}";
|
|
3171
|
-
src: local("${n}"), url('${
|
|
3168
|
+
src: local("${n}"), url('${i}') format('woff2');
|
|
3172
3169
|
font-display: fallback;
|
|
3173
3170
|
font-weight: 400;
|
|
3174
3171
|
}
|
|
@@ -3177,7 +3174,7 @@ font-weight: 400;
|
|
|
3177
3174
|
if (!(String(Number(s)) === s))
|
|
3178
3175
|
continue;
|
|
3179
3176
|
const l = e.files[s];
|
|
3180
|
-
l && l !==
|
|
3177
|
+
l && l !== i && (o += `
|
|
3181
3178
|
@font-face {
|
|
3182
3179
|
font-family: "${t}";
|
|
3183
3180
|
src: url('${l}') format('woff2');
|
|
@@ -3186,7 +3183,7 @@ font-weight: ${s};
|
|
|
3186
3183
|
}
|
|
3187
3184
|
`.trim());
|
|
3188
3185
|
}
|
|
3189
|
-
return
|
|
3186
|
+
return o;
|
|
3190
3187
|
}, getFontCss = ({
|
|
3191
3188
|
customFonts: e
|
|
3192
3189
|
}) => {
|
|
@@ -3226,7 +3223,7 @@ ${getFontCss({
|
|
|
3226
3223
|
${getDefaultStyles(e.isNestedRender)}
|
|
3227
3224
|
`.trim()
|
|
3228
3225
|
);
|
|
3229
|
-
return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
|
|
3226
|
+
return /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-content", styles: t });
|
|
3230
3227
|
}
|
|
3231
3228
|
const getRootStateInitialValue = ({
|
|
3232
3229
|
content: e,
|
|
@@ -3234,12 +3231,12 @@ const getRootStateInitialValue = ({
|
|
|
3234
3231
|
locale: n
|
|
3235
3232
|
}) => {
|
|
3236
3233
|
var a, r, s;
|
|
3237
|
-
const
|
|
3234
|
+
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
3238
3235
|
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
|
|
3239
|
-
c.name && c.defaultValue !== void 0 && (
|
|
3236
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
3240
3237
|
}), {
|
|
3241
|
-
...o,
|
|
3242
3238
|
...i,
|
|
3239
|
+
...o,
|
|
3243
3240
|
...t,
|
|
3244
3241
|
...n ? {
|
|
3245
3242
|
locale: n
|
|
@@ -3257,31 +3254,31 @@ const getRootStateInitialValue = ({
|
|
|
3257
3254
|
meta: e == null ? void 0 : e.meta
|
|
3258
3255
|
} : void 0;
|
|
3259
3256
|
function ContentComponent(e) {
|
|
3260
|
-
var c, l,
|
|
3257
|
+
var c, l, u, m, g, h, y;
|
|
3261
3258
|
const [t, n] = useState(
|
|
3262
3259
|
() => {
|
|
3263
|
-
var
|
|
3260
|
+
var p, k;
|
|
3264
3261
|
return getUpdateVariantVisibilityScript({
|
|
3265
3262
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3266
|
-
variationId: (
|
|
3263
|
+
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
3267
3264
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3268
3265
|
contentId: (k = e.content) == null ? void 0 : k.id
|
|
3269
3266
|
});
|
|
3270
3267
|
}
|
|
3271
3268
|
);
|
|
3272
|
-
function
|
|
3269
|
+
function i(p) {
|
|
3273
3270
|
s((k) => ({
|
|
3274
3271
|
...k,
|
|
3275
|
-
rootState:
|
|
3272
|
+
rootState: p
|
|
3276
3273
|
}));
|
|
3277
3274
|
}
|
|
3278
|
-
const [
|
|
3275
|
+
const [o, a] = useState(
|
|
3279
3276
|
() => [
|
|
3280
3277
|
...getDefaultRegisteredComponents(),
|
|
3281
3278
|
...e.customComponents || []
|
|
3282
3279
|
].reduce(
|
|
3283
|
-
(
|
|
3284
|
-
...
|
|
3280
|
+
(p, { component: k, ...T }) => ({
|
|
3281
|
+
...p,
|
|
3285
3282
|
[T.name]: {
|
|
3286
3283
|
component: k,
|
|
3287
3284
|
...serializeComponentInfo(T)
|
|
@@ -3300,7 +3297,7 @@ function ContentComponent(e) {
|
|
|
3300
3297
|
data: e.data,
|
|
3301
3298
|
locale: e.locale
|
|
3302
3299
|
}),
|
|
3303
|
-
rootSetState:
|
|
3300
|
+
rootSetState: i,
|
|
3304
3301
|
context: e.context || {},
|
|
3305
3302
|
apiKey: e.apiKey,
|
|
3306
3303
|
apiVersion: e.apiVersion,
|
|
@@ -3308,8 +3305,8 @@ function ContentComponent(e) {
|
|
|
3308
3305
|
...getDefaultRegisteredComponents(),
|
|
3309
3306
|
...e.customComponents || []
|
|
3310
3307
|
].reduce(
|
|
3311
|
-
(
|
|
3312
|
-
...
|
|
3308
|
+
(p, { component: k, ...T }) => ({
|
|
3309
|
+
...p,
|
|
3313
3310
|
[T.name]: serializeComponentInfo(T)
|
|
3314
3311
|
}),
|
|
3315
3312
|
{}
|
|
@@ -3322,7 +3319,7 @@ function ContentComponent(e) {
|
|
|
3322
3319
|
ComponentsContext.Provider,
|
|
3323
3320
|
{
|
|
3324
3321
|
value: {
|
|
3325
|
-
registeredComponents:
|
|
3322
|
+
registeredComponents: o
|
|
3326
3323
|
},
|
|
3327
3324
|
children: /* @__PURE__ */ jsxs(
|
|
3328
3325
|
EnableEditor,
|
|
@@ -3343,22 +3340,28 @@ function ContentComponent(e) {
|
|
|
3343
3340
|
trustedHosts: e.trustedHosts,
|
|
3344
3341
|
setBuilderContextSignal: s,
|
|
3345
3342
|
children: [
|
|
3346
|
-
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
3343
|
+
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
3344
|
+
InlinedScript,
|
|
3345
|
+
{
|
|
3346
|
+
id: "builderio-variant-visibility",
|
|
3347
|
+
scriptStr: t
|
|
3348
|
+
}
|
|
3349
|
+
) : null,
|
|
3347
3350
|
/* @__PURE__ */ jsx(
|
|
3348
3351
|
ContentStyles,
|
|
3349
3352
|
{
|
|
3350
3353
|
isNestedRender: e.isNestedRender,
|
|
3351
3354
|
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
3352
|
-
cssCode: (
|
|
3355
|
+
cssCode: (u = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : u.cssCode,
|
|
3353
3356
|
customFonts: (g = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
|
|
3354
3357
|
}
|
|
3355
3358
|
),
|
|
3356
3359
|
/* @__PURE__ */ jsx(
|
|
3357
3360
|
Blocks,
|
|
3358
3361
|
{
|
|
3359
|
-
blocks: (y = (
|
|
3362
|
+
blocks: (y = (h = r.content) == null ? void 0 : h.data) == null ? void 0 : y.blocks,
|
|
3360
3363
|
context: r,
|
|
3361
|
-
registeredComponents:
|
|
3364
|
+
registeredComponents: o,
|
|
3362
3365
|
linkComponent: e.linkComponent
|
|
3363
3366
|
}
|
|
3364
3367
|
)
|
|
@@ -3369,31 +3372,31 @@ function ContentComponent(e) {
|
|
|
3369
3372
|
);
|
|
3370
3373
|
}
|
|
3371
3374
|
function ContentVariants(e) {
|
|
3372
|
-
var r
|
|
3375
|
+
var r;
|
|
3373
3376
|
const [t, n] = useState(
|
|
3374
3377
|
() => checkShouldRenderVariants({
|
|
3375
3378
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3376
3379
|
content: e.content
|
|
3377
3380
|
})
|
|
3378
3381
|
);
|
|
3379
|
-
function
|
|
3380
|
-
var
|
|
3382
|
+
function i() {
|
|
3383
|
+
var s;
|
|
3381
3384
|
return getUpdateCookieAndStylesScript(
|
|
3382
|
-
getVariants(e.content).map((
|
|
3383
|
-
id:
|
|
3384
|
-
testRatio:
|
|
3385
|
+
getVariants(e.content).map((c) => ({
|
|
3386
|
+
id: c.testVariationId,
|
|
3387
|
+
testRatio: c.testRatio
|
|
3385
3388
|
})),
|
|
3386
|
-
((
|
|
3389
|
+
((s = e.content) == null ? void 0 : s.id) || ""
|
|
3387
3390
|
);
|
|
3388
3391
|
}
|
|
3389
|
-
function
|
|
3390
|
-
return getVariants(e.content).map((
|
|
3392
|
+
function o() {
|
|
3393
|
+
return getVariants(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
|
|
3391
3394
|
}
|
|
3392
3395
|
function a() {
|
|
3393
|
-
var
|
|
3396
|
+
var s;
|
|
3394
3397
|
return t ? {
|
|
3395
3398
|
...e.content,
|
|
3396
|
-
testVariationId: (
|
|
3399
|
+
testVariationId: (s = e.content) == null ? void 0 : s.id
|
|
3397
3400
|
} : handleABTestingSync({
|
|
3398
3401
|
item: e.content,
|
|
3399
3402
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -3401,21 +3404,33 @@ function ContentVariants(e) {
|
|
|
3401
3404
|
}
|
|
3402
3405
|
return useEffect(() => {
|
|
3403
3406
|
}, []), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3404
|
-
!e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(
|
|
3407
|
+
!e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(
|
|
3408
|
+
InlinedScript,
|
|
3409
|
+
{
|
|
3410
|
+
id: "builderio-init-variants-fns",
|
|
3411
|
+
scriptStr: getInitVariantsFnsScriptString()
|
|
3412
|
+
}
|
|
3413
|
+
) : null,
|
|
3405
3414
|
t ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3406
3415
|
/* @__PURE__ */ jsx(
|
|
3407
3416
|
InlinedStyles,
|
|
3408
3417
|
{
|
|
3409
|
-
id:
|
|
3410
|
-
styles:
|
|
3418
|
+
id: "builderio-variants",
|
|
3419
|
+
styles: o()
|
|
3420
|
+
}
|
|
3421
|
+
),
|
|
3422
|
+
/* @__PURE__ */ jsx(
|
|
3423
|
+
InlinedScript,
|
|
3424
|
+
{
|
|
3425
|
+
id: "builderio-variants-visibility",
|
|
3426
|
+
scriptStr: i()
|
|
3411
3427
|
}
|
|
3412
3428
|
),
|
|
3413
|
-
|
|
3414
|
-
(s = getVariants(e.content)) == null ? void 0 : s.map((c) => /* @__PURE__ */ jsx(
|
|
3429
|
+
(r = getVariants(e.content)) == null ? void 0 : r.map((s) => /* @__PURE__ */ jsx(
|
|
3415
3430
|
ContentComponent,
|
|
3416
3431
|
{
|
|
3417
3432
|
isNestedRender: e.isNestedRender,
|
|
3418
|
-
content:
|
|
3433
|
+
content: s,
|
|
3419
3434
|
showContent: !1,
|
|
3420
3435
|
model: e.model,
|
|
3421
3436
|
data: e.data,
|
|
@@ -3434,7 +3449,7 @@ function ContentVariants(e) {
|
|
|
3434
3449
|
contentWrapperProps: e.contentWrapperProps,
|
|
3435
3450
|
trustedHosts: e.trustedHosts
|
|
3436
3451
|
},
|
|
3437
|
-
|
|
3452
|
+
s.testVariationId
|
|
3438
3453
|
))
|
|
3439
3454
|
] }) : null,
|
|
3440
3455
|
/* @__PURE__ */ jsx(
|
|
@@ -3485,29 +3500,29 @@ const fetchSymbolContent = async ({
|
|
|
3485
3500
|
function Symbol$1(e) {
|
|
3486
3501
|
var a, r, s, c;
|
|
3487
3502
|
function t() {
|
|
3488
|
-
var l,
|
|
3503
|
+
var l, u;
|
|
3489
3504
|
return [
|
|
3490
3505
|
e.attributes[getClassPropName()],
|
|
3491
3506
|
"builder-symbol",
|
|
3492
3507
|
(l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
|
|
3493
|
-
(
|
|
3508
|
+
(u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
3494
3509
|
].filter(Boolean).join(" ");
|
|
3495
3510
|
}
|
|
3496
|
-
const [n,
|
|
3511
|
+
const [n, i] = useState(() => {
|
|
3497
3512
|
var l;
|
|
3498
3513
|
return (l = e.symbol) == null ? void 0 : l.content;
|
|
3499
3514
|
});
|
|
3500
|
-
function
|
|
3515
|
+
function o() {
|
|
3501
3516
|
n || fetchSymbolContent({
|
|
3502
3517
|
symbol: e.symbol,
|
|
3503
3518
|
builderContextValue: e.builderContext
|
|
3504
3519
|
}).then((l) => {
|
|
3505
|
-
l &&
|
|
3520
|
+
l && i(l);
|
|
3506
3521
|
});
|
|
3507
3522
|
}
|
|
3508
3523
|
return useEffect(() => {
|
|
3509
3524
|
}, []), useEffect(() => {
|
|
3510
|
-
|
|
3525
|
+
o();
|
|
3511
3526
|
}, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
|
|
3512
3527
|
ContentVariants,
|
|
3513
3528
|
{
|