@builder.io/sdk-react 1.0.19-dev-0 → 1.0.20
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 +13 -13
- package/lib/browser/blocks-exports.mjs +339 -349
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-cfff49d1.js → server-entry-a562cf23.js} +1 -1
- package/lib/browser/{server-entry-1a86f409.cjs → server-entry-a77461d4.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-87a3568e.cjs → blocks-523eb4f1.cjs} +4 -4
- package/lib/edge/{blocks-03aafa4f.js → blocks-683aad9f.js} +26 -26
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-58695538.cjs → button-0d418bcf.cjs} +1 -1
- package/lib/edge/{button-14d13356.js → button-9f6acf3e.js} +3 -3
- package/lib/edge/{columns-f98bd830.cjs → columns-1613d62d.cjs} +2 -2
- package/lib/edge/{columns-d2f7e212.js → columns-b0785992.js} +33 -33
- package/lib/edge/{content-variants-ad9f707f.js → content-variants-13f821c6.js} +68 -68
- package/lib/edge/{content-variants-7e661199.cjs → content-variants-281298f6.cjs} +5 -5
- package/lib/edge/dynamic-renderer-8b343325.js +8 -0
- package/lib/edge/{dynamic-renderer-1c9f24c0.cjs → dynamic-renderer-b29b45ca.cjs} +1 -1
- package/lib/edge/form-0483aa64.cjs +1 -0
- package/lib/edge/{form-04cf10db.js → form-db27fc26.js} +56 -66
- package/lib/edge/{get-class-prop-name-859a7f60.js → get-class-prop-name-6bfc4756.js} +1 -1
- package/lib/edge/{get-class-prop-name-f1301669.cjs → get-class-prop-name-e3ba0522.cjs} +1 -1
- package/lib/edge/{image-2cc909d9.js → image-0008c792.js} +25 -25
- package/lib/edge/image-ee3dd857.cjs +17 -0
- package/lib/edge/{img-b4ff1bef.js → img-43a8ffe0.js} +1 -1
- package/lib/edge/{img-0c1e53c0.cjs → img-f01d904d.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-c6fee09c.js → input-805a9ac6.js} +1 -1
- package/lib/edge/{input-2103da14.cjs → input-e6483bd7.cjs} +1 -1
- package/lib/edge/select-4966723f.js +20 -0
- package/lib/edge/select-e5d1e627.cjs +1 -0
- package/lib/edge/{server-entry-00891f33.cjs → server-entry-83648311.cjs} +1 -1
- package/lib/edge/{server-entry-d46a218d.js → server-entry-c13e82bd.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-8fa7f242.js → slot-1b0351de.js} +4 -4
- package/lib/edge/{slot-bb84f342.cjs → slot-3ef77ae1.cjs} +1 -1
- package/lib/edge/{symbol-636383eb.cjs → symbol-883d624f.cjs} +1 -1
- package/lib/edge/{symbol-324dadc8.js → symbol-f1632f93.js} +2 -2
- package/lib/edge/{video-d02ff89b.js → video-58c2cc8d.js} +15 -15
- package/lib/edge/video-e20dcbbc.cjs +1 -0
- package/lib/node/blocks-exports.cjs +72 -32
- package/lib/node/blocks-exports.mjs +1018 -902
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +22 -23
- package/lib/node/{server-entry-8c84ddbd.js → server-entry-8c712c9b.js} +1 -1
- package/lib/node/{server-entry-ff6fc2b4.cjs → server-entry-bedf45f8.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -6
- package/types/blocks/button/button.d.ts +1 -1
- package/types/blocks/button/button.types.d.ts +1 -1
- package/types/blocks/button/component-info.d.ts +1 -1
- package/types/blocks/columns/columns.d.ts +1 -1
- package/types/blocks/columns/columns.types.d.ts +2 -2
- package/types/blocks/columns/component-info.d.ts +1 -1
- package/types/blocks/custom-code/component-info.d.ts +1 -1
- package/types/blocks/embed/component-info.d.ts +1 -1
- package/types/blocks/form/form/component-info.d.ts +1 -1
- package/types/blocks/form/form/form.d.ts +2 -2
- package/types/blocks/form/input/component-info.d.ts +1 -1
- package/types/blocks/form/select/component-info.d.ts +1 -1
- package/types/blocks/form/submit-button/component-info.d.ts +1 -1
- package/types/blocks/fragment/component-info.d.ts +1 -1
- package/types/blocks/fragment/fragment.d.ts +1 -1
- package/types/blocks/image/component-info.d.ts +1 -1
- package/types/blocks/image/image.d.ts +1 -1
- package/types/blocks/image/image.types.d.ts +1 -1
- package/types/blocks/img/component-info.d.ts +1 -1
- package/types/blocks/raw-text/component-info.d.ts +1 -1
- package/types/blocks/section/component-info.d.ts +1 -1
- package/types/blocks/section/section.d.ts +1 -1
- package/types/blocks/slot/component-info.d.ts +1 -1
- package/types/blocks/slot/slot.d.ts +1 -1
- package/types/blocks/symbol/component-info.d.ts +1 -1
- package/types/blocks/symbol/symbol.d.ts +1 -1
- package/types/blocks/symbol/symbol.helpers.d.ts +2 -2
- package/types/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/blocks/text/component-info.d.ts +1 -1
- package/types/blocks/text/text.d.ts +1 -1
- package/types/blocks/textarea/component-info.d.ts +1 -1
- package/types/blocks/video/component-info.d.ts +1 -1
- package/types/blocks/video/video.d.ts +1 -1
- package/types/blocks/video/video.types.d.ts +1 -1
- package/types/components/block/animator.d.ts +1 -1
- package/types/components/block/block.d.ts +2 -2
- package/types/components/block/block.helpers.d.ts +4 -4
- package/types/components/block/components/block-styles.d.ts +2 -2
- package/types/components/block/components/block-wrapper.d.ts +2 -2
- package/types/components/block/components/component-ref/component-ref.d.ts +1 -1
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/types/components/block/components/interactive-element.d.ts +3 -3
- package/types/components/block/components/repeated-block.d.ts +1 -1
- package/types/components/block/types.d.ts +2 -2
- package/types/components/blocks/blocks-wrapper.d.ts +1 -1
- package/types/components/blocks/blocks.d.ts +1 -1
- package/types/components/blocks/blocks.types.d.ts +1 -1
- package/types/components/content/components/enable-editor.d.ts +2 -2
- package/types/components/content/components/styles.d.ts +1 -1
- package/types/components/content/content.d.ts +1 -1
- package/types/components/content/content.helpers.d.ts +3 -3
- package/types/components/content/content.types.d.ts +2 -2
- package/types/components/content/contentProps.types.d.ts +2 -2
- package/types/components/content-variants/content-variants.d.ts +1 -1
- package/types/components/content-variants/content-variants.types.d.ts +4 -4
- package/types/components/content-variants/helpers.d.ts +5 -5
- package/types/constants/builder-registered-components.d.ts +1 -1
- package/types/constants/extra-components.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/index.d.ts +1 -1
- package/types/context/types.d.ts +4 -4
- package/types/functions/evaluate/browser-runtime/browser.d.ts +2 -2
- package/types/functions/evaluate/browser-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/choose-eval.d.ts +1 -1
- package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +1 -1
- package/types/functions/evaluate/edge-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +1 -1
- package/types/functions/evaluate/helpers.d.ts +3 -3
- package/types/functions/evaluate/index.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +1 -2
- package/types/functions/evaluate/placeholder-runtime.d.ts +1 -1
- package/types/functions/fetch-builder-props.d.ts +3 -3
- package/types/functions/get-block-actions-handler.d.ts +2 -2
- package/types/functions/get-block-actions.d.ts +2 -2
- package/types/functions/get-block-component-options.d.ts +1 -1
- package/types/functions/get-block-properties.d.ts +2 -2
- package/types/functions/get-builder-search-params/index.d.ts +1 -1
- package/types/functions/get-content/generate-content-url.d.ts +1 -1
- package/types/functions/get-content/index.d.ts +2 -2
- package/types/functions/get-processed-block.d.ts +2 -2
- package/types/functions/get-style.d.ts +2 -2
- package/types/functions/is-editing.d.ts +1 -1
- package/types/functions/is-previewing.d.ts +1 -1
- package/types/functions/register-component.d.ts +1 -1
- package/types/functions/register.d.ts +2 -2
- package/types/functions/track/index.d.ts +2 -2
- package/types/functions/transform-block-properties.d.ts +2 -2
- package/types/functions/transform-block.d.ts +1 -1
- package/types/functions/transform-style-property.d.ts +2 -2
- package/types/helpers/ab-tests.d.ts +3 -3
- package/types/helpers/cookie.d.ts +1 -1
- package/types/helpers/localStorage.d.ts +2 -2
- package/types/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/helpers/preview-lru-cache/set.d.ts +1 -1
- package/types/helpers/sessionId.d.ts +1 -1
- package/types/helpers/subscribe-to-editor.d.ts +3 -3
- package/types/helpers/visitorId.d.ts +1 -1
- package/types/index-helpers/blocks-exports.d.ts +11 -11
- package/types/index.d.ts +3 -3
- package/types/server-index.d.ts +27 -27
- package/types/types/builder-content.d.ts +3 -3
- package/types/types/builder-props.d.ts +2 -2
- package/types/types/components.d.ts +2 -2
- package/types/types/enforced-partials.d.ts +1 -1
- package/lib/edge/dynamic-renderer-96ba4e48.js +0 -8
- package/lib/edge/form-e83f7b7a.cjs +0 -1
- package/lib/edge/image-7e1361ce.cjs +0 -17
- package/lib/edge/select-b8ad0a4c.cjs +0 -1
- package/lib/edge/select-f260d051.js +0 -20
- package/lib/edge/video-64014cc4.cjs +0 -1
- package/lib/node/init.cjs +0 -1
- package/lib/node/init.mjs +0 -8
- package/lib/node/node-runtime-1ca09d03.js +0 -137
- package/lib/node/node-runtime-56212f7c.cjs +0 -41
- package/types/blocks/form/component-info.d.ts +0 -2
- package/types/blocks/form/form.d.ts +0 -3
- package/types/blocks/input/component-info.d.ts +0 -2
- package/types/blocks/input/input.d.ts +0 -15
- package/types/blocks/select/component-info.d.ts +0 -2
- package/types/blocks/select/select.d.ts +0 -16
- package/types/blocks/submit-button/component-info.d.ts +0 -2
- package/types/blocks/submit-button/submit-button.d.ts +0 -10
- package/types/components/content/components/context-updater.d.ts +0 -5
- package/types/components/dynamic-renderer.d.ts +0 -3
- package/types/functions/evaluate/node-runtime/init.d.ts +0 -2
- package/types/functions/get-react-native-block-styles.d.ts +0 -15
- package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/types/functions/sanitize-rn-allowed-css.d.ts +0 -8
- package/types/node-runtime/index.d.ts +0 -1
- package/types/node-runtime/node-runtime.d.ts +0 -9
- package/types/node-runtime.d.ts +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { jsx
|
|
6
|
-
import { TARGET
|
|
7
|
-
import { createContext
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
switch (q) {
|
|
2
|
+
var N = Object.defineProperty;
|
|
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
|
+
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-8c712c9b.js";
|
|
7
|
+
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
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
|
+
function DynamicRenderer(e) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
11
|
+
}
|
|
12
|
+
const getClassPropName = () => {
|
|
13
|
+
switch (TARGET) {
|
|
15
14
|
case "react":
|
|
16
15
|
case "reactNative":
|
|
17
16
|
case "rsc":
|
|
@@ -23,13 +22,13 @@ const H = () => {
|
|
|
23
22
|
return "class";
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
|
-
function
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
25
|
+
function Button(e) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
DynamicRenderer,
|
|
29
28
|
{
|
|
30
29
|
attributes: {
|
|
31
30
|
...e.attributes,
|
|
32
|
-
[
|
|
31
|
+
[getClassPropName()]: `${e.link ? "" : "builder-button"} ${e.attributes[getClassPropName()] || ""}`,
|
|
33
32
|
...e.link ? {
|
|
34
33
|
href: e.link,
|
|
35
34
|
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
@@ -44,7 +43,7 @@ function Xe(e) {
|
|
|
44
43
|
}
|
|
45
44
|
);
|
|
46
45
|
}
|
|
47
|
-
const
|
|
46
|
+
const builderContext = createContext({
|
|
48
47
|
content: null,
|
|
49
48
|
context: {},
|
|
50
49
|
localState: void 0,
|
|
@@ -57,8 +56,8 @@ const re = ke({
|
|
|
57
56
|
inheritedStyles: {},
|
|
58
57
|
BlocksWrapper: "div",
|
|
59
58
|
BlocksWrapperProps: {}
|
|
60
|
-
}),
|
|
61
|
-
function
|
|
59
|
+
}), ComponentsContext = createContext({ registeredComponents: {} });
|
|
60
|
+
function getBlockComponentOptions(e) {
|
|
62
61
|
var t;
|
|
63
62
|
return {
|
|
64
63
|
...(t = e.component) == null ? void 0 : t.options,
|
|
@@ -69,28 +68,47 @@ function Ze(e) {
|
|
|
69
68
|
builderBlock: e
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
|
-
const
|
|
71
|
+
const getFunctionArguments = ({
|
|
72
|
+
builder: e,
|
|
73
|
+
context: t,
|
|
74
|
+
event: n,
|
|
75
|
+
state: i
|
|
76
|
+
}) => Object.entries({
|
|
77
|
+
state: i,
|
|
78
|
+
Builder: e,
|
|
79
|
+
// legacy
|
|
80
|
+
builder: e,
|
|
81
|
+
context: t,
|
|
82
|
+
event: n
|
|
83
|
+
}), getBuilderGlobals = () => ({
|
|
84
|
+
isEditing: isEditing(),
|
|
85
|
+
isBrowser: isBrowser(),
|
|
86
|
+
isServer: !isBrowser(),
|
|
87
|
+
getUserAttributes: () => getUserAttributes()
|
|
88
|
+
}), parseCode = (e, {
|
|
89
|
+
isExpression: t = !0
|
|
90
|
+
}) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, runInBrowser = ({
|
|
73
91
|
code: e,
|
|
74
92
|
builder: t,
|
|
75
93
|
context: n,
|
|
76
94
|
event: i,
|
|
77
95
|
localState: o,
|
|
78
|
-
rootSetState:
|
|
79
|
-
rootState:
|
|
96
|
+
rootSetState: a,
|
|
97
|
+
rootState: r
|
|
80
98
|
}) => {
|
|
81
|
-
const s =
|
|
99
|
+
const s = getFunctionArguments({
|
|
82
100
|
builder: t,
|
|
83
101
|
context: n,
|
|
84
102
|
event: i,
|
|
85
|
-
state:
|
|
86
|
-
rootState:
|
|
103
|
+
state: flattenState({
|
|
104
|
+
rootState: r,
|
|
87
105
|
localState: o,
|
|
88
|
-
rootSetState:
|
|
106
|
+
rootSetState: a
|
|
89
107
|
})
|
|
90
108
|
});
|
|
91
|
-
return new Function(...s.map(([
|
|
109
|
+
return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
|
|
92
110
|
};
|
|
93
|
-
function
|
|
111
|
+
function flattenState({
|
|
94
112
|
rootState: e,
|
|
95
113
|
localState: t,
|
|
96
114
|
rootSetState: n
|
|
@@ -99,33 +117,138 @@ function Te({
|
|
|
99
117
|
get: (i, o) => {
|
|
100
118
|
if (t && o in t)
|
|
101
119
|
return t[o];
|
|
102
|
-
const
|
|
103
|
-
return typeof
|
|
104
|
-
rootState:
|
|
120
|
+
const a = i[o];
|
|
121
|
+
return typeof a == "object" && a !== null ? flattenState({
|
|
122
|
+
rootState: a,
|
|
105
123
|
localState: void 0,
|
|
106
|
-
rootSetState: n ? (
|
|
107
|
-
i[o] =
|
|
124
|
+
rootSetState: n ? (r) => {
|
|
125
|
+
i[o] = r, n(i);
|
|
108
126
|
} : void 0
|
|
109
|
-
}) :
|
|
127
|
+
}) : a;
|
|
110
128
|
},
|
|
111
|
-
set: (i, o,
|
|
129
|
+
set: (i, o, a) => {
|
|
112
130
|
if (t && o in t)
|
|
113
131
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
114
|
-
return i[o] =
|
|
132
|
+
return i[o] = a, n == null || n(i), !0;
|
|
115
133
|
}
|
|
116
134
|
});
|
|
117
135
|
}
|
|
118
|
-
|
|
136
|
+
const set = (e, t, n) => {
|
|
137
|
+
if (Object(e) !== e)
|
|
138
|
+
return e;
|
|
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
|
+
}, noop = () => {
|
|
142
|
+
};
|
|
143
|
+
let safeDynamicRequire = noop;
|
|
144
|
+
try {
|
|
145
|
+
safeDynamicRequire = eval("require");
|
|
146
|
+
} catch (e) {
|
|
147
|
+
}
|
|
148
|
+
const getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
|
|
149
|
+
var refToProxy = (obj) => {
|
|
150
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
151
|
+
return obj;
|
|
152
|
+
}
|
|
153
|
+
return new Proxy({}, {
|
|
154
|
+
get(target, key) {
|
|
155
|
+
if (key === 'copySync') {
|
|
156
|
+
return () => obj.copySync();
|
|
157
|
+
}
|
|
158
|
+
const val = obj.getSync(key);
|
|
159
|
+
if (typeof val?.getSync === 'function') {
|
|
160
|
+
return refToProxy(val);
|
|
161
|
+
}
|
|
162
|
+
return val;
|
|
163
|
+
},
|
|
164
|
+
set(target, key, value) {
|
|
165
|
+
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
166
|
+
obj.setSync(key, v);
|
|
167
|
+
${BUILDER_SET_STATE_NAME}(key, value)
|
|
168
|
+
},
|
|
169
|
+
deleteProperty(target, key) {
|
|
170
|
+
obj.deleteSync(key);
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
`, processCode = ({
|
|
175
|
+
code: e,
|
|
176
|
+
args: t
|
|
177
|
+
}) => {
|
|
178
|
+
const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
|
|
179
|
+
return `
|
|
180
|
+
${REF_TO_PROXY_FN}
|
|
181
|
+
${n}
|
|
182
|
+
function theFunction() {
|
|
183
|
+
${e}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
let output = theFunction()
|
|
187
|
+
|
|
188
|
+
if (typeof output === 'object' && output !== null) {
|
|
189
|
+
output = JSON.stringify(output.copySync ? output.copySync() : output);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
output;
|
|
193
|
+
`;
|
|
194
|
+
}, getIsolateContext = () => {
|
|
195
|
+
const e = safeDynamicRequire("isolated-vm");
|
|
196
|
+
return new e.Isolate({
|
|
197
|
+
memoryLimit: 128
|
|
198
|
+
}).createContextSync();
|
|
199
|
+
}, runInNode = ({
|
|
200
|
+
code: e,
|
|
201
|
+
builder: t,
|
|
202
|
+
context: n,
|
|
203
|
+
event: i,
|
|
204
|
+
localState: o,
|
|
205
|
+
rootSetState: a,
|
|
206
|
+
rootState: r
|
|
207
|
+
}) => {
|
|
208
|
+
const s = safeDynamicRequire("isolated-vm"), c = fastClone({
|
|
209
|
+
...r,
|
|
210
|
+
...o
|
|
211
|
+
}), l = getFunctionArguments({
|
|
212
|
+
builder: t,
|
|
213
|
+
context: n,
|
|
214
|
+
event: i,
|
|
215
|
+
state: c
|
|
216
|
+
}), u = getIsolateContext(), m = u.global;
|
|
217
|
+
m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
|
|
218
|
+
console.log(...y);
|
|
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
|
+
// workaround: methods with default values for arguments is not being cloned over
|
|
224
|
+
y === "builder" ? {
|
|
225
|
+
...p,
|
|
226
|
+
getUserAttributes: () => p.getUserAttributes()
|
|
227
|
+
} : p
|
|
228
|
+
) : null;
|
|
229
|
+
m.setSync(getSyncValName(y), k);
|
|
230
|
+
}), m.setSync(INJECTED_IVM_GLOBAL, s);
|
|
231
|
+
const g = processCode({
|
|
232
|
+
code: e,
|
|
233
|
+
args: l
|
|
234
|
+
}), h = u.evalSync(g);
|
|
235
|
+
try {
|
|
236
|
+
return JSON.parse(h);
|
|
237
|
+
} catch {
|
|
238
|
+
return h;
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
function isNodeRuntime() {
|
|
119
242
|
var e;
|
|
120
|
-
return typeof process != "undefined" &&
|
|
243
|
+
return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
121
244
|
}
|
|
122
|
-
const
|
|
245
|
+
const shouldForceBrowserRuntimeInNode = () => {
|
|
123
246
|
var i;
|
|
124
|
-
if (!
|
|
247
|
+
if (!isNodeRuntime())
|
|
125
248
|
return !1;
|
|
126
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");
|
|
127
|
-
return e && t && !n ? (
|
|
128
|
-
},
|
|
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), P = class P {
|
|
129
252
|
static getCacheKey(t) {
|
|
130
253
|
return JSON.stringify({
|
|
131
254
|
...t,
|
|
@@ -135,61 +258,64 @@ const nt = () => {
|
|
|
135
258
|
});
|
|
136
259
|
}
|
|
137
260
|
static getCachedValue(t) {
|
|
138
|
-
return
|
|
261
|
+
return P.cache.get(t);
|
|
139
262
|
}
|
|
140
263
|
static setCachedValue(t, n) {
|
|
141
|
-
|
|
264
|
+
P.cache.size > 20 && P.cache.delete(P.cache.keys().next().value), P.cache.set(t, {
|
|
142
265
|
value: n
|
|
143
266
|
});
|
|
144
267
|
}
|
|
145
268
|
};
|
|
146
|
-
|
|
147
|
-
let
|
|
148
|
-
function
|
|
269
|
+
F(P, "cacheLimit", 20), F(P, "cache", /* @__PURE__ */ new Map());
|
|
270
|
+
let EvalCache = P;
|
|
271
|
+
function evaluate({
|
|
149
272
|
code: e,
|
|
150
273
|
context: t,
|
|
151
274
|
localState: n,
|
|
152
275
|
rootState: i,
|
|
153
276
|
rootSetState: o,
|
|
154
|
-
event:
|
|
155
|
-
isExpression:
|
|
277
|
+
event: a,
|
|
278
|
+
isExpression: r = !0,
|
|
156
279
|
enableCache: s
|
|
157
280
|
}) {
|
|
158
281
|
if (e === "") {
|
|
159
|
-
|
|
282
|
+
logger.warn("Skipping evaluation of empty code block.");
|
|
160
283
|
return;
|
|
161
284
|
}
|
|
162
|
-
const
|
|
163
|
-
code:
|
|
164
|
-
isExpression:
|
|
285
|
+
const c = {
|
|
286
|
+
code: parseCode(e, {
|
|
287
|
+
isExpression: r
|
|
165
288
|
}),
|
|
166
|
-
builder:
|
|
289
|
+
builder: getBuilderGlobals(),
|
|
167
290
|
context: t,
|
|
168
|
-
event:
|
|
291
|
+
event: a,
|
|
169
292
|
rootSetState: o,
|
|
170
293
|
rootState: i,
|
|
171
294
|
localState: n
|
|
172
295
|
};
|
|
173
296
|
if (s) {
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
return
|
|
297
|
+
const l = EvalCache.getCacheKey(c), u = EvalCache.getCachedValue(l);
|
|
298
|
+
if (u)
|
|
299
|
+
return u.value;
|
|
177
300
|
}
|
|
178
301
|
try {
|
|
179
|
-
const
|
|
302
|
+
const l = chooseBrowserOrServerEval(c);
|
|
180
303
|
if (s) {
|
|
181
|
-
const
|
|
182
|
-
|
|
304
|
+
const u = EvalCache.getCacheKey(c);
|
|
305
|
+
EvalCache.setCachedValue(u, l);
|
|
183
306
|
}
|
|
184
|
-
return
|
|
185
|
-
} catch (
|
|
186
|
-
|
|
307
|
+
return l;
|
|
308
|
+
} catch (l) {
|
|
309
|
+
logger.error("Failed code evaluation: " + l.message, {
|
|
187
310
|
code: e
|
|
188
311
|
});
|
|
189
312
|
return;
|
|
190
313
|
}
|
|
191
314
|
}
|
|
192
|
-
|
|
315
|
+
function transformBlock(e) {
|
|
316
|
+
return e;
|
|
317
|
+
}
|
|
318
|
+
const evaluateBindings = ({
|
|
193
319
|
block: e,
|
|
194
320
|
context: t,
|
|
195
321
|
localState: n,
|
|
@@ -198,202 +324,202 @@ const ot = ({
|
|
|
198
324
|
}) => {
|
|
199
325
|
if (!e.bindings)
|
|
200
326
|
return e;
|
|
201
|
-
const
|
|
202
|
-
...
|
|
327
|
+
const a = fastClone(e), r = {
|
|
328
|
+
...a,
|
|
203
329
|
properties: {
|
|
204
|
-
...
|
|
330
|
+
...a.properties
|
|
205
331
|
},
|
|
206
332
|
actions: {
|
|
207
|
-
...
|
|
333
|
+
...a.actions
|
|
208
334
|
}
|
|
209
335
|
};
|
|
210
336
|
for (const s in e.bindings) {
|
|
211
|
-
const
|
|
212
|
-
code:
|
|
337
|
+
const c = e.bindings[s], l = evaluate({
|
|
338
|
+
code: c,
|
|
213
339
|
localState: n,
|
|
214
340
|
rootState: i,
|
|
215
341
|
rootSetState: o,
|
|
216
342
|
context: t,
|
|
217
343
|
enableCache: !0
|
|
218
344
|
});
|
|
219
|
-
|
|
345
|
+
set(r, s, l);
|
|
220
346
|
}
|
|
221
|
-
return
|
|
347
|
+
return r;
|
|
222
348
|
};
|
|
223
|
-
function
|
|
349
|
+
function getProcessedBlock({
|
|
224
350
|
block: e,
|
|
225
351
|
context: t,
|
|
226
352
|
shouldEvaluateBindings: n,
|
|
227
353
|
localState: i,
|
|
228
354
|
rootState: o,
|
|
229
|
-
rootSetState:
|
|
355
|
+
rootSetState: a
|
|
230
356
|
}) {
|
|
231
|
-
const
|
|
232
|
-
return n ?
|
|
233
|
-
block:
|
|
357
|
+
const r = e;
|
|
358
|
+
return n ? evaluateBindings({
|
|
359
|
+
block: r,
|
|
234
360
|
localState: i,
|
|
235
361
|
rootState: o,
|
|
236
|
-
rootSetState:
|
|
362
|
+
rootSetState: a,
|
|
237
363
|
context: t
|
|
238
|
-
}) :
|
|
364
|
+
}) : r;
|
|
239
365
|
}
|
|
240
|
-
function
|
|
241
|
-
let i, o,
|
|
242
|
-
const
|
|
243
|
-
s = n.leading === !1 ? 0 : Date.now(),
|
|
366
|
+
function throttle(e, t, n = {}) {
|
|
367
|
+
let i, o, a, r = null, s = 0;
|
|
368
|
+
const c = function() {
|
|
369
|
+
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
|
|
244
370
|
};
|
|
245
371
|
return function() {
|
|
246
|
-
const
|
|
247
|
-
!s && n.leading === !1 && (s =
|
|
248
|
-
const
|
|
249
|
-
return i = this, o = arguments,
|
|
372
|
+
const l = Date.now();
|
|
373
|
+
!s && n.leading === !1 && (s = l);
|
|
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;
|
|
250
376
|
};
|
|
251
377
|
}
|
|
252
|
-
function
|
|
378
|
+
function assign(e, ...t) {
|
|
253
379
|
const n = Object(e);
|
|
254
380
|
for (let i = 1; i < arguments.length; i++) {
|
|
255
381
|
const o = arguments[i];
|
|
256
382
|
if (o != null)
|
|
257
|
-
for (const
|
|
258
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
383
|
+
for (const a in o)
|
|
384
|
+
Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
|
|
259
385
|
}
|
|
260
386
|
return n;
|
|
261
387
|
}
|
|
262
|
-
const
|
|
263
|
-
function
|
|
388
|
+
const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
389
|
+
function bindAnimations(e) {
|
|
264
390
|
for (const t of e)
|
|
265
391
|
switch (t.trigger) {
|
|
266
392
|
case "pageLoad":
|
|
267
|
-
|
|
393
|
+
triggerAnimation(t);
|
|
268
394
|
break;
|
|
269
395
|
case "hover":
|
|
270
|
-
|
|
396
|
+
bindHoverAnimation(t);
|
|
271
397
|
break;
|
|
272
398
|
case "scrollInView":
|
|
273
|
-
|
|
399
|
+
bindScrollInViewAnimation(t);
|
|
274
400
|
break;
|
|
275
401
|
}
|
|
276
402
|
}
|
|
277
|
-
function
|
|
403
|
+
function warnElementNotPresent(e) {
|
|
278
404
|
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
279
405
|
}
|
|
280
|
-
function
|
|
281
|
-
const n =
|
|
282
|
-
for (const s of
|
|
283
|
-
for (const
|
|
284
|
-
|
|
406
|
+
function augmentAnimation(e, t) {
|
|
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
|
+
for (const s of r)
|
|
409
|
+
for (const c of n)
|
|
410
|
+
c in s || (s[c] = i[c]);
|
|
285
411
|
}
|
|
286
|
-
function
|
|
412
|
+
function getAllStylesUsed(e) {
|
|
287
413
|
const t = [];
|
|
288
414
|
for (const n of e.steps)
|
|
289
415
|
for (const i in n.styles)
|
|
290
416
|
t.indexOf(i) === -1 && t.push(i);
|
|
291
417
|
return t;
|
|
292
418
|
}
|
|
293
|
-
function
|
|
419
|
+
function triggerAnimation(e) {
|
|
294
420
|
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
295
421
|
if (!t.length) {
|
|
296
|
-
|
|
422
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
297
423
|
return;
|
|
298
424
|
}
|
|
299
425
|
Array.from(t).forEach((n) => {
|
|
300
|
-
|
|
301
|
-
n.style.transition = `all ${e.duration}s ${
|
|
426
|
+
augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
|
|
427
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
|
|
302
428
|
n.style.transition = "", n.style.transitionDelay = "";
|
|
303
429
|
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
304
430
|
});
|
|
305
431
|
});
|
|
306
432
|
}
|
|
307
|
-
function
|
|
433
|
+
function bindHoverAnimation(e) {
|
|
308
434
|
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
309
435
|
if (!t.length) {
|
|
310
|
-
|
|
436
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
311
437
|
return;
|
|
312
438
|
}
|
|
313
439
|
Array.from(t).forEach((n) => {
|
|
314
|
-
|
|
440
|
+
augmentAnimation(e, n);
|
|
315
441
|
const i = e.steps[0].styles, o = e.steps[1].styles;
|
|
316
|
-
function r() {
|
|
317
|
-
D(n.style, i);
|
|
318
|
-
}
|
|
319
442
|
function a() {
|
|
320
|
-
|
|
443
|
+
assign(n.style, i);
|
|
321
444
|
}
|
|
322
|
-
|
|
323
|
-
|
|
445
|
+
function r() {
|
|
446
|
+
assign(n.style, o);
|
|
447
|
+
}
|
|
448
|
+
a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
|
|
449
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
324
450
|
});
|
|
325
451
|
});
|
|
326
452
|
}
|
|
327
|
-
function
|
|
453
|
+
function bindScrollInViewAnimation(e) {
|
|
328
454
|
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
329
455
|
if (!t.length) {
|
|
330
|
-
|
|
456
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
331
457
|
return;
|
|
332
458
|
}
|
|
333
459
|
Array.from(t).forEach((n) => {
|
|
334
|
-
|
|
460
|
+
augmentAnimation(e, n);
|
|
335
461
|
let i = !1, o = !1;
|
|
336
|
-
function
|
|
462
|
+
function a() {
|
|
337
463
|
!i && s(n) ? (i = !0, o = !0, setTimeout(() => {
|
|
338
|
-
|
|
464
|
+
assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
|
|
339
465
|
o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
|
|
340
466
|
}, (e.duration + (e.delay || 0)) * 1e3 + 100);
|
|
341
|
-
})) : e.repeat && i && !o && !s(n) && (i = !1,
|
|
467
|
+
})) : e.repeat && i && !o && !s(n) && (i = !1, assign(n.style, e.steps[0].styles));
|
|
342
468
|
}
|
|
343
|
-
const
|
|
469
|
+
const r = throttle(a, 200, {
|
|
344
470
|
leading: !1
|
|
345
471
|
});
|
|
346
|
-
function s(
|
|
347
|
-
const
|
|
348
|
-
return
|
|
472
|
+
function s(u) {
|
|
473
|
+
const m = u.getBoundingClientRect(), g = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * g;
|
|
474
|
+
return m.bottom > y && m.top < g - y;
|
|
349
475
|
}
|
|
350
|
-
const
|
|
351
|
-
function
|
|
352
|
-
|
|
476
|
+
const c = e.steps[0].styles;
|
|
477
|
+
function l() {
|
|
478
|
+
assign(n.style, c);
|
|
353
479
|
}
|
|
354
|
-
|
|
355
|
-
n.style.transition = `all ${e.duration}s ${
|
|
356
|
-
}), document.addEventListener("scroll",
|
|
480
|
+
l(), setTimeout(() => {
|
|
481
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
482
|
+
}), document.addEventListener("scroll", r, {
|
|
357
483
|
capture: !0,
|
|
358
484
|
passive: !0
|
|
359
|
-
}),
|
|
485
|
+
}), a();
|
|
360
486
|
});
|
|
361
487
|
}
|
|
362
|
-
const
|
|
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]) => {
|
|
363
489
|
if (typeof i == "string")
|
|
364
|
-
return `${
|
|
365
|
-
}).filter(
|
|
366
|
-
`),
|
|
490
|
+
return `${camelToKebabCase(n)}: ${i};`;
|
|
491
|
+
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
492
|
+
`), createCssClass = ({
|
|
367
493
|
mediaQuery: e,
|
|
368
494
|
className: t,
|
|
369
495
|
styles: n
|
|
370
496
|
}) => {
|
|
371
497
|
const i = `.${t} {
|
|
372
|
-
${
|
|
498
|
+
${convertStyleMapToCSS(n)}
|
|
373
499
|
}`;
|
|
374
500
|
return e ? `${e} {
|
|
375
501
|
${i}
|
|
376
502
|
}` : i;
|
|
377
503
|
};
|
|
378
|
-
function
|
|
504
|
+
function transformStyleProperty({
|
|
379
505
|
style: e
|
|
380
506
|
}) {
|
|
381
507
|
return e;
|
|
382
508
|
}
|
|
383
|
-
const
|
|
509
|
+
const getStyle = ({
|
|
384
510
|
block: e,
|
|
385
511
|
context: t
|
|
386
|
-
}) =>
|
|
512
|
+
}) => mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
387
513
|
style: e.style || {},
|
|
388
514
|
context: t,
|
|
389
515
|
block: e
|
|
390
516
|
}));
|
|
391
|
-
function
|
|
392
|
-
switch (
|
|
517
|
+
function mapStyleObjToStrIfNeeded(e) {
|
|
518
|
+
switch (TARGET) {
|
|
393
519
|
case "svelte":
|
|
394
520
|
case "vue":
|
|
395
521
|
case "solid":
|
|
396
|
-
return
|
|
522
|
+
return convertStyleMapToCSSArray(e).join(" ");
|
|
397
523
|
case "qwik":
|
|
398
524
|
case "reactNative":
|
|
399
525
|
case "react":
|
|
@@ -401,20 +527,20 @@ function Pe(e) {
|
|
|
401
527
|
return e;
|
|
402
528
|
}
|
|
403
529
|
}
|
|
404
|
-
const
|
|
530
|
+
const getComponent = ({
|
|
405
531
|
block: e,
|
|
406
532
|
context: t,
|
|
407
533
|
registeredComponents: n
|
|
408
534
|
}) => {
|
|
409
|
-
var
|
|
410
|
-
const i = (
|
|
535
|
+
var a;
|
|
536
|
+
const i = (a = getProcessedBlock({
|
|
411
537
|
block: e,
|
|
412
538
|
localState: t.localState,
|
|
413
539
|
rootState: t.rootState,
|
|
414
540
|
rootSetState: t.rootSetState,
|
|
415
541
|
context: t.context,
|
|
416
542
|
shouldEvaluateBindings: !1
|
|
417
|
-
}).component) == null ? void 0 :
|
|
543
|
+
}).component) == null ? void 0 : a.name;
|
|
418
544
|
if (!i)
|
|
419
545
|
return null;
|
|
420
546
|
const o = n[i];
|
|
@@ -423,7 +549,7 @@ const ht = ({
|
|
|
423
549
|
console.warn(`
|
|
424
550
|
Could not find a registered component named "${i}".
|
|
425
551
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
426
|
-
},
|
|
552
|
+
}, getRepeatItemData = ({
|
|
427
553
|
block: e,
|
|
428
554
|
context: t
|
|
429
555
|
}) => {
|
|
@@ -433,7 +559,7 @@ const ht = ({
|
|
|
433
559
|
} = e;
|
|
434
560
|
if (!(n != null && n.collection))
|
|
435
561
|
return;
|
|
436
|
-
const o =
|
|
562
|
+
const o = evaluate({
|
|
437
563
|
code: n.collection,
|
|
438
564
|
localState: t.localState,
|
|
439
565
|
rootState: t.rootState,
|
|
@@ -443,21 +569,21 @@ const ht = ({
|
|
|
443
569
|
});
|
|
444
570
|
if (!Array.isArray(o))
|
|
445
571
|
return;
|
|
446
|
-
const
|
|
447
|
-
return o.map((
|
|
572
|
+
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
573
|
+
return o.map((c, l) => ({
|
|
448
574
|
context: {
|
|
449
575
|
...t,
|
|
450
576
|
localState: {
|
|
451
577
|
...t.localState,
|
|
452
|
-
$index:
|
|
453
|
-
$item:
|
|
454
|
-
[
|
|
455
|
-
[`$${
|
|
578
|
+
$index: l,
|
|
579
|
+
$item: c,
|
|
580
|
+
[r]: c,
|
|
581
|
+
[`$${r}Index`]: l
|
|
456
582
|
}
|
|
457
583
|
},
|
|
458
584
|
block: i
|
|
459
585
|
}));
|
|
460
|
-
},
|
|
586
|
+
}, SIZES = {
|
|
461
587
|
small: {
|
|
462
588
|
min: 320,
|
|
463
589
|
default: 321,
|
|
@@ -473,11 +599,11 @@ const ht = ({
|
|
|
473
599
|
default: 991,
|
|
474
600
|
max: 1200
|
|
475
601
|
}
|
|
476
|
-
},
|
|
602
|
+
}, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
|
|
477
603
|
small: e,
|
|
478
604
|
medium: t
|
|
479
605
|
}) => {
|
|
480
|
-
const n =
|
|
606
|
+
const n = fastClone(SIZES);
|
|
481
607
|
if (!e || !t)
|
|
482
608
|
return n;
|
|
483
609
|
const i = Math.floor(e / 2);
|
|
@@ -492,16 +618,16 @@ const ht = ({
|
|
|
492
618
|
min: o,
|
|
493
619
|
default: o + 1
|
|
494
620
|
};
|
|
495
|
-
const
|
|
621
|
+
const a = n.medium.max + 1;
|
|
496
622
|
return n.large = {
|
|
497
623
|
max: 2e3,
|
|
498
624
|
// TODO: decide upper limit
|
|
499
|
-
min:
|
|
500
|
-
default:
|
|
625
|
+
min: a,
|
|
626
|
+
default: a + 1
|
|
501
627
|
}, n;
|
|
502
628
|
};
|
|
503
|
-
function
|
|
504
|
-
return /* @__PURE__ */
|
|
629
|
+
function InlinedStyles(e) {
|
|
630
|
+
return /* @__PURE__ */ jsx(
|
|
505
631
|
"style",
|
|
506
632
|
{
|
|
507
633
|
dangerouslySetInnerHTML: { __html: e.styles },
|
|
@@ -509,9 +635,9 @@ function Z(e) {
|
|
|
509
635
|
}
|
|
510
636
|
);
|
|
511
637
|
}
|
|
512
|
-
function
|
|
638
|
+
function BlockStyles(e) {
|
|
513
639
|
function t() {
|
|
514
|
-
const i =
|
|
640
|
+
const i = getProcessedBlock({
|
|
515
641
|
block: e.block,
|
|
516
642
|
localState: e.context.localState,
|
|
517
643
|
rootState: e.context.rootState,
|
|
@@ -519,48 +645,48 @@ function bt(e) {
|
|
|
519
645
|
context: e.context.context,
|
|
520
646
|
shouldEvaluateBindings: !0
|
|
521
647
|
});
|
|
522
|
-
return
|
|
648
|
+
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
523
649
|
}
|
|
524
650
|
function n() {
|
|
525
|
-
var
|
|
526
|
-
const i =
|
|
651
|
+
var y;
|
|
652
|
+
const i = getProcessedBlock({
|
|
527
653
|
block: e.block,
|
|
528
654
|
localState: e.context.localState,
|
|
529
655
|
rootState: e.context.rootState,
|
|
530
656
|
rootSetState: e.context.rootSetState,
|
|
531
657
|
context: e.context.context,
|
|
532
658
|
shouldEvaluateBindings: !0
|
|
533
|
-
}), o = i.responsiveStyles,
|
|
534
|
-
((
|
|
535
|
-
), s = o == null ? void 0 : o.large,
|
|
536
|
-
if (!
|
|
659
|
+
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
660
|
+
((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
|
|
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)
|
|
537
663
|
return "";
|
|
538
|
-
const
|
|
539
|
-
className:
|
|
664
|
+
const m = s ? createCssClass({
|
|
665
|
+
className: u,
|
|
540
666
|
styles: s
|
|
541
|
-
}) : "",
|
|
542
|
-
className:
|
|
543
|
-
styles:
|
|
544
|
-
mediaQuery:
|
|
667
|
+
}) : "", g = c ? createCssClass({
|
|
668
|
+
className: u,
|
|
669
|
+
styles: c,
|
|
670
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
545
671
|
"medium",
|
|
546
|
-
|
|
672
|
+
r
|
|
547
673
|
)
|
|
548
|
-
}) : "",
|
|
549
|
-
className:
|
|
550
|
-
styles:
|
|
551
|
-
mediaQuery:
|
|
674
|
+
}) : "", h = l ? createCssClass({
|
|
675
|
+
className: u,
|
|
676
|
+
styles: l,
|
|
677
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
552
678
|
"small",
|
|
553
|
-
|
|
679
|
+
r
|
|
554
680
|
)
|
|
555
681
|
}) : "";
|
|
556
|
-
return [
|
|
682
|
+
return [m, g, h].join(" ");
|
|
557
683
|
}
|
|
558
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
|
|
559
685
|
}
|
|
560
|
-
function
|
|
686
|
+
function capitalizeFirstLetter(e) {
|
|
561
687
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
562
688
|
}
|
|
563
|
-
const
|
|
689
|
+
const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
|
|
564
690
|
code: e,
|
|
565
691
|
context: t.context,
|
|
566
692
|
localState: t.localState,
|
|
@@ -570,66 +696,66 @@ const pt = (e) => `on${yt(e)}`, xt = (e, t) => (n) => K({
|
|
|
570
696
|
isExpression: !1,
|
|
571
697
|
enableCache: !0
|
|
572
698
|
});
|
|
573
|
-
function
|
|
699
|
+
function getBlockActions(e) {
|
|
574
700
|
var i;
|
|
575
701
|
const t = {}, n = (i = e.block.actions) != null ? i : {};
|
|
576
702
|
for (const o in n) {
|
|
577
703
|
if (!n.hasOwnProperty(o))
|
|
578
704
|
continue;
|
|
579
|
-
const
|
|
580
|
-
let
|
|
705
|
+
const a = n[o];
|
|
706
|
+
let r = getEventHandlerName(o);
|
|
581
707
|
if (e.stripPrefix)
|
|
582
|
-
switch (
|
|
708
|
+
switch (TARGET) {
|
|
583
709
|
case "vue":
|
|
584
|
-
|
|
710
|
+
r = r.replace("v-on:", "");
|
|
585
711
|
break;
|
|
586
712
|
case "svelte":
|
|
587
|
-
|
|
713
|
+
r = r.replace("on:", "");
|
|
588
714
|
break;
|
|
589
715
|
}
|
|
590
|
-
t[
|
|
716
|
+
t[r] = createEventHandler(a, e);
|
|
591
717
|
}
|
|
592
718
|
return t;
|
|
593
719
|
}
|
|
594
|
-
function
|
|
720
|
+
function transformBlockProperties({
|
|
595
721
|
properties: e
|
|
596
722
|
}) {
|
|
597
723
|
return e;
|
|
598
724
|
}
|
|
599
|
-
const
|
|
725
|
+
const extractRelevantRootBlockProperties = (e) => ({
|
|
600
726
|
href: e.href
|
|
601
727
|
});
|
|
602
|
-
function
|
|
728
|
+
function getBlockProperties({
|
|
603
729
|
block: e,
|
|
604
730
|
context: t
|
|
605
731
|
}) {
|
|
606
732
|
var i;
|
|
607
733
|
const n = {
|
|
608
|
-
...
|
|
734
|
+
...extractRelevantRootBlockProperties(e),
|
|
609
735
|
...e.properties,
|
|
610
736
|
"builder-id": e.id,
|
|
611
|
-
style:
|
|
737
|
+
style: getStyle({
|
|
612
738
|
block: e,
|
|
613
739
|
context: t
|
|
614
740
|
}),
|
|
615
|
-
[
|
|
741
|
+
[getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
|
|
616
742
|
};
|
|
617
|
-
return
|
|
743
|
+
return transformBlockProperties({
|
|
618
744
|
properties: n,
|
|
619
745
|
context: t,
|
|
620
746
|
block: e
|
|
621
747
|
});
|
|
622
748
|
}
|
|
623
|
-
function
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
-
|
|
749
|
+
function BlockWrapper(e) {
|
|
750
|
+
return /* @__PURE__ */ jsx(
|
|
751
|
+
DynamicRenderer,
|
|
626
752
|
{
|
|
627
753
|
TagName: e.Wrapper,
|
|
628
|
-
attributes:
|
|
754
|
+
attributes: getBlockProperties({
|
|
629
755
|
block: e.block,
|
|
630
756
|
context: e.context
|
|
631
757
|
}),
|
|
632
|
-
actionAttributes:
|
|
758
|
+
actionAttributes: getBlockActions({
|
|
633
759
|
block: e.block,
|
|
634
760
|
rootState: e.context.rootState,
|
|
635
761
|
rootSetState: e.context.rootSetState,
|
|
@@ -641,17 +767,17 @@ function kt(e) {
|
|
|
641
767
|
}
|
|
642
768
|
);
|
|
643
769
|
}
|
|
644
|
-
function
|
|
645
|
-
return /* @__PURE__ */
|
|
770
|
+
function InteractiveElement(e) {
|
|
771
|
+
return /* @__PURE__ */ jsx(
|
|
646
772
|
e.Wrapper,
|
|
647
773
|
{
|
|
648
774
|
...e.wrapperProps,
|
|
649
775
|
attributes: e.includeBlockProps ? {
|
|
650
|
-
...
|
|
776
|
+
...getBlockProperties({
|
|
651
777
|
block: e.block,
|
|
652
778
|
context: e.context
|
|
653
779
|
}),
|
|
654
|
-
...
|
|
780
|
+
...getBlockActions({
|
|
655
781
|
block: e.block,
|
|
656
782
|
rootState: e.context.rootState,
|
|
657
783
|
rootSetState: e.context.rootSetState,
|
|
@@ -663,14 +789,14 @@ function Ct(e) {
|
|
|
663
789
|
}
|
|
664
790
|
);
|
|
665
791
|
}
|
|
666
|
-
const
|
|
792
|
+
const getWrapperProps = ({
|
|
667
793
|
componentOptions: e,
|
|
668
794
|
builderBlock: t,
|
|
669
795
|
context: n,
|
|
670
796
|
componentRef: i,
|
|
671
797
|
includeBlockProps: o,
|
|
672
|
-
isInteractive:
|
|
673
|
-
contextValue:
|
|
798
|
+
isInteractive: a,
|
|
799
|
+
contextValue: r
|
|
674
800
|
}) => {
|
|
675
801
|
const s = {
|
|
676
802
|
...e,
|
|
@@ -679,13 +805,13 @@ const wt = ({
|
|
|
679
805
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
680
806
|
*/
|
|
681
807
|
...o ? {
|
|
682
|
-
attributes:
|
|
808
|
+
attributes: getBlockProperties({
|
|
683
809
|
block: t,
|
|
684
|
-
context:
|
|
810
|
+
context: r
|
|
685
811
|
})
|
|
686
812
|
} : {}
|
|
687
813
|
};
|
|
688
|
-
return
|
|
814
|
+
return a ? {
|
|
689
815
|
Wrapper: i,
|
|
690
816
|
block: t,
|
|
691
817
|
context: n,
|
|
@@ -693,15 +819,15 @@ const wt = ({
|
|
|
693
819
|
includeBlockProps: o
|
|
694
820
|
} : s;
|
|
695
821
|
};
|
|
696
|
-
function
|
|
822
|
+
function ComponentRef(e) {
|
|
697
823
|
var i;
|
|
698
|
-
const [t, n] =
|
|
699
|
-
() => e.isInteractive ?
|
|
824
|
+
const [t, n] = useState(
|
|
825
|
+
() => e.isInteractive ? InteractiveElement : e.componentRef
|
|
700
826
|
);
|
|
701
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
702
828
|
t,
|
|
703
829
|
{
|
|
704
|
-
...
|
|
830
|
+
...getWrapperProps({
|
|
705
831
|
componentOptions: e.componentOptions,
|
|
706
832
|
builderBlock: e.builderBlock,
|
|
707
833
|
context: e.context,
|
|
@@ -711,8 +837,8 @@ function ge(e) {
|
|
|
711
837
|
isInteractive: e.isInteractive,
|
|
712
838
|
contextValue: e.context
|
|
713
839
|
}),
|
|
714
|
-
children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */
|
|
715
|
-
|
|
840
|
+
children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ jsx(
|
|
841
|
+
Block,
|
|
716
842
|
{
|
|
717
843
|
block: o,
|
|
718
844
|
context: e.context,
|
|
@@ -724,10 +850,10 @@ function ge(e) {
|
|
|
724
850
|
}
|
|
725
851
|
) }) : null });
|
|
726
852
|
}
|
|
727
|
-
function
|
|
728
|
-
const [t, n] =
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
|
|
853
|
+
function RepeatedBlock(e) {
|
|
854
|
+
const [t, n] = useState(() => e.repeatContext);
|
|
855
|
+
return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
|
|
856
|
+
Block,
|
|
731
857
|
{
|
|
732
858
|
block: e.block,
|
|
733
859
|
context: t,
|
|
@@ -736,24 +862,24 @@ function It(e) {
|
|
|
736
862
|
}
|
|
737
863
|
) });
|
|
738
864
|
}
|
|
739
|
-
function
|
|
740
|
-
var
|
|
865
|
+
function Block(e) {
|
|
866
|
+
var c, l, u;
|
|
741
867
|
function t() {
|
|
742
|
-
return
|
|
868
|
+
return getComponent({
|
|
743
869
|
block: e.block,
|
|
744
870
|
context: e.context,
|
|
745
871
|
registeredComponents: e.registeredComponents
|
|
746
872
|
});
|
|
747
873
|
}
|
|
748
874
|
function n() {
|
|
749
|
-
return
|
|
875
|
+
return getRepeatItemData({
|
|
750
876
|
block: e.block,
|
|
751
877
|
context: e.context
|
|
752
878
|
});
|
|
753
879
|
}
|
|
754
880
|
function i() {
|
|
755
|
-
var
|
|
756
|
-
return (
|
|
881
|
+
var m;
|
|
882
|
+
return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
|
|
757
883
|
block: e.block,
|
|
758
884
|
localState: e.context.localState,
|
|
759
885
|
rootState: e.context.rootState,
|
|
@@ -763,32 +889,32 @@ function _(e) {
|
|
|
763
889
|
});
|
|
764
890
|
}
|
|
765
891
|
function o() {
|
|
766
|
-
var
|
|
767
|
-
return e.block.tagName === "a" || ((
|
|
768
|
-
}
|
|
769
|
-
function r() {
|
|
770
|
-
var p, v;
|
|
771
|
-
if ((p = e.block.repeat) != null && p.collection)
|
|
772
|
-
return !!((v = n == null ? void 0 : n()) != null && v.length);
|
|
773
|
-
const f = "hide" in i() ? i().hide : !1;
|
|
774
|
-
return ("show" in i() ? i().show : !0) && !f;
|
|
892
|
+
var g;
|
|
893
|
+
return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
775
894
|
}
|
|
776
895
|
function a() {
|
|
777
|
-
var
|
|
778
|
-
|
|
896
|
+
var h, y;
|
|
897
|
+
if ((h = e.block.repeat) != null && h.collection)
|
|
898
|
+
return !!((y = n == null ? void 0 : n()) != null && y.length);
|
|
899
|
+
const m = "hide" in i() ? i().hide : !1;
|
|
900
|
+
return ("show" in i() ? i().show : !0) && !m;
|
|
901
|
+
}
|
|
902
|
+
function r() {
|
|
903
|
+
var g, h;
|
|
904
|
+
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (h = i().children) != null ? h : [] : [];
|
|
779
905
|
}
|
|
780
906
|
function s() {
|
|
781
|
-
var
|
|
907
|
+
var m, g, h, y, p, k, T, S, C, E, I;
|
|
782
908
|
return {
|
|
783
|
-
blockChildren: (
|
|
784
|
-
componentRef: (
|
|
909
|
+
blockChildren: (m = i().children) != null ? m : [],
|
|
910
|
+
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
785
911
|
componentOptions: {
|
|
786
|
-
...
|
|
912
|
+
...getBlockComponentOptions(i()),
|
|
787
913
|
builderContext: e.context,
|
|
788
|
-
...((
|
|
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" ? {
|
|
789
915
|
builderLinkComponent: e.linkComponent
|
|
790
916
|
} : {},
|
|
791
|
-
...((
|
|
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" ? {
|
|
792
918
|
builderComponents: e.registeredComponents
|
|
793
919
|
} : {}
|
|
794
920
|
},
|
|
@@ -796,22 +922,22 @@ function _(e) {
|
|
|
796
922
|
linkComponent: e.linkComponent,
|
|
797
923
|
registeredComponents: e.registeredComponents,
|
|
798
924
|
builderBlock: i(),
|
|
799
|
-
includeBlockProps: ((
|
|
800
|
-
isInteractive: !((
|
|
925
|
+
includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
|
|
926
|
+
isInteractive: !((I = t == null ? void 0 : t()) != null && I.isRSC)
|
|
801
927
|
};
|
|
802
928
|
}
|
|
803
|
-
return
|
|
804
|
-
const
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
...
|
|
808
|
-
elementId:
|
|
929
|
+
return useEffect(() => {
|
|
930
|
+
const m = i().id, g = i().animations;
|
|
931
|
+
g && m && bindAnimations(
|
|
932
|
+
g.filter((h) => h.trigger !== "hover").map((h) => ({
|
|
933
|
+
...h,
|
|
934
|
+
elementId: m
|
|
809
935
|
}))
|
|
810
936
|
);
|
|
811
|
-
}, []), /* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
(
|
|
814
|
-
|
|
937
|
+
}, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
938
|
+
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
939
|
+
(c = t == null ? void 0 : t()) != null && c.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
940
|
+
ComponentRef,
|
|
815
941
|
{
|
|
816
942
|
componentRef: s().componentRef,
|
|
817
943
|
componentOptions: s().componentOptions,
|
|
@@ -823,25 +949,25 @@ function _(e) {
|
|
|
823
949
|
includeBlockProps: s().includeBlockProps,
|
|
824
950
|
isInteractive: s().isInteractive
|
|
825
951
|
}
|
|
826
|
-
) }) : /* @__PURE__ */
|
|
827
|
-
|
|
952
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (u = n()) == null ? void 0 : u.map((m, g) => /* @__PURE__ */ jsx(
|
|
953
|
+
RepeatedBlock,
|
|
828
954
|
{
|
|
829
|
-
repeatContext:
|
|
830
|
-
block:
|
|
955
|
+
repeatContext: m.context,
|
|
956
|
+
block: m.block,
|
|
831
957
|
registeredComponents: e.registeredComponents,
|
|
832
958
|
linkComponent: e.linkComponent
|
|
833
959
|
},
|
|
834
|
-
|
|
835
|
-
)) }) : /* @__PURE__ */
|
|
836
|
-
|
|
960
|
+
g
|
|
961
|
+
)) }) : /* @__PURE__ */ jsxs(
|
|
962
|
+
BlockWrapper,
|
|
837
963
|
{
|
|
838
964
|
Wrapper: o(),
|
|
839
965
|
block: i(),
|
|
840
966
|
context: e.context,
|
|
841
967
|
linkComponent: e.linkComponent,
|
|
842
968
|
children: [
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
|
|
969
|
+
/* @__PURE__ */ jsx(
|
|
970
|
+
ComponentRef,
|
|
845
971
|
{
|
|
846
972
|
componentRef: s().componentRef,
|
|
847
973
|
componentOptions: s().componentOptions,
|
|
@@ -854,29 +980,29 @@ function _(e) {
|
|
|
854
980
|
isInteractive: s().isInteractive
|
|
855
981
|
}
|
|
856
982
|
),
|
|
857
|
-
(
|
|
858
|
-
|
|
983
|
+
(l = r()) == null ? void 0 : l.map((m) => /* @__PURE__ */ jsx(
|
|
984
|
+
Block,
|
|
859
985
|
{
|
|
860
|
-
block:
|
|
986
|
+
block: m,
|
|
861
987
|
registeredComponents: e.registeredComponents,
|
|
862
988
|
linkComponent: e.linkComponent,
|
|
863
989
|
context: e.context
|
|
864
990
|
},
|
|
865
|
-
|
|
991
|
+
m.id
|
|
866
992
|
))
|
|
867
993
|
]
|
|
868
994
|
}
|
|
869
|
-
) })
|
|
995
|
+
) })
|
|
870
996
|
] }) : null });
|
|
871
997
|
}
|
|
872
|
-
function
|
|
998
|
+
function BlocksWrapper(e) {
|
|
873
999
|
function t() {
|
|
874
1000
|
var o;
|
|
875
1001
|
return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
|
|
876
1002
|
}
|
|
877
1003
|
function n() {
|
|
878
|
-
var o,
|
|
879
|
-
|
|
1004
|
+
var o, a;
|
|
1005
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
880
1006
|
{
|
|
881
1007
|
type: "builder.clickEmptyBlocks",
|
|
882
1008
|
data: {
|
|
@@ -888,8 +1014,8 @@ function Tt(e) {
|
|
|
888
1014
|
));
|
|
889
1015
|
}
|
|
890
1016
|
function i() {
|
|
891
|
-
var o,
|
|
892
|
-
|
|
1017
|
+
var o, a;
|
|
1018
|
+
isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
|
|
893
1019
|
{
|
|
894
1020
|
type: "builder.hoverEmptyBlocks",
|
|
895
1021
|
data: {
|
|
@@ -900,11 +1026,11 @@ function Tt(e) {
|
|
|
900
1026
|
"*"
|
|
901
1027
|
));
|
|
902
1028
|
}
|
|
903
|
-
return /* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
1029
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1030
|
+
/* @__PURE__ */ jsx(
|
|
905
1031
|
e.BlocksWrapper,
|
|
906
1032
|
{
|
|
907
|
-
className: t() + " props-blocks-wrapper-
|
|
1033
|
+
className: t() + " props-blocks-wrapper-7cd1560e",
|
|
908
1034
|
"builder-path": e.path,
|
|
909
1035
|
"builder-parent-id": e.parent,
|
|
910
1036
|
style: e.styleProp,
|
|
@@ -915,18 +1041,18 @@ function Tt(e) {
|
|
|
915
1041
|
children: e.children
|
|
916
1042
|
}
|
|
917
1043
|
),
|
|
918
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ jsx("style", { children: `.props-blocks-wrapper-7cd1560e {
|
|
919
1045
|
display: flex;
|
|
920
1046
|
flex-direction: column;
|
|
921
1047
|
align-items: stretch;
|
|
922
1048
|
}` })
|
|
923
1049
|
] });
|
|
924
1050
|
}
|
|
925
|
-
function
|
|
926
|
-
var i, o,
|
|
927
|
-
const t =
|
|
928
|
-
return /* @__PURE__ */
|
|
929
|
-
|
|
1051
|
+
function Blocks(e) {
|
|
1052
|
+
var i, o, a;
|
|
1053
|
+
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
1054
|
+
return /* @__PURE__ */ jsx(
|
|
1055
|
+
BlocksWrapper,
|
|
930
1056
|
{
|
|
931
1057
|
blocks: e.blocks,
|
|
932
1058
|
parent: e.parent,
|
|
@@ -934,95 +1060,95 @@ function O(e) {
|
|
|
934
1060
|
styleProp: e.styleProp,
|
|
935
1061
|
BlocksWrapper: ((i = e.context) == null ? void 0 : i.BlocksWrapper) || t.BlocksWrapper,
|
|
936
1062
|
BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || t.BlocksWrapperProps,
|
|
937
|
-
children: e.blocks ? /* @__PURE__ */
|
|
938
|
-
|
|
1063
|
+
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
|
|
1064
|
+
Block,
|
|
939
1065
|
{
|
|
940
|
-
block:
|
|
1066
|
+
block: r,
|
|
941
1067
|
linkComponent: e.linkComponent,
|
|
942
1068
|
context: e.context || t,
|
|
943
1069
|
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
944
1070
|
},
|
|
945
|
-
|
|
1071
|
+
r.id
|
|
946
1072
|
)) }) : null
|
|
947
1073
|
}
|
|
948
1074
|
);
|
|
949
1075
|
}
|
|
950
|
-
function
|
|
951
|
-
var
|
|
952
|
-
const [t, n] =
|
|
1076
|
+
function Columns(e) {
|
|
1077
|
+
var T;
|
|
1078
|
+
const [t, n] = useState(
|
|
953
1079
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
954
|
-
), [i, o] =
|
|
1080
|
+
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
955
1081
|
() => e.stackColumnsAt || "tablet"
|
|
956
1082
|
);
|
|
957
|
-
function s(
|
|
958
|
-
var
|
|
959
|
-
return ((
|
|
1083
|
+
function s(S) {
|
|
1084
|
+
var C;
|
|
1085
|
+
return ((C = i[S]) == null ? void 0 : C.width) || 100 / i.length;
|
|
960
1086
|
}
|
|
961
|
-
function
|
|
962
|
-
const
|
|
963
|
-
return `calc(${s(
|
|
1087
|
+
function c(S) {
|
|
1088
|
+
const C = t * (i.length - 1) / i.length;
|
|
1089
|
+
return `calc(${s(S)}% - ${C}px)`;
|
|
964
1090
|
}
|
|
965
|
-
function
|
|
966
|
-
stackedStyle:
|
|
967
|
-
desktopStyle:
|
|
1091
|
+
function l({
|
|
1092
|
+
stackedStyle: S,
|
|
1093
|
+
desktopStyle: C
|
|
968
1094
|
}) {
|
|
969
|
-
return
|
|
1095
|
+
return a === "tablet" ? S : C;
|
|
970
1096
|
}
|
|
971
|
-
function
|
|
972
|
-
stackedStyle:
|
|
973
|
-
desktopStyle:
|
|
1097
|
+
function u({
|
|
1098
|
+
stackedStyle: S,
|
|
1099
|
+
desktopStyle: C
|
|
974
1100
|
}) {
|
|
975
|
-
return
|
|
1101
|
+
return a === "never" ? C : S;
|
|
976
1102
|
}
|
|
977
|
-
const [
|
|
1103
|
+
const [m, g] = useState(
|
|
978
1104
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
979
1105
|
);
|
|
980
|
-
function
|
|
1106
|
+
function h() {
|
|
981
1107
|
return {
|
|
982
|
-
"--flex-dir":
|
|
983
|
-
"--flex-dir-tablet":
|
|
984
|
-
stackedStyle:
|
|
1108
|
+
"--flex-dir": m,
|
|
1109
|
+
"--flex-dir-tablet": l({
|
|
1110
|
+
stackedStyle: m,
|
|
985
1111
|
desktopStyle: "row"
|
|
986
1112
|
})
|
|
987
1113
|
};
|
|
988
1114
|
}
|
|
989
|
-
function
|
|
990
|
-
const
|
|
1115
|
+
function y(S) {
|
|
1116
|
+
const C = S === 0 ? 0 : t, E = c(S), I = `${C}px`, B = "100%", j = 0;
|
|
991
1117
|
return {
|
|
992
1118
|
...{
|
|
993
1119
|
display: "flex",
|
|
994
1120
|
flexDirection: "column",
|
|
995
1121
|
alignItems: "stretch"
|
|
996
1122
|
},
|
|
997
|
-
width:
|
|
998
|
-
["marginLeft"]:
|
|
999
|
-
"--column-width-mobile":
|
|
1000
|
-
stackedStyle:
|
|
1001
|
-
desktopStyle: P
|
|
1002
|
-
}),
|
|
1003
|
-
"--column-margin-left-mobile": m({
|
|
1004
|
-
stackedStyle: L,
|
|
1123
|
+
width: E,
|
|
1124
|
+
["marginLeft"]: I,
|
|
1125
|
+
"--column-width-mobile": u({
|
|
1126
|
+
stackedStyle: B,
|
|
1005
1127
|
desktopStyle: E
|
|
1006
1128
|
}),
|
|
1007
|
-
"--column-
|
|
1008
|
-
stackedStyle:
|
|
1009
|
-
desktopStyle:
|
|
1129
|
+
"--column-margin-left-mobile": u({
|
|
1130
|
+
stackedStyle: j,
|
|
1131
|
+
desktopStyle: I
|
|
1010
1132
|
}),
|
|
1011
|
-
"--column-
|
|
1012
|
-
stackedStyle:
|
|
1133
|
+
"--column-width-tablet": l({
|
|
1134
|
+
stackedStyle: B,
|
|
1013
1135
|
desktopStyle: E
|
|
1136
|
+
}),
|
|
1137
|
+
"--column-margin-left-tablet": l({
|
|
1138
|
+
stackedStyle: j,
|
|
1139
|
+
desktopStyle: I
|
|
1014
1140
|
})
|
|
1015
1141
|
};
|
|
1016
1142
|
}
|
|
1017
|
-
function
|
|
1018
|
-
var
|
|
1019
|
-
return
|
|
1020
|
-
((
|
|
1021
|
-
)[
|
|
1143
|
+
function p(S) {
|
|
1144
|
+
var E, I;
|
|
1145
|
+
return getSizesForBreakpoints(
|
|
1146
|
+
((I = (E = e.builderContext.content) == null ? void 0 : E.meta) == null ? void 0 : I.breakpoints) || {}
|
|
1147
|
+
)[S].max;
|
|
1022
1148
|
}
|
|
1023
|
-
function
|
|
1149
|
+
function k() {
|
|
1024
1150
|
return `
|
|
1025
|
-
@media (max-width: ${
|
|
1151
|
+
@media (max-width: ${p("medium")}px) {
|
|
1026
1152
|
.${e.builderBlock.id}-breakpoints {
|
|
1027
1153
|
flex-direction: var(--flex-dir-tablet);
|
|
1028
1154
|
align-items: stretch;
|
|
@@ -1034,7 +1160,7 @@ function Et(e) {
|
|
|
1034
1160
|
}
|
|
1035
1161
|
}
|
|
1036
1162
|
|
|
1037
|
-
@media (max-width: ${
|
|
1163
|
+
@media (max-width: ${p("small")}px) {
|
|
1038
1164
|
.${e.builderBlock.id}-breakpoints {
|
|
1039
1165
|
flex-direction: var(--flex-dir);
|
|
1040
1166
|
align-items: stretch;
|
|
@@ -1047,30 +1173,30 @@ function Et(e) {
|
|
|
1047
1173
|
},
|
|
1048
1174
|
`;
|
|
1049
1175
|
}
|
|
1050
|
-
return /* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1176
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1177
|
+
/* @__PURE__ */ jsxs(
|
|
1052
1178
|
"div",
|
|
1053
1179
|
{
|
|
1054
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
1055
|
-
style:
|
|
1180
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,
|
|
1181
|
+
style: h(),
|
|
1056
1182
|
children: [
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
(
|
|
1059
|
-
|
|
1183
|
+
/* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: k() }),
|
|
1184
|
+
(T = e.columns) == null ? void 0 : T.map((S, C) => /* @__PURE__ */ jsx(
|
|
1185
|
+
DynamicRenderer,
|
|
1060
1186
|
{
|
|
1061
|
-
TagName:
|
|
1187
|
+
TagName: S.link ? e.builderLinkComponent || "a" : "div",
|
|
1062
1188
|
actionAttributes: {},
|
|
1063
1189
|
attributes: {
|
|
1064
|
-
...
|
|
1065
|
-
href:
|
|
1190
|
+
...S.link ? {
|
|
1191
|
+
href: S.link
|
|
1066
1192
|
} : {},
|
|
1067
|
-
[
|
|
1068
|
-
style:
|
|
1193
|
+
[getClassPropName()]: "builder-column",
|
|
1194
|
+
style: mapStyleObjToStrIfNeeded(y(C))
|
|
1069
1195
|
},
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1071
|
-
|
|
1196
|
+
children: /* @__PURE__ */ jsx(
|
|
1197
|
+
Blocks,
|
|
1072
1198
|
{
|
|
1073
|
-
path: `component.options.columns.${
|
|
1199
|
+
path: `component.options.columns.${C}.blocks`,
|
|
1074
1200
|
parent: e.builderBlock.id,
|
|
1075
1201
|
styleProp: {
|
|
1076
1202
|
flexGrow: "1"
|
|
@@ -1078,89 +1204,89 @@ function Et(e) {
|
|
|
1078
1204
|
context: e.builderContext,
|
|
1079
1205
|
registeredComponents: e.builderComponents,
|
|
1080
1206
|
linkComponent: e.builderLinkComponent,
|
|
1081
|
-
blocks:
|
|
1207
|
+
blocks: S.blocks
|
|
1082
1208
|
}
|
|
1083
1209
|
)
|
|
1084
1210
|
},
|
|
1085
|
-
|
|
1211
|
+
C
|
|
1086
1212
|
))
|
|
1087
1213
|
]
|
|
1088
1214
|
}
|
|
1089
1215
|
),
|
|
1090
|
-
/* @__PURE__ */
|
|
1216
|
+
/* @__PURE__ */ jsx("style", { children: `.div-003f4b1c {
|
|
1091
1217
|
display: flex;
|
|
1092
1218
|
line-height: normal;
|
|
1093
1219
|
}` })
|
|
1094
1220
|
] });
|
|
1095
1221
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return /* @__PURE__ */
|
|
1222
|
+
function FragmentComponent(e) {
|
|
1223
|
+
return /* @__PURE__ */ jsx("span", { children: e.children });
|
|
1098
1224
|
}
|
|
1099
|
-
function
|
|
1225
|
+
function removeProtocol(e) {
|
|
1100
1226
|
return e.replace(/http(s)?:/, "");
|
|
1101
1227
|
}
|
|
1102
|
-
function
|
|
1228
|
+
function updateQueryParam(e = "", t, n) {
|
|
1103
1229
|
const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
|
|
1104
1230
|
return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
|
|
1105
1231
|
}
|
|
1106
|
-
function
|
|
1232
|
+
function getShopifyImageUrl(e, t) {
|
|
1107
1233
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
1108
1234
|
return e;
|
|
1109
1235
|
if (t === "master")
|
|
1110
|
-
return
|
|
1236
|
+
return removeProtocol(e);
|
|
1111
1237
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
1112
1238
|
if (n) {
|
|
1113
|
-
const i = e.split(n[0]), o = n[3],
|
|
1114
|
-
return
|
|
1239
|
+
const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
|
|
1240
|
+
return removeProtocol(`${i[0]}_${a}${o}`);
|
|
1115
1241
|
}
|
|
1116
1242
|
return null;
|
|
1117
1243
|
}
|
|
1118
|
-
function
|
|
1244
|
+
function getSrcSet(e) {
|
|
1119
1245
|
if (!e)
|
|
1120
1246
|
return e;
|
|
1121
1247
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
1122
1248
|
if (e.match(/builder\.io/)) {
|
|
1123
1249
|
let n = e;
|
|
1124
1250
|
const i = Number(e.split("?width=")[1]);
|
|
1125
|
-
return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${
|
|
1251
|
+
return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
|
|
1126
1252
|
}
|
|
1127
|
-
return e.match(/cdn\.shopify\.com/) ? t.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;
|
|
1128
1254
|
}
|
|
1129
|
-
function
|
|
1130
|
-
var o,
|
|
1255
|
+
function Image(e) {
|
|
1256
|
+
var o, a, r, s;
|
|
1131
1257
|
function t() {
|
|
1132
|
-
var
|
|
1133
|
-
const
|
|
1134
|
-
if (!
|
|
1258
|
+
var u;
|
|
1259
|
+
const l = e.image || e.src;
|
|
1260
|
+
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
1135
1261
|
// images, otherwise you can supply this prop manually
|
|
1136
|
-
!(
|
|
1262
|
+
!(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
|
|
1137
1263
|
return e.srcset;
|
|
1138
|
-
if (e.srcset && ((
|
|
1264
|
+
if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
|
|
1139
1265
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1140
|
-
return console.debug("Removed given srcset"),
|
|
1266
|
+
return console.debug("Removed given srcset"), getSrcSet(l);
|
|
1141
1267
|
} else if (e.image && !e.srcset)
|
|
1142
|
-
return
|
|
1143
|
-
return
|
|
1268
|
+
return getSrcSet(l);
|
|
1269
|
+
return getSrcSet(l);
|
|
1144
1270
|
}
|
|
1145
1271
|
function n() {
|
|
1146
|
-
var
|
|
1147
|
-
return (
|
|
1272
|
+
var c;
|
|
1273
|
+
return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1148
1274
|
}
|
|
1149
1275
|
function i() {
|
|
1150
|
-
const
|
|
1276
|
+
const c = {
|
|
1151
1277
|
position: "absolute",
|
|
1152
1278
|
height: "100%",
|
|
1153
1279
|
width: "100%",
|
|
1154
1280
|
left: "0px",
|
|
1155
1281
|
top: "0px"
|
|
1156
1282
|
};
|
|
1157
|
-
return e.aspectRatio ?
|
|
1283
|
+
return e.aspectRatio ? c : void 0;
|
|
1158
1284
|
}
|
|
1159
|
-
return /* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
n() ? /* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1286
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1287
|
+
/* @__PURE__ */ jsxs("picture", { children: [
|
|
1288
|
+
n() ? /* @__PURE__ */ jsx("source", { type: "image/webp", srcSet: n() }) : null,
|
|
1289
|
+
/* @__PURE__ */ jsx(
|
|
1164
1290
|
"img",
|
|
1165
1291
|
{
|
|
1166
1292
|
loading: "lazy",
|
|
@@ -1171,33 +1297,33 @@ function Bt(e) {
|
|
|
1171
1297
|
objectFit: e.backgroundSize || "cover",
|
|
1172
1298
|
...i()
|
|
1173
1299
|
},
|
|
1174
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
1300
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
1175
1301
|
src: e.image,
|
|
1176
1302
|
srcSet: t(),
|
|
1177
1303
|
sizes: e.sizes
|
|
1178
1304
|
}
|
|
1179
1305
|
)
|
|
1180
1306
|
] }),
|
|
1181
|
-
e.aspectRatio && !((
|
|
1307
|
+
e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(
|
|
1182
1308
|
"div",
|
|
1183
1309
|
{
|
|
1184
|
-
className: "builder-image-sizer div-
|
|
1310
|
+
className: "builder-image-sizer div-a0c95e8c",
|
|
1185
1311
|
style: {
|
|
1186
1312
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
1187
1313
|
}
|
|
1188
1314
|
}
|
|
1189
|
-
)
|
|
1190
|
-
(s = (
|
|
1191
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
1315
|
+
) : null,
|
|
1316
|
+
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1317
|
+
!e.fitContent && e.children ? /* @__PURE__ */ jsx("div", { className: "div-a0c95e8c-2", children: e.children }) : null
|
|
1192
1318
|
] }),
|
|
1193
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ jsx("style", { children: `.img-a0c95e8c {
|
|
1194
1320
|
opacity: 1;
|
|
1195
1321
|
transition: opacity 0.2s ease-in-out;
|
|
1196
|
-
}.div-
|
|
1322
|
+
}.div-a0c95e8c {
|
|
1197
1323
|
width: 100%;
|
|
1198
1324
|
pointer-events: none;
|
|
1199
1325
|
font-size: 0;
|
|
1200
|
-
}.div-
|
|
1326
|
+
}.div-a0c95e8c-2 {
|
|
1201
1327
|
display: flex;
|
|
1202
1328
|
flex-direction: column;
|
|
1203
1329
|
align-items: stretch;
|
|
@@ -1209,8 +1335,8 @@ function Bt(e) {
|
|
|
1209
1335
|
}` })
|
|
1210
1336
|
] });
|
|
1211
1337
|
}
|
|
1212
|
-
function
|
|
1213
|
-
return /* @__PURE__ */
|
|
1338
|
+
function SectionComponent(e) {
|
|
1339
|
+
return /* @__PURE__ */ jsx(
|
|
1214
1340
|
"section",
|
|
1215
1341
|
{
|
|
1216
1342
|
...e.attributes,
|
|
@@ -1230,7 +1356,7 @@ function Wt(e) {
|
|
|
1230
1356
|
}
|
|
1231
1357
|
);
|
|
1232
1358
|
}
|
|
1233
|
-
const
|
|
1359
|
+
const componentInfo$f = {
|
|
1234
1360
|
name: "Core:Button",
|
|
1235
1361
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1236
1362
|
defaultStyles: {
|
|
@@ -1263,7 +1389,7 @@ const Nt = {
|
|
|
1263
1389
|
}],
|
|
1264
1390
|
static: !0,
|
|
1265
1391
|
noWrap: !0
|
|
1266
|
-
},
|
|
1392
|
+
}, componentInfo$e = {
|
|
1267
1393
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1268
1394
|
name: "Columns",
|
|
1269
1395
|
isRSC: !0,
|
|
@@ -1442,7 +1568,7 @@ const Nt = {
|
|
|
1442
1568
|
});
|
|
1443
1569
|
}
|
|
1444
1570
|
const n = e.get("columns");
|
|
1445
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (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();
|
|
1446
1572
|
}
|
|
1447
1573
|
}, {
|
|
1448
1574
|
name: "space",
|
|
@@ -1464,13 +1590,13 @@ const Nt = {
|
|
|
1464
1590
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1465
1591
|
advanced: !0
|
|
1466
1592
|
}]
|
|
1467
|
-
},
|
|
1593
|
+
}, componentInfo$d = {
|
|
1468
1594
|
name: "Fragment",
|
|
1469
1595
|
static: !0,
|
|
1470
1596
|
hidden: !0,
|
|
1471
1597
|
canHaveChildren: !0,
|
|
1472
1598
|
noWrap: !0
|
|
1473
|
-
}, $
|
|
1599
|
+
}, componentInfo$c = {
|
|
1474
1600
|
name: "Image",
|
|
1475
1601
|
static: !0,
|
|
1476
1602
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1490,29 +1616,29 @@ const Nt = {
|
|
|
1490
1616
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1491
1617
|
onChange: (e) => {
|
|
1492
1618
|
e.delete("srcset"), e.delete("noWebp");
|
|
1493
|
-
function n(
|
|
1494
|
-
return new Promise((
|
|
1495
|
-
const
|
|
1496
|
-
let
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
},
|
|
1500
|
-
console.warn("Image load failed",
|
|
1501
|
-
}),
|
|
1502
|
-
|
|
1619
|
+
function n(r, s = 6e4) {
|
|
1620
|
+
return new Promise((c, l) => {
|
|
1621
|
+
const u = document.createElement("img");
|
|
1622
|
+
let m = !1;
|
|
1623
|
+
u.onload = () => {
|
|
1624
|
+
m = !0, c(u);
|
|
1625
|
+
}, u.addEventListener("error", (g) => {
|
|
1626
|
+
console.warn("Image load failed", g.error), l(g.error);
|
|
1627
|
+
}), u.src = r, setTimeout(() => {
|
|
1628
|
+
m || l(new Error("Image load timed out"));
|
|
1503
1629
|
}, s);
|
|
1504
1630
|
});
|
|
1505
1631
|
}
|
|
1506
|
-
function i(
|
|
1507
|
-
return Math.round(
|
|
1632
|
+
function i(r) {
|
|
1633
|
+
return Math.round(r * 1e3) / 1e3;
|
|
1508
1634
|
}
|
|
1509
|
-
const o = e.get("image"),
|
|
1510
|
-
if (fetch(o).then((
|
|
1511
|
-
|
|
1512
|
-
}), o && (!
|
|
1513
|
-
return n(o).then((
|
|
1635
|
+
const o = e.get("image"), a = e.get("aspectRatio");
|
|
1636
|
+
if (fetch(o).then((r) => r.blob()).then((r) => {
|
|
1637
|
+
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1638
|
+
}), o && (!a || a === 0.7041))
|
|
1639
|
+
return n(o).then((r) => {
|
|
1514
1640
|
const s = e.get("aspectRatio");
|
|
1515
|
-
e.get("image") === o && (!s || s === 0.7041) &&
|
|
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));
|
|
1516
1642
|
});
|
|
1517
1643
|
}
|
|
1518
1644
|
}, {
|
|
@@ -1570,7 +1696,7 @@ const Nt = {
|
|
|
1570
1696
|
advanced: !0,
|
|
1571
1697
|
defaultValue: 0.7041
|
|
1572
1698
|
}]
|
|
1573
|
-
},
|
|
1699
|
+
}, componentInfo$b = {
|
|
1574
1700
|
name: "Core:Section",
|
|
1575
1701
|
static: !0,
|
|
1576
1702
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1609,7 +1735,7 @@ const Nt = {
|
|
|
1609
1735
|
}
|
|
1610
1736
|
}
|
|
1611
1737
|
}]
|
|
1612
|
-
},
|
|
1738
|
+
}, componentInfo$a = {
|
|
1613
1739
|
name: "Slot",
|
|
1614
1740
|
isRSC: !0,
|
|
1615
1741
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -1623,9 +1749,9 @@ const Nt = {
|
|
|
1623
1749
|
defaultValue: "children"
|
|
1624
1750
|
}]
|
|
1625
1751
|
};
|
|
1626
|
-
function
|
|
1752
|
+
function Slot(e) {
|
|
1627
1753
|
var t, n, i;
|
|
1628
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ jsx(
|
|
1629
1755
|
"div",
|
|
1630
1756
|
{
|
|
1631
1757
|
style: {
|
|
@@ -1634,8 +1760,8 @@ function Mt(e) {
|
|
|
1634
1760
|
...!((t = e.builderContext.context) != null && t.symbolId) && {
|
|
1635
1761
|
"builder-slot": e.name
|
|
1636
1762
|
},
|
|
1637
|
-
children: /* @__PURE__ */
|
|
1638
|
-
|
|
1763
|
+
children: /* @__PURE__ */ jsx(
|
|
1764
|
+
Blocks,
|
|
1639
1765
|
{
|
|
1640
1766
|
parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
|
|
1641
1767
|
path: `symbol.data.${e.name}`,
|
|
@@ -1646,7 +1772,7 @@ function Mt(e) {
|
|
|
1646
1772
|
}
|
|
1647
1773
|
);
|
|
1648
1774
|
}
|
|
1649
|
-
const
|
|
1775
|
+
const componentInfo$9 = {
|
|
1650
1776
|
name: "Symbol",
|
|
1651
1777
|
noWrap: !0,
|
|
1652
1778
|
static: !0,
|
|
@@ -1679,7 +1805,7 @@ const jt = {
|
|
|
1679
1805
|
hideFromUI: !0,
|
|
1680
1806
|
type: "boolean"
|
|
1681
1807
|
}]
|
|
1682
|
-
},
|
|
1808
|
+
}, componentInfo$8 = {
|
|
1683
1809
|
name: "Text",
|
|
1684
1810
|
static: !0,
|
|
1685
1811
|
isRSC: !0,
|
|
@@ -1698,9 +1824,9 @@ const jt = {
|
|
|
1698
1824
|
textAlign: "center"
|
|
1699
1825
|
}
|
|
1700
1826
|
};
|
|
1701
|
-
function
|
|
1827
|
+
function Text(e) {
|
|
1702
1828
|
var t;
|
|
1703
|
-
return /* @__PURE__ */
|
|
1829
|
+
return /* @__PURE__ */ jsx(
|
|
1704
1830
|
"div",
|
|
1705
1831
|
{
|
|
1706
1832
|
className: "builder-text",
|
|
@@ -1711,7 +1837,7 @@ function Ut(e) {
|
|
|
1711
1837
|
}
|
|
1712
1838
|
);
|
|
1713
1839
|
}
|
|
1714
|
-
const
|
|
1840
|
+
const componentInfo$7 = {
|
|
1715
1841
|
name: "Custom Code",
|
|
1716
1842
|
static: !0,
|
|
1717
1843
|
requiredPermissions: ["editCode"],
|
|
@@ -1734,36 +1860,36 @@ const Ht = {
|
|
|
1734
1860
|
advanced: !0
|
|
1735
1861
|
}]
|
|
1736
1862
|
};
|
|
1737
|
-
function
|
|
1738
|
-
const t =
|
|
1739
|
-
return
|
|
1863
|
+
function CustomCode(e) {
|
|
1864
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1865
|
+
return useEffect(() => {
|
|
1740
1866
|
var s;
|
|
1741
1867
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
|
|
1742
1868
|
return;
|
|
1743
|
-
const
|
|
1744
|
-
for (let
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1747
|
-
if (n.includes(
|
|
1869
|
+
const r = t.current.getElementsByTagName("script");
|
|
1870
|
+
for (let c = 0; c < r.length; c++) {
|
|
1871
|
+
const l = r[c];
|
|
1872
|
+
if (l.src) {
|
|
1873
|
+
if (n.includes(l.src))
|
|
1748
1874
|
continue;
|
|
1749
|
-
n.push(
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1752
|
-
} else if (!
|
|
1875
|
+
n.push(l.src);
|
|
1876
|
+
const u = document.createElement("script");
|
|
1877
|
+
u.async = !0, u.src = l.src, document.head.appendChild(u);
|
|
1878
|
+
} else if (!l.type || [
|
|
1753
1879
|
"text/javascript",
|
|
1754
1880
|
"application/javascript",
|
|
1755
1881
|
"application/ecmascript"
|
|
1756
|
-
].includes(
|
|
1757
|
-
if (o.includes(
|
|
1882
|
+
].includes(l.type)) {
|
|
1883
|
+
if (o.includes(l.innerText))
|
|
1758
1884
|
continue;
|
|
1759
1885
|
try {
|
|
1760
|
-
o.push(
|
|
1761
|
-
} catch (
|
|
1762
|
-
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);
|
|
1763
1889
|
}
|
|
1764
1890
|
}
|
|
1765
1891
|
}
|
|
1766
|
-
}, []), /* @__PURE__ */
|
|
1892
|
+
}, []), /* @__PURE__ */ jsx(
|
|
1767
1893
|
"div",
|
|
1768
1894
|
{
|
|
1769
1895
|
ref: t,
|
|
@@ -1772,7 +1898,7 @@ function Kt(e) {
|
|
|
1772
1898
|
}
|
|
1773
1899
|
);
|
|
1774
1900
|
}
|
|
1775
|
-
const
|
|
1901
|
+
const componentInfo$6 = {
|
|
1776
1902
|
name: "Embed",
|
|
1777
1903
|
static: !0,
|
|
1778
1904
|
inputs: [{
|
|
@@ -1797,30 +1923,30 @@ const qt = {
|
|
|
1797
1923
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1798
1924
|
hideFromUI: !0
|
|
1799
1925
|
}]
|
|
1800
|
-
},
|
|
1801
|
-
function
|
|
1802
|
-
const t =
|
|
1803
|
-
function
|
|
1926
|
+
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1927
|
+
function Embed(e) {
|
|
1928
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
|
|
1929
|
+
function c() {
|
|
1804
1930
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1805
1931
|
return;
|
|
1806
|
-
const
|
|
1807
|
-
for (let
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1810
|
-
n.push(
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
} else if (
|
|
1932
|
+
const l = t.current.getElementsByTagName("script");
|
|
1933
|
+
for (let u = 0; u < l.length; u++) {
|
|
1934
|
+
const m = l[u];
|
|
1935
|
+
if (m.src && !n.includes(m.src)) {
|
|
1936
|
+
n.push(m.src);
|
|
1937
|
+
const g = document.createElement("script");
|
|
1938
|
+
g.async = !0, g.src = m.src, document.head.appendChild(g);
|
|
1939
|
+
} else if (isJsScript(m) && !o.includes(m.innerText))
|
|
1814
1940
|
try {
|
|
1815
|
-
o.push(
|
|
1816
|
-
} catch (
|
|
1817
|
-
console.warn("`Embed`: Error running script:",
|
|
1941
|
+
o.push(m.innerText), new Function(m.innerText)();
|
|
1942
|
+
} catch (g) {
|
|
1943
|
+
console.warn("`Embed`: Error running script:", g);
|
|
1818
1944
|
}
|
|
1819
1945
|
}
|
|
1820
1946
|
}
|
|
1821
|
-
return
|
|
1822
|
-
t.current && !
|
|
1823
|
-
}, [t.current,
|
|
1947
|
+
return useEffect(() => {
|
|
1948
|
+
t.current && !r && (s(!0), c());
|
|
1949
|
+
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1824
1950
|
"div",
|
|
1825
1951
|
{
|
|
1826
1952
|
className: "builder-embed",
|
|
@@ -1829,7 +1955,7 @@ function Jt(e) {
|
|
|
1829
1955
|
}
|
|
1830
1956
|
);
|
|
1831
1957
|
}
|
|
1832
|
-
const
|
|
1958
|
+
const componentInfo$5 = {
|
|
1833
1959
|
name: "Form:Form",
|
|
1834
1960
|
// editableTags: ['builder-form-error']
|
|
1835
1961
|
defaults: {
|
|
@@ -2060,127 +2186,127 @@ const Yt = {
|
|
|
2060
2186
|
}
|
|
2061
2187
|
}
|
|
2062
2188
|
}]
|
|
2063
|
-
},
|
|
2189
|
+
}, validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], getEnv = () => {
|
|
2064
2190
|
const e = process.env.NODE_ENV || "production";
|
|
2065
|
-
return
|
|
2066
|
-
},
|
|
2067
|
-
const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o,
|
|
2191
|
+
return validEnvList.includes(e) ? e : "production";
|
|
2192
|
+
}, get = (e, t, n) => {
|
|
2193
|
+
const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, a) => o != null ? o[a] : o, e);
|
|
2068
2194
|
return i === void 0 || i === e ? n : i;
|
|
2069
2195
|
};
|
|
2070
|
-
function
|
|
2071
|
-
var
|
|
2072
|
-
const t =
|
|
2073
|
-
function
|
|
2074
|
-
var
|
|
2075
|
-
const
|
|
2196
|
+
function FormComponent(e) {
|
|
2197
|
+
var m, g;
|
|
2198
|
+
const t = useRef(null), [n, i] = useState(() => "unsubmitted"), [o, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2199
|
+
function c(h) {
|
|
2200
|
+
var p, k;
|
|
2201
|
+
const y = {
|
|
2076
2202
|
...e.builderContext.rootState,
|
|
2077
|
-
...
|
|
2203
|
+
...h
|
|
2078
2204
|
};
|
|
2079
|
-
e.builderContext.rootSetState ? (
|
|
2205
|
+
e.builderContext.rootSetState ? (k = (p = e.builderContext).rootSetState) == null || k.call(p, y) : e.builderContext.rootState = y;
|
|
2080
2206
|
}
|
|
2081
|
-
function
|
|
2082
|
-
return
|
|
2207
|
+
function l() {
|
|
2208
|
+
return isEditing() && e.previewState || n;
|
|
2083
2209
|
}
|
|
2084
|
-
function
|
|
2085
|
-
var
|
|
2086
|
-
const
|
|
2210
|
+
function u(h) {
|
|
2211
|
+
var p;
|
|
2212
|
+
const y = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
2087
2213
|
if (e.sendSubmissionsTo === "zapier")
|
|
2088
|
-
|
|
2089
|
-
else if (
|
|
2214
|
+
h.preventDefault();
|
|
2215
|
+
else if (y) {
|
|
2090
2216
|
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
2091
|
-
|
|
2217
|
+
h.preventDefault();
|
|
2092
2218
|
return;
|
|
2093
2219
|
}
|
|
2094
|
-
|
|
2095
|
-
const
|
|
2096
|
-
let
|
|
2097
|
-
const
|
|
2098
|
-
|
|
2099
|
-
).filter((
|
|
2100
|
-
let
|
|
2101
|
-
const
|
|
2102
|
-
if (
|
|
2103
|
-
if (
|
|
2104
|
-
if (
|
|
2105
|
-
return
|
|
2106
|
-
key:
|
|
2107
|
-
value:
|
|
2220
|
+
h.preventDefault();
|
|
2221
|
+
const k = h.currentTarget, T = e.customHeaders || {};
|
|
2222
|
+
let S;
|
|
2223
|
+
const C = new FormData(k), E = Array.from(
|
|
2224
|
+
h.currentTarget.querySelectorAll("input,select,textarea")
|
|
2225
|
+
).filter((d) => !!d.name).map((d) => {
|
|
2226
|
+
let f;
|
|
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,
|
|
2233
|
+
value: f
|
|
2108
2234
|
};
|
|
2109
|
-
} else if (
|
|
2110
|
-
|
|
2111
|
-
else if (
|
|
2112
|
-
const
|
|
2113
|
-
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);
|
|
2114
2240
|
} else
|
|
2115
|
-
|
|
2241
|
+
d.type === "file" ? f = d.files : f = d.value;
|
|
2116
2242
|
else
|
|
2117
|
-
|
|
2243
|
+
f = d.value;
|
|
2118
2244
|
return {
|
|
2119
|
-
key:
|
|
2120
|
-
value:
|
|
2245
|
+
key: v,
|
|
2246
|
+
value: f
|
|
2121
2247
|
};
|
|
2122
2248
|
});
|
|
2123
|
-
let
|
|
2124
|
-
if (e.sendSubmissionsTo === "email" && (
|
|
2125
|
-
(
|
|
2126
|
-
}),
|
|
2127
|
-
|
|
2249
|
+
let I = e.contentType;
|
|
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");
|
|
2252
|
+
}), I !== "application/json")
|
|
2253
|
+
S = C;
|
|
2128
2254
|
else {
|
|
2129
|
-
const
|
|
2130
|
-
Array.from(
|
|
2131
|
-
|
|
2132
|
-
}),
|
|
2255
|
+
const d = {};
|
|
2256
|
+
Array.from(E).forEach(({ value: f, key: v }) => {
|
|
2257
|
+
set(d, v, f);
|
|
2258
|
+
}), S = JSON.stringify(d);
|
|
2133
2259
|
}
|
|
2134
|
-
|
|
2135
|
-
const
|
|
2136
|
-
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))
|
|
2137
2263
|
return;
|
|
2138
2264
|
i("sending");
|
|
2139
|
-
const
|
|
2265
|
+
const j = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2140
2266
|
e.sendSubmissionsToEmail || ""
|
|
2141
2267
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
2142
2268
|
fetch(
|
|
2143
|
-
e.sendSubmissionsTo === "email" ?
|
|
2144
|
-
{ body:
|
|
2269
|
+
e.sendSubmissionsTo === "email" ? j : e.action,
|
|
2270
|
+
{ body: S, headers: T, method: e.method || "post" }
|
|
2145
2271
|
).then(
|
|
2146
|
-
async (
|
|
2147
|
-
let
|
|
2148
|
-
const
|
|
2149
|
-
if (
|
|
2150
|
-
let
|
|
2151
|
-
|
|
2272
|
+
async (d) => {
|
|
2273
|
+
let f;
|
|
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 }));
|
|
2152
2278
|
}
|
|
2153
|
-
if (
|
|
2154
|
-
const
|
|
2155
|
-
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 }
|
|
2156
2282
|
});
|
|
2157
2283
|
if (t.current) {
|
|
2158
|
-
if (t.current.dispatchEvent(
|
|
2284
|
+
if (t.current.dispatchEvent(b), b.defaultPrevented)
|
|
2159
2285
|
return;
|
|
2160
2286
|
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2161
2287
|
}
|
|
2162
2288
|
if (e.successUrl)
|
|
2163
2289
|
if (t.current) {
|
|
2164
|
-
const
|
|
2290
|
+
const x = new CustomEvent("route", {
|
|
2165
2291
|
detail: { url: e.successUrl }
|
|
2166
2292
|
});
|
|
2167
|
-
t.current.dispatchEvent(
|
|
2293
|
+
t.current.dispatchEvent(x), x.defaultPrevented || (location.href = e.successUrl);
|
|
2168
2294
|
} else
|
|
2169
2295
|
location.href = e.successUrl;
|
|
2170
2296
|
}
|
|
2171
2297
|
},
|
|
2172
|
-
(
|
|
2173
|
-
const
|
|
2174
|
-
detail: { error:
|
|
2298
|
+
(d) => {
|
|
2299
|
+
const f = new CustomEvent("submit:error", {
|
|
2300
|
+
detail: { error: d }
|
|
2175
2301
|
});
|
|
2176
|
-
t.current && (t.current.dispatchEvent(
|
|
2302
|
+
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(d), i("error"));
|
|
2177
2303
|
}
|
|
2178
2304
|
);
|
|
2179
2305
|
}
|
|
2180
2306
|
}
|
|
2181
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2182
2308
|
" ",
|
|
2183
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsxs(
|
|
2184
2310
|
"form",
|
|
2185
2311
|
{
|
|
2186
2312
|
validate: e.validate,
|
|
@@ -2188,63 +2314,53 @@ function Zt(e) {
|
|
|
2188
2314
|
action: !e.sendWithJs && e.action,
|
|
2189
2315
|
method: e.method,
|
|
2190
2316
|
name: e.name,
|
|
2191
|
-
onSubmit: (
|
|
2317
|
+
onSubmit: (h) => u(h),
|
|
2192
2318
|
...e.attributes,
|
|
2193
2319
|
children: [
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
_,
|
|
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(
|
|
2321
|
+
Block,
|
|
2197
2322
|
{
|
|
2198
|
-
block:
|
|
2323
|
+
block: h,
|
|
2199
2324
|
context: e.builderContext,
|
|
2200
2325
|
registeredComponents: e.builderComponents,
|
|
2201
2326
|
linkComponent: e.builderLinkComponent
|
|
2202
2327
|
},
|
|
2203
|
-
`form-block-${
|
|
2328
|
+
`form-block-${y}`
|
|
2204
2329
|
)) }) : null,
|
|
2205
|
-
"
|
|
2206
|
-
|
|
2207
|
-
O,
|
|
2330
|
+
l() === "error" ? /* @__PURE__ */ jsx(
|
|
2331
|
+
Blocks,
|
|
2208
2332
|
{
|
|
2209
2333
|
path: "errorMessage",
|
|
2210
2334
|
blocks: e.errorMessage,
|
|
2211
2335
|
context: e.builderContext
|
|
2212
2336
|
}
|
|
2213
|
-
)
|
|
2214
|
-
"
|
|
2215
|
-
|
|
2216
|
-
O,
|
|
2337
|
+
) : null,
|
|
2338
|
+
l() === "sending" ? /* @__PURE__ */ jsx(
|
|
2339
|
+
Blocks,
|
|
2217
2340
|
{
|
|
2218
2341
|
path: "sendingMessage",
|
|
2219
2342
|
blocks: e.sendingMessage,
|
|
2220
2343
|
context: e.builderContext
|
|
2221
2344
|
}
|
|
2222
|
-
)
|
|
2223
|
-
" ",
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
JSON.stringify(o, null, 2),
|
|
2227
|
-
" "
|
|
2228
|
-
] }) }) : null,
|
|
2229
|
-
" ",
|
|
2230
|
-
c() === "success" ? /* @__PURE__ */ l(g, { children: /* @__PURE__ */ l(
|
|
2231
|
-
O,
|
|
2345
|
+
) : null,
|
|
2346
|
+
l() === "error" && o ? /* @__PURE__ */ jsx("pre", { className: "builder-form-error-text pre-31bf8a14", children: JSON.stringify(o, null, 2) }) : null,
|
|
2347
|
+
l() === "success" ? /* @__PURE__ */ jsx(
|
|
2348
|
+
Blocks,
|
|
2232
2349
|
{
|
|
2233
2350
|
path: "successMessage",
|
|
2234
2351
|
blocks: e.successMessage,
|
|
2235
2352
|
context: e.builderContext
|
|
2236
2353
|
}
|
|
2237
|
-
)
|
|
2238
|
-
" "
|
|
2354
|
+
) : null
|
|
2239
2355
|
]
|
|
2240
2356
|
}
|
|
2241
2357
|
),
|
|
2242
2358
|
" ",
|
|
2243
|
-
/* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ jsx("style", { children: ".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }" }),
|
|
2244
2360
|
" "
|
|
2245
2361
|
] });
|
|
2246
2362
|
}
|
|
2247
|
-
const
|
|
2363
|
+
const componentInfo$4 = {
|
|
2248
2364
|
name: "Form:Input",
|
|
2249
2365
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
2250
2366
|
inputs: [
|
|
@@ -2296,12 +2412,12 @@ const en = {
|
|
|
2296
2412
|
borderColor: "#ccc"
|
|
2297
2413
|
}
|
|
2298
2414
|
};
|
|
2299
|
-
function
|
|
2300
|
-
return /* @__PURE__ */
|
|
2415
|
+
function FormInputComponent(e) {
|
|
2416
|
+
return /* @__PURE__ */ createElement(
|
|
2301
2417
|
"input",
|
|
2302
2418
|
{
|
|
2303
2419
|
...e.attributes,
|
|
2304
|
-
key:
|
|
2420
|
+
key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
|
|
2305
2421
|
placeholder: e.placeholder,
|
|
2306
2422
|
type: e.type,
|
|
2307
2423
|
name: e.name,
|
|
@@ -2311,7 +2427,7 @@ function tn(e) {
|
|
|
2311
2427
|
}
|
|
2312
2428
|
);
|
|
2313
2429
|
}
|
|
2314
|
-
const
|
|
2430
|
+
const componentInfo$3 = {
|
|
2315
2431
|
name: "Form:Select",
|
|
2316
2432
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
2317
2433
|
defaultStyles: {
|
|
@@ -2354,21 +2470,21 @@ const nn = {
|
|
|
2354
2470
|
static: !0,
|
|
2355
2471
|
noWrap: !0
|
|
2356
2472
|
};
|
|
2357
|
-
function
|
|
2473
|
+
function SelectComponent(e) {
|
|
2358
2474
|
var t;
|
|
2359
|
-
return /* @__PURE__ */
|
|
2475
|
+
return /* @__PURE__ */ createElement(
|
|
2360
2476
|
"select",
|
|
2361
2477
|
{
|
|
2362
2478
|
...e.attributes,
|
|
2363
2479
|
value: e.value,
|
|
2364
|
-
key:
|
|
2480
|
+
key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
|
|
2365
2481
|
defaultValue: e.defaultValue,
|
|
2366
2482
|
name: e.name
|
|
2367
2483
|
},
|
|
2368
|
-
(t = e.options) == null ? void 0 : t.map((n) => /* @__PURE__ */
|
|
2484
|
+
(t = e.options) == null ? void 0 : t.map((n, i) => /* @__PURE__ */ jsx("option", { value: n.value, children: n.name || n.value }, `${n.name}-${i}`))
|
|
2369
2485
|
);
|
|
2370
2486
|
}
|
|
2371
|
-
const
|
|
2487
|
+
const componentInfo$2 = {
|
|
2372
2488
|
name: "Form:SubmitButton",
|
|
2373
2489
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
2374
2490
|
defaultStyles: {
|
|
@@ -2394,10 +2510,10 @@ const an = {
|
|
|
2394
2510
|
// TODO: defaultChildren
|
|
2395
2511
|
// canHaveChildren: true,
|
|
2396
2512
|
};
|
|
2397
|
-
function
|
|
2398
|
-
return /* @__PURE__ */
|
|
2513
|
+
function SubmitButton(e) {
|
|
2514
|
+
return /* @__PURE__ */ jsx("button", { type: "submit", ...e.attributes, children: e.text });
|
|
2399
2515
|
}
|
|
2400
|
-
const
|
|
2516
|
+
const componentInfo$1 = {
|
|
2401
2517
|
// friendlyName?
|
|
2402
2518
|
name: "Raw:Img",
|
|
2403
2519
|
hideFromInsertMenu: !0,
|
|
@@ -2412,8 +2528,8 @@ const ln = {
|
|
|
2412
2528
|
noWrap: !0,
|
|
2413
2529
|
static: !0
|
|
2414
2530
|
};
|
|
2415
|
-
function
|
|
2416
|
-
return /* @__PURE__ */
|
|
2531
|
+
function ImgComponent(e) {
|
|
2532
|
+
return /* @__PURE__ */ jsx(
|
|
2417
2533
|
"img",
|
|
2418
2534
|
{
|
|
2419
2535
|
style: {
|
|
@@ -2424,10 +2540,10 @@ function sn(e) {
|
|
|
2424
2540
|
src: e.imgSrc || e.image,
|
|
2425
2541
|
...e.attributes
|
|
2426
2542
|
},
|
|
2427
|
-
|
|
2543
|
+
isEditing() && e.imgSrc || "default-key"
|
|
2428
2544
|
);
|
|
2429
2545
|
}
|
|
2430
|
-
const
|
|
2546
|
+
const componentInfo = {
|
|
2431
2547
|
name: "Video",
|
|
2432
2548
|
canHaveChildren: !0,
|
|
2433
2549
|
defaultStyles: {
|
|
@@ -2509,8 +2625,8 @@ const cn = {
|
|
|
2509
2625
|
advanced: !0
|
|
2510
2626
|
}]
|
|
2511
2627
|
};
|
|
2512
|
-
function
|
|
2513
|
-
var i, o,
|
|
2628
|
+
function Video(e) {
|
|
2629
|
+
var i, o, a, r, s, c, l;
|
|
2514
2630
|
function t() {
|
|
2515
2631
|
return {
|
|
2516
2632
|
...e.autoPlay === !0 ? {
|
|
@@ -2535,14 +2651,14 @@ function dn(e) {
|
|
|
2535
2651
|
...t()
|
|
2536
2652
|
};
|
|
2537
2653
|
}
|
|
2538
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ jsxs(
|
|
2539
2655
|
"div",
|
|
2540
2656
|
{
|
|
2541
2657
|
style: {
|
|
2542
2658
|
position: "relative"
|
|
2543
2659
|
},
|
|
2544
2660
|
children: [
|
|
2545
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ jsx(
|
|
2546
2662
|
"video",
|
|
2547
2663
|
{
|
|
2548
2664
|
className: "builder-video",
|
|
@@ -2564,10 +2680,10 @@ function dn(e) {
|
|
|
2564
2680
|
},
|
|
2565
2681
|
src: e.video || "no-src",
|
|
2566
2682
|
poster: e.posterImage,
|
|
2567
|
-
children: e.lazyLoad ? null : /* @__PURE__ */
|
|
2683
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
2568
2684
|
}
|
|
2569
2685
|
),
|
|
2570
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
2686
|
+
e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(
|
|
2571
2687
|
"div",
|
|
2572
2688
|
{
|
|
2573
2689
|
style: {
|
|
@@ -2577,8 +2693,8 @@ function dn(e) {
|
|
|
2577
2693
|
fontSize: "0px"
|
|
2578
2694
|
}
|
|
2579
2695
|
}
|
|
2580
|
-
)
|
|
2581
|
-
(s = (
|
|
2696
|
+
) : null,
|
|
2697
|
+
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(
|
|
2582
2698
|
"div",
|
|
2583
2699
|
{
|
|
2584
2700
|
style: {
|
|
@@ -2588,8 +2704,8 @@ function dn(e) {
|
|
|
2588
2704
|
},
|
|
2589
2705
|
children: e.children
|
|
2590
2706
|
}
|
|
2591
|
-
)
|
|
2592
|
-
(
|
|
2707
|
+
) : null,
|
|
2708
|
+
(l = (c = e.builderBlock) == null ? void 0 : c.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ jsx(
|
|
2593
2709
|
"div",
|
|
2594
2710
|
{
|
|
2595
2711
|
style: {
|
|
@@ -2605,60 +2721,60 @@ function dn(e) {
|
|
|
2605
2721
|
},
|
|
2606
2722
|
children: e.children
|
|
2607
2723
|
}
|
|
2608
|
-
)
|
|
2724
|
+
) : null
|
|
2609
2725
|
]
|
|
2610
2726
|
}
|
|
2611
2727
|
);
|
|
2612
2728
|
}
|
|
2613
|
-
const
|
|
2614
|
-
component:
|
|
2615
|
-
...
|
|
2729
|
+
const getExtraComponents = () => [{
|
|
2730
|
+
component: CustomCode,
|
|
2731
|
+
...componentInfo$7
|
|
2616
2732
|
}, {
|
|
2617
|
-
component:
|
|
2618
|
-
...
|
|
2733
|
+
component: Embed,
|
|
2734
|
+
...componentInfo$6
|
|
2619
2735
|
}, {
|
|
2620
|
-
component:
|
|
2621
|
-
...
|
|
2736
|
+
component: FormComponent,
|
|
2737
|
+
...componentInfo$5
|
|
2622
2738
|
}, {
|
|
2623
|
-
component:
|
|
2624
|
-
...
|
|
2739
|
+
component: FormInputComponent,
|
|
2740
|
+
...componentInfo$4
|
|
2625
2741
|
}, {
|
|
2626
|
-
component:
|
|
2627
|
-
...
|
|
2742
|
+
component: SubmitButton,
|
|
2743
|
+
...componentInfo$2
|
|
2628
2744
|
}, {
|
|
2629
|
-
component:
|
|
2630
|
-
...
|
|
2745
|
+
component: SelectComponent,
|
|
2746
|
+
...componentInfo$3
|
|
2631
2747
|
}, {
|
|
2632
|
-
component:
|
|
2633
|
-
...
|
|
2748
|
+
component: ImgComponent,
|
|
2749
|
+
...componentInfo$1
|
|
2634
2750
|
}, {
|
|
2635
|
-
component:
|
|
2636
|
-
...
|
|
2637
|
-
}],
|
|
2638
|
-
component:
|
|
2639
|
-
...
|
|
2751
|
+
component: Video,
|
|
2752
|
+
...componentInfo
|
|
2753
|
+
}], getDefaultRegisteredComponents = () => [{
|
|
2754
|
+
component: Button,
|
|
2755
|
+
...componentInfo$f
|
|
2640
2756
|
}, {
|
|
2641
|
-
component:
|
|
2642
|
-
...
|
|
2757
|
+
component: Columns,
|
|
2758
|
+
...componentInfo$e
|
|
2643
2759
|
}, {
|
|
2644
|
-
component:
|
|
2645
|
-
...
|
|
2760
|
+
component: FragmentComponent,
|
|
2761
|
+
...componentInfo$d
|
|
2646
2762
|
}, {
|
|
2647
|
-
component:
|
|
2648
|
-
|
|
2763
|
+
component: Image,
|
|
2764
|
+
...componentInfo$c
|
|
2649
2765
|
}, {
|
|
2650
|
-
component:
|
|
2651
|
-
...
|
|
2766
|
+
component: SectionComponent,
|
|
2767
|
+
...componentInfo$b
|
|
2652
2768
|
}, {
|
|
2653
|
-
component:
|
|
2654
|
-
...
|
|
2769
|
+
component: Slot,
|
|
2770
|
+
...componentInfo$a
|
|
2655
2771
|
}, {
|
|
2656
|
-
component:
|
|
2657
|
-
...
|
|
2772
|
+
component: Symbol$1,
|
|
2773
|
+
...componentInfo$9
|
|
2658
2774
|
}, {
|
|
2659
|
-
component:
|
|
2660
|
-
...
|
|
2661
|
-
}, ...
|
|
2775
|
+
component: Text,
|
|
2776
|
+
...componentInfo$8
|
|
2777
|
+
}, ...getExtraComponents()], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
2662
2778
|
function getAndSetVariantId() {
|
|
2663
2779
|
function setCookie(name, value, days) {
|
|
2664
2780
|
let expires = '';
|
|
@@ -2714,7 +2830,7 @@ const un = () => [{
|
|
|
2714
2830
|
}).join('');
|
|
2715
2831
|
styleEl.innerHTML = newStyleStr;
|
|
2716
2832
|
}
|
|
2717
|
-
}`,
|
|
2833
|
+
}`, UPDATE_VARIANT_VISIBILITY_SCRIPT = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
2718
2834
|
if (!navigator.cookieEnabled) {
|
|
2719
2835
|
return;
|
|
2720
2836
|
}
|
|
@@ -2748,27 +2864,27 @@ const un = () => [{
|
|
|
2748
2864
|
thisScriptEl?.remove();
|
|
2749
2865
|
}
|
|
2750
2866
|
return;
|
|
2751
|
-
}`,
|
|
2867
|
+
}`, UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest", UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent", getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
2752
2868
|
...t,
|
|
2753
2869
|
testVariationId: t.id,
|
|
2754
2870
|
id: e == null ? void 0 : e.id
|
|
2755
|
-
})),
|
|
2871
|
+
})), checkShouldRenderVariants = ({
|
|
2756
2872
|
canTrack: e,
|
|
2757
2873
|
content: t
|
|
2758
|
-
}) => !(!(
|
|
2759
|
-
window.${
|
|
2760
|
-
window.${
|
|
2761
|
-
`,
|
|
2762
|
-
window.${
|
|
2763
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
2764
|
-
)`,
|
|
2874
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getInitVariantsFnsScriptString = () => `
|
|
2875
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2876
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2877
|
+
`, getUpdateCookieAndStylesScript = (e, t) => `
|
|
2878
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2879
|
+
"${t}",${JSON.stringify(e)}, ${isHydrationTarget}
|
|
2880
|
+
)`, getUpdateVariantVisibilityScript = ({
|
|
2765
2881
|
contentId: e,
|
|
2766
2882
|
variationId: t
|
|
2767
|
-
}) => `window.${
|
|
2768
|
-
"${t}", "${e}", ${
|
|
2883
|
+
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2884
|
+
"${t}", "${e}", ${isHydrationTarget}
|
|
2769
2885
|
)`;
|
|
2770
|
-
function
|
|
2771
|
-
return /* @__PURE__ */
|
|
2886
|
+
function InlinedScript(e) {
|
|
2887
|
+
return /* @__PURE__ */ jsx(
|
|
2772
2888
|
"script",
|
|
2773
2889
|
{
|
|
2774
2890
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
@@ -2776,10 +2892,10 @@ function ie(e) {
|
|
|
2776
2892
|
}
|
|
2777
2893
|
);
|
|
2778
2894
|
}
|
|
2779
|
-
function
|
|
2895
|
+
function round(e) {
|
|
2780
2896
|
return Math.round(e * 1e3) / 1e3;
|
|
2781
2897
|
}
|
|
2782
|
-
const
|
|
2898
|
+
const findParentElement = (e, t, n = !0) => {
|
|
2783
2899
|
if (!(e instanceof HTMLElement))
|
|
2784
2900
|
return null;
|
|
2785
2901
|
let i = n ? e : e.parentElement;
|
|
@@ -2790,28 +2906,28 @@ const xn = (e, t, n = !0) => {
|
|
|
2790
2906
|
return i;
|
|
2791
2907
|
} while (i = i.parentElement);
|
|
2792
2908
|
return null;
|
|
2793
|
-
},
|
|
2909
|
+
}, findBuilderParent = (e) => findParentElement(e, (t) => {
|
|
2794
2910
|
const n = t.getAttribute("builder-id") || t.id;
|
|
2795
2911
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
2796
|
-
}),
|
|
2912
|
+
}), computeOffset = ({
|
|
2797
2913
|
event: e,
|
|
2798
2914
|
target: t
|
|
2799
2915
|
}) => {
|
|
2800
|
-
const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top,
|
|
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);
|
|
2801
2917
|
return {
|
|
2802
|
-
x:
|
|
2803
|
-
y:
|
|
2918
|
+
x: a,
|
|
2919
|
+
y: r
|
|
2804
2920
|
};
|
|
2805
|
-
},
|
|
2806
|
-
const t = e.target, n = t &&
|
|
2921
|
+
}, getInteractionPropertiesForEvent = (e) => {
|
|
2922
|
+
const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2807
2923
|
return {
|
|
2808
2924
|
targetBuilderElement: i || void 0,
|
|
2809
2925
|
metadata: {
|
|
2810
|
-
targetOffset: t ?
|
|
2926
|
+
targetOffset: t ? computeOffset({
|
|
2811
2927
|
event: e,
|
|
2812
2928
|
target: t
|
|
2813
2929
|
}) : void 0,
|
|
2814
|
-
builderTargetOffset: n ?
|
|
2930
|
+
builderTargetOffset: n ? computeOffset({
|
|
2815
2931
|
event: e,
|
|
2816
2932
|
target: n
|
|
2817
2933
|
}) : void 0,
|
|
@@ -2819,71 +2935,71 @@ const xn = (e, t, n = !0) => {
|
|
|
2819
2935
|
}
|
|
2820
2936
|
};
|
|
2821
2937
|
};
|
|
2822
|
-
function
|
|
2823
|
-
var
|
|
2824
|
-
const t =
|
|
2825
|
-
function n(
|
|
2826
|
-
var
|
|
2827
|
-
const
|
|
2938
|
+
function EnableEditor(e) {
|
|
2939
|
+
var T, S, C, E, I, B, j;
|
|
2940
|
+
const t = useRef(null);
|
|
2941
|
+
function n(d) {
|
|
2942
|
+
var v, b;
|
|
2943
|
+
const f = {
|
|
2828
2944
|
...e.builderContextSignal.rootState,
|
|
2829
|
-
...
|
|
2945
|
+
...d
|
|
2830
2946
|
};
|
|
2831
|
-
e.builderContextSignal.rootSetState ? (
|
|
2832
|
-
...
|
|
2833
|
-
rootState:
|
|
2947
|
+
e.builderContextSignal.rootSetState ? (b = (v = e.builderContextSignal).rootSetState) == null || b.call(v, f) : e.setBuilderContextSignal((x) => ({
|
|
2948
|
+
...x,
|
|
2949
|
+
rootState: f
|
|
2834
2950
|
}));
|
|
2835
2951
|
}
|
|
2836
|
-
function i(
|
|
2837
|
-
var
|
|
2838
|
-
const
|
|
2952
|
+
function i(d) {
|
|
2953
|
+
var v, b, x, w, A;
|
|
2954
|
+
const f = {
|
|
2839
2955
|
...e.builderContextSignal.content,
|
|
2840
|
-
...
|
|
2956
|
+
...d,
|
|
2841
2957
|
data: {
|
|
2842
|
-
...(
|
|
2843
|
-
...
|
|
2958
|
+
...(v = e.builderContextSignal.content) == null ? void 0 : v.data,
|
|
2959
|
+
...d == null ? void 0 : d.data
|
|
2844
2960
|
},
|
|
2845
2961
|
meta: {
|
|
2846
|
-
...(
|
|
2847
|
-
...
|
|
2848
|
-
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)
|
|
2849
2965
|
}
|
|
2850
2966
|
};
|
|
2851
|
-
e.setBuilderContextSignal((
|
|
2852
|
-
...
|
|
2853
|
-
content:
|
|
2967
|
+
e.setBuilderContextSignal((R) => ({
|
|
2968
|
+
...R,
|
|
2969
|
+
content: f
|
|
2854
2970
|
}));
|
|
2855
2971
|
}
|
|
2856
|
-
const [o,
|
|
2972
|
+
const [o, a] = useState(
|
|
2857
2973
|
() => e.contentWrapper || "div"
|
|
2858
2974
|
);
|
|
2859
|
-
function
|
|
2860
|
-
return
|
|
2975
|
+
function r(d) {
|
|
2976
|
+
return createEditorListener({
|
|
2861
2977
|
model: e.model,
|
|
2862
2978
|
trustedHosts: e.trustedHosts,
|
|
2863
2979
|
callbacks: {
|
|
2864
|
-
configureSdk: (
|
|
2865
|
-
var
|
|
2866
|
-
const { breakpoints:
|
|
2867
|
-
!
|
|
2980
|
+
configureSdk: (f) => {
|
|
2981
|
+
var x;
|
|
2982
|
+
const { breakpoints: v, contentId: b } = f;
|
|
2983
|
+
!b || b !== ((x = e.builderContextSignal.content) == null ? void 0 : x.id) || v && i({
|
|
2868
2984
|
meta: {
|
|
2869
|
-
breakpoints:
|
|
2985
|
+
breakpoints: v
|
|
2870
2986
|
}
|
|
2871
2987
|
});
|
|
2872
2988
|
},
|
|
2873
|
-
animation: (
|
|
2874
|
-
|
|
2989
|
+
animation: (f) => {
|
|
2990
|
+
triggerAnimation(f);
|
|
2875
2991
|
},
|
|
2876
|
-
contentUpdate: (
|
|
2877
|
-
i(
|
|
2992
|
+
contentUpdate: (f) => {
|
|
2993
|
+
i(f);
|
|
2878
2994
|
}
|
|
2879
2995
|
}
|
|
2880
|
-
})(
|
|
2996
|
+
})(d);
|
|
2881
2997
|
}
|
|
2882
2998
|
function s() {
|
|
2883
|
-
var
|
|
2884
|
-
const
|
|
2885
|
-
|
|
2886
|
-
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,
|
|
2887
3003
|
context: e.context || {},
|
|
2888
3004
|
localState: void 0,
|
|
2889
3005
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2894,35 +3010,35 @@ function kn(e) {
|
|
|
2894
3010
|
enableCache: !1
|
|
2895
3011
|
});
|
|
2896
3012
|
}
|
|
2897
|
-
const [
|
|
2898
|
-
function
|
|
2899
|
-
var
|
|
3013
|
+
const [c, l] = useState(() => ({})), [u, m] = useState(() => ({})), [g, h] = useState(() => !1);
|
|
3014
|
+
function y(d) {
|
|
3015
|
+
var f, v;
|
|
2900
3016
|
if (e.builderContextSignal.content) {
|
|
2901
|
-
const
|
|
2902
|
-
|
|
3017
|
+
const b = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, x = (v = e.builderContextSignal.content) == null ? void 0 : v.id;
|
|
3018
|
+
_track({
|
|
2903
3019
|
type: "click",
|
|
2904
|
-
canTrack:
|
|
2905
|
-
contentId:
|
|
3020
|
+
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3021
|
+
contentId: x,
|
|
2906
3022
|
apiKey: e.apiKey,
|
|
2907
|
-
variationId:
|
|
2908
|
-
...
|
|
2909
|
-
unique: !
|
|
3023
|
+
variationId: b !== x ? b : void 0,
|
|
3024
|
+
...getInteractionPropertiesForEvent(d),
|
|
3025
|
+
unique: !g
|
|
2910
3026
|
});
|
|
2911
3027
|
}
|
|
2912
|
-
|
|
3028
|
+
g || h(!0);
|
|
2913
3029
|
}
|
|
2914
|
-
function
|
|
2915
|
-
var
|
|
2916
|
-
const
|
|
2917
|
-
Object.entries(
|
|
2918
|
-
if (!
|
|
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())
|
|
2919
3035
|
return;
|
|
2920
|
-
|
|
2921
|
-
const
|
|
3036
|
+
u[x] = !0;
|
|
3037
|
+
const A = w.replace(
|
|
2922
3038
|
/{{([^}]+)}}/g,
|
|
2923
|
-
(
|
|
2924
|
-
|
|
2925
|
-
code:
|
|
3039
|
+
(R, V) => String(
|
|
3040
|
+
evaluate({
|
|
3041
|
+
code: V,
|
|
2926
3042
|
context: e.context || {},
|
|
2927
3043
|
localState: void 0,
|
|
2928
3044
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2931,24 +3047,24 @@ function kn(e) {
|
|
|
2931
3047
|
})
|
|
2932
3048
|
)
|
|
2933
3049
|
);
|
|
2934
|
-
|
|
3050
|
+
fetch$1(A).then((R) => R.json()).then((R) => {
|
|
2935
3051
|
n({
|
|
2936
|
-
[
|
|
2937
|
-
}),
|
|
2938
|
-
}).catch((
|
|
2939
|
-
console.error("error fetching dynamic data",
|
|
3052
|
+
[x]: R
|
|
3053
|
+
}), c[x] = !0;
|
|
3054
|
+
}).catch((R) => {
|
|
3055
|
+
console.error("error fetching dynamic data", w, R);
|
|
2940
3056
|
}).finally(() => {
|
|
2941
|
-
|
|
3057
|
+
u[x] = !1;
|
|
2942
3058
|
});
|
|
2943
3059
|
});
|
|
2944
3060
|
}
|
|
2945
|
-
function
|
|
2946
|
-
|
|
3061
|
+
function k() {
|
|
3062
|
+
isEditing() && window.dispatchEvent(
|
|
2947
3063
|
new CustomEvent(
|
|
2948
3064
|
"builder:component:stateChange",
|
|
2949
3065
|
{
|
|
2950
3066
|
detail: {
|
|
2951
|
-
state:
|
|
3067
|
+
state: fastClone(e.builderContextSignal.rootState),
|
|
2952
3068
|
ref: {
|
|
2953
3069
|
name: e.model
|
|
2954
3070
|
}
|
|
@@ -2957,10 +3073,10 @@ function kn(e) {
|
|
|
2957
3073
|
)
|
|
2958
3074
|
);
|
|
2959
3075
|
}
|
|
2960
|
-
return
|
|
2961
|
-
var
|
|
2962
|
-
if (
|
|
2963
|
-
if (
|
|
3076
|
+
return useEffect(() => {
|
|
3077
|
+
var d, f;
|
|
3078
|
+
if (isBrowser()) {
|
|
3079
|
+
if (isEditing() && (window.addEventListener("message", r), registerInsertMenu(), setupBrowserForEditing({
|
|
2964
3080
|
...e.locale ? {
|
|
2965
3081
|
locale: e.locale
|
|
2966
3082
|
} : {},
|
|
@@ -2972,79 +3088,79 @@ function kn(e) {
|
|
|
2972
3088
|
} : {}
|
|
2973
3089
|
}), Object.values(
|
|
2974
3090
|
e.builderContextSignal.componentInfos
|
|
2975
|
-
).forEach((
|
|
2976
|
-
var
|
|
2977
|
-
const
|
|
2978
|
-
(
|
|
3091
|
+
).forEach((b) => {
|
|
3092
|
+
var w;
|
|
3093
|
+
const x = createRegisterComponentMessage(b);
|
|
3094
|
+
(w = window.parent) == null || w.postMessage(x, "*");
|
|
2979
3095
|
}), window.addEventListener(
|
|
2980
3096
|
"builder:component:stateChangeListenerActivated",
|
|
2981
|
-
|
|
2982
|
-
)), e.builderContextSignal.content &&
|
|
2983
|
-
const
|
|
2984
|
-
|
|
3097
|
+
k
|
|
3098
|
+
)), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
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;
|
|
3100
|
+
_track({
|
|
2985
3101
|
type: "impression",
|
|
2986
3102
|
canTrack: !0,
|
|
2987
|
-
contentId:
|
|
2988
|
-
apiKey:
|
|
2989
|
-
variationId:
|
|
3103
|
+
contentId: x,
|
|
3104
|
+
apiKey: w,
|
|
3105
|
+
variationId: b !== x ? b : void 0
|
|
2990
3106
|
});
|
|
2991
3107
|
}
|
|
2992
|
-
if (
|
|
2993
|
-
const
|
|
2994
|
-
`builder.preview.${
|
|
2995
|
-
),
|
|
2996
|
-
|
|
3108
|
+
if (isPreviewing()) {
|
|
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({
|
|
2997
3113
|
model: e.model,
|
|
2998
3114
|
apiKey: e.apiKey,
|
|
2999
3115
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3000
|
-
}).then((
|
|
3001
|
-
|
|
3116
|
+
}).then((R) => {
|
|
3117
|
+
R && i(R);
|
|
3002
3118
|
});
|
|
3003
3119
|
}
|
|
3004
3120
|
}
|
|
3005
|
-
}, []),
|
|
3006
|
-
e.apiKey ||
|
|
3121
|
+
}, []), useEffect(() => {
|
|
3122
|
+
e.apiKey || logger.error(
|
|
3007
3123
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3008
|
-
), s(),
|
|
3009
|
-
}, []),
|
|
3124
|
+
), s(), p(), k();
|
|
3125
|
+
}, []), useEffect(() => {
|
|
3010
3126
|
e.content && i(e.content);
|
|
3011
|
-
}, [e.content]),
|
|
3127
|
+
}, [e.content]), useEffect(() => {
|
|
3012
3128
|
s();
|
|
3013
|
-
}, [(
|
|
3014
|
-
|
|
3015
|
-
}, [(
|
|
3016
|
-
|
|
3017
|
-
}, [e.builderContextSignal.rootState]),
|
|
3129
|
+
}, [(S = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : S.jsCode]), useEffect(() => {
|
|
3130
|
+
p();
|
|
3131
|
+
}, [(E = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : E.httpRequests]), useEffect(() => {
|
|
3132
|
+
k();
|
|
3133
|
+
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
3018
3134
|
e.data && n(e.data);
|
|
3019
|
-
}, [e.data]),
|
|
3135
|
+
}, [e.data]), useEffect(() => {
|
|
3020
3136
|
e.locale && n({
|
|
3021
3137
|
locale: e.locale
|
|
3022
3138
|
});
|
|
3023
|
-
}, [e.locale]),
|
|
3024
|
-
|
|
3139
|
+
}, [e.locale]), useEffect(() => () => {
|
|
3140
|
+
isBrowser() && (window.removeEventListener("message", r), window.removeEventListener(
|
|
3025
3141
|
"builder:component:stateChangeListenerActivated",
|
|
3026
|
-
|
|
3142
|
+
k
|
|
3027
3143
|
));
|
|
3028
|
-
}, []), /* @__PURE__ */
|
|
3144
|
+
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(
|
|
3029
3145
|
o,
|
|
3030
3146
|
{
|
|
3031
3147
|
ref: t,
|
|
3032
|
-
onClick: (
|
|
3033
|
-
"builder-content-id": (
|
|
3148
|
+
onClick: (d) => y(d),
|
|
3149
|
+
"builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
|
|
3034
3150
|
"builder-model": e.model,
|
|
3035
3151
|
...e.showContent ? {} : {
|
|
3036
3152
|
hidden: !0,
|
|
3037
3153
|
"aria-hidden": !0
|
|
3038
3154
|
},
|
|
3039
3155
|
...e.contentWrapperProps,
|
|
3040
|
-
className: `variant-${((
|
|
3156
|
+
className: `variant-${((B = e.content) == null ? void 0 : B.testVariationId) || ((j = e.content) == null ? void 0 : j.id)}`,
|
|
3041
3157
|
children: e.children
|
|
3042
3158
|
}
|
|
3043
|
-
)
|
|
3159
|
+
) : null });
|
|
3044
3160
|
}
|
|
3045
|
-
const
|
|
3046
|
-
var
|
|
3047
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (
|
|
3161
|
+
const getCssFromFont = (e) => {
|
|
3162
|
+
var a, r;
|
|
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;
|
|
3048
3164
|
let o = "";
|
|
3049
3165
|
if (i && t && n && (o += `
|
|
3050
3166
|
@font-face {
|
|
@@ -3057,26 +3173,26 @@ font-weight: 400;
|
|
|
3057
3173
|
for (const s in e.files) {
|
|
3058
3174
|
if (!(String(Number(s)) === s))
|
|
3059
3175
|
continue;
|
|
3060
|
-
const
|
|
3061
|
-
|
|
3176
|
+
const l = e.files[s];
|
|
3177
|
+
l && l !== i && (o += `
|
|
3062
3178
|
@font-face {
|
|
3063
3179
|
font-family: "${t}";
|
|
3064
|
-
src: url('${
|
|
3180
|
+
src: url('${l}') format('woff2');
|
|
3065
3181
|
font-display: fallback;
|
|
3066
3182
|
font-weight: ${s};
|
|
3067
3183
|
}
|
|
3068
3184
|
`.trim());
|
|
3069
3185
|
}
|
|
3070
3186
|
return o;
|
|
3071
|
-
},
|
|
3187
|
+
}, getFontCss = ({
|
|
3072
3188
|
customFonts: e
|
|
3073
3189
|
}) => {
|
|
3074
3190
|
var t;
|
|
3075
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
3076
|
-
},
|
|
3191
|
+
return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
|
|
3192
|
+
}, getCss = ({
|
|
3077
3193
|
cssCode: e,
|
|
3078
3194
|
contentId: t
|
|
3079
|
-
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "",
|
|
3195
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", DEFAULT_STYLES = `
|
|
3080
3196
|
.builder-button {
|
|
3081
3197
|
all: unset;
|
|
3082
3198
|
}
|
|
@@ -3093,31 +3209,31 @@ font-weight: ${s};
|
|
|
3093
3209
|
text-align: inherit;
|
|
3094
3210
|
font-family: inherit;
|
|
3095
3211
|
}
|
|
3096
|
-
`,
|
|
3097
|
-
function
|
|
3098
|
-
const [t, n] =
|
|
3212
|
+
`, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES;
|
|
3213
|
+
function ContentStyles(e) {
|
|
3214
|
+
const [t, n] = useState(
|
|
3099
3215
|
() => `
|
|
3100
|
-
${
|
|
3216
|
+
${getCss({
|
|
3101
3217
|
cssCode: e.cssCode,
|
|
3102
3218
|
contentId: e.contentId
|
|
3103
3219
|
})}
|
|
3104
|
-
${
|
|
3220
|
+
${getFontCss({
|
|
3105
3221
|
customFonts: e.customFonts
|
|
3106
3222
|
})}
|
|
3107
|
-
${
|
|
3223
|
+
${getDefaultStyles(e.isNestedRender)}
|
|
3108
3224
|
`.trim()
|
|
3109
3225
|
);
|
|
3110
|
-
return /* @__PURE__ */
|
|
3226
|
+
return /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-content", styles: t });
|
|
3111
3227
|
}
|
|
3112
|
-
const
|
|
3228
|
+
const getRootStateInitialValue = ({
|
|
3113
3229
|
content: e,
|
|
3114
3230
|
data: t,
|
|
3115
3231
|
locale: n
|
|
3116
3232
|
}) => {
|
|
3117
|
-
var
|
|
3118
|
-
const i = {}, o = ((
|
|
3119
|
-
return (s = (
|
|
3120
|
-
|
|
3233
|
+
var a, r, s;
|
|
3234
|
+
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
3235
|
+
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
|
|
3236
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
3121
3237
|
}), {
|
|
3122
3238
|
...i,
|
|
3123
3239
|
...o,
|
|
@@ -3126,7 +3242,7 @@ const Pn = ({
|
|
|
3126
3242
|
locale: n
|
|
3127
3243
|
} : {}
|
|
3128
3244
|
};
|
|
3129
|
-
},
|
|
3245
|
+
}, getContentInitialValue = ({
|
|
3130
3246
|
content: e,
|
|
3131
3247
|
data: t
|
|
3132
3248
|
}) => e ? {
|
|
@@ -3137,46 +3253,46 @@ const Pn = ({
|
|
|
3137
3253
|
},
|
|
3138
3254
|
meta: e == null ? void 0 : e.meta
|
|
3139
3255
|
} : void 0;
|
|
3140
|
-
function
|
|
3141
|
-
var
|
|
3142
|
-
const [t, n] =
|
|
3256
|
+
function ContentComponent(e) {
|
|
3257
|
+
var c, l, u, m, g, h, y;
|
|
3258
|
+
const [t, n] = useState(
|
|
3143
3259
|
() => {
|
|
3144
|
-
var
|
|
3145
|
-
return
|
|
3260
|
+
var p, k;
|
|
3261
|
+
return getUpdateVariantVisibilityScript({
|
|
3146
3262
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3147
|
-
variationId: (
|
|
3263
|
+
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
3148
3264
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3149
|
-
contentId: (
|
|
3265
|
+
contentId: (k = e.content) == null ? void 0 : k.id
|
|
3150
3266
|
});
|
|
3151
3267
|
}
|
|
3152
3268
|
);
|
|
3153
|
-
function i(
|
|
3154
|
-
s((
|
|
3155
|
-
...
|
|
3156
|
-
rootState:
|
|
3269
|
+
function i(p) {
|
|
3270
|
+
s((k) => ({
|
|
3271
|
+
...k,
|
|
3272
|
+
rootState: p
|
|
3157
3273
|
}));
|
|
3158
3274
|
}
|
|
3159
|
-
const [o,
|
|
3275
|
+
const [o, a] = useState(
|
|
3160
3276
|
() => [
|
|
3161
|
-
...
|
|
3277
|
+
...getDefaultRegisteredComponents(),
|
|
3162
3278
|
...e.customComponents || []
|
|
3163
3279
|
].reduce(
|
|
3164
|
-
(
|
|
3165
|
-
...
|
|
3166
|
-
[
|
|
3167
|
-
component:
|
|
3168
|
-
...
|
|
3280
|
+
(p, { component: k, ...T }) => ({
|
|
3281
|
+
...p,
|
|
3282
|
+
[T.name]: {
|
|
3283
|
+
component: k,
|
|
3284
|
+
...serializeComponentInfo(T)
|
|
3169
3285
|
}
|
|
3170
3286
|
}),
|
|
3171
3287
|
{}
|
|
3172
3288
|
)
|
|
3173
|
-
), [
|
|
3174
|
-
content:
|
|
3289
|
+
), [r, s] = useState(() => ({
|
|
3290
|
+
content: getContentInitialValue({
|
|
3175
3291
|
content: e.content,
|
|
3176
3292
|
data: e.data
|
|
3177
3293
|
}),
|
|
3178
3294
|
localState: void 0,
|
|
3179
|
-
rootState:
|
|
3295
|
+
rootState: getRootStateInitialValue({
|
|
3180
3296
|
content: e.content,
|
|
3181
3297
|
data: e.data,
|
|
3182
3298
|
locale: e.locale
|
|
@@ -3186,12 +3302,12 @@ function Se(e) {
|
|
|
3186
3302
|
apiKey: e.apiKey,
|
|
3187
3303
|
apiVersion: e.apiVersion,
|
|
3188
3304
|
componentInfos: [
|
|
3189
|
-
...
|
|
3305
|
+
...getDefaultRegisteredComponents(),
|
|
3190
3306
|
...e.customComponents || []
|
|
3191
3307
|
].reduce(
|
|
3192
|
-
(
|
|
3193
|
-
...
|
|
3194
|
-
[
|
|
3308
|
+
(p, { component: k, ...T }) => ({
|
|
3309
|
+
...p,
|
|
3310
|
+
[T.name]: serializeComponentInfo(T)
|
|
3195
3311
|
}),
|
|
3196
3312
|
{}
|
|
3197
3313
|
),
|
|
@@ -3199,14 +3315,14 @@ function Se(e) {
|
|
|
3199
3315
|
BlocksWrapper: e.blocksWrapper || "div",
|
|
3200
3316
|
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
3201
3317
|
}));
|
|
3202
|
-
return /* @__PURE__ */
|
|
3203
|
-
|
|
3318
|
+
return /* @__PURE__ */ jsx(
|
|
3319
|
+
ComponentsContext.Provider,
|
|
3204
3320
|
{
|
|
3205
3321
|
value: {
|
|
3206
3322
|
registeredComponents: o
|
|
3207
3323
|
},
|
|
3208
|
-
children: /* @__PURE__ */
|
|
3209
|
-
|
|
3324
|
+
children: /* @__PURE__ */ jsxs(
|
|
3325
|
+
EnableEditor,
|
|
3210
3326
|
{
|
|
3211
3327
|
content: e.content,
|
|
3212
3328
|
data: e.data,
|
|
@@ -3217,34 +3333,34 @@ function Se(e) {
|
|
|
3217
3333
|
locale: e.locale,
|
|
3218
3334
|
enrich: e.enrich,
|
|
3219
3335
|
showContent: e.showContent,
|
|
3220
|
-
builderContextSignal:
|
|
3336
|
+
builderContextSignal: r,
|
|
3221
3337
|
contentWrapper: e.contentWrapper,
|
|
3222
3338
|
contentWrapperProps: e.contentWrapperProps,
|
|
3223
3339
|
linkComponent: e.linkComponent,
|
|
3224
3340
|
trustedHosts: e.trustedHosts,
|
|
3225
3341
|
setBuilderContextSignal: s,
|
|
3226
3342
|
children: [
|
|
3227
|
-
e.isSsrAbTest ? /* @__PURE__ */
|
|
3228
|
-
|
|
3343
|
+
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
3344
|
+
InlinedScript,
|
|
3229
3345
|
{
|
|
3230
3346
|
id: "builderio-variant-visibility",
|
|
3231
3347
|
scriptStr: t
|
|
3232
3348
|
}
|
|
3233
|
-
)
|
|
3234
|
-
/* @__PURE__ */
|
|
3235
|
-
|
|
3349
|
+
) : null,
|
|
3350
|
+
/* @__PURE__ */ jsx(
|
|
3351
|
+
ContentStyles,
|
|
3236
3352
|
{
|
|
3237
3353
|
isNestedRender: e.isNestedRender,
|
|
3238
|
-
contentId: (
|
|
3239
|
-
cssCode: (
|
|
3240
|
-
customFonts: (
|
|
3354
|
+
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
3355
|
+
cssCode: (u = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : u.cssCode,
|
|
3356
|
+
customFonts: (g = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
|
|
3241
3357
|
}
|
|
3242
|
-
)
|
|
3243
|
-
/* @__PURE__ */
|
|
3244
|
-
|
|
3358
|
+
),
|
|
3359
|
+
/* @__PURE__ */ jsx(
|
|
3360
|
+
Blocks,
|
|
3245
3361
|
{
|
|
3246
|
-
blocks: (
|
|
3247
|
-
context:
|
|
3362
|
+
blocks: (y = (h = r.content) == null ? void 0 : h.data) == null ? void 0 : y.blocks,
|
|
3363
|
+
context: r,
|
|
3248
3364
|
registeredComponents: o,
|
|
3249
3365
|
linkComponent: e.linkComponent
|
|
3250
3366
|
}
|
|
@@ -3255,63 +3371,63 @@ function Se(e) {
|
|
|
3255
3371
|
}
|
|
3256
3372
|
);
|
|
3257
3373
|
}
|
|
3258
|
-
function
|
|
3259
|
-
var
|
|
3260
|
-
const [t, n] =
|
|
3261
|
-
() =>
|
|
3262
|
-
canTrack:
|
|
3374
|
+
function ContentVariants(e) {
|
|
3375
|
+
var r;
|
|
3376
|
+
const [t, n] = useState(
|
|
3377
|
+
() => checkShouldRenderVariants({
|
|
3378
|
+
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3263
3379
|
content: e.content
|
|
3264
3380
|
})
|
|
3265
3381
|
);
|
|
3266
3382
|
function i() {
|
|
3267
3383
|
var s;
|
|
3268
|
-
return
|
|
3269
|
-
|
|
3270
|
-
id:
|
|
3271
|
-
testRatio:
|
|
3384
|
+
return getUpdateCookieAndStylesScript(
|
|
3385
|
+
getVariants(e.content).map((c) => ({
|
|
3386
|
+
id: c.testVariationId,
|
|
3387
|
+
testRatio: c.testRatio
|
|
3272
3388
|
})),
|
|
3273
3389
|
((s = e.content) == null ? void 0 : s.id) || ""
|
|
3274
3390
|
);
|
|
3275
3391
|
}
|
|
3276
3392
|
function o() {
|
|
3277
|
-
return
|
|
3393
|
+
return getVariants(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
|
|
3278
3394
|
}
|
|
3279
|
-
function
|
|
3395
|
+
function a() {
|
|
3280
3396
|
var s;
|
|
3281
3397
|
return t ? {
|
|
3282
3398
|
...e.content,
|
|
3283
3399
|
testVariationId: (s = e.content) == null ? void 0 : s.id
|
|
3284
|
-
} :
|
|
3400
|
+
} : handleABTestingSync({
|
|
3285
3401
|
item: e.content,
|
|
3286
|
-
canTrack:
|
|
3402
|
+
canTrack: getDefaultCanTrack(e.canTrack)
|
|
3287
3403
|
});
|
|
3288
3404
|
}
|
|
3289
|
-
return
|
|
3290
|
-
}, []), /* @__PURE__ */
|
|
3291
|
-
!e.isNestedRender &&
|
|
3292
|
-
|
|
3405
|
+
return useEffect(() => {
|
|
3406
|
+
}, []), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3407
|
+
!e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(
|
|
3408
|
+
InlinedScript,
|
|
3293
3409
|
{
|
|
3294
3410
|
id: "builderio-init-variants-fns",
|
|
3295
|
-
scriptStr:
|
|
3411
|
+
scriptStr: getInitVariantsFnsScriptString()
|
|
3296
3412
|
}
|
|
3297
|
-
)
|
|
3298
|
-
t ? /* @__PURE__ */
|
|
3299
|
-
/* @__PURE__ */
|
|
3300
|
-
|
|
3413
|
+
) : null,
|
|
3414
|
+
t ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3415
|
+
/* @__PURE__ */ jsx(
|
|
3416
|
+
InlinedStyles,
|
|
3301
3417
|
{
|
|
3302
3418
|
id: "builderio-variants",
|
|
3303
3419
|
styles: o()
|
|
3304
3420
|
}
|
|
3305
3421
|
),
|
|
3306
|
-
/* @__PURE__ */
|
|
3307
|
-
|
|
3422
|
+
/* @__PURE__ */ jsx(
|
|
3423
|
+
InlinedScript,
|
|
3308
3424
|
{
|
|
3309
3425
|
id: "builderio-variants-visibility",
|
|
3310
3426
|
scriptStr: i()
|
|
3311
3427
|
}
|
|
3312
3428
|
),
|
|
3313
|
-
(
|
|
3314
|
-
|
|
3429
|
+
(r = getVariants(e.content)) == null ? void 0 : r.map((s) => /* @__PURE__ */ jsx(
|
|
3430
|
+
ContentComponent,
|
|
3315
3431
|
{
|
|
3316
3432
|
isNestedRender: e.isNestedRender,
|
|
3317
3433
|
content: s,
|
|
@@ -3336,11 +3452,11 @@ function Bn(e) {
|
|
|
3336
3452
|
s.testVariationId
|
|
3337
3453
|
))
|
|
3338
3454
|
] }) : null,
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
|
|
3455
|
+
/* @__PURE__ */ jsx(
|
|
3456
|
+
ContentComponent,
|
|
3341
3457
|
{
|
|
3342
3458
|
isNestedRender: e.isNestedRender,
|
|
3343
|
-
content:
|
|
3459
|
+
content: a(),
|
|
3344
3460
|
showContent: !0,
|
|
3345
3461
|
model: e.model,
|
|
3346
3462
|
data: e.data,
|
|
@@ -3362,13 +3478,13 @@ function Bn(e) {
|
|
|
3362
3478
|
)
|
|
3363
3479
|
] });
|
|
3364
3480
|
}
|
|
3365
|
-
const
|
|
3481
|
+
const fetchSymbolContent = async ({
|
|
3366
3482
|
builderContextValue: e,
|
|
3367
3483
|
symbol: t
|
|
3368
3484
|
}) => {
|
|
3369
3485
|
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
3370
3486
|
(e != null && e.apiKey))
|
|
3371
|
-
return
|
|
3487
|
+
return fetchOneEntry({
|
|
3372
3488
|
model: t.model,
|
|
3373
3489
|
apiKey: e.apiKey,
|
|
3374
3490
|
apiVersion: e.apiVersion,
|
|
@@ -3378,52 +3494,52 @@ const Wn = async ({
|
|
|
3378
3494
|
}
|
|
3379
3495
|
}
|
|
3380
3496
|
}).catch((n) => {
|
|
3381
|
-
|
|
3497
|
+
logger.error("Could not fetch symbol content: ", n);
|
|
3382
3498
|
});
|
|
3383
3499
|
};
|
|
3384
|
-
function
|
|
3385
|
-
var
|
|
3500
|
+
function Symbol$1(e) {
|
|
3501
|
+
var a, r, s, c;
|
|
3386
3502
|
function t() {
|
|
3387
|
-
var
|
|
3503
|
+
var l, u;
|
|
3388
3504
|
return [
|
|
3389
|
-
e.attributes[
|
|
3505
|
+
e.attributes[getClassPropName()],
|
|
3390
3506
|
"builder-symbol",
|
|
3391
|
-
(
|
|
3392
|
-
(
|
|
3507
|
+
(l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
|
|
3508
|
+
(u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
3393
3509
|
].filter(Boolean).join(" ");
|
|
3394
3510
|
}
|
|
3395
|
-
const [n, i] =
|
|
3396
|
-
var
|
|
3397
|
-
return (
|
|
3511
|
+
const [n, i] = useState(() => {
|
|
3512
|
+
var l;
|
|
3513
|
+
return (l = e.symbol) == null ? void 0 : l.content;
|
|
3398
3514
|
});
|
|
3399
3515
|
function o() {
|
|
3400
|
-
n ||
|
|
3516
|
+
n || fetchSymbolContent({
|
|
3401
3517
|
symbol: e.symbol,
|
|
3402
3518
|
builderContextValue: e.builderContext
|
|
3403
|
-
}).then((
|
|
3404
|
-
|
|
3519
|
+
}).then((l) => {
|
|
3520
|
+
l && i(l);
|
|
3405
3521
|
});
|
|
3406
3522
|
}
|
|
3407
|
-
return
|
|
3408
|
-
}, []),
|
|
3523
|
+
return useEffect(() => {
|
|
3524
|
+
}, []), useEffect(() => {
|
|
3409
3525
|
o();
|
|
3410
|
-
}, [e.symbol]), /* @__PURE__ */
|
|
3411
|
-
|
|
3526
|
+
}, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
|
|
3527
|
+
ContentVariants,
|
|
3412
3528
|
{
|
|
3413
3529
|
isNestedRender: !0,
|
|
3414
3530
|
apiVersion: e.builderContext.apiVersion,
|
|
3415
3531
|
apiKey: e.builderContext.apiKey,
|
|
3416
3532
|
context: {
|
|
3417
3533
|
...e.builderContext.context,
|
|
3418
|
-
symbolId: (
|
|
3534
|
+
symbolId: (a = e.builderBlock) == null ? void 0 : a.id
|
|
3419
3535
|
},
|
|
3420
3536
|
customComponents: Object.values(e.builderComponents),
|
|
3421
3537
|
data: {
|
|
3422
|
-
...(
|
|
3538
|
+
...(r = e.symbol) == null ? void 0 : r.data,
|
|
3423
3539
|
...e.builderContext.localState,
|
|
3424
3540
|
...(s = n == null ? void 0 : n.data) == null ? void 0 : s.state
|
|
3425
3541
|
},
|
|
3426
|
-
model: (
|
|
3542
|
+
model: (c = e.symbol) == null ? void 0 : c.model,
|
|
3427
3543
|
content: n,
|
|
3428
3544
|
linkComponent: e.builderLinkComponent,
|
|
3429
3545
|
blocksWrapper: "div",
|
|
@@ -3432,15 +3548,15 @@ function Nn(e) {
|
|
|
3432
3548
|
) });
|
|
3433
3549
|
}
|
|
3434
3550
|
export {
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3551
|
+
Blocks,
|
|
3552
|
+
builderContext as BuilderContext,
|
|
3553
|
+
Button,
|
|
3554
|
+
Columns,
|
|
3555
|
+
ContentVariants as Content,
|
|
3556
|
+
FragmentComponent as Fragment,
|
|
3557
|
+
Image,
|
|
3558
|
+
SectionComponent as Section,
|
|
3559
|
+
Symbol$1 as Symbol,
|
|
3560
|
+
Text,
|
|
3561
|
+
Video
|
|
3446
3562
|
};
|