@builder.io/sdk-vue 0.3.2-0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/package.json +1 -1
  2. package/packages/_vue2/dist/block-styles.18ca317b.cjs +1 -0
  3. package/packages/_vue2/dist/{block-styles.22c50e60.js → block-styles.69ca115c.js} +11 -10
  4. package/packages/_vue2/dist/css.24c082d4.cjs +6 -0
  5. package/packages/_vue2/dist/css.ce776b44.js +75 -0
  6. package/packages/_vue2/dist/evaluate.8238dbc9.js +63 -0
  7. package/packages/_vue2/dist/evaluate.cff086ca.cjs +4 -0
  8. package/packages/_vue2/dist/index.c16f4cca.cjs +32 -0
  9. package/packages/_vue2/dist/index.e2db82e0.js +1372 -0
  10. package/packages/_vue2/dist/{render-block.11a66585.js → render-block.0f23cd7e.js} +22 -21
  11. package/packages/_vue2/dist/render-block.954cc390.cjs +3 -0
  12. package/packages/_vue2/dist/{render-component.dc53dbd0.js → render-component.74280c04.js} +3 -3
  13. package/packages/_vue2/dist/render-component.e8047ef5.cjs +1 -0
  14. package/packages/_vue2/dist/render-content.672eabd9.js +1359 -0
  15. package/packages/_vue2/dist/render-content.702f0387.cjs +1 -0
  16. package/packages/_vue2/dist/render-inlined-styles.2c0cf85b.cjs +1 -0
  17. package/packages/_vue2/dist/render-inlined-styles.ac06208e.js +23 -0
  18. package/packages/_vue2/dist/{render-repeated-block.1cb6b42e.cjs → render-repeated-block.5740965b.cjs} +1 -1
  19. package/packages/_vue2/dist/{render-repeated-block.7b83bd13.js → render-repeated-block.c40e7c25.js} +2 -2
  20. package/packages/_vue2/dist/{render-styles.37cf66d9.js → render-styles.af4e2d5a.js} +3 -3
  21. package/packages/_vue2/dist/{render-styles.fe76b092.cjs → render-styles.e6e62ba1.cjs} +6 -6
  22. package/packages/_vue2/dist/sdk.cjs +1 -1
  23. package/packages/_vue2/dist/sdk.js +19 -23
  24. package/packages/_vue2/dist/src/blocks/button/button.vue.d.ts +1 -1
  25. package/packages/_vue2/dist/src/blocks/columns/columns.vue.d.ts +1 -1
  26. package/packages/_vue2/dist/src/blocks/custom-code/custom-code.vue.d.ts +1 -1
  27. package/packages/_vue2/dist/src/blocks/image/image.vue.d.ts +1 -1
  28. package/packages/_vue2/dist/src/blocks/symbol/symbol.vue.d.ts +1 -1
  29. package/packages/_vue2/dist/src/components/render-blocks.vue.d.ts +1 -1
  30. package/packages/_vue2/dist/src/components/render-content/render-content.types.d.ts +9 -2
  31. package/packages/_vue2/dist/src/components/render-content/render-content.vue.d.ts +2 -0
  32. package/packages/_vue2/dist/src/components/render-content-variants/helpers.d.ts +17 -0
  33. package/packages/_vue2/dist/src/components/render-content-variants/render-content-variants.vue.d.ts +29 -0
  34. package/packages/_vue2/dist/src/components/render-inlined-styles.vue.d.ts +4 -6
  35. package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
  36. package/packages/_vue2/dist/src/functions/get-builder-search-params/index.d.ts +6 -0
  37. package/packages/_vue2/dist/src/functions/get-content/index.d.ts +7 -2
  38. package/packages/_vue2/dist/src/helpers/ab-tests.d.ts +8 -7
  39. package/packages/_vue2/dist/src/helpers/canTrack.d.ts +1 -0
  40. package/packages/_vue2/dist/src/helpers/cookie.d.ts +7 -3
  41. package/packages/_vue2/dist/src/helpers/logger.d.ts +1 -0
  42. package/packages/_vue2/dist/src/index-helpers/blocks-exports.d.ts +1 -1
  43. package/packages/_vue2/dist/src/index.d.ts +9 -7
  44. package/packages/_vue2/dist/src/types/builder-content.d.ts +1 -3
  45. package/packages/_vue2/dist/src/types/targets.d.ts +3 -0
  46. package/packages/_vue2/dist/style.css +1 -1
  47. package/packages/_vue3/dist/{block-styles.c0e7bfbe.js → block-styles.7969d695.js} +10 -9
  48. package/packages/_vue3/dist/block-styles.e3f09eb7.cjs +1 -0
  49. package/packages/_vue3/dist/css.5cacc3c3.cjs +6 -0
  50. package/packages/_vue3/dist/css.7fe37cb4.js +75 -0
  51. package/packages/_vue3/dist/evaluate.975fa4d3.js +63 -0
  52. package/packages/_vue3/dist/evaluate.9a614eea.cjs +4 -0
  53. package/packages/_vue3/dist/index.3f716812.cjs +32 -0
  54. package/packages/_vue3/dist/index.cdd37dcf.js +1393 -0
  55. package/packages/_vue3/dist/{render-block.d0ed34b4.js → render-block.348e561a.js} +16 -15
  56. package/packages/_vue3/dist/render-block.d1c4ccaa.cjs +3 -0
  57. package/packages/_vue3/dist/{render-component.77f33093.cjs → render-component.788543b4.cjs} +1 -1
  58. package/packages/_vue3/dist/{render-component.268e7bd8.js → render-component.9bd5c435.js} +3 -3
  59. package/packages/_vue3/dist/render-content.0423df8b.js +1355 -0
  60. package/packages/_vue3/dist/render-content.17e9b187.cjs +1 -0
  61. package/packages/_vue3/dist/render-inlined-styles.49a121f8.js +16 -0
  62. package/packages/_vue3/dist/render-inlined-styles.528fb5cd.cjs +1 -0
  63. package/packages/_vue3/dist/{render-repeated-block.0d46ab69.cjs → render-repeated-block.04301799.cjs} +1 -1
  64. package/packages/_vue3/dist/{render-repeated-block.b1101852.js → render-repeated-block.35a0d813.js} +2 -2
  65. package/packages/_vue3/dist/{render-styles.7f31b369.js → render-styles.3411b577.js} +3 -3
  66. package/packages/_vue3/dist/{render-styles.5073866f.cjs → render-styles.b4509dd3.cjs} +3 -3
  67. package/packages/_vue3/dist/sdk.cjs +1 -1
  68. package/packages/_vue3/dist/sdk.js +20 -24
  69. package/packages/_vue3/dist/src/blocks/button/button.vue.d.ts +1 -1
  70. package/packages/_vue3/dist/src/blocks/columns/columns.vue.d.ts +1 -1
  71. package/packages/_vue3/dist/src/blocks/custom-code/custom-code.vue.d.ts +1 -1
  72. package/packages/_vue3/dist/src/blocks/image/image.vue.d.ts +1 -1
  73. package/packages/_vue3/dist/src/blocks/symbol/symbol.vue.d.ts +1 -1
  74. package/packages/_vue3/dist/src/components/render-blocks.vue.d.ts +1 -1
  75. package/packages/_vue3/dist/src/components/render-content/render-content.types.d.ts +9 -2
  76. package/packages/_vue3/dist/src/components/render-content/render-content.vue.d.ts +17 -3
  77. package/packages/_vue3/dist/src/components/render-content-variants/helpers.d.ts +17 -0
  78. package/packages/_vue3/dist/src/components/render-content-variants/render-content-variants.vue.d.ts +29 -0
  79. package/packages/_vue3/dist/src/components/render-inlined-styles.vue.d.ts +4 -6
  80. package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
  81. package/packages/_vue3/dist/src/functions/get-builder-search-params/index.d.ts +6 -0
  82. package/packages/_vue3/dist/src/functions/get-content/index.d.ts +7 -2
  83. package/packages/_vue3/dist/src/helpers/ab-tests.d.ts +8 -7
  84. package/packages/_vue3/dist/src/helpers/canTrack.d.ts +1 -0
  85. package/packages/_vue3/dist/src/helpers/cookie.d.ts +7 -3
  86. package/packages/_vue3/dist/src/helpers/logger.d.ts +1 -0
  87. package/packages/_vue3/dist/src/index-helpers/blocks-exports.d.ts +1 -1
  88. package/packages/_vue3/dist/src/index.d.ts +9 -7
  89. package/packages/_vue3/dist/src/types/builder-content.d.ts +1 -3
  90. package/packages/_vue3/dist/src/types/targets.d.ts +3 -0
  91. package/packages/_vue3/dist/style.css +1 -1
  92. package/packages/_vue2/dist/block-styles.82ffdfab.cjs +0 -1
  93. package/packages/_vue2/dist/css.d1f35fa9.js +0 -74
  94. package/packages/_vue2/dist/css.d67364ee.cjs +0 -6
  95. package/packages/_vue2/dist/index.1955e2ac.js +0 -2586
  96. package/packages/_vue2/dist/index.2eccdb53.cjs +0 -29
  97. package/packages/_vue2/dist/render-block.742f7d9b.cjs +0 -3
  98. package/packages/_vue2/dist/render-component.8f5204ca.cjs +0 -1
  99. package/packages/_vue2/dist/render-inlined-styles.1887b766.cjs +0 -1
  100. package/packages/_vue2/dist/render-inlined-styles.955770d4.js +0 -34
  101. package/packages/_vue2/dist/src/functions/get-content/ab-testing.d.ts +0 -5
  102. package/packages/_vue3/dist/block-styles.18a1a0e6.cjs +0 -1
  103. package/packages/_vue3/dist/css.7a6108f3.cjs +0 -6
  104. package/packages/_vue3/dist/css.ee7d0ab8.js +0 -74
  105. package/packages/_vue3/dist/index.c3536d81.js +0 -2574
  106. package/packages/_vue3/dist/index.e7a22b43.cjs +0 -29
  107. package/packages/_vue3/dist/render-block.bcafe494.cjs +0 -3
  108. package/packages/_vue3/dist/render-inlined-styles.5aa04bb8.js +0 -32
  109. package/packages/_vue3/dist/render-inlined-styles.86c0a89d.cjs +0 -1
  110. package/packages/_vue3/dist/src/functions/get-content/ab-testing.d.ts +0 -5
@@ -0,0 +1,1372 @@
1
+ import { defineComponent as g } from "vue";
2
+ const et = g({
3
+ name: "builder-button",
4
+ props: ["attributes", "text", "link", "openLinkInNewTab"],
5
+ methods: {
6
+ filterAttrs: function(t = {}, n) {
7
+ const r = "v-on:";
8
+ return Object.keys(t).filter((o) => {
9
+ if (!t[o])
10
+ return !1;
11
+ const s = o.startsWith(r);
12
+ return n ? s : !s;
13
+ }).reduce(
14
+ (o, s) => ({
15
+ ...o,
16
+ [s.replace(r, "")]: t[s]
17
+ }),
18
+ {}
19
+ );
20
+ },
21
+ _classStringToObject(e) {
22
+ const t = {};
23
+ if (typeof e != "string")
24
+ return t;
25
+ const n = e.trim().split(/\s+/);
26
+ for (const r of n)
27
+ t[r] = !0;
28
+ return t;
29
+ }
30
+ }
31
+ });
32
+ function y(e, t, n, r, o, s, i, u) {
33
+ var a = typeof e == "function" ? e.options : e;
34
+ t && (a.render = t, a.staticRenderFns = n, a._compiled = !0), r && (a.functional = !0), s && (a._scopeId = "data-v-" + s);
35
+ var c;
36
+ if (i ? (c = function(l) {
37
+ l = l || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !l && typeof __VUE_SSR_CONTEXT__ < "u" && (l = __VUE_SSR_CONTEXT__), o && o.call(this, l), l && l._registeredComponents && l._registeredComponents.add(i);
38
+ }, a._ssrRegister = c) : o && (c = u ? function() {
39
+ o.call(
40
+ this,
41
+ (a.functional ? this.parent : this).$root.$options.shadowRoot
42
+ );
43
+ } : o), c)
44
+ if (a.functional) {
45
+ a._injectStyles = c;
46
+ var b = a.render;
47
+ a.render = function(m, d) {
48
+ return c.call(d), b(m, d);
49
+ };
50
+ } else {
51
+ var f = a.beforeCreate;
52
+ a.beforeCreate = f ? [].concat(f, c) : [c];
53
+ }
54
+ return {
55
+ exports: e,
56
+ options: a
57
+ };
58
+ }
59
+ var nt = function() {
60
+ var t = this, n = t._self._c;
61
+ return t._self._setupProxy, t.link ? n("a", t._g(t._b({ attrs: { role: "button", href: t.link, target: t.openLinkInNewTab ? "_blank" : void 0 } }, "a", t.filterAttrs(t.attributes, !1), !1), t.filterAttrs(t.attributes, !0)), [t._v(" " + t._s(t.text) + " ")]) : n("button", t._g(t._b({ class: t._classStringToObject(
62
+ t.attributes.class + " button-2fnk003dqad"
63
+ ) }, "button", t.filterAttrs(t.attributes, !1), !1), t.filterAttrs(t.attributes, !0)), [t._v(" " + t._s(t.text) + " ")]);
64
+ }, rt = [], ot = /* @__PURE__ */ y(
65
+ et,
66
+ nt,
67
+ rt,
68
+ !1,
69
+ null,
70
+ "7e3d619b",
71
+ null,
72
+ null
73
+ );
74
+ const De = ot.exports, A = (e) => JSON.parse(JSON.stringify(e)), M = {
75
+ small: {
76
+ min: 320,
77
+ default: 321,
78
+ max: 640
79
+ },
80
+ medium: {
81
+ min: 641,
82
+ default: 642,
83
+ max: 991
84
+ },
85
+ large: {
86
+ min: 990,
87
+ default: 991,
88
+ max: 1200
89
+ }
90
+ }, He = (e, t = M) => `@media (max-width: ${t[e].max}px)`, st = ({ small: e, medium: t }) => {
91
+ const n = A(M);
92
+ if (!e || !t)
93
+ return n;
94
+ const r = Math.floor(e / 2);
95
+ n.small = {
96
+ max: e,
97
+ min: r,
98
+ default: r + 1
99
+ };
100
+ const o = n.small.max + 1;
101
+ n.medium = {
102
+ max: t,
103
+ min: o,
104
+ default: o + 1
105
+ };
106
+ const s = n.medium.max + 1;
107
+ return n.large = {
108
+ max: 2e3,
109
+ min: s,
110
+ default: s + 1
111
+ }, n;
112
+ }, T = "vue2", it = Symbol(), E = {
113
+ Builder: {
114
+ content: null,
115
+ context: {},
116
+ localState: void 0,
117
+ rootSetState() {
118
+ },
119
+ rootState: {},
120
+ apiKey: null,
121
+ apiVersion: void 0,
122
+ registeredComponents: {},
123
+ inheritedStyles: {}
124
+ },
125
+ key: it
126
+ }, at = () => Promise.resolve().then(() => Et).then((e) => e.default).catch((e) => {
127
+ throw console.error(
128
+ "Error while attempting to dynamically import component RenderBlocks at ../../components/render-blocks.vue",
129
+ e
130
+ ), e;
131
+ }), ct = () => import("./render-inlined-styles.ac06208e.js").then((e) => e.default).catch((e) => {
132
+ throw console.error(
133
+ "Error while attempting to dynamically import component RenderInlinedStyles at ../../components/render-inlined-styles.vue",
134
+ e
135
+ ), e;
136
+ }), lt = g({
137
+ name: "builder-columns",
138
+ components: {
139
+ RenderInlinedStyles: ct,
140
+ RenderBlocks: at
141
+ },
142
+ props: [
143
+ "space",
144
+ "columns",
145
+ "stackColumnsAt",
146
+ "reverseColumnsWhenStacked",
147
+ "builderBlock"
148
+ ],
149
+ data() {
150
+ return {
151
+ gutterSize: typeof this.space == "number" ? this.space || 0 : 20,
152
+ cols: this.columns || [],
153
+ stackAt: this.stackColumnsAt || "tablet",
154
+ flexDir: this.stackColumnsAt === "never" ? "row" : this.reverseColumnsWhenStacked ? "column-reverse" : "column",
155
+ TARGET: T
156
+ };
157
+ },
158
+ inject: {
159
+ builderContext: E.key
160
+ },
161
+ computed: {
162
+ columnsCssVars() {
163
+ return {
164
+ "--flex-dir": this.flexDir,
165
+ "--flex-dir-tablet": this.getTabletStyle({
166
+ stackedStyle: this.flexDir,
167
+ desktopStyle: "row"
168
+ })
169
+ };
170
+ },
171
+ columnsStyles() {
172
+ return `
173
+ @media (max-width: ${this.getWidthForBreakpointSize("medium")}px) {
174
+ .${this.builderBlock.id}-breakpoints {
175
+ flex-direction: var(--flex-dir-tablet);
176
+ align-items: stretch;
177
+ }
178
+
179
+ .${this.builderBlock.id}-breakpoints > .builder-column {
180
+ width: var(--column-width-tablet) !important;
181
+ margin-left: var(--column-margin-left-tablet) !important;
182
+ }
183
+ }
184
+
185
+ @media (max-width: ${this.getWidthForBreakpointSize("small")}px) {
186
+ .${this.builderBlock.id}-breakpoints {
187
+ flex-direction: var(--flex-dir);
188
+ align-items: stretch;
189
+ }
190
+
191
+ .${this.builderBlock.id}-breakpoints > .builder-column {
192
+ width: var(--column-width-mobile) !important;
193
+ margin-left: var(--column-margin-left-mobile) !important;
194
+ }
195
+ },
196
+ `;
197
+ }
198
+ },
199
+ methods: {
200
+ getWidth(e) {
201
+ var t;
202
+ return ((t = this.cols[e]) == null ? void 0 : t.width) || 100 / this.cols.length;
203
+ },
204
+ getColumnCssWidth(e) {
205
+ const t = this.gutterSize * (this.cols.length - 1) / this.cols.length;
206
+ return `calc(${this.getWidth(e)}% - ${t}px)`;
207
+ },
208
+ getTabletStyle({
209
+ stackedStyle: e,
210
+ desktopStyle: t
211
+ }) {
212
+ return this.stackAt === "tablet" ? e : t;
213
+ },
214
+ getMobileStyle({
215
+ stackedStyle: e,
216
+ desktopStyle: t
217
+ }) {
218
+ return this.stackAt === "never" ? t : e;
219
+ },
220
+ columnCssVars(e) {
221
+ const t = e === 0 ? 0 : this.gutterSize, n = this.getColumnCssWidth(e), r = `${t}px`, o = "100%", s = 0;
222
+ return {
223
+ width: n,
224
+ "margin-left": r,
225
+ "--column-width-mobile": this.getMobileStyle({
226
+ stackedStyle: o,
227
+ desktopStyle: n
228
+ }),
229
+ "--column-margin-left-mobile": this.getMobileStyle({
230
+ stackedStyle: s,
231
+ desktopStyle: r
232
+ }),
233
+ "--column-width-tablet": this.getTabletStyle({
234
+ stackedStyle: o,
235
+ desktopStyle: n
236
+ }),
237
+ "--column-margin-left-tablet": this.getTabletStyle({
238
+ stackedStyle: s,
239
+ desktopStyle: r
240
+ })
241
+ };
242
+ },
243
+ getWidthForBreakpointSize(e) {
244
+ var n, r;
245
+ return st(
246
+ ((r = (n = this.builderContext.content) == null ? void 0 : n.meta) == null ? void 0 : r.breakpoints) || {}
247
+ )[e].max;
248
+ },
249
+ _classStringToObject(e) {
250
+ const t = {};
251
+ if (typeof e != "string")
252
+ return t;
253
+ const n = e.trim().split(/\s+/);
254
+ for (const r of n)
255
+ t[r] = !0;
256
+ return t;
257
+ }
258
+ }
259
+ });
260
+ var ut = function() {
261
+ var t = this, n = t._self._c;
262
+ return t._self._setupProxy, n("div", { class: t._classStringToObject(
263
+ `builder-columns ${t.builderBlock.id}-breakpoints div-t9spj7joih`
264
+ ), style: t.columnsCssVars, attrs: { dataSet: {
265
+ "builder-block-name": "builder-columns"
266
+ } } }, [t.TARGET !== "reactNative" ? [n("render-inlined-styles", { attrs: { styles: t.columnsStyles } })] : t._e(), t._l(t.columns, function(r, o) {
267
+ return n("div", { key: o, staticClass: "builder-column div-t9spj7joih-2", style: t.columnCssVars(o), attrs: { dataSet: {
268
+ "builder-block-name": "builder-column"
269
+ } } }, [n("render-blocks", { attrs: { blocks: r.blocks, path: `component.options.columns.${o}.blocks`, parent: t.builderBlock.id, styleProp: {
270
+ flexGrow: "1"
271
+ } } })], 1);
272
+ })], 2);
273
+ }, dt = [], ft = /* @__PURE__ */ y(
274
+ lt,
275
+ ut,
276
+ dt,
277
+ !1,
278
+ null,
279
+ "ea80c645",
280
+ null,
281
+ null
282
+ );
283
+ const qe = ft.exports, mt = g({
284
+ name: "builder-fragment-component",
285
+ props: []
286
+ });
287
+ var pt = function() {
288
+ var t = this, n = t._self._c;
289
+ return t._self._setupProxy, n("span", [t._t("default")], 2);
290
+ }, ht = [], bt = /* @__PURE__ */ y(
291
+ mt,
292
+ pt,
293
+ ht,
294
+ !1,
295
+ null,
296
+ null,
297
+ null,
298
+ null
299
+ );
300
+ const Je = bt.exports;
301
+ function V(e) {
302
+ return e.replace(/http(s)?:/, "");
303
+ }
304
+ function _t(e = "", t, n) {
305
+ const r = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
306
+ return e.match(r) ? e.replace(r, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
307
+ }
308
+ function gt(e, t) {
309
+ if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
310
+ return e;
311
+ if (t === "master")
312
+ return V(e);
313
+ const n = e.match(
314
+ /(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i
315
+ );
316
+ if (n) {
317
+ const r = e.split(n[0]), o = n[3], s = t.match("x") ? t : `${t}x`;
318
+ return V(`${r[0]}_${s}${o}`);
319
+ }
320
+ return null;
321
+ }
322
+ function R(e) {
323
+ if (!e)
324
+ return e;
325
+ const t = [100, 200, 400, 800, 1200, 1600, 2e3];
326
+ if (e.match(/builder\.io/)) {
327
+ let n = e;
328
+ const r = Number(e.split("?width=")[1]);
329
+ return isNaN(r) || (n = `${n} ${r}w`), t.filter((o) => o !== r).map((o) => `${_t(e, "width", o)} ${o}w`).concat([n]).join(", ");
330
+ }
331
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [gt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, r]) => `${n} ${r}w`).concat([e]).join(", ") : e;
332
+ }
333
+ const yt = g({
334
+ name: "builder-image",
335
+ props: [
336
+ "image",
337
+ "src",
338
+ "srcset",
339
+ "noWebp",
340
+ "aspectRatio",
341
+ "altText",
342
+ "backgroundPosition",
343
+ "backgroundSize",
344
+ "className",
345
+ "sizes",
346
+ "builderBlock",
347
+ "fitContent"
348
+ ],
349
+ computed: {
350
+ srcSetToUse() {
351
+ var n;
352
+ const t = this.image || this.src;
353
+ if (!t || !(t.match(/builder\.io/) || t.match(/cdn\.shopify\.com/)))
354
+ return this.srcset;
355
+ if (this.srcset && ((n = this.image) == null ? void 0 : n.includes("builder.io/api/v1/image"))) {
356
+ if (!this.srcset.includes(this.image.split("?")[0]))
357
+ return console.debug("Removed given srcset"), R(t);
358
+ } else if (this.image && !this.srcset)
359
+ return R(t);
360
+ return R(t);
361
+ },
362
+ webpSrcSet() {
363
+ var e;
364
+ return ((e = this.srcSetToUse) == null ? void 0 : e.match(/builder\.io/)) && !this.noWebp ? this.srcSetToUse.replace(/\?/g, "?format=webp&") : "";
365
+ },
366
+ aspectRatioCss() {
367
+ const e = {
368
+ position: "absolute",
369
+ height: "100%",
370
+ width: "100%",
371
+ left: "0px",
372
+ top: "0px"
373
+ };
374
+ return this.aspectRatio ? e : void 0;
375
+ }
376
+ },
377
+ methods: {
378
+ _classStringToObject(e) {
379
+ const t = {};
380
+ if (typeof e != "string")
381
+ return t;
382
+ const n = e.trim().split(/\s+/);
383
+ for (const r of n)
384
+ t[r] = !0;
385
+ return t;
386
+ }
387
+ }
388
+ });
389
+ var vt = function() {
390
+ var r, o, s, i;
391
+ var t = this, n = t._self._c;
392
+ return t._self._setupProxy, n("div", [n("picture", [t.webpSrcSet ? [n("source", { attrs: { type: "image/webp", srcset: t.webpSrcSet } })] : t._e(), n("img", { class: t._classStringToObject(
393
+ "builder-image" + (t.className ? " " + t.className : "") + " img-1pl23ac79ld"
394
+ ), style: {
395
+ objectPosition: t.backgroundPosition || "center",
396
+ objectFit: t.backgroundSize || "cover",
397
+ ...t.aspectRatioCss
398
+ }, attrs: { loading: "lazy", alt: t.altText, role: t.altText ? "presentation" : void 0, src: t.image, srcset: t.srcSetToUse, sizes: t.sizes } })], 2), t.aspectRatio && !(((o = (r = t.builderBlock) == null ? void 0 : r.children) == null ? void 0 : o.length) && t.fitContent) ? [n("div", { staticClass: "builder-image-sizer div-1pl23ac79ld", style: {
399
+ paddingTop: t.aspectRatio * 100 + "%"
400
+ } })] : t._e(), ((i = (s = t.builderBlock) == null ? void 0 : s.children) == null ? void 0 : i.length) && t.fitContent ? [t._t("default")] : t._e(), !t.fitContent && t.children ? [n("div", { staticClass: "div-1pl23ac79ld-2" }, [t._t("default")], 2)] : t._e()], 2);
401
+ }, St = [], kt = /* @__PURE__ */ y(
402
+ yt,
403
+ vt,
404
+ St,
405
+ !1,
406
+ null,
407
+ "7eca4996",
408
+ null,
409
+ null
410
+ );
411
+ const Xe = kt.exports;
412
+ function h() {
413
+ return typeof window < "u" && typeof document < "u";
414
+ }
415
+ function xt() {
416
+ return h() && window.self !== window.top;
417
+ }
418
+ function $() {
419
+ return xt() && window.location.search.indexOf("builder.frameEditing=") !== -1;
420
+ }
421
+ const Ct = () => import("./block-styles.69ca115c.js").then((e) => e.default).catch((e) => {
422
+ throw console.error(
423
+ "Error while attempting to dynamically import component BlockStyles at ./render-block/block-styles.vue",
424
+ e
425
+ ), e;
426
+ }), wt = () => import("./render-block.0f23cd7e.js").then((e) => e.default).catch((e) => {
427
+ throw console.error(
428
+ "Error while attempting to dynamically import component RenderBlock at ./render-block/render-block.vue",
429
+ e
430
+ ), e;
431
+ }), $t = g({
432
+ name: "render-blocks",
433
+ components: { RenderBlock: wt, BlockStyles: Ct },
434
+ props: ["blocks", "parent", "path", "styleProp"],
435
+ inject: {
436
+ builderContext: E.key
437
+ },
438
+ computed: {
439
+ className() {
440
+ var e;
441
+ return "builder-blocks" + ((e = this.blocks) != null && e.length ? "" : " no-blocks");
442
+ }
443
+ },
444
+ methods: {
445
+ onClick() {
446
+ var e, t;
447
+ $() && !((e = this.blocks) != null && e.length) && ((t = window.parent) == null || t.postMessage(
448
+ {
449
+ type: "builder.clickEmptyBlocks",
450
+ data: {
451
+ parentElementId: this.parent,
452
+ dataPath: this.path
453
+ }
454
+ },
455
+ "*"
456
+ ));
457
+ },
458
+ onMouseEnter() {
459
+ var e, t;
460
+ $() && !((e = this.blocks) != null && e.length) && ((t = window.parent) == null || t.postMessage(
461
+ {
462
+ type: "builder.hoverEmptyBlocks",
463
+ data: {
464
+ parentElementId: this.parent,
465
+ dataPath: this.path
466
+ }
467
+ },
468
+ "*"
469
+ ));
470
+ },
471
+ _classStringToObject(e) {
472
+ const t = {};
473
+ if (typeof e != "string")
474
+ return t;
475
+ const n = e.trim().split(/\s+/);
476
+ for (const r of n)
477
+ t[r] = !0;
478
+ return t;
479
+ }
480
+ }
481
+ });
482
+ var Tt = function() {
483
+ var t = this, n = t._self._c;
484
+ return t._self._setupProxy, n("div", { class: t._classStringToObject(t.className + " div-21azgz5avex"), style: t.styleProp, attrs: { "builder-path": t.path, "builder-parent-id": t.parent, dataSet: {
485
+ class: t.className
486
+ } }, on: { click: function(r) {
487
+ return t.onClick();
488
+ }, mouseenter: function(r) {
489
+ return t.onMouseEnter();
490
+ } } }, [t.blocks ? t._l(t.blocks, function(r, o) {
491
+ return n("render-block", { key: "render-block-" + r.id, attrs: { block: r, context: t.builderContext } });
492
+ }) : t._e(), t.blocks ? t._l(t.blocks, function(r, o) {
493
+ return n("block-styles", { key: "block-style-" + r.id, attrs: { block: r, context: t.builderContext } });
494
+ }) : t._e()], 2);
495
+ }, Rt = [], It = /* @__PURE__ */ y(
496
+ $t,
497
+ Tt,
498
+ Rt,
499
+ !1,
500
+ null,
501
+ "23bbd49b",
502
+ null,
503
+ null
504
+ );
505
+ const At = It.exports, Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
506
+ __proto__: null,
507
+ default: At
508
+ }, Symbol.toStringTag, { value: "Module" })), Ot = g({
509
+ name: "builder-section-component",
510
+ props: ["maxWidth", "attributes"],
511
+ methods: {
512
+ filterAttrs: function(t = {}, n) {
513
+ const r = "v-on:";
514
+ return Object.keys(t).filter((o) => {
515
+ if (!t[o])
516
+ return !1;
517
+ const s = o.startsWith(r);
518
+ return n ? s : !s;
519
+ }).reduce(
520
+ (o, s) => ({
521
+ ...o,
522
+ [s.replace(r, "")]: t[s]
523
+ }),
524
+ {}
525
+ );
526
+ }
527
+ }
528
+ });
529
+ var Vt = function() {
530
+ var t = this, n = t._self._c;
531
+ return t._self._setupProxy, n("section", t._g(t._b({ style: {
532
+ width: "100%",
533
+ alignSelf: "stretch",
534
+ flexGrow: 1,
535
+ boxSizing: "border-box",
536
+ maxWidth: t.maxWidth || 1200,
537
+ display: "flex",
538
+ flexDirection: "column",
539
+ alignItems: "stretch",
540
+ marginLeft: "auto",
541
+ marginRight: "auto"
542
+ } }, "section", t.filterAttrs(t.attributes, !1), !1), t.filterAttrs(t.attributes, !0)), [t._t("default")], 2);
543
+ }, Pt = [], jt = /* @__PURE__ */ y(
544
+ Ot,
545
+ Vt,
546
+ Pt,
547
+ !1,
548
+ null,
549
+ null,
550
+ null,
551
+ null
552
+ );
553
+ const Qe = jt.exports, x = "[Builder.io]: ", v = {
554
+ log: (...e) => console.log(x, ...e),
555
+ error: (...e) => console.error(x, ...e),
556
+ warn: (...e) => console.warn(x, ...e),
557
+ debug: (...e) => console.debug(x, ...e)
558
+ }, k = (e) => e != null, Bt = (e) => {
559
+ if (e === "localhost" || e === "127.0.0.1")
560
+ return e;
561
+ const t = e.split(".");
562
+ return t.length > 2 ? t.slice(1).join(".") : e;
563
+ }, U = ({
564
+ name: e,
565
+ canTrack: t
566
+ }) => {
567
+ var n;
568
+ try {
569
+ return t ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
570
+ } catch (r) {
571
+ v.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
572
+ return;
573
+ }
574
+ }, W = async (e) => U(e), Nt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(k).join("; "), Ft = [
575
+ ["secure", ""],
576
+ ["SameSite", "None"]
577
+ ], Mt = ({
578
+ name: e,
579
+ value: t,
580
+ expires: n
581
+ }) => {
582
+ const o = (h() ? location.protocol === "https:" : !0) ? Ft : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], i = [
583
+ [e, t],
584
+ ...s,
585
+ ["path", "/"],
586
+ ["domain", Bt(window.location.hostname)],
587
+ ...o
588
+ ];
589
+ return Nt(i);
590
+ }, L = async ({
591
+ name: e,
592
+ value: t,
593
+ expires: n,
594
+ canTrack: r
595
+ }) => {
596
+ try {
597
+ if (!r)
598
+ return;
599
+ const o = Mt({ name: e, value: t, expires: n });
600
+ document.cookie = o;
601
+ } catch (o) {
602
+ v.warn("[COOKIE] SET error: ", (o == null ? void 0 : o.message) || o);
603
+ }
604
+ }, Ut = "builder.tests", O = (e) => `${Ut}.${e}`, Wt = ({ contentId: e }) => W({ name: O(e), canTrack: !0 }), Lt = ({ contentId: e }) => U({ name: O(e), canTrack: !0 }), zt = ({
605
+ contentId: e,
606
+ value: t
607
+ }) => L({ name: O(e), value: t, canTrack: !0 }), z = (e) => k(e.id) && k(e.variations) && Object.keys(e.variations).length > 0, Kt = ({
608
+ id: e,
609
+ variations: t
610
+ }) => {
611
+ var o;
612
+ let n = 0;
613
+ const r = Math.random();
614
+ for (const s in t) {
615
+ const i = (o = t[s]) == null ? void 0 : o.testRatio;
616
+ if (n += i, r < n)
617
+ return s;
618
+ }
619
+ return e;
620
+ }, K = (e) => {
621
+ const t = Kt(e);
622
+ return zt({
623
+ contentId: e.id,
624
+ value: t
625
+ }).catch((n) => {
626
+ v.error("could not store A/B test variation: ", n);
627
+ }), t;
628
+ }, G = ({
629
+ item: e,
630
+ testGroupId: t
631
+ }) => {
632
+ const n = e.variations[t];
633
+ return t === e.id || !n ? {
634
+ testVariationId: e.id,
635
+ testVariationName: "Default"
636
+ } : {
637
+ data: n.data,
638
+ testVariationId: n.id,
639
+ testVariationName: n.name || (n.id === e.id ? "Default" : "")
640
+ };
641
+ }, Gt = ({
642
+ item: e,
643
+ canTrack: t
644
+ }) => {
645
+ if (!t)
646
+ return e;
647
+ if (!e)
648
+ return;
649
+ if (!z(e))
650
+ return e;
651
+ const n = Lt({
652
+ contentId: e.id
653
+ }) || K({
654
+ variations: e.variations,
655
+ id: e.id
656
+ }), r = G({ item: e, testGroupId: n });
657
+ return {
658
+ ...e,
659
+ ...r
660
+ };
661
+ }, Dt = async ({
662
+ item: e,
663
+ canTrack: t
664
+ }) => {
665
+ if (!t || !z(e))
666
+ return e;
667
+ const r = await Wt({
668
+ contentId: e.id
669
+ }) || K({
670
+ variations: e.variations,
671
+ id: e.id
672
+ }), o = G({ item: e, testGroupId: r });
673
+ return {
674
+ ...e,
675
+ ...o
676
+ };
677
+ }, C = (e) => k(e) ? e : !0;
678
+ function Ht() {
679
+ return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
680
+ }
681
+ function qt() {
682
+ const e = Ht().fetch;
683
+ if (typeof e > "u")
684
+ throw console.warn(
685
+ `Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
686
+ For more information, read https://github.com/BuilderIO/this-package-uses-fetch`
687
+ ), new Error("Builder SDK could not find a global `fetch` function");
688
+ return e;
689
+ }
690
+ const Jt = qt();
691
+ function I(e, t = null, n = ".") {
692
+ return Object.keys(e).reduce((r, o) => {
693
+ const s = e[o], i = [t, o].filter(Boolean).join(n);
694
+ return [
695
+ typeof s == "object",
696
+ s !== null,
697
+ !(Array.isArray(s) && s.length === 0)
698
+ ].every(Boolean) ? { ...r, ...I(s, i, n) } : { ...r, [i]: s };
699
+ }, {});
700
+ }
701
+ const P = "builder.", Xt = "options.", Qt = (e) => {
702
+ const t = {};
703
+ return e.forEach((n, r) => {
704
+ t[r] = n;
705
+ }), t;
706
+ }, Yt = (e) => {
707
+ if (!e)
708
+ return {};
709
+ const t = D(e), n = {};
710
+ return Object.keys(t).forEach((r) => {
711
+ if (r.startsWith(P)) {
712
+ const o = r.replace(P, "").replace(Xt, "");
713
+ n[o] = t[r];
714
+ }
715
+ }), n;
716
+ }, Zt = () => {
717
+ if (!h())
718
+ return {};
719
+ const e = new URLSearchParams(window.location.search);
720
+ return Yt(e);
721
+ }, D = (e) => e instanceof URLSearchParams ? Qt(e) : e, te = "v3", H = (e) => {
722
+ const {
723
+ limit: t = 30,
724
+ userAttributes: n,
725
+ query: r,
726
+ noTraverse: o = !1,
727
+ model: s,
728
+ apiKey: i,
729
+ includeRefs: u = !0,
730
+ enrich: a,
731
+ locale: c,
732
+ apiVersion: b = te
733
+ } = e;
734
+ if (!i)
735
+ throw new Error("Missing API key");
736
+ if (!["v2", "v3"].includes(b))
737
+ throw new Error(
738
+ `Invalid apiVersion: expected 'v2' or 'v3', received '${b}'`
739
+ );
740
+ const f = new URL(
741
+ `https://cdn.builder.io/api/${b}/content/${s}?apiKey=${i}&limit=${t}&noTraverse=${o}&includeRefs=${u}${c ? `&locale=${c}` : ""}${a ? `&enrich=${a}` : ""}`
742
+ ), l = {
743
+ ...Zt(),
744
+ ...D(e.options || {})
745
+ }, m = I(l);
746
+ for (const d in m)
747
+ f.searchParams.set(d, String(m[d]));
748
+ if (n && f.searchParams.set("userAttributes", JSON.stringify(n)), r) {
749
+ const d = I({ query: r });
750
+ for (const _ in d)
751
+ f.searchParams.set(_, JSON.stringify(d[_]));
752
+ }
753
+ return f;
754
+ }, q = (e) => "results" in e;
755
+ async function ee(e) {
756
+ const t = await oe({ ...e, limit: 1 });
757
+ return t && q(t) && t.results[0] || null;
758
+ }
759
+ const ne = async (e) => {
760
+ const t = H(e);
761
+ return await (await Jt(t.href)).json();
762
+ }, re = async (e, t) => {
763
+ const n = C(e.canTrack);
764
+ if (!n || !(h() || T === "reactNative"))
765
+ return t;
766
+ try {
767
+ const r = [];
768
+ for (const o of t.results)
769
+ r.push(await Dt({ item: o, canTrack: n }));
770
+ t.results = r;
771
+ } catch (r) {
772
+ v.error("Could not process A/B tests. ", r);
773
+ }
774
+ return t;
775
+ };
776
+ async function oe(e) {
777
+ try {
778
+ const t = H(e), n = await ne(e);
779
+ return q(n) ? re(e, n) : (v.error("Error fetching data. ", { url: t, content: n, options: e }), n);
780
+ } catch (t) {
781
+ return v.error("Error fetching data. ", t), null;
782
+ }
783
+ }
784
+ const se = () => import("./render-content.672eabd9.js").then((e) => e.default).catch((e) => {
785
+ throw console.error(
786
+ "Error while attempting to dynamically import component RenderContent at ../../components/render-content/render-content.vue",
787
+ e
788
+ ), e;
789
+ }), ie = g({
790
+ name: "builder-symbol",
791
+ components: { RenderContent: se },
792
+ props: ["attributes", "symbol", "dynamic"],
793
+ data() {
794
+ var e, t, n;
795
+ return {
796
+ className: [
797
+ ...Object.keys(this.attributes.class),
798
+ "builder-symbol",
799
+ (e = this.symbol) != null && e.inline ? "builder-inline-symbol" : void 0,
800
+ ((t = this.symbol) == null ? void 0 : t.dynamic) || this.dynamic ? "builder-dynamic-symbol" : void 0
801
+ ].filter(Boolean).join(" "),
802
+ contentToUse: (n = this.symbol) == null ? void 0 : n.content
803
+ };
804
+ },
805
+ inject: {
806
+ builderContext: E.key
807
+ },
808
+ mounted() {
809
+ this.fetchContent();
810
+ },
811
+ watch: {
812
+ onUpdateHook0: {
813
+ handler() {
814
+ this.fetchContent();
815
+ },
816
+ immediate: !0
817
+ }
818
+ },
819
+ computed: {
820
+ onUpdateHook0() {
821
+ return {
822
+ 0: this.symbol
823
+ };
824
+ }
825
+ },
826
+ methods: {
827
+ fetchContent() {
828
+ var e, t;
829
+ !this.contentToUse && ((e = this.symbol) == null ? void 0 : e.model) && ((t = this.builderContext) == null ? void 0 : t.apiKey) && ee({
830
+ model: this.symbol.model,
831
+ apiKey: this.builderContext.apiKey,
832
+ apiVersion: this.builderContext.apiVersion,
833
+ query: {
834
+ id: this.symbol.entry
835
+ }
836
+ }).then((n) => {
837
+ n && (this.contentToUse = n);
838
+ }).catch((n) => {
839
+ v.error("Could not fetch symbol content: ", n);
840
+ });
841
+ },
842
+ filterAttrs: function(t = {}, n) {
843
+ const r = "v-on:";
844
+ return Object.keys(t).filter((o) => {
845
+ if (!t[o])
846
+ return !1;
847
+ const s = o.startsWith(r);
848
+ return n ? s : !s;
849
+ }).reduce(
850
+ (o, s) => ({
851
+ ...o,
852
+ [s.replace(r, "")]: t[s]
853
+ }),
854
+ {}
855
+ );
856
+ },
857
+ _classStringToObject(e) {
858
+ const t = {};
859
+ if (typeof e != "string")
860
+ return t;
861
+ const n = e.trim().split(/\s+/);
862
+ for (const r of n)
863
+ t[r] = !0;
864
+ return t;
865
+ }
866
+ }
867
+ });
868
+ var ae = function() {
869
+ var r, o, s, i;
870
+ var t = this, n = t._self._c;
871
+ return t._self._setupProxy, n("div", t._g(t._b({ class: t._classStringToObject(t.className), attrs: { dataSet: {
872
+ class: t.className
873
+ } } }, "div", t.filterAttrs(t.attributes, !1), !1), t.filterAttrs(t.attributes, !0)), [n("render-content", { attrs: { apiVersion: t.builderContext.apiVersion, apiKey: t.builderContext.apiKey, context: t.builderContext.context, customComponents: Object.values(t.builderContext.registeredComponents), data: {
874
+ ...(r = t.symbol) == null ? void 0 : r.data,
875
+ ...t.builderContext.localState,
876
+ ...(s = (o = t.contentToUse) == null ? void 0 : o.data) == null ? void 0 : s.state
877
+ }, model: (i = t.symbol) == null ? void 0 : i.model, content: t.contentToUse } })], 1);
878
+ }, ce = [], le = /* @__PURE__ */ y(
879
+ ie,
880
+ ae,
881
+ ce,
882
+ !1,
883
+ null,
884
+ null,
885
+ null,
886
+ null
887
+ );
888
+ const Ye = le.exports, ue = g({
889
+ name: "builder-text",
890
+ props: ["text"]
891
+ });
892
+ var de = function() {
893
+ var t = this, n = t._self._c;
894
+ return t._self._setupProxy, n("span", { staticClass: "builder-text", style: {
895
+ outline: "none"
896
+ }, domProps: { innerHTML: t._s(t.text) } });
897
+ }, fe = [], me = /* @__PURE__ */ y(
898
+ ue,
899
+ de,
900
+ fe,
901
+ !1,
902
+ null,
903
+ null,
904
+ null,
905
+ null
906
+ );
907
+ const Ze = me.exports, pe = g({
908
+ name: "builder-video",
909
+ props: [
910
+ "autoPlay",
911
+ "muted",
912
+ "controls",
913
+ "loop",
914
+ "playsInline",
915
+ "attributes",
916
+ "fit",
917
+ "position",
918
+ "video",
919
+ "posterImage"
920
+ ],
921
+ computed: {
922
+ videoProps() {
923
+ return {
924
+ ...this.autoPlay === !0 ? {
925
+ autoPlay: !0
926
+ } : {},
927
+ ...this.muted === !0 ? {
928
+ muted: !0
929
+ } : {},
930
+ ...this.controls === !0 ? {
931
+ controls: !0
932
+ } : {},
933
+ ...this.loop === !0 ? {
934
+ loop: !0
935
+ } : {},
936
+ ...this.playsInline === !0 ? {
937
+ playsInline: !0
938
+ } : {}
939
+ };
940
+ },
941
+ spreadProps() {
942
+ return {
943
+ ...this.attributes,
944
+ ...this.videoProps
945
+ };
946
+ }
947
+ }
948
+ });
949
+ var he = function() {
950
+ var r;
951
+ var t = this, n = t._self._c;
952
+ return t._self._setupProxy, n("video", t._b({ style: {
953
+ width: "100%",
954
+ height: "100%",
955
+ ...(r = t.attributes) == null ? void 0 : r.style,
956
+ objectFit: t.fit,
957
+ objectPosition: t.position,
958
+ borderRadius: 1
959
+ }, attrs: { src: t.video || "no-src", poster: t.posterImage } }, "video", t.spreadProps, !1));
960
+ }, be = [], _e = /* @__PURE__ */ y(
961
+ pe,
962
+ he,
963
+ be,
964
+ !1,
965
+ null,
966
+ null,
967
+ null,
968
+ null
969
+ );
970
+ const tn = _e.exports, w = (e) => Object.values((e == null ? void 0 : e.variations) || {}), j = ({
971
+ canTrack: e,
972
+ content: t
973
+ }) => !(!(w(t).length > 0) || !e || h());
974
+ function ge(e, t, n) {
975
+ function r() {
976
+ function i(m, d, _) {
977
+ let S = "";
978
+ if (_) {
979
+ const p = new Date();
980
+ p.setTime(p.getTime() + _ * 24 * 60 * 60 * 1e3), S = "; expires=" + p.toUTCString();
981
+ }
982
+ document.cookie = m + "=" + (d || "") + S + "; path=/; Secure; SameSite=None";
983
+ }
984
+ function u(m) {
985
+ const d = m + "=", _ = document.cookie.split(";");
986
+ for (let S = 0; S < _.length; S++) {
987
+ let p = _[S];
988
+ for (; p.charAt(0) === " "; )
989
+ p = p.substring(1, p.length);
990
+ if (p.indexOf(d) === 0)
991
+ return p.substring(d.length, p.length);
992
+ }
993
+ return null;
994
+ }
995
+ const a = `builder.tests.${e}`, c = u(a), b = t.map((m) => m.id).concat(e);
996
+ if (c && b.includes(c))
997
+ return c;
998
+ let f = 0;
999
+ const l = Math.random();
1000
+ for (let m = 0; m < t.length; m++) {
1001
+ const d = t[m], _ = d.testRatio;
1002
+ if (f += _, l < f)
1003
+ return i(a, d.id), d.id;
1004
+ }
1005
+ return i(a, e), e;
1006
+ }
1007
+ const o = r(), s = document.getElementById(
1008
+ `variants-styles-${e}`
1009
+ );
1010
+ if (n) {
1011
+ s.remove();
1012
+ const i = document.getElementById(
1013
+ `variants-script-${e}`
1014
+ );
1015
+ i == null || i.remove();
1016
+ } else {
1017
+ const i = t.concat({ id: e }).filter((u) => u.id !== o).map((u) => `.variant-${u.id} { display: none; }
1018
+ `).join("");
1019
+ s.innerHTML = i;
1020
+ }
1021
+ }
1022
+ function ye(e, t, n) {
1023
+ if (!navigator.cookieEnabled)
1024
+ return;
1025
+ function r(a) {
1026
+ const c = a + "=", b = document.cookie.split(";");
1027
+ for (let f = 0; f < b.length; f++) {
1028
+ let l = b[f];
1029
+ for (; l.charAt(0) === " "; )
1030
+ l = l.substring(1, l.length);
1031
+ if (l.indexOf(c) === 0)
1032
+ return l.substring(c.length, l.length);
1033
+ }
1034
+ return null;
1035
+ }
1036
+ const o = `builder.tests.${t}`, s = r(o), i = document.querySelector(
1037
+ `[builder-content-id="${e}"]`
1038
+ ), u = e === t;
1039
+ if (s === e) {
1040
+ if (u)
1041
+ return;
1042
+ i == null || i.removeAttribute("hidden"), i == null || i.removeAttribute("aria-hidden");
1043
+ } else {
1044
+ u && (n ? i == null || i.remove() : (i == null || i.setAttribute("hidden", "true"), i == null || i.setAttribute("aria-hidden", "true")));
1045
+ return;
1046
+ }
1047
+ }
1048
+ const J = (e) => e === "react" || e === "reactNative" || e === "vue3" || e === "vue2", B = "bldrAbTest", X = "bldrCntntScrpt", ve = (e, t) => {
1049
+ const n = ge.toString().replace(/\s+/g, " "), r = ye.toString().replace(/\s+/g, " ");
1050
+ return `
1051
+ const ${B} = ${n}
1052
+ const ${X} = ${r}
1053
+ ${B}("${t}", ${JSON.stringify(
1054
+ e
1055
+ )}, ${J})
1056
+ `;
1057
+ }, en = ({
1058
+ parentContentId: e,
1059
+ contentId: t
1060
+ }) => `
1061
+ ${X}("${t}", "${e}", ${J})`, Se = () => import("./render-content.672eabd9.js").then((e) => e.default).catch((e) => {
1062
+ throw console.error(
1063
+ "Error while attempting to dynamically import component RenderContent at ../render-content/render-content.vue",
1064
+ e
1065
+ ), e;
1066
+ }), ke = () => import("./render-inlined-styles.ac06208e.js").then((e) => e.default).catch((e) => {
1067
+ throw console.error(
1068
+ "Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",
1069
+ e
1070
+ ), e;
1071
+ }), xe = g({
1072
+ name: "render-content-variants",
1073
+ components: {
1074
+ RenderInlinedStyles: ke,
1075
+ RenderContent: Se
1076
+ },
1077
+ props: [
1078
+ "content",
1079
+ "canTrack",
1080
+ "apiKey",
1081
+ "apiVersion",
1082
+ "customComponents",
1083
+ "model"
1084
+ ],
1085
+ data() {
1086
+ var e;
1087
+ return {
1088
+ variantScriptStr: ve(
1089
+ w(this.content).map((t) => ({
1090
+ id: t.id,
1091
+ testRatio: t.testRatio
1092
+ })),
1093
+ ((e = this.content) == null ? void 0 : e.id) || ""
1094
+ ),
1095
+ shouldRenderVariants: j({
1096
+ canTrack: C(this.canTrack),
1097
+ content: this.content
1098
+ }),
1099
+ hideVariantsStyleString: w(this.content).map((t) => `.variant-${t.id} { display: none; } `).join(""),
1100
+ contentToRender: j({
1101
+ canTrack: C(this.canTrack),
1102
+ content: this.content
1103
+ }) ? this.content : Gt({
1104
+ item: this.content,
1105
+ canTrack: C(this.canTrack)
1106
+ }),
1107
+ getVariants: w
1108
+ };
1109
+ }
1110
+ });
1111
+ var Ce = function() {
1112
+ var r, o, s, i;
1113
+ var t = this, n = t._self._c;
1114
+ return t._self._setupProxy, n("div", [t.shouldRenderVariants ? [n("render-inlined-styles", { attrs: { id: `variants-styles-${(r = t.content) == null ? void 0 : r.id}`, styles: t.hideVariantsStyleString } }), n("script", { tag: "component", attrs: { id: `variants-script-${(o = t.content) == null ? void 0 : o.id}` }, domProps: { innerHTML: t._s(t.variantScriptStr) } }), t._l(t.getVariants(t.content), function(u, a) {
1115
+ var c;
1116
+ return n("render-content", { key: u.id, attrs: { content: u, apiKey: t.apiKey, apiVersion: t.apiVersion, canTrack: t.canTrack, customComponents: t.customComponents, hideContent: !0, parentContentId: (c = t.content) == null ? void 0 : c.id, isSsrAbTest: t.shouldRenderVariants } });
1117
+ })] : t._e(), n("render-content", { attrs: { model: t.model, content: t.contentToRender, apiKey: t.apiKey, apiVersion: t.apiVersion, canTrack: t.canTrack, customComponents: t.customComponents, classNameProp: `variant-${(s = t.content) == null ? void 0 : s.id}`, parentContentId: (i = t.content) == null ? void 0 : i.id, isSsrAbTest: t.shouldRenderVariants } })], 2);
1118
+ }, we = [], $e = /* @__PURE__ */ y(
1119
+ xe,
1120
+ Ce,
1121
+ we,
1122
+ !1,
1123
+ null,
1124
+ null,
1125
+ null,
1126
+ null
1127
+ );
1128
+ const nn = $e.exports;
1129
+ function rn() {
1130
+ return !h() || $() ? !1 : Boolean(location.search.indexOf("builder.preview=") !== -1);
1131
+ }
1132
+ const Te = (e) => {
1133
+ const t = e.toString().trim();
1134
+ return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1135
+ }, on = [], sn = ({
1136
+ component: e,
1137
+ ...t
1138
+ }) => ({
1139
+ type: "builder.registerComponent",
1140
+ data: Ie(t)
1141
+ }), Re = (e) => typeof e == "function" ? Te(e) : A(e), Ie = ({
1142
+ inputs: e,
1143
+ ...t
1144
+ }) => ({
1145
+ ...A(t),
1146
+ inputs: e == null ? void 0 : e.map(
1147
+ (n) => Object.entries(n).reduce(
1148
+ (r, [o, s]) => ({
1149
+ ...r,
1150
+ [o]: Re(s)
1151
+ }),
1152
+ {}
1153
+ )
1154
+ )
1155
+ }), N = {};
1156
+ function an(e, t) {
1157
+ let n = N[e];
1158
+ if (n || (n = N[e] = []), n.push(t), h()) {
1159
+ const r = {
1160
+ type: "builder.register",
1161
+ data: {
1162
+ type: e,
1163
+ info: t
1164
+ }
1165
+ };
1166
+ try {
1167
+ parent.postMessage(r, "*"), parent !== window && window.postMessage(r, "*");
1168
+ } catch (o) {
1169
+ console.debug("Could not postmessage", o);
1170
+ }
1171
+ }
1172
+ }
1173
+ const F = {};
1174
+ function cn(e) {
1175
+ if (h()) {
1176
+ Object.assign(F, e);
1177
+ const t = {
1178
+ type: "builder.settingsChange",
1179
+ data: F
1180
+ };
1181
+ parent.postMessage(t, "*");
1182
+ }
1183
+ }
1184
+ function Ae() {
1185
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1186
+ const t = Math.random() * 16 | 0;
1187
+ return (e == "x" ? t : t & 3 | 8).toString(16);
1188
+ });
1189
+ }
1190
+ function Q() {
1191
+ return Ae().replace(/-/g, "");
1192
+ }
1193
+ const Y = "builderSessionId", Ee = async ({
1194
+ canTrack: e
1195
+ }) => {
1196
+ if (!e)
1197
+ return;
1198
+ const t = await W({
1199
+ name: Y,
1200
+ canTrack: e
1201
+ });
1202
+ if (k(t))
1203
+ return t;
1204
+ {
1205
+ const n = Oe();
1206
+ return Ve({ id: n, canTrack: e }), n;
1207
+ }
1208
+ }, Oe = () => Q(), Ve = ({
1209
+ id: e,
1210
+ canTrack: t
1211
+ }) => L({ name: Y, value: e, canTrack: t }), Z = () => h() && typeof localStorage < "u" ? localStorage : void 0, Pe = ({
1212
+ key: e,
1213
+ canTrack: t
1214
+ }) => {
1215
+ var n;
1216
+ try {
1217
+ return t ? (n = Z()) == null ? void 0 : n.getItem(e) : void 0;
1218
+ } catch (r) {
1219
+ console.debug("[LocalStorage] GET error: ", r);
1220
+ return;
1221
+ }
1222
+ }, je = ({
1223
+ key: e,
1224
+ canTrack: t,
1225
+ value: n
1226
+ }) => {
1227
+ var r;
1228
+ try {
1229
+ t && ((r = Z()) == null || r.setItem(e, n));
1230
+ } catch (o) {
1231
+ console.debug("[LocalStorage] SET error: ", o);
1232
+ }
1233
+ }, tt = "builderVisitorId", Be = ({ canTrack: e }) => {
1234
+ if (!e)
1235
+ return;
1236
+ const t = Pe({
1237
+ key: tt,
1238
+ canTrack: e
1239
+ });
1240
+ if (k(t))
1241
+ return t;
1242
+ {
1243
+ const n = Ne();
1244
+ return Fe({ id: n, canTrack: e }), n;
1245
+ }
1246
+ }, Ne = () => Q(), Fe = ({
1247
+ id: e,
1248
+ canTrack: t
1249
+ }) => je({
1250
+ key: tt,
1251
+ value: e,
1252
+ canTrack: t
1253
+ }), Me = () => {
1254
+ if (h()) {
1255
+ const e = new URL(location.href);
1256
+ return e.pathname === "" && (e.pathname = "/"), e;
1257
+ } else
1258
+ return console.warn("Cannot get location for tracking in non-browser environment"), null;
1259
+ }, Ue = () => typeof navigator == "object" && navigator.userAgent || "", We = () => {
1260
+ const e = Ue(), t = {
1261
+ Android() {
1262
+ return e.match(/Android/i);
1263
+ },
1264
+ BlackBerry() {
1265
+ return e.match(/BlackBerry/i);
1266
+ },
1267
+ iOS() {
1268
+ return e.match(/iPhone|iPod/i);
1269
+ },
1270
+ Opera() {
1271
+ return e.match(/Opera Mini/i);
1272
+ },
1273
+ Windows() {
1274
+ return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
1275
+ },
1276
+ any() {
1277
+ return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || T === "reactNative";
1278
+ }
1279
+ }, n = e.match(/Tablet|iPad/i), r = Me();
1280
+ return {
1281
+ urlPath: r == null ? void 0 : r.pathname,
1282
+ host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
1283
+ device: n ? "tablet" : t.any() ? "mobile" : "desktop"
1284
+ };
1285
+ }, Le = async ({
1286
+ canTrack: e
1287
+ }) => {
1288
+ if (!e)
1289
+ return { visitorId: void 0, sessionId: void 0 };
1290
+ const t = await Ee({ canTrack: e }), n = Be({ canTrack: e });
1291
+ return {
1292
+ sessionId: t,
1293
+ visitorId: n
1294
+ };
1295
+ }, ze = async ({
1296
+ type: e,
1297
+ canTrack: t,
1298
+ apiKey: n,
1299
+ metadata: r,
1300
+ ...o
1301
+ }) => ({
1302
+ type: e,
1303
+ data: {
1304
+ ...o,
1305
+ metadata: {
1306
+ url: location.href,
1307
+ ...r
1308
+ },
1309
+ ...await Le({ canTrack: t }),
1310
+ userAttributes: We(),
1311
+ ownerId: n
1312
+ }
1313
+ });
1314
+ async function Ke(e) {
1315
+ if (!e.apiKey) {
1316
+ v.error(
1317
+ "Missing API key for track call. Please provide your API key."
1318
+ );
1319
+ return;
1320
+ }
1321
+ if (!!e.canTrack && !$() && !!(h() || T === "reactNative"))
1322
+ return fetch("https://builder.io/api/v1/track", {
1323
+ method: "POST",
1324
+ body: JSON.stringify({
1325
+ events: [await ze(e)]
1326
+ }),
1327
+ headers: {
1328
+ "content-type": "application/json"
1329
+ },
1330
+ mode: "cors"
1331
+ }).catch((t) => {
1332
+ console.error("Failed to track: ", t);
1333
+ });
1334
+ }
1335
+ const ln = (e) => Ke({ ...e, canTrack: !0 });
1336
+ export {
1337
+ Et as A,
1338
+ De as B,
1339
+ qe as C,
1340
+ Je as F,
1341
+ Xe as I,
1342
+ Qe as S,
1343
+ T,
1344
+ tn as V,
1345
+ Ke as _,
1346
+ He as a,
1347
+ h as b,
1348
+ k as c,
1349
+ Ye as d,
1350
+ Ze as e,
1351
+ A as f,
1352
+ st as g,
1353
+ on as h,
1354
+ $ as i,
1355
+ en as j,
1356
+ E as k,
1357
+ v as l,
1358
+ sn as m,
1359
+ y as n,
1360
+ rn as o,
1361
+ ee as p,
1362
+ Jt as q,
1363
+ an as r,
1364
+ Te as s,
1365
+ cn as t,
1366
+ oe as u,
1367
+ re as v,
1368
+ Yt as w,
1369
+ ln as x,
1370
+ At as y,
1371
+ nn as z
1372
+ };