@builder.io/sdk-vue 0.4.5 → 0.5.0

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 (232) hide show
  1. package/package.json +1 -1
  2. package/packages/_vue2/dist/block-styles.6a14fec4.cjs +1 -0
  3. package/packages/_vue2/dist/block-styles.982735c2.js +77 -0
  4. package/packages/_vue2/dist/block-wrapper.701626ff.cjs +1 -0
  5. package/packages/_vue2/dist/block-wrapper.fbaeab1b.js +66 -0
  6. package/packages/_vue2/dist/block.a18a495f.cjs +3 -0
  7. package/packages/_vue2/dist/block.e9484073.js +178 -0
  8. package/packages/_vue2/dist/blocks-wrapper.4afaccc5.js +72 -0
  9. package/packages/_vue2/dist/blocks-wrapper.e0086c60.cjs +1 -0
  10. package/packages/_vue2/dist/builder.context.29ec27bd.js +18 -0
  11. package/packages/_vue2/dist/builder.context.e22f06a0.cjs +1 -0
  12. package/packages/_vue2/dist/component-ref.8772e5f7.cjs +1 -0
  13. package/packages/_vue2/dist/component-ref.ad8ecffe.js +98 -0
  14. package/packages/_vue2/dist/content.697b2fbd.js +905 -0
  15. package/packages/_vue2/dist/content.fb93079e.cjs +1 -0
  16. package/packages/_vue2/dist/css.1aff1efe.js +21 -0
  17. package/packages/_vue2/dist/css.daac46ac.cjs +6 -0
  18. package/packages/_vue2/dist/enable-editor.12c3716b.cjs +1 -0
  19. package/packages/_vue2/dist/enable-editor.8d1c24b0.js +428 -0
  20. package/packages/_vue2/dist/evaluate.b0496c3f.js +4970 -0
  21. package/packages/_vue2/dist/evaluate.d1bef2c5.cjs +31 -0
  22. package/packages/_vue2/dist/get-block-actions.88b6dbbf.cjs +1 -0
  23. package/packages/_vue2/dist/get-block-actions.a39f0f6b.js +36 -0
  24. package/packages/_vue2/dist/get-block-properties.316bbdf9.js +48 -0
  25. package/packages/_vue2/dist/get-block-properties.3ab4b67f.cjs +1 -0
  26. package/packages/_vue2/dist/get-processed-block.2c6787e1.js +52 -0
  27. package/packages/_vue2/dist/get-processed-block.deb6b33a.cjs +1 -0
  28. package/packages/_vue2/dist/index.051a3d7b.cjs +32 -0
  29. package/packages/_vue2/dist/{index.dcd9672f.js → index.8352d880.js} +484 -517
  30. package/packages/_vue2/dist/inlined-script.874c7b5a.cjs +1 -0
  31. package/packages/_vue2/dist/{inlined-script.5b4b5fc3.js → inlined-script.b4595308.js} +1 -1
  32. package/packages/_vue2/dist/{inlined-styles.9ddda3d7.cjs → inlined-styles.d8b2af39.cjs} +1 -1
  33. package/packages/_vue2/dist/{inlined-styles.759d26e8.js → inlined-styles.dd4a079a.js} +1 -1
  34. package/packages/_vue2/dist/interactive-element.12db10c4.cjs +1 -0
  35. package/packages/_vue2/dist/interactive-element.e2f7ca88.js +42 -0
  36. package/packages/_vue2/dist/repeated-block.0343c63e.cjs +1 -0
  37. package/packages/_vue2/dist/repeated-block.c74334c2.js +39 -0
  38. package/packages/_vue2/dist/sdk.cjs +1 -1
  39. package/packages/_vue2/dist/sdk.js +11 -11
  40. package/packages/_vue2/dist/src/blocks/button/button.vue.d.ts +9 -18
  41. package/packages/_vue2/dist/src/blocks/button/component-info.d.ts +1 -1
  42. package/packages/_vue2/dist/src/blocks/columns/columns.vue.d.ts +7 -6
  43. package/packages/_vue2/dist/src/blocks/columns/component-info.d.ts +1 -1
  44. package/packages/_vue2/dist/src/blocks/custom-code/component-info.d.ts +1 -1
  45. package/packages/_vue2/dist/src/blocks/embed/component-info.d.ts +1 -1
  46. package/packages/_vue2/dist/src/blocks/embed/embed.vue.d.ts +1 -1
  47. package/packages/_vue2/dist/src/blocks/fragment/component-info.d.ts +1 -1
  48. package/packages/_vue2/dist/src/blocks/helpers.d.ts +13 -0
  49. package/packages/_vue2/dist/src/blocks/image/component-info.d.ts +1 -1
  50. package/packages/_vue2/dist/src/blocks/image/image.vue.d.ts +6 -6
  51. package/packages/_vue2/dist/src/blocks/img/component-info.d.ts +1 -1
  52. package/packages/_vue2/dist/src/blocks/img/img.vue.d.ts +27 -6
  53. package/packages/_vue2/dist/src/blocks/section/component-info.d.ts +1 -1
  54. package/packages/_vue2/dist/src/blocks/section/section.vue.d.ts +9 -6
  55. package/packages/_vue2/dist/src/blocks/symbol/component-info.d.ts +1 -1
  56. package/packages/_vue2/dist/src/blocks/symbol/symbol.helpers.d.ts +14 -0
  57. package/packages/_vue2/dist/src/blocks/symbol/symbol.vue.d.ts +11 -7
  58. package/packages/_vue2/dist/src/blocks/text/component-info.d.ts +1 -1
  59. package/packages/_vue2/dist/src/blocks/video/component-info.d.ts +1 -1
  60. package/packages/_vue2/dist/src/blocks/video/video.vue.d.ts +7 -3
  61. package/packages/_vue2/dist/src/components/block/block.helpers.d.ts +13 -0
  62. package/packages/{_vue3/dist/src/components/render-block/render-block.vue.d.ts → _vue2/dist/src/components/block/block.vue.d.ts} +3 -2
  63. package/packages/_vue2/dist/src/components/{render-block → block/components}/block-styles.vue.d.ts +4 -4
  64. package/packages/_vue2/dist/src/components/block/components/block-wrapper.vue.d.ts +29 -0
  65. package/packages/_vue2/dist/src/components/block/components/component-ref/component-ref.helpers.d.ts +30 -0
  66. package/packages/_vue2/dist/src/components/block/components/component-ref/component-ref.vue.d.ts +2 -0
  67. package/packages/_vue2/dist/src/components/block/components/interactive-element.vue.d.ts +30 -0
  68. package/packages/_vue2/dist/src/components/block/components/repeated-block.vue.d.ts +16 -0
  69. package/packages/_vue2/dist/src/components/{render-blocks.vue.d.ts → blocks/blocks-wrapper.vue.d.ts} +6 -6
  70. package/packages/_vue2/dist/src/components/blocks/blocks.vue.d.ts +29 -0
  71. package/packages/_vue2/dist/src/components/{render-content/render-content.vue.d.ts → content/components/enable-editor.vue.d.ts} +12 -34
  72. package/packages/{_vue3/dist/src/components/render-content/components/render-styles.helpers.d.ts → _vue2/dist/src/components/content/components/styles.helpers.d.ts} +1 -1
  73. package/packages/_vue2/dist/src/components/{render-content/components/render-styles.vue.d.ts → content/components/styles.vue.d.ts} +1 -1
  74. package/packages/_vue2/dist/src/components/content/content.helpers.d.ts +7 -0
  75. package/packages/{_vue3/dist/src/components/render-content/render-content.types.d.ts → _vue2/dist/src/components/content/content.types.d.ts} +4 -4
  76. package/packages/_vue2/dist/src/components/content/content.vue.d.ts +26 -0
  77. package/packages/_vue2/dist/src/components/{render-content-variants/render-content-variants.types.d.ts → content-variants/content-variants.types.d.ts} +5 -5
  78. package/packages/_vue2/dist/src/components/{render-content-variants/render-content-variants.vue.d.ts → content-variants/content-variants.vue.d.ts} +9 -8
  79. package/packages/_vue2/dist/src/components/{render-content-variants → content-variants}/helpers.d.ts +4 -4
  80. package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
  81. package/packages/_vue2/dist/src/constants/target.d.ts +1 -1
  82. package/packages/_vue2/dist/src/context/builder.context.d.ts +1 -1
  83. package/packages/_vue2/dist/src/context/types.d.ts +1 -1
  84. package/packages/_vue2/dist/src/functions/{evaluate.d.ts → evaluate/evaluate.d.ts} +5 -2
  85. package/packages/_vue2/dist/src/functions/evaluate/index.d.ts +1 -0
  86. package/packages/_vue2/dist/src/functions/evaluate/interpreter.d.ts +2 -0
  87. package/packages/_vue2/dist/src/functions/evaluate/non-node-runtime.d.ts +2 -0
  88. package/packages/_vue2/dist/src/functions/evaluate/types.d.ts +10 -0
  89. package/packages/_vue2/dist/src/functions/get-block-actions.d.ts +1 -0
  90. package/packages/_vue2/dist/src/functions/get-block-properties.d.ts +5 -1
  91. package/packages/_vue2/dist/src/functions/get-content/index.d.ts +2 -6
  92. package/packages/_vue2/dist/src/functions/get-processed-block.d.ts +1 -1
  93. package/packages/_vue2/dist/src/functions/get-react-native-block-styles.d.ts +1 -1
  94. package/packages/_vue2/dist/src/functions/is-non-node-server.d.ts +4 -0
  95. package/packages/_vue2/dist/src/functions/register-component.d.ts +2 -1
  96. package/packages/_vue2/dist/src/helpers/ab-tests.d.ts +2 -2
  97. package/packages/_vue2/dist/src/helpers/cookie.d.ts +2 -2
  98. package/packages/_vue2/dist/src/helpers/css.d.ts +1 -1
  99. package/packages/_vue2/dist/src/helpers/localStorage.d.ts +2 -2
  100. package/packages/_vue2/dist/src/helpers/preview-lru-cache/get.d.ts +1 -0
  101. package/packages/_vue2/dist/src/helpers/preview-lru-cache/helpers.d.ts +1 -0
  102. package/packages/_vue2/dist/src/helpers/preview-lru-cache/init.d.ts +6 -0
  103. package/packages/_vue2/dist/src/helpers/preview-lru-cache/set.d.ts +7 -0
  104. package/packages/_vue2/dist/src/helpers/preview-lru-cache/types.d.ts +12 -0
  105. package/packages/_vue2/dist/src/helpers/sessionId.d.ts +2 -2
  106. package/packages/_vue2/dist/src/helpers/visitorId.d.ts +1 -1
  107. package/packages/_vue2/dist/src/index-helpers/blocks-exports.d.ts +2 -2
  108. package/packages/_vue2/dist/src/index.d.ts +2 -2
  109. package/packages/_vue2/dist/src/types/builder-props.d.ts +9 -0
  110. package/packages/_vue2/dist/src/types/components.d.ts +8 -2
  111. package/packages/_vue2/dist/src/types/enforced-partials.d.ts +1 -1
  112. package/packages/_vue2/dist/src/types/targets.d.ts +1 -3
  113. package/packages/_vue2/dist/src/types/typescript.d.ts +3 -0
  114. package/packages/_vue2/dist/style.css +1 -1
  115. package/packages/_vue2/dist/{render-styles.b41f1309.js → styles.367c17da.js} +7 -5
  116. package/packages/_vue2/dist/{render-styles.ba0e223a.cjs → styles.716893e3.cjs} +4 -4
  117. package/packages/_vue3/dist/block-wrapper.0590efed.js +54 -0
  118. package/packages/_vue3/dist/block-wrapper.caa27b4d.cjs +1 -0
  119. package/packages/_vue3/dist/component-ref.7c88b254.cjs +1 -0
  120. package/packages/_vue3/dist/component-ref.9039745a.js +111 -0
  121. package/packages/_vue3/dist/get-block-actions.a8cbb712.cjs +1 -0
  122. package/packages/_vue3/dist/get-block-actions.cc5999ea.js +79 -0
  123. package/packages/_vue3/dist/index.52e5e57e.js +8079 -0
  124. package/packages/_vue3/dist/index.a789f147.cjs +99 -0
  125. package/packages/_vue3/dist/repeated-block.1eba0fc4.js +33 -0
  126. package/packages/_vue3/dist/repeated-block.e0f9db51.cjs +1 -0
  127. package/packages/_vue3/dist/sdk.cjs +1 -72
  128. package/packages/_vue3/dist/sdk.js +22 -3275
  129. package/packages/_vue3/dist/src/blocks/button/button.vue.d.ts +10 -6
  130. package/packages/_vue3/dist/src/blocks/button/component-info.d.ts +1 -1
  131. package/packages/_vue3/dist/src/blocks/columns/columns.vue.d.ts +18 -8
  132. package/packages/_vue3/dist/src/blocks/columns/component-info.d.ts +1 -1
  133. package/packages/_vue3/dist/src/blocks/custom-code/component-info.d.ts +1 -1
  134. package/packages/_vue3/dist/src/blocks/custom-code/custom-code.vue.d.ts +3 -3
  135. package/packages/_vue3/dist/src/blocks/embed/component-info.d.ts +1 -1
  136. package/packages/_vue3/dist/src/blocks/fragment/component-info.d.ts +1 -1
  137. package/packages/_vue3/dist/src/blocks/helpers.d.ts +13 -0
  138. package/packages/_vue3/dist/src/blocks/image/component-info.d.ts +1 -1
  139. package/packages/_vue3/dist/src/blocks/image/image.vue.d.ts +6 -6
  140. package/packages/_vue3/dist/src/blocks/img/component-info.d.ts +1 -1
  141. package/packages/_vue3/dist/src/blocks/img/img.vue.d.ts +9 -7
  142. package/packages/_vue3/dist/src/blocks/section/component-info.d.ts +1 -1
  143. package/packages/_vue3/dist/src/blocks/section/section.vue.d.ts +9 -6
  144. package/packages/_vue3/dist/src/blocks/symbol/component-info.d.ts +1 -1
  145. package/packages/_vue3/dist/src/blocks/symbol/symbol.helpers.d.ts +14 -0
  146. package/packages/_vue3/dist/src/blocks/symbol/symbol.vue.d.ts +20 -7
  147. package/packages/_vue3/dist/src/blocks/text/component-info.d.ts +1 -1
  148. package/packages/_vue3/dist/src/blocks/video/component-info.d.ts +1 -1
  149. package/packages/_vue3/dist/src/blocks/video/video.vue.d.ts +7 -3
  150. package/packages/_vue3/dist/src/components/block/block.helpers.d.ts +13 -0
  151. package/packages/{_vue2/dist/src/components/render-block/render-block.vue.d.ts → _vue3/dist/src/components/block/block.vue.d.ts} +3 -2
  152. package/packages/_vue3/dist/src/components/{render-block → block/components}/block-styles.vue.d.ts +4 -4
  153. package/packages/_vue3/dist/src/components/block/components/block-wrapper.vue.d.ts +29 -0
  154. package/packages/_vue3/dist/src/components/block/components/component-ref/component-ref.helpers.d.ts +30 -0
  155. package/packages/_vue3/dist/src/components/block/components/component-ref/component-ref.vue.d.ts +2 -0
  156. package/packages/_vue3/dist/src/components/block/components/interactive-element.vue.d.ts +30 -0
  157. package/packages/_vue3/dist/src/components/{render-block/render-repeated-block.vue.d.ts → block/components/repeated-block.vue.d.ts} +3 -0
  158. package/packages/_vue3/dist/src/components/{render-blocks.vue.d.ts → blocks/blocks-wrapper.vue.d.ts} +6 -6
  159. package/packages/_vue3/dist/src/components/blocks/blocks.vue.d.ts +29 -0
  160. package/packages/_vue3/dist/src/components/{render-content/render-content.vue.d.ts → content/components/enable-editor.vue.d.ts} +18 -49
  161. package/packages/{_vue2/dist/src/components/render-content/components/render-styles.helpers.d.ts → _vue3/dist/src/components/content/components/styles.helpers.d.ts} +1 -1
  162. package/packages/_vue3/dist/src/components/content/content.helpers.d.ts +7 -0
  163. package/packages/{_vue2/dist/src/components/render-content/render-content.types.d.ts → _vue3/dist/src/components/content/content.types.d.ts} +4 -4
  164. package/packages/_vue3/dist/src/components/content/content.vue.d.ts +69 -0
  165. package/packages/_vue3/dist/src/components/{render-content-variants/render-content-variants.types.d.ts → content-variants/content-variants.types.d.ts} +5 -5
  166. package/packages/_vue3/dist/src/components/{render-content-variants/render-content-variants.vue.d.ts → content-variants/content-variants.vue.d.ts} +21 -20
  167. package/packages/_vue3/dist/src/components/{render-content-variants → content-variants}/helpers.d.ts +7 -7
  168. package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
  169. package/packages/_vue3/dist/src/constants/target.d.ts +1 -1
  170. package/packages/_vue3/dist/src/context/builder.context.d.ts +1 -1
  171. package/packages/_vue3/dist/src/context/types.d.ts +1 -1
  172. package/packages/_vue3/dist/src/functions/{evaluate.d.ts → evaluate/evaluate.d.ts} +5 -2
  173. package/packages/_vue3/dist/src/functions/evaluate/index.d.ts +1 -0
  174. package/packages/_vue3/dist/src/functions/evaluate/interpreter.d.ts +2 -0
  175. package/packages/_vue3/dist/src/functions/evaluate/non-node-runtime.d.ts +2 -0
  176. package/packages/_vue3/dist/src/functions/evaluate/types.d.ts +10 -0
  177. package/packages/_vue3/dist/src/functions/get-block-actions.d.ts +1 -0
  178. package/packages/_vue3/dist/src/functions/get-block-properties.d.ts +5 -1
  179. package/packages/_vue3/dist/src/functions/get-content/index.d.ts +2 -6
  180. package/packages/_vue3/dist/src/functions/get-processed-block.d.ts +1 -1
  181. package/packages/_vue3/dist/src/functions/get-react-native-block-styles.d.ts +1 -1
  182. package/packages/_vue3/dist/src/functions/is-non-node-server.d.ts +4 -0
  183. package/packages/_vue3/dist/src/functions/register-component.d.ts +2 -1
  184. package/packages/_vue3/dist/src/helpers/ab-tests.d.ts +2 -2
  185. package/packages/_vue3/dist/src/helpers/cookie.d.ts +2 -2
  186. package/packages/_vue3/dist/src/helpers/css.d.ts +1 -1
  187. package/packages/_vue3/dist/src/helpers/localStorage.d.ts +2 -2
  188. package/packages/_vue3/dist/src/helpers/preview-lru-cache/get.d.ts +1 -0
  189. package/packages/_vue3/dist/src/helpers/preview-lru-cache/helpers.d.ts +1 -0
  190. package/packages/_vue3/dist/src/helpers/preview-lru-cache/init.d.ts +6 -0
  191. package/packages/_vue3/dist/src/helpers/preview-lru-cache/set.d.ts +7 -0
  192. package/packages/_vue3/dist/src/helpers/preview-lru-cache/types.d.ts +12 -0
  193. package/packages/_vue3/dist/src/helpers/sessionId.d.ts +2 -2
  194. package/packages/_vue3/dist/src/helpers/visitorId.d.ts +1 -1
  195. package/packages/_vue3/dist/src/index-helpers/blocks-exports.d.ts +2 -2
  196. package/packages/_vue3/dist/src/index.d.ts +2 -2
  197. package/packages/_vue3/dist/src/types/builder-props.d.ts +9 -0
  198. package/packages/_vue3/dist/src/types/components.d.ts +8 -2
  199. package/packages/_vue3/dist/src/types/enforced-partials.d.ts +1 -1
  200. package/packages/_vue3/dist/src/types/targets.d.ts +1 -3
  201. package/packages/_vue3/dist/src/types/typescript.d.ts +3 -0
  202. package/packages/_vue3/dist/style.css +1 -1
  203. package/packages/_vue2/dist/block-styles.503c2141.cjs +0 -1
  204. package/packages/_vue2/dist/block-styles.76e698a7.js +0 -72
  205. package/packages/_vue2/dist/css.1601c108.js +0 -75
  206. package/packages/_vue2/dist/css.6d92c2ca.cjs +0 -6
  207. package/packages/_vue2/dist/evaluate.5365c739.js +0 -63
  208. package/packages/_vue2/dist/evaluate.97a0f474.cjs +0 -4
  209. package/packages/_vue2/dist/index.4de025de.cjs +0 -32
  210. package/packages/_vue2/dist/inlined-script.6a6ca760.cjs +0 -1
  211. package/packages/_vue2/dist/render-block.844495c0.js +0 -263
  212. package/packages/_vue2/dist/render-block.c0841b5d.cjs +0 -3
  213. package/packages/_vue2/dist/render-component.a3770d92.cjs +0 -1
  214. package/packages/_vue2/dist/render-component.a57a8b32.js +0 -38
  215. package/packages/_vue2/dist/render-content.19fe4991.cjs +0 -1
  216. package/packages/_vue2/dist/render-content.8d297efd.js +0 -1359
  217. package/packages/_vue2/dist/render-repeated-block.be86aae1.cjs +0 -1
  218. package/packages/_vue2/dist/render-repeated-block.f51da3f5.js +0 -38
  219. package/packages/_vue2/dist/src/blocks/util.d.ts +0 -4
  220. package/packages/_vue2/dist/src/components/render-block/render-block.helpers.d.ts +0 -12
  221. package/packages/_vue2/dist/src/components/render-block/render-component.vue.d.ts +0 -16
  222. package/packages/_vue2/dist/src/components/render-block/render-repeated-block.vue.d.ts +0 -13
  223. package/packages/_vue2/dist/src/components/render-content/render-content.helpers.d.ts +0 -7
  224. package/packages/_vue3/dist/src/blocks/util.d.ts +0 -4
  225. package/packages/_vue3/dist/src/components/render-block/render-block.helpers.d.ts +0 -12
  226. package/packages/_vue3/dist/src/components/render-block/render-component.vue.d.ts +0 -16
  227. package/packages/_vue3/dist/src/components/render-content/render-content.helpers.d.ts +0 -7
  228. /package/packages/_vue2/dist/src/components/{render-block → block}/types.d.ts +0 -0
  229. /package/packages/_vue2/dist/src/components/{render-content → content}/wrap-component-ref.d.ts +0 -0
  230. /package/packages/_vue3/dist/src/components/{render-block → block}/types.d.ts +0 -0
  231. /package/packages/_vue3/dist/src/components/{render-content/components/render-styles.vue.d.ts → content/components/styles.vue.d.ts} +0 -0
  232. /package/packages/_vue3/dist/src/components/{render-content → content}/wrap-component-ref.d.ts +0 -0
@@ -1,3277 +1,24 @@
1
- import { defineComponent as f, openBlock as d, createElementBlock as m, mergeProps as T, toHandlers as P, toDisplayString as oe, h as me, resolveComponent as b, createBlock as g, createCommentVNode as v, defineAsyncComponent as G, resolveDynamicComponent as J, normalizeProps as Y, withCtx as he, Fragment as $, renderList as A, createVNode as O, guardReactiveProps as Me, normalizeClass as L, normalizeStyle as N, renderSlot as W, createElementVNode as re, markRaw as We } from "vue";
2
- const Le = f({
3
- name: "builder-button",
4
- props: ["attributes", "text", "link", "openLinkInNewTab"],
5
- methods: {
6
- filterAttrs: function(t = {}, n) {
7
- const o = "v-on:";
8
- return Object.keys(t).filter((r) => {
9
- if (!t[r])
10
- return !1;
11
- const i = r.startsWith(o);
12
- return n ? i : !i;
13
- }).reduce(
14
- (r, i) => ({
15
- ...r,
16
- [i.replace(o, "")]: t[i]
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 o of n)
27
- t[o] = !0;
28
- return t;
29
- }
30
- }
31
- });
32
- const y = (e, t) => {
33
- const n = e.__vccOpts || e;
34
- for (const [o, r] of t)
35
- n[o] = r;
36
- return n;
37
- }, He = ["href", "target"];
38
- function Ke(e, t, n, o, r, i) {
39
- return e.link ? (d(), m("a", T({
40
- key: 0,
41
- role: "button",
42
- href: e.link,
43
- target: e.openLinkInNewTab ? "_blank" : void 0
44
- }, e.filterAttrs(e.attributes, !1), P(e.filterAttrs(e.attributes, !0), !0)), oe(e.text), 17, He)) : (d(), m("button", T({
45
- key: 1,
46
- class: e._classStringToObject(
47
- e.attributes.class + " button-1yj9n7yt24z"
48
- )
49
- }, e.filterAttrs(e.attributes, !1), P(e.filterAttrs(e.attributes, !0), !0)), oe(e.text), 17));
50
- }
51
- const ze = /* @__PURE__ */ y(Le, [["render", Ke], ["__scopeId", "data-v-34071254"]]), De = Symbol(), j = {
52
- Builder: {
53
- content: null,
54
- context: {},
55
- localState: void 0,
56
- rootSetState() {
57
- },
58
- rootState: {},
59
- apiKey: null,
60
- apiVersion: void 0,
61
- registeredComponents: {},
62
- inheritedStyles: {}
63
- },
64
- key: De
65
- }, E = "vue3";
66
- function C() {
67
- return typeof window < "u" && typeof document < "u";
68
- }
69
- function qe() {
70
- return C() && window.self !== window.top;
71
- }
72
- function V() {
73
- return qe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
74
- }
75
- const H = (e) => JSON.parse(JSON.stringify(e)), fe = {
76
- small: {
77
- min: 320,
78
- default: 321,
79
- max: 640
80
- },
81
- medium: {
82
- min: 641,
83
- default: 642,
84
- max: 991
85
- },
86
- large: {
87
- min: 990,
88
- default: 991,
89
- max: 1200
90
- }
91
- }, ie = (e, t = fe) => `@media (max-width: ${t[e].max}px)`, ge = ({ small: e, medium: t }) => {
92
- const n = H(fe);
93
- if (!e || !t)
94
- return n;
95
- const o = Math.floor(e / 2);
96
- n.small = {
97
- max: e,
98
- min: o,
99
- default: o + 1
100
- };
101
- const r = n.small.max + 1;
102
- n.medium = {
103
- max: t,
104
- min: r,
105
- default: r + 1
106
- };
107
- const i = n.medium.max + 1;
108
- return n.large = {
109
- max: 2e3,
110
- min: i,
111
- default: i + 1
112
- }, n;
113
- };
114
- function F({
115
- code: e,
116
- context: t,
117
- localState: n,
118
- rootState: o,
119
- rootSetState: r,
120
- event: i,
121
- isExpression: s = !0
122
- }) {
123
- if (e === "") {
124
- console.warn("Skipping evaluation of empty code block.");
125
- return;
126
- }
127
- const l = {
128
- isEditing: V(),
129
- isBrowser: C(),
130
- isServer: !C()
131
- }, c = s && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e;
132
- try {
133
- return new Function(
134
- "builder",
135
- "Builder",
136
- "state",
137
- "context",
138
- "event",
139
- c
140
- )(
141
- l,
142
- l,
143
- Ge(o, n, r),
144
- t,
145
- i
146
- );
147
- } catch (u) {
148
- console.warn(
149
- `Builder custom code error:
150
- While Evaluating:
151
- `,
152
- c,
153
- `
154
- `,
155
- u
156
- );
157
- }
158
- }
159
- function Ge(e, t, n) {
160
- if (e === t)
161
- throw new Error("rootState === localState");
162
- return new Proxy(e, {
163
- get: (o, r) => t && r in t ? t[r] : e[r],
164
- set: (o, r, i) => {
165
- if (t && r in t)
166
- throw new Error(
167
- "Writing to local state is not allowed as it is read-only."
168
- );
169
- return e[r] = i, n == null || n(e), !0;
170
- }
171
- });
172
- }
173
- const Je = (e, t, n) => {
174
- if (Object(e) !== e)
175
- return e;
176
- const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
177
- return o.slice(0, -1).reduce(
178
- (r, i, s) => Object(r[i]) === r[i] ? r[i] : r[i] = Math.abs(Number(o[s + 1])) >> 0 === +o[s + 1] ? [] : {},
179
- e
180
- )[o[o.length - 1]] = n, e;
181
- };
182
- const Ye = ({
183
- block: e,
184
- context: t,
185
- localState: n,
186
- rootState: o,
187
- rootSetState: r
188
- }) => {
189
- if (!e.bindings)
190
- return e;
191
- const i = H(e), s = {
192
- ...i,
193
- properties: { ...i.properties },
194
- actions: { ...i.actions }
195
- };
196
- for (const l in e.bindings) {
197
- const a = e.bindings[l], c = F({
198
- code: a,
199
- localState: n,
200
- rootState: o,
201
- rootSetState: r,
202
- context: t
203
- });
204
- Je(s, l, c);
205
- }
206
- return s;
207
- };
208
- function ee({
209
- block: e,
210
- context: t,
211
- shouldEvaluateBindings: n,
212
- localState: o,
213
- rootState: r,
214
- rootSetState: i
215
- }) {
216
- const s = e;
217
- return n ? Ye({
218
- block: s,
219
- localState: o,
220
- rootState: r,
221
- rootSetState: i,
222
- context: t
223
- }) : s;
224
- }
225
- const Xe = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), R = (e) => e != null, be = (e) => Object.entries(e).map(([n, o]) => {
226
- if (typeof o == "string")
227
- return `${Xe(n)}: ${o};`;
228
- }).filter(R), Qe = (e) => be(e).join(`
229
- `), D = ({
230
- mediaQuery: e,
231
- className: t,
232
- styles: n
233
- }) => {
234
- const o = `.${t} {
235
- ${Qe(n)}
236
- }`;
237
- return e ? `${e} {
238
- ${o}
239
- }` : o;
240
- }, K = f({
241
- render() {
242
- return me("style", { id: this.id, innerHTML: this.styles });
243
- },
244
- name: "inlined-styles",
245
- props: ["styles", "id"]
246
- }), Ze = f({
247
- name: "block-styles",
248
- components: { InlinedStyles: K },
249
- props: ["block", "context"],
250
- data() {
251
- return { TARGET: E };
252
- },
253
- computed: {
254
- useBlock() {
255
- return ee({
256
- block: this.block,
257
- localState: this.context.localState,
258
- rootState: this.context.rootState,
259
- rootSetState: this.context.rootSetState,
260
- context: this.context.context,
261
- shouldEvaluateBindings: !0
262
- });
263
- },
264
- canShowBlock() {
265
- return R(this.useBlock.hide) ? !this.useBlock.hide : R(this.useBlock.show) ? this.useBlock.show : !0;
266
- },
267
- css() {
268
- var u;
269
- const e = this.useBlock.responsiveStyles, t = this.context.content, n = ge(
270
- ((u = t == null ? void 0 : t.meta) == null ? void 0 : u.breakpoints) || {}
271
- ), o = e == null ? void 0 : e.large, r = e == null ? void 0 : e.medium, i = e == null ? void 0 : e.small, s = this.useBlock.id;
272
- if (!s)
273
- return "";
274
- const l = o ? D({
275
- className: s,
276
- styles: o
277
- }) : "", a = r ? D({
278
- className: s,
279
- styles: r,
280
- mediaQuery: ie(
281
- "medium",
282
- n
283
- )
284
- }) : "", c = i ? D({
285
- className: s,
286
- styles: i,
287
- mediaQuery: ie(
288
- "small",
289
- n
290
- )
291
- }) : "";
292
- return [l, a, c].join(" ");
293
- }
294
- }
295
- });
296
- function et(e, t, n, o, r, i) {
297
- const s = b("inlined-styles");
298
- return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? (d(), g(s, {
299
- key: 0,
300
- styles: e.css
301
- }, null, 8, ["styles"])) : v("", !0);
302
- }
303
- const te = /* @__PURE__ */ y(Ze, [["render", et]]), tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
304
- __proto__: null,
305
- default: te
306
- }, Symbol.toStringTag, { value: "Module" })), nt = (e) => `v-on:${e.toLowerCase()}`, ot = (e, t) => (n) => F({
307
- code: e,
308
- context: t.context,
309
- localState: t.localState,
310
- rootState: t.rootState,
311
- rootSetState: t.rootSetState,
312
- event: n,
313
- isExpression: !1
314
- });
315
- function rt(e) {
316
- var o;
317
- const t = {}, n = (o = e.block.actions) != null ? o : {};
318
- for (const r in n) {
319
- if (!n.hasOwnProperty(r))
320
- continue;
321
- const i = n[r];
322
- t[nt(r)] = ot(i, e);
323
- }
324
- return t;
325
- }
326
- function it(e) {
327
- var t;
328
- return {
329
- ...(t = e.component) == null ? void 0 : t.options,
330
- ...e.options,
331
- builderBlock: e
332
- };
333
- }
334
- function st(e) {
335
- const t = {};
336
- if (typeof e != "string")
337
- return t;
338
- const n = e.trim().split(/\\s+/);
339
- for (const o of n)
340
- t[o] = !0;
341
- return t;
342
- }
343
- function at(e) {
344
- return e.class = st(e.class), e;
345
- }
346
- const lt = (e) => ({ href: e.href });
347
- function ct(e) {
348
- var n;
349
- const t = {
350
- ...lt(e),
351
- ...e.properties,
352
- "builder-id": e.id,
353
- style: dt(e.style),
354
- class: [e.id, "builder-block", e.class, (n = e.properties) == null ? void 0 : n.class].filter(Boolean).join(" ")
355
- };
356
- return at(t);
357
- }
358
- function dt(e) {
359
- if (!!e)
360
- switch (E) {
361
- case "svelte":
362
- case "vue2":
363
- case "vue3":
364
- case "solid":
365
- return be(e).join(" ");
366
- case "qwik":
367
- case "reactNative":
368
- case "react":
369
- return e;
370
- }
371
- }
372
- const ut = [
373
- "area",
374
- "base",
375
- "br",
376
- "col",
377
- "embed",
378
- "hr",
379
- "img",
380
- "input",
381
- "keygen",
382
- "link",
383
- "meta",
384
- "param",
385
- "source",
386
- "track",
387
- "wbr"
388
- ], pt = (e) => typeof e == "string" && ut.includes(e.toLowerCase()), mt = ({
389
- block: e,
390
- context: t
391
- }) => {
392
- var r;
393
- const n = (r = ee({
394
- block: e,
395
- localState: t.localState,
396
- rootState: t.rootState,
397
- rootSetState: t.rootSetState,
398
- context: t.context,
399
- shouldEvaluateBindings: !1
400
- }).component) == null ? void 0 : r.name;
401
- if (!n)
402
- return null;
403
- const o = t.registeredComponents[n];
404
- if (o)
405
- return o;
406
- console.warn(`
407
- Could not find a registered component named "${n}".
408
- If you registered it, is the file that registered it imported by the file that needs to render it?`);
409
- }, ht = ({
410
- block: e,
411
- context: t
412
- }) => {
413
- const { repeat: n, ...o } = e;
414
- if (!(n != null && n.collection))
415
- return;
416
- const r = F({
417
- code: n.collection,
418
- localState: t.localState,
419
- rootState: t.rootState,
420
- rootSetState: t.rootSetState,
421
- context: t.context
422
- });
423
- if (!Array.isArray(r))
424
- return;
425
- const i = n.collection.split(".").pop(), s = n.itemName || (i ? i + "Item" : "item");
426
- return r.map((a, c) => ({
427
- context: {
428
- ...t,
429
- localState: {
430
- ...t.localState,
431
- $index: c,
432
- $item: a,
433
- [s]: a,
434
- [`$${s}Index`]: c
435
- }
436
- },
437
- block: o
438
- }));
439
- }, ft = () => Promise.resolve().then(() => ke).then((e) => e.default).catch((e) => {
440
- throw console.error(
441
- "Error while attempting to dynamically import component RenderBlock at ./render-block.vue",
442
- e
443
- ), e;
444
- }), gt = f({
445
- name: "render-repeated-block",
446
- components: { RenderBlock: G(ft) },
447
- props: ["repeatContext", "block"],
448
- data() {
449
- return { store: this.repeatContext };
450
- },
451
- provide() {
452
- const e = this;
453
- return {
454
- [j.key]: e.store
455
- };
456
- }
457
- });
458
- function bt(e, t, n, o, r, i) {
459
- const s = b("render-block");
460
- return d(), g(s, {
461
- block: e.block,
462
- context: e.store
463
- }, null, 8, ["block", "context"]);
464
- }
465
- const yt = /* @__PURE__ */ y(gt, [["render", bt]]), kt = () => Promise.resolve().then(() => tt).then((e) => e.default).catch((e) => {
466
- throw console.error(
467
- "Error while attempting to dynamically import component BlockStyles at ./block-styles.vue",
468
- e
469
- ), e;
470
- }), St = () => Promise.resolve().then(() => ke).then((e) => e.default).catch((e) => {
471
- throw console.error(
472
- "Error while attempting to dynamically import component RenderBlock at ./render-block.vue",
473
- e
474
- ), e;
475
- }), vt = f({
476
- name: "render-component",
477
- components: {
478
- RenderBlock: G(St),
479
- BlockStyles: G(kt)
480
- },
481
- props: ["componentRef", "componentOptions", "blockChildren", "context"]
482
- });
483
- function Ct(e, t, n, o, r, i) {
484
- const s = b("render-block"), l = b("block-styles");
485
- return e.componentRef ? (d(), g(J(e.componentRef), Y(T({ key: 0 }, e.componentOptions)), {
486
- default: he(() => [
487
- (d(!0), m($, null, A(e.blockChildren, (a, c) => (d(), g(s, {
488
- key: "render-block-" + a.id,
489
- block: a,
490
- context: e.context
491
- }, null, 8, ["block", "context"]))), 128)),
492
- (d(!0), m($, null, A(e.blockChildren, (a, c) => (d(), g(l, {
493
- key: "block-style-" + a.id,
494
- block: a,
495
- context: e.context
496
- }, null, 8, ["block", "context"]))), 128))
497
- ]),
498
- _: 1
499
- }, 16)) : v("", !0);
500
- }
501
- const wt = /* @__PURE__ */ y(vt, [["render", Ct]]), $t = f({
502
- name: "render-block",
503
- components: {
504
- RenderComponent: wt,
505
- RenderRepeatedBlock: yt,
506
- BlockStyles: te
507
- },
508
- props: ["block", "context"],
509
- data() {
510
- return {
511
- component: mt({
512
- block: this.block,
513
- context: this.context
514
- }),
515
- Tag: this.block.tagName || "div",
516
- childrenContext: this.context,
517
- isEmptyHtmlElement: pt
518
- };
519
- },
520
- computed: {
521
- repeatItem() {
522
- return ht({
523
- block: this.block,
524
- context: this.context
525
- });
526
- },
527
- useBlock() {
528
- return this.repeatItem ? this.block : ee({
529
- block: this.block,
530
- localState: this.context.localState,
531
- rootState: this.context.rootState,
532
- rootSetState: this.context.rootSetState,
533
- context: this.context.context,
534
- shouldEvaluateBindings: !0
535
- });
536
- },
537
- canShowBlock() {
538
- return "hide" in this.useBlock ? !this.useBlock.hide : "show" in this.useBlock ? this.useBlock.show : !0;
539
- },
540
- actions() {
541
- return rt({
542
- block: this.useBlock,
543
- rootState: this.context.rootState,
544
- rootSetState: this.context.rootSetState,
545
- localState: this.context.localState,
546
- context: this.context.context
547
- });
548
- },
549
- attributes() {
550
- return {
551
- ...ct(this.useBlock)
552
- };
553
- },
554
- childrenWithoutParentComponent() {
555
- var t, n;
556
- return !((t = this.component) != null && t.component) && !this.repeatItem ? (n = this.useBlock.children) != null ? n : [] : [];
557
- },
558
- renderComponentProps() {
559
- var e, t, n;
560
- return {
561
- blockChildren: (e = this.useBlock.children) != null ? e : [],
562
- componentRef: (t = this.component) == null ? void 0 : t.component,
563
- componentOptions: {
564
- ...it(this.useBlock),
565
- ...(n = this.component) != null && n.noWrap ? {
566
- attributes: {
567
- ...this.attributes,
568
- ...this.actions
569
- }
570
- } : {}
571
- },
572
- context: this.childrenContext
573
- };
574
- }
575
- },
576
- methods: {
577
- stripVOn: function(t = {}) {
578
- return Object.keys(t).reduce(
579
- (n, o) => ({
580
- ...n,
581
- [o.replace("v-on:", "")]: t[o]
582
- }),
583
- {}
584
- );
585
- }
586
- }
587
- });
588
- function Tt(e, t, n, o, r, i) {
589
- var u;
590
- const s = b("render-repeated-block"), l = b("render-component"), a = b("render-block", !0), c = b("block-styles");
591
- return e.canShowBlock ? (d(), m($, { key: 0 }, [
592
- (u = e.component) != null && u.noWrap ? (d(), g(l, Y(T({ key: 1 }, e.renderComponentProps)), null, 16)) : (d(), m($, { key: 0 }, [
593
- e.isEmptyHtmlElement(e.Tag) ? (d(), g(J(e.Tag), T({ key: 0 }, e.attributes, P(e.stripVOn(e.actions))), null, 16)) : v("", !0),
594
- !e.isEmptyHtmlElement(e.Tag) && e.repeatItem ? (d(!0), m($, { key: 1 }, A(e.repeatItem, (p, h) => (d(), g(s, {
595
- key: h,
596
- repeatContext: p.context,
597
- block: p.block
598
- }, null, 8, ["repeatContext", "block"]))), 128)) : v("", !0),
599
- !e.isEmptyHtmlElement(e.Tag) && !e.repeatItem ? (d(), g(J(e.Tag), T({ key: 2 }, e.attributes, P(e.stripVOn(e.actions))), {
600
- default: he(() => [
601
- O(l, Y(Me(e.renderComponentProps)), null, 16),
602
- (d(!0), m($, null, A(e.childrenWithoutParentComponent, (p, h) => (d(), g(a, {
603
- key: "render-block-" + p.id,
604
- block: p,
605
- context: e.childrenContext
606
- }, null, 8, ["block", "context"]))), 128)),
607
- (d(!0), m($, null, A(e.childrenWithoutParentComponent, (p, h) => (d(), g(c, {
608
- key: "block-style-" + p.id,
609
- block: p,
610
- context: e.childrenContext
611
- }, null, 8, ["block", "context"]))), 128))
612
- ]),
613
- _: 1
614
- }, 16)) : v("", !0)
615
- ], 64))
616
- ], 64)) : v("", !0);
617
- }
618
- const ye = /* @__PURE__ */ y($t, [["render", Tt]]), ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
619
- __proto__: null,
620
- default: ye
621
- }, Symbol.toStringTag, { value: "Module" })), xt = f({
622
- name: "render-blocks",
623
- components: { RenderBlock: ye, BlockStyles: te },
624
- props: ["blocks", "parent", "path", "styleProp"],
625
- inject: {
626
- builderContext: j.key
627
- },
628
- computed: {
629
- className() {
630
- var e;
631
- return "builder-blocks" + ((e = this.blocks) != null && e.length ? "" : " no-blocks");
632
- }
633
- },
634
- methods: {
635
- onClick() {
636
- var e, t;
637
- V() && !((e = this.blocks) != null && e.length) && ((t = window.parent) == null || t.postMessage(
638
- {
639
- type: "builder.clickEmptyBlocks",
640
- data: {
641
- parentElementId: this.parent,
642
- dataPath: this.path
643
- }
644
- },
645
- "*"
646
- ));
647
- },
648
- onMouseEnter() {
649
- var e, t;
650
- V() && !((e = this.blocks) != null && e.length) && ((t = window.parent) == null || t.postMessage(
651
- {
652
- type: "builder.hoverEmptyBlocks",
653
- data: {
654
- parentElementId: this.parent,
655
- dataPath: this.path
656
- }
657
- },
658
- "*"
659
- ));
660
- },
661
- _classStringToObject(e) {
662
- const t = {};
663
- if (typeof e != "string")
664
- return t;
665
- const n = e.trim().split(/\s+/);
666
- for (const o of n)
667
- t[o] = !0;
668
- return t;
669
- }
670
- }
671
- });
672
- const It = ["builder-path", "builder-parent-id", "dataSet"];
673
- function Rt(e, t, n, o, r, i) {
674
- const s = b("render-block"), l = b("block-styles");
675
- return d(), m("div", {
676
- class: L(e._classStringToObject(e.className + " div-1n1bt6e2i9n")),
677
- "builder-path": e.path,
678
- "builder-parent-id": e.parent,
679
- dataSet: {
680
- class: e.className
681
- },
682
- style: N(e.styleProp),
683
- onClick: t[0] || (t[0] = (a) => e.onClick()),
684
- onMouseenter: t[1] || (t[1] = (a) => e.onMouseEnter()),
685
- onKeypress: t[2] || (t[2] = (a) => e.onClick())
686
- }, [
687
- e.blocks ? (d(!0), m($, { key: 0 }, A(e.blocks, (a, c) => (d(), g(s, {
688
- key: "render-block-" + a.id,
689
- block: a,
690
- context: e.builderContext
691
- }, null, 8, ["block", "context"]))), 128)) : v("", !0),
692
- e.blocks ? (d(!0), m($, { key: 1 }, A(e.blocks, (a, c) => (d(), g(l, {
693
- key: "block-style-" + a.id,
694
- block: a,
695
- context: e.builderContext
696
- }, null, 8, ["block", "context"]))), 128)) : v("", !0)
697
- ], 46, It);
698
- }
699
- const Se = /* @__PURE__ */ y(xt, [["render", Rt], ["__scopeId", "data-v-8b51fb80"]]), Et = f({
700
- name: "builder-columns",
701
- components: { InlinedStyles: K, RenderBlocks: Se },
702
- props: [
703
- "space",
704
- "columns",
705
- "stackColumnsAt",
706
- "reverseColumnsWhenStacked",
707
- "builderBlock"
708
- ],
709
- data() {
710
- return {
711
- gutterSize: typeof this.space == "number" ? this.space || 0 : 20,
712
- cols: this.columns || [],
713
- stackAt: this.stackColumnsAt || "tablet",
714
- flexDir: this.stackColumnsAt === "never" ? "row" : this.reverseColumnsWhenStacked ? "column-reverse" : "column",
715
- TARGET: E
716
- };
717
- },
718
- inject: {
719
- builderContext: j.key
720
- },
721
- computed: {
722
- columnsCssVars() {
723
- return {
724
- "--flex-dir": this.flexDir,
725
- "--flex-dir-tablet": this.getTabletStyle({
726
- stackedStyle: this.flexDir,
727
- desktopStyle: "row"
728
- })
729
- };
730
- },
731
- columnsStyles() {
732
- return `
733
- @media (max-width: ${this.getWidthForBreakpointSize("medium")}px) {
734
- .${this.builderBlock.id}-breakpoints {
735
- flex-direction: var(--flex-dir-tablet);
736
- align-items: stretch;
737
- }
738
-
739
- .${this.builderBlock.id}-breakpoints > .builder-column {
740
- width: var(--column-width-tablet) !important;
741
- margin-left: var(--column-margin-left-tablet) !important;
742
- }
743
- }
744
-
745
- @media (max-width: ${this.getWidthForBreakpointSize("small")}px) {
746
- .${this.builderBlock.id}-breakpoints {
747
- flex-direction: var(--flex-dir);
748
- align-items: stretch;
749
- }
750
-
751
- .${this.builderBlock.id}-breakpoints > .builder-column {
752
- width: var(--column-width-mobile) !important;
753
- margin-left: var(--column-margin-left-mobile) !important;
754
- }
755
- },
756
- `;
757
- }
758
- },
759
- methods: {
760
- getWidth(e) {
761
- var t;
762
- return ((t = this.cols[e]) == null ? void 0 : t.width) || 100 / this.cols.length;
763
- },
764
- getColumnCssWidth(e) {
765
- const t = this.gutterSize * (this.cols.length - 1) / this.cols.length;
766
- return `calc(${this.getWidth(e)}% - ${t}px)`;
767
- },
768
- getTabletStyle({
769
- stackedStyle: e,
770
- desktopStyle: t
771
- }) {
772
- return this.stackAt === "tablet" ? e : t;
773
- },
774
- getMobileStyle({
775
- stackedStyle: e,
776
- desktopStyle: t
777
- }) {
778
- return this.stackAt === "never" ? t : e;
779
- },
780
- columnCssVars(e) {
781
- const t = e === 0 ? 0 : this.gutterSize, n = this.getColumnCssWidth(e), o = `${t}px`, r = "100%", i = 0;
782
- return {
783
- width: n,
784
- "margin-left": o,
785
- "--column-width-mobile": this.getMobileStyle({
786
- stackedStyle: r,
787
- desktopStyle: n
788
- }),
789
- "--column-margin-left-mobile": this.getMobileStyle({
790
- stackedStyle: i,
791
- desktopStyle: o
792
- }),
793
- "--column-width-tablet": this.getTabletStyle({
794
- stackedStyle: r,
795
- desktopStyle: n
796
- }),
797
- "--column-margin-left-tablet": this.getTabletStyle({
798
- stackedStyle: i,
799
- desktopStyle: o
800
- })
801
- };
802
- },
803
- getWidthForBreakpointSize(e) {
804
- var n, o;
805
- return ge(
806
- ((o = (n = this.builderContext.content) == null ? void 0 : n.meta) == null ? void 0 : o.breakpoints) || {}
807
- )[e].max;
808
- },
809
- _classStringToObject(e) {
810
- const t = {};
811
- if (typeof e != "string")
812
- return t;
813
- const n = e.trim().split(/\s+/);
814
- for (const o of n)
815
- t[o] = !0;
816
- return t;
817
- }
818
- }
819
- });
820
- function At(e, t, n, o, r, i) {
821
- const s = b("inlined-styles"), l = b("render-blocks");
822
- return d(), m("div", {
823
- class: L(
824
- e._classStringToObject(
825
- `builder-columns ${e.builderBlock.id}-breakpoints div-361b1o6wv2k`
826
- )
827
- ),
828
- style: N(e.columnsCssVars),
829
- dataSet: {
830
- "builder-block-name": "builder-columns"
831
- }
832
- }, [
833
- e.TARGET !== "reactNative" ? (d(), g(s, {
834
- key: 0,
835
- styles: e.columnsStyles
836
- }, null, 8, ["styles"])) : v("", !0),
837
- (d(!0), m($, null, A(e.columns, (a, c) => (d(), m("div", {
838
- key: c,
839
- class: "builder-column div-361b1o6wv2k-2",
840
- style: N(e.columnCssVars(c)),
841
- dataSet: {
842
- "builder-block-name": "builder-column"
843
- }
844
- }, [
845
- O(l, {
846
- blocks: a.blocks,
847
- path: `component.options.columns.${c}.blocks`,
848
- parent: e.builderBlock.id,
849
- styleProp: {
850
- flexGrow: "1"
851
- }
852
- }, null, 8, ["blocks", "path", "parent"])
853
- ], 4))), 128))
854
- ], 6);
855
- }
856
- const Vt = /* @__PURE__ */ y(Et, [["render", At], ["__scopeId", "data-v-fb535450"]]), Bt = f({
857
- name: "builder-fragment-component",
858
- props: []
859
- });
860
- function _t(e, t, n, o, r, i) {
861
- return d(), m("span", null, [
862
- W(e.$slots, "default")
863
- ]);
864
- }
865
- const Pt = /* @__PURE__ */ y(Bt, [["render", _t]]);
866
- function se(e) {
867
- return e.replace(/http(s)?:/, "");
868
- }
869
- function Ot(e = "", t, n) {
870
- const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), r = e.indexOf("?") !== -1 ? "&" : "?";
871
- return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + r + t + "=" + encodeURIComponent(n);
872
- }
873
- function jt(e, t) {
874
- if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
875
- return e;
876
- if (t === "master")
877
- return se(e);
878
- const n = e.match(
879
- /(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i
880
- );
881
- if (n) {
882
- const o = e.split(n[0]), r = n[3], i = t.match("x") ? t : `${t}x`;
883
- return se(`${o[0]}_${i}${r}`);
884
- }
885
- return null;
886
- }
887
- function q(e) {
888
- if (!e)
889
- return e;
890
- const t = [100, 200, 400, 800, 1200, 1600, 2e3];
891
- if (e.match(/builder\.io/)) {
892
- let n = e;
893
- const o = Number(e.split("?width=")[1]);
894
- return isNaN(o) || (n = `${n} ${o}w`), t.filter((r) => r !== o).map((r) => `${Ot(e, "width", r)} ${r}w`).concat([n]).join(", ");
895
- }
896
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [jt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
897
- }
898
- const Nt = f({
899
- name: "builder-image",
900
- props: [
901
- "image",
902
- "src",
903
- "srcset",
904
- "noWebp",
905
- "aspectRatio",
906
- "altText",
907
- "backgroundPosition",
908
- "backgroundSize",
909
- "className",
910
- "sizes",
911
- "builderBlock",
912
- "fitContent"
913
- ],
914
- computed: {
915
- srcSetToUse() {
916
- var n;
917
- const t = this.image || this.src;
918
- if (!t || !(t.match(/builder\.io/) || t.match(/cdn\.shopify\.com/)))
919
- return this.srcset;
920
- if (this.srcset && ((n = this.image) == null ? void 0 : n.includes("builder.io/api/v1/image"))) {
921
- if (!this.srcset.includes(this.image.split("?")[0]))
922
- return console.debug("Removed given srcset"), q(t);
923
- } else if (this.image && !this.srcset)
924
- return q(t);
925
- return q(t);
926
- },
927
- webpSrcSet() {
928
- var e;
929
- return ((e = this.srcSetToUse) == null ? void 0 : e.match(/builder\.io/)) && !this.noWebp ? this.srcSetToUse.replace(/\?/g, "?format=webp&") : "";
930
- },
931
- aspectRatioCss() {
932
- const e = {
933
- position: "absolute",
934
- height: "100%",
935
- width: "100%",
936
- left: "0px",
937
- top: "0px"
938
- };
939
- return this.aspectRatio ? e : void 0;
940
- }
941
- },
942
- methods: {
943
- _classStringToObject(e) {
944
- const t = {};
945
- if (typeof e != "string")
946
- return t;
947
- const n = e.trim().split(/\s+/);
948
- for (const o of n)
949
- t[o] = !0;
950
- return t;
951
- }
952
- }
953
- });
954
- const Ft = ["srcset"], Ut = ["alt", "role", "src", "srcset", "sizes"], Mt = {
955
- key: 2,
956
- class: "div-7jvpanrlkn-2"
957
- };
958
- function Wt(e, t, n, o, r, i) {
959
- var s, l, a, c;
960
- return d(), m($, null, [
961
- re("picture", null, [
962
- e.webpSrcSet ? (d(), m("source", {
963
- key: 0,
964
- type: "image/webp",
965
- srcset: e.webpSrcSet
966
- }, null, 8, Ft)) : v("", !0),
967
- re("img", {
968
- loading: "lazy",
969
- alt: e.altText,
970
- role: e.altText ? "presentation" : void 0,
971
- style: N({
972
- objectPosition: e.backgroundPosition || "center",
973
- objectFit: e.backgroundSize || "cover",
974
- ...e.aspectRatioCss
975
- }),
976
- class: L(
977
- e._classStringToObject(
978
- "builder-image" + (e.className ? " " + e.className : "") + " img-7jvpanrlkn"
979
- )
980
- ),
981
- src: e.image,
982
- srcset: e.srcSetToUse,
983
- sizes: e.sizes
984
- }, null, 14, Ut)
985
- ]),
986
- e.aspectRatio && !(((l = (s = e.builderBlock) == null ? void 0 : s.children) == null ? void 0 : l.length) && e.fitContent) ? (d(), m("div", {
987
- key: 0,
988
- class: "builder-image-sizer div-7jvpanrlkn",
989
- style: N({
990
- paddingTop: e.aspectRatio * 100 + "%"
991
- })
992
- }, null, 4)) : v("", !0),
993
- ((c = (a = e.builderBlock) == null ? void 0 : a.children) == null ? void 0 : c.length) && e.fitContent ? W(e.$slots, "default", { key: 1 }, void 0, !0) : v("", !0),
994
- !e.fitContent && e.children ? (d(), m("div", Mt, [
995
- W(e.$slots, "default", {}, void 0, !0)
996
- ])) : v("", !0)
997
- ], 64);
998
- }
999
- const Lt = /* @__PURE__ */ y(Nt, [["render", Wt], ["__scopeId", "data-v-60254c11"]]), Ht = f({
1000
- name: "builder-section-component",
1001
- props: ["maxWidth", "attributes"],
1002
- methods: {
1003
- filterAttrs: function(t = {}, n) {
1004
- const o = "v-on:";
1005
- return Object.keys(t).filter((r) => {
1006
- if (!t[r])
1007
- return !1;
1008
- const i = r.startsWith(o);
1009
- return n ? i : !i;
1010
- }).reduce(
1011
- (r, i) => ({
1012
- ...r,
1013
- [i.replace(o, "")]: t[i]
1014
- }),
1015
- {}
1016
- );
1017
- }
1018
- }
1019
- });
1020
- function Kt(e, t, n, o, r, i) {
1021
- return d(), m("section", T({
1022
- style: {
1023
- width: "100%",
1024
- alignSelf: "stretch",
1025
- flexGrow: 1,
1026
- boxSizing: "border-box",
1027
- maxWidth: e.maxWidth || 1200,
1028
- display: "flex",
1029
- flexDirection: "column",
1030
- alignItems: "stretch",
1031
- marginLeft: "auto",
1032
- marginRight: "auto"
1033
- }
1034
- }, e.filterAttrs(e.attributes, !1), P(e.filterAttrs(e.attributes, !0), !0)), [
1035
- W(e.$slots, "default")
1036
- ], 16);
1037
- }
1038
- const zt = /* @__PURE__ */ y(Ht, [["render", Kt]]), M = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1039
- ...t,
1040
- testVariationId: t.id,
1041
- id: e == null ? void 0 : e.id
1042
- })), Dt = ({
1043
- canTrack: e,
1044
- content: t
1045
- }) => !(!(M(t).length > 0) || !e);
1046
- function qt(e, t, n) {
1047
- var s;
1048
- function o() {
1049
- function l(S, w, I) {
1050
- let _ = "";
1051
- if (I) {
1052
- const x = new Date();
1053
- x.setTime(x.getTime() + I * 24 * 60 * 60 * 1e3), _ = "; expires=" + x.toUTCString();
1054
- }
1055
- document.cookie = S + "=" + (w || "") + _ + "; path=/; Secure; SameSite=None";
1056
- }
1057
- function a(S) {
1058
- const w = S + "=", I = document.cookie.split(";");
1059
- for (let _ = 0; _ < I.length; _++) {
1060
- let x = I[_];
1061
- for (; x.charAt(0) === " "; )
1062
- x = x.substring(1, x.length);
1063
- if (x.indexOf(w) === 0)
1064
- return x.substring(w.length, x.length);
1065
- }
1066
- return null;
1067
- }
1068
- const c = `builder.tests.${e}`, u = a(c), p = t.map((S) => S.id).concat(e);
1069
- if (u && p.includes(u))
1070
- return u;
1071
- let h = 0;
1072
- const k = Math.random();
1073
- for (let S = 0; S < t.length; S++) {
1074
- const w = t[S], I = w.testRatio;
1075
- if (h += I, k < h)
1076
- return l(c, w.id), w.id;
1077
- }
1078
- return l(c, e), e;
1079
- }
1080
- const r = o(), i = (s = document.currentScript) == null ? void 0 : s.previousElementSibling;
1081
- if (n) {
1082
- i.remove();
1083
- const l = document.currentScript;
1084
- l == null || l.remove();
1085
- } else {
1086
- const l = t.concat({ id: e }).filter((a) => a.id !== r).map((a) => `.variant-${a.id} { display: none; }
1087
- `).join("");
1088
- i.innerHTML = l;
1089
- }
1090
- }
1091
- function Gt(e, t, n) {
1092
- var a;
1093
- if (!navigator.cookieEnabled)
1094
- return;
1095
- function o(c) {
1096
- const u = c + "=", p = document.cookie.split(";");
1097
- for (let h = 0; h < p.length; h++) {
1098
- let k = p[h];
1099
- for (; k.charAt(0) === " "; )
1100
- k = k.substring(1, k.length);
1101
- if (k.indexOf(u) === 0)
1102
- return k.substring(u.length, k.length);
1103
- }
1104
- return null;
1105
- }
1106
- const r = `builder.tests.${t}`, i = o(r), s = (a = document.currentScript) == null ? void 0 : a.parentElement, l = e === t;
1107
- if (i === e) {
1108
- if (l)
1109
- return;
1110
- s == null || s.removeAttribute("hidden"), s == null || s.removeAttribute("aria-hidden");
1111
- } else {
1112
- l && (n ? s == null || s.remove() : (s == null || s.setAttribute("hidden", "true"), s == null || s.setAttribute("aria-hidden", "true")));
1113
- return;
1114
- }
1115
- }
1116
- const Jt = (e) => e === "react" || e === "reactNative", ve = Jt(E), Ce = "builderIoAbTest", we = "builderIoRenderContent", Yt = () => {
1117
- const e = qt.toString().replace(/\s+/g, " "), t = Gt.toString().replace(/\s+/g, " ");
1118
- return `
1119
- window.${Ce} = ${e}
1120
- window.${we} = ${t}
1121
- `;
1122
- }, Xt = (e, t) => `
1123
- window.${Ce}("${t}",${JSON.stringify(
1124
- e
1125
- )}, ${ve})`, Qt = ({
1126
- contentId: e,
1127
- variationId: t
1128
- }) => `
1129
- window.${we}("${t}", "${e}", ${ve})`, Zt = {
1130
- name: "Core:Button",
1131
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1132
- defaultStyles: {
1133
- appearance: "none",
1134
- paddingTop: "15px",
1135
- paddingBottom: "15px",
1136
- paddingLeft: "25px",
1137
- paddingRight: "25px",
1138
- backgroundColor: "#000000",
1139
- color: "white",
1140
- borderRadius: "4px",
1141
- textAlign: "center",
1142
- cursor: "pointer"
1143
- },
1144
- inputs: [
1145
- {
1146
- name: "text",
1147
- type: "text",
1148
- defaultValue: "Click me!",
1149
- bubble: !0
1150
- },
1151
- {
1152
- name: "link",
1153
- type: "url",
1154
- bubble: !0
1155
- },
1156
- {
1157
- name: "openLinkInNewTab",
1158
- type: "boolean",
1159
- defaultValue: !1,
1160
- friendlyName: "Open link in new tab"
1161
- }
1162
- ],
1163
- static: !0,
1164
- noWrap: !0
1165
- }, z = (e) => {
1166
- const t = e.toString().trim();
1167
- return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1168
- }, en = {
1169
- name: "Columns",
1170
- inputs: [
1171
- {
1172
- name: "columns",
1173
- type: "array",
1174
- broadcast: !0,
1175
- subFields: [
1176
- {
1177
- name: "blocks",
1178
- type: "array",
1179
- hideFromUI: !0,
1180
- defaultValue: [
1181
- {
1182
- "@type": "@builder.io/sdk:Element",
1183
- responsiveStyles: {
1184
- large: {
1185
- display: "flex",
1186
- flexDirection: "column",
1187
- alignItems: "stretch",
1188
- flexShrink: "0",
1189
- position: "relative",
1190
- marginTop: "30px",
1191
- textAlign: "center",
1192
- lineHeight: "normal",
1193
- height: "auto",
1194
- minHeight: "20px",
1195
- minWidth: "20px",
1196
- overflow: "hidden"
1197
- }
1198
- },
1199
- component: {
1200
- name: "Image",
1201
- options: {
1202
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1203
- backgroundPosition: "center",
1204
- backgroundSize: "cover",
1205
- aspectRatio: 0.7004048582995948
1206
- }
1207
- }
1208
- },
1209
- {
1210
- "@type": "@builder.io/sdk:Element",
1211
- responsiveStyles: {
1212
- large: {
1213
- display: "flex",
1214
- flexDirection: "column",
1215
- alignItems: "stretch",
1216
- flexShrink: "0",
1217
- position: "relative",
1218
- marginTop: "30px",
1219
- textAlign: "center",
1220
- lineHeight: "normal",
1221
- height: "auto"
1222
- }
1223
- },
1224
- component: {
1225
- name: "Text",
1226
- options: {
1227
- text: "<p>Enter some text...</p>"
1228
- }
1229
- }
1230
- }
1231
- ]
1232
- },
1233
- {
1234
- name: "width",
1235
- type: "number",
1236
- hideFromUI: !0,
1237
- helperText: "Width %, e.g. set to 50 to fill half of the space"
1238
- },
1239
- {
1240
- name: "link",
1241
- type: "url",
1242
- helperText: "Optionally set a url that clicking this column will link to"
1243
- }
1244
- ],
1245
- defaultValue: [
1246
- {
1247
- blocks: [
1248
- {
1249
- "@type": "@builder.io/sdk:Element",
1250
- responsiveStyles: {
1251
- large: {
1252
- display: "flex",
1253
- flexDirection: "column",
1254
- alignItems: "stretch",
1255
- flexShrink: "0",
1256
- position: "relative",
1257
- marginTop: "30px",
1258
- textAlign: "center",
1259
- lineHeight: "normal",
1260
- height: "auto",
1261
- minHeight: "20px",
1262
- minWidth: "20px",
1263
- overflow: "hidden"
1264
- }
1265
- },
1266
- component: {
1267
- name: "Image",
1268
- options: {
1269
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1270
- backgroundPosition: "center",
1271
- backgroundSize: "cover",
1272
- aspectRatio: 0.7004048582995948
1273
- }
1274
- }
1275
- },
1276
- {
1277
- "@type": "@builder.io/sdk:Element",
1278
- responsiveStyles: {
1279
- large: {
1280
- display: "flex",
1281
- flexDirection: "column",
1282
- alignItems: "stretch",
1283
- flexShrink: "0",
1284
- position: "relative",
1285
- marginTop: "30px",
1286
- textAlign: "center",
1287
- lineHeight: "normal",
1288
- height: "auto"
1289
- }
1290
- },
1291
- component: {
1292
- name: "Text",
1293
- options: {
1294
- text: "<p>Enter some text...</p>"
1295
- }
1296
- }
1297
- }
1298
- ]
1299
- },
1300
- {
1301
- blocks: [
1302
- {
1303
- "@type": "@builder.io/sdk:Element",
1304
- responsiveStyles: {
1305
- large: {
1306
- display: "flex",
1307
- flexDirection: "column",
1308
- alignItems: "stretch",
1309
- flexShrink: "0",
1310
- position: "relative",
1311
- marginTop: "30px",
1312
- textAlign: "center",
1313
- lineHeight: "normal",
1314
- height: "auto",
1315
- minHeight: "20px",
1316
- minWidth: "20px",
1317
- overflow: "hidden"
1318
- }
1319
- },
1320
- component: {
1321
- name: "Image",
1322
- options: {
1323
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1324
- backgroundPosition: "center",
1325
- backgroundSize: "cover",
1326
- aspectRatio: 0.7004048582995948
1327
- }
1328
- }
1329
- },
1330
- {
1331
- "@type": "@builder.io/sdk:Element",
1332
- responsiveStyles: {
1333
- large: {
1334
- display: "flex",
1335
- flexDirection: "column",
1336
- alignItems: "stretch",
1337
- flexShrink: "0",
1338
- position: "relative",
1339
- marginTop: "30px",
1340
- textAlign: "center",
1341
- lineHeight: "normal",
1342
- height: "auto"
1343
- }
1344
- },
1345
- component: {
1346
- name: "Text",
1347
- options: {
1348
- text: "<p>Enter some text...</p>"
1349
- }
1350
- }
1351
- }
1352
- ]
1353
- }
1354
- ],
1355
- onChange: z((e) => {
1356
- function t() {
1357
- n.forEach((o) => {
1358
- o.delete("width");
1359
- });
1360
- }
1361
- const n = e.get("columns");
1362
- Array.isArray(n) && !!n.find(
1363
- (r) => r.get("width")
1364
- ) && (!!n.find(
1365
- (i) => !i.get("width")
1366
- ) || n.reduce((l, a) => l + a.get("width"), 0) !== 100) && t();
1367
- })
1368
- },
1369
- {
1370
- name: "space",
1371
- type: "number",
1372
- defaultValue: 20,
1373
- helperText: "Size of gap between columns",
1374
- advanced: !0
1375
- },
1376
- {
1377
- name: "stackColumnsAt",
1378
- type: "string",
1379
- defaultValue: "tablet",
1380
- helperText: "Convert horizontal columns to vertical at what device size",
1381
- enum: ["tablet", "mobile", "never"],
1382
- advanced: !0
1383
- },
1384
- {
1385
- name: "reverseColumnsWhenStacked",
1386
- type: "boolean",
1387
- defaultValue: !1,
1388
- helperText: "When stacking columns for mobile devices, reverse the ordering",
1389
- advanced: !0
1390
- }
1391
- ]
1392
- }, tn = {
1393
- name: "Fragment",
1394
- static: !0,
1395
- hidden: !0,
1396
- canHaveChildren: !0,
1397
- noWrap: !0
1398
- }, nn = {
1399
- name: "Image",
1400
- static: !0,
1401
- 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",
1402
- defaultStyles: {
1403
- position: "relative",
1404
- minHeight: "20px",
1405
- minWidth: "20px",
1406
- overflow: "hidden"
1407
- },
1408
- canHaveChildren: !0,
1409
- inputs: [
1410
- {
1411
- name: "image",
1412
- type: "file",
1413
- bubble: !0,
1414
- allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1415
- required: !0,
1416
- defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1417
- onChange: z(
1418
- (e) => {
1419
- e.delete("srcset"), e.delete("noWebp");
1420
- function n(s, l = 6e4) {
1421
- return new Promise((a, c) => {
1422
- const u = document.createElement("img");
1423
- let p = !1;
1424
- u.onload = () => {
1425
- p = !0, a(u);
1426
- }, u.addEventListener("error", (h) => {
1427
- console.warn("Image load failed", h.error), c(h.error);
1428
- }), u.src = s, setTimeout(() => {
1429
- p || c(new Error("Image load timed out"));
1430
- }, l);
1431
- });
1432
- }
1433
- function o(s) {
1434
- return Math.round(s * 1e3) / 1e3;
1435
- }
1436
- const r = e.get("image"), i = e.get("aspectRatio");
1437
- if (fetch(r).then((s) => s.blob()).then((s) => {
1438
- s.type.includes("svg") && e.set("noWebp", !0);
1439
- }), r && (!i || i === 0.7041))
1440
- return n(r).then((s) => {
1441
- const l = e.get("aspectRatio");
1442
- e.get("image") === r && (!l || l === 0.7041) && s.width && s.height && (e.set("aspectRatio", o(s.height / s.width)), e.set("height", s.height), e.set("width", s.width));
1443
- });
1444
- }
1445
- )
1446
- },
1447
- {
1448
- name: "backgroundSize",
1449
- type: "text",
1450
- defaultValue: "cover",
1451
- enum: [
1452
- {
1453
- label: "contain",
1454
- value: "contain",
1455
- helperText: "The image should never get cropped"
1456
- },
1457
- {
1458
- label: "cover",
1459
- value: "cover",
1460
- helperText: "The image should fill it's box, cropping when needed"
1461
- }
1462
- ]
1463
- },
1464
- {
1465
- name: "backgroundPosition",
1466
- type: "text",
1467
- defaultValue: "center",
1468
- enum: [
1469
- "center",
1470
- "top",
1471
- "left",
1472
- "right",
1473
- "bottom",
1474
- "top left",
1475
- "top right",
1476
- "bottom left",
1477
- "bottom right"
1478
- ]
1479
- },
1480
- {
1481
- name: "altText",
1482
- type: "string",
1483
- helperText: "Text to display when the user has images off"
1484
- },
1485
- {
1486
- name: "height",
1487
- type: "number",
1488
- hideFromUI: !0
1489
- },
1490
- {
1491
- name: "width",
1492
- type: "number",
1493
- hideFromUI: !0
1494
- },
1495
- {
1496
- name: "sizes",
1497
- type: "string",
1498
- hideFromUI: !0
1499
- },
1500
- {
1501
- name: "srcset",
1502
- type: "string",
1503
- hideFromUI: !0
1504
- },
1505
- {
1506
- name: "lazy",
1507
- type: "boolean",
1508
- defaultValue: !0,
1509
- hideFromUI: !0
1510
- },
1511
- {
1512
- name: "fitContent",
1513
- type: "boolean",
1514
- helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1515
- defaultValue: !0
1516
- },
1517
- {
1518
- name: "aspectRatio",
1519
- type: "number",
1520
- helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
1521
- advanced: !0,
1522
- defaultValue: 0.7041
1523
- }
1524
- ]
1525
- }, on = {
1526
- name: "Core:Section",
1527
- static: !0,
1528
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1529
- inputs: [
1530
- {
1531
- name: "maxWidth",
1532
- type: "number",
1533
- defaultValue: 1200
1534
- },
1535
- {
1536
- name: "lazyLoad",
1537
- type: "boolean",
1538
- defaultValue: !1,
1539
- advanced: !0,
1540
- description: "Only render this section when in view"
1541
- }
1542
- ],
1543
- defaultStyles: {
1544
- paddingLeft: "20px",
1545
- paddingRight: "20px",
1546
- paddingTop: "50px",
1547
- paddingBottom: "50px",
1548
- marginTop: "0px",
1549
- width: "100vw",
1550
- marginLeft: "calc(50% - 50vw)"
1551
- },
1552
- canHaveChildren: !0,
1553
- defaultChildren: [
1554
- {
1555
- "@type": "@builder.io/sdk:Element",
1556
- responsiveStyles: {
1557
- large: {
1558
- textAlign: "center"
1559
- }
1560
- },
1561
- component: {
1562
- name: "Text",
1563
- options: {
1564
- text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
1565
- }
1566
- }
1567
- }
1568
- ]
1569
- }, rn = {
1570
- name: "Symbol",
1571
- noWrap: !0,
1572
- static: !0,
1573
- inputs: [
1574
- {
1575
- name: "symbol",
1576
- type: "uiSymbol"
1577
- },
1578
- {
1579
- name: "dataOnly",
1580
- helperText: "Make this a data symbol that doesn't display any UI",
1581
- type: "boolean",
1582
- defaultValue: !1,
1583
- advanced: !0,
1584
- hideFromUI: !0
1585
- },
1586
- {
1587
- name: "inheritState",
1588
- helperText: "Inherit the parent component state and data",
1589
- type: "boolean",
1590
- defaultValue: !1,
1591
- advanced: !0
1592
- },
1593
- {
1594
- name: "renderToLiquid",
1595
- helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1596
- type: "boolean",
1597
- defaultValue: !1,
1598
- advanced: !0,
1599
- hideFromUI: !0
1600
- },
1601
- {
1602
- name: "useChildren",
1603
- hideFromUI: !0,
1604
- type: "boolean"
1605
- }
1606
- ]
1607
- }, sn = {
1608
- name: "Text",
1609
- static: !0,
1610
- image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
1611
- inputs: [
1612
- {
1613
- name: "text",
1614
- type: "html",
1615
- required: !0,
1616
- autoFocus: !0,
1617
- bubble: !0,
1618
- defaultValue: "Enter some text..."
1619
- }
1620
- ],
1621
- defaultStyles: {
1622
- lineHeight: "normal",
1623
- height: "auto",
1624
- textAlign: "center"
1625
- }
1626
- }, an = f({
1627
- name: "builder-text",
1628
- props: ["text"]
1629
- }), ln = ["innerHTML"];
1630
- function cn(e, t, n, o, r, i) {
1631
- var s;
1632
- return d(), m("span", {
1633
- class: "builder-text",
1634
- innerHTML: (s = e.text) == null ? void 0 : s.toString(),
1635
- style: {
1636
- outline: "none"
1637
- }
1638
- }, null, 8, ln);
1639
- }
1640
- const dn = /* @__PURE__ */ y(an, [["render", cn]]), un = {
1641
- name: "Video",
1642
- canHaveChildren: !0,
1643
- defaultStyles: {
1644
- minHeight: "20px",
1645
- minWidth: "20px"
1646
- },
1647
- image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
1648
- inputs: [
1649
- {
1650
- name: "video",
1651
- type: "file",
1652
- allowedFileTypes: ["mp4"],
1653
- bubble: !0,
1654
- defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
1655
- required: !0
1656
- },
1657
- {
1658
- name: "posterImage",
1659
- type: "file",
1660
- allowedFileTypes: ["jpeg", "png"],
1661
- helperText: "Image to show before the video plays"
1662
- },
1663
- {
1664
- name: "autoPlay",
1665
- type: "boolean",
1666
- defaultValue: !0
1667
- },
1668
- {
1669
- name: "controls",
1670
- type: "boolean",
1671
- defaultValue: !1
1672
- },
1673
- {
1674
- name: "muted",
1675
- type: "boolean",
1676
- defaultValue: !0
1677
- },
1678
- {
1679
- name: "loop",
1680
- type: "boolean",
1681
- defaultValue: !0
1682
- },
1683
- {
1684
- name: "playsInline",
1685
- type: "boolean",
1686
- defaultValue: !0
1687
- },
1688
- {
1689
- name: "fit",
1690
- type: "text",
1691
- defaultValue: "cover",
1692
- enum: ["contain", "cover", "fill", "auto"]
1693
- },
1694
- {
1695
- name: "fitContent",
1696
- type: "boolean",
1697
- helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1698
- defaultValue: !0,
1699
- advanced: !0
1700
- },
1701
- {
1702
- name: "position",
1703
- type: "text",
1704
- defaultValue: "center",
1705
- enum: [
1706
- "center",
1707
- "top",
1708
- "left",
1709
- "right",
1710
- "bottom",
1711
- "top left",
1712
- "top right",
1713
- "bottom left",
1714
- "bottom right"
1715
- ]
1716
- },
1717
- {
1718
- name: "height",
1719
- type: "number",
1720
- advanced: !0
1721
- },
1722
- {
1723
- name: "width",
1724
- type: "number",
1725
- advanced: !0
1726
- },
1727
- {
1728
- name: "aspectRatio",
1729
- type: "number",
1730
- advanced: !0,
1731
- defaultValue: 0.7004048582995948
1732
- },
1733
- {
1734
- name: "lazyLoad",
1735
- type: "boolean",
1736
- helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1737
- defaultValue: !0,
1738
- advanced: !0
1739
- }
1740
- ]
1741
- }, pn = f({
1742
- name: "builder-video",
1743
- props: [
1744
- "autoPlay",
1745
- "muted",
1746
- "controls",
1747
- "loop",
1748
- "playsInline",
1749
- "attributes",
1750
- "fit",
1751
- "position",
1752
- "video",
1753
- "posterImage"
1754
- ],
1755
- computed: {
1756
- videoProps() {
1757
- return {
1758
- ...this.autoPlay === !0 ? {
1759
- autoPlay: !0
1760
- } : {},
1761
- ...this.muted === !0 ? {
1762
- muted: !0
1763
- } : {},
1764
- ...this.controls === !0 ? {
1765
- controls: !0
1766
- } : {},
1767
- ...this.loop === !0 ? {
1768
- loop: !0
1769
- } : {},
1770
- ...this.playsInline === !0 ? {
1771
- playsInline: !0
1772
- } : {}
1773
- };
1774
- },
1775
- spreadProps() {
1776
- return {
1777
- ...this.attributes,
1778
- ...this.videoProps
1779
- };
1780
- }
1781
- }
1782
- }), mn = ["src", "poster"];
1783
- function hn(e, t, n, o, r, i) {
1784
- var s;
1785
- return d(), m("video", T({
1786
- style: {
1787
- width: "100%",
1788
- height: "100%",
1789
- ...(s = e.attributes) == null ? void 0 : s.style,
1790
- objectFit: e.fit,
1791
- objectPosition: e.position,
1792
- borderRadius: 1
1793
- },
1794
- src: e.video || "no-src",
1795
- poster: e.posterImage
1796
- }, e.spreadProps), null, 16, mn);
1797
- }
1798
- const fn = /* @__PURE__ */ y(pn, [["render", hn]]), gn = {
1799
- name: "Embed",
1800
- static: !0,
1801
- inputs: [
1802
- {
1803
- name: "url",
1804
- type: "url",
1805
- required: !0,
1806
- defaultValue: "",
1807
- helperText: "e.g. enter a youtube url, google map, etc",
1808
- onChange: z(
1809
- (e) => {
1810
- const t = e.get("url");
1811
- if (t)
1812
- return e.set("content", "Loading..."), fetch(
1813
- `https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`
1814
- ).then((o) => o.json()).then((o) => {
1815
- e.get("url") === t && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
1816
- }).catch((o) => {
1817
- e.set(
1818
- "content",
1819
- "There was an error embedding this URL, please try again or another URL"
1820
- );
1821
- });
1822
- e.delete("content");
1823
- }
1824
- )
1825
- },
1826
- {
1827
- name: "content",
1828
- type: "html",
1829
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1830
- hideFromUI: !0
1831
- }
1832
- ]
1833
- }, bn = [
1834
- "text/javascript",
1835
- "application/javascript",
1836
- "application/ecmascript"
1837
- ], yn = (e) => bn.includes(e.type), kn = f({
1838
- name: "builder-embed",
1839
- props: ["content"],
1840
- data() {
1841
- return { scriptsInserted: [], scriptsRun: [], ranInitFn: !1 };
1842
- },
1843
- watch: {
1844
- onUpdateHook0: {
1845
- handler() {
1846
- this.$refs.elem && !this.ranInitFn && (this.ranInitFn = !0, this.findAndRunScripts());
1847
- },
1848
- immediate: !0
1849
- }
1850
- },
1851
- computed: {
1852
- onUpdateHook0() {
1853
- return {
1854
- 0: this.$refs.elem,
1855
- 1: this.ranInitFn
1856
- };
1857
- }
1858
- },
1859
- methods: {
1860
- findAndRunScripts() {
1861
- if (!this.$refs.elem || !this.$refs.elem.getElementsByTagName)
1862
- return;
1863
- const e = this.$refs.elem.getElementsByTagName("script");
1864
- for (let t = 0; t < e.length; t++) {
1865
- const n = e[t];
1866
- if (n.src && !this.scriptsInserted.includes(n.src)) {
1867
- this.scriptsInserted.push(n.src);
1868
- const o = document.createElement("script");
1869
- o.async = !0, o.src = n.src, document.head.appendChild(o);
1870
- } else if (yn(n) && !this.scriptsRun.includes(n.innerText))
1871
- try {
1872
- this.scriptsRun.push(n.innerText), new Function(n.innerText)();
1873
- } catch (o) {
1874
- console.warn("`Embed`: Error running script:", o);
1875
- }
1876
- }
1877
- }
1878
- }
1879
- }), Sn = ["innerHTML"];
1880
- function vn(e, t, n, o, r, i) {
1881
- return d(), m("div", {
1882
- class: "builder-embed",
1883
- ref: "elem",
1884
- innerHTML: e.content
1885
- }, null, 8, Sn);
1886
- }
1887
- const Cn = /* @__PURE__ */ y(kn, [["render", vn]]), wn = f({
1888
- name: "builder-img-component",
1889
- props: [
1890
- "backgroundSize",
1891
- "backgroundPosition",
1892
- "imgSrc",
1893
- "altText",
1894
- "image",
1895
- "attributes"
1896
- ],
1897
- data() {
1898
- return { isEditing: V };
1899
- },
1900
- methods: {
1901
- filterAttrs: function(t = {}, n) {
1902
- const o = "v-on:";
1903
- return Object.keys(t).filter((r) => {
1904
- if (!t[r])
1905
- return !1;
1906
- const i = r.startsWith(o);
1907
- return n ? i : !i;
1908
- }).reduce(
1909
- (r, i) => ({
1910
- ...r,
1911
- [i.replace(o, "")]: t[i]
1912
- }),
1913
- {}
1914
- );
1915
- }
1916
- }
1917
- }), $n = ["alt", "src"];
1918
- function Tn(e, t, n, o, r, i) {
1919
- return d(), m("img", T({
1920
- style: {
1921
- objectFit: e.backgroundSize || "cover",
1922
- objectPosition: e.backgroundPosition || "center"
1923
- },
1924
- key: e.isEditing() && e.imgSrc || "default-key",
1925
- alt: e.altText,
1926
- src: e.imgSrc || e.image
1927
- }, e.filterAttrs(e.attributes, !1), P(e.filterAttrs(e.attributes, !0), !0)), null, 16, $n);
1928
- }
1929
- const xn = /* @__PURE__ */ y(wn, [["render", Tn]]), In = {
1930
- name: "Raw:Img",
1931
- hideFromInsertMenu: !0,
1932
- 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",
1933
- inputs: [
1934
- {
1935
- name: "image",
1936
- bubble: !0,
1937
- type: "file",
1938
- allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1939
- required: !0
1940
- }
1941
- ],
1942
- noWrap: !0,
1943
- static: !0
1944
- }, Rn = f({
1945
- name: "builder-custom-code",
1946
- props: ["replaceNodes", "code"],
1947
- data() {
1948
- return { scriptsInserted: [], scriptsRun: [] };
1949
- },
1950
- mounted() {
1951
- this.findAndRunScripts();
1952
- },
1953
- methods: {
1954
- findAndRunScripts() {
1955
- if (this.$refs.elem && this.$refs.elem.getElementsByTagName && typeof window < "u") {
1956
- const e = this.$refs.elem.getElementsByTagName("script");
1957
- for (let t = 0; t < e.length; t++) {
1958
- const n = e[t];
1959
- if (n.src) {
1960
- if (this.scriptsInserted.includes(n.src))
1961
- continue;
1962
- this.scriptsInserted.push(n.src);
1963
- const o = document.createElement("script");
1964
- o.async = !0, o.src = n.src, document.head.appendChild(o);
1965
- } else if (!n.type || [
1966
- "text/javascript",
1967
- "application/javascript",
1968
- "application/ecmascript"
1969
- ].includes(n.type)) {
1970
- if (this.scriptsRun.includes(n.innerText))
1971
- continue;
1972
- try {
1973
- this.scriptsRun.push(n.innerText), new Function(n.innerText)();
1974
- } catch (o) {
1975
- console.warn("`CustomCode`: Error running script:", o);
1976
- }
1977
- }
1978
- }
1979
- }
1980
- },
1981
- _classStringToObject(e) {
1982
- const t = {};
1983
- if (typeof e != "string")
1984
- return t;
1985
- const n = e.trim().split(/\s+/);
1986
- for (const o of n)
1987
- t[o] = !0;
1988
- return t;
1989
- }
1990
- }
1991
- }), En = ["innerHTML"];
1992
- function An(e, t, n, o, r, i) {
1993
- return d(), m("div", {
1994
- ref: "elem",
1995
- class: L(
1996
- e._classStringToObject(
1997
- "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : "")
1998
- )
1999
- ),
2000
- innerHTML: e.code
2001
- }, null, 10, En);
2002
- }
2003
- const Vn = /* @__PURE__ */ y(Rn, [["render", An]]), Bn = {
2004
- name: "Custom Code",
2005
- static: !0,
2006
- requiredPermissions: ["editCode"],
2007
- inputs: [
2008
- {
2009
- name: "code",
2010
- type: "html",
2011
- required: !0,
2012
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
2013
- code: !0
2014
- },
2015
- {
2016
- name: "replaceNodes",
2017
- type: "boolean",
2018
- helperText: "Preserve server rendered dom nodes",
2019
- advanced: !0
2020
- },
2021
- {
2022
- name: "scriptsClientOnly",
2023
- type: "boolean",
2024
- defaultValue: !1,
2025
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
2026
- advanced: !0
2027
- }
2028
- ]
2029
- }, _n = () => [
2030
- { component: ze, ...Zt },
2031
- { component: Vt, ...en },
2032
- { component: Vn, ...Bn },
2033
- { component: Cn, ...gn },
2034
- { component: Pt, ...tn },
2035
- { component: Lt, ...nn },
2036
- { component: xn, ...In },
2037
- { component: zt, ...on },
2038
- { component: qo, ...rn },
2039
- { component: dn, ...sn },
2040
- { component: fn, ...un }
2041
- ], U = "[Builder.io]: ", B = {
2042
- log: (...e) => console.log(U, ...e),
2043
- error: (...e) => console.error(U, ...e),
2044
- warn: (...e) => console.warn(U, ...e),
2045
- debug: (...e) => console.debug(U, ...e)
2046
- }, Pn = (e) => {
2047
- if (e === "localhost" || e === "127.0.0.1")
2048
- return e;
2049
- const t = e.split(".");
2050
- return t.length > 2 ? t.slice(1).join(".") : e;
2051
- }, $e = ({
2052
- name: e,
2053
- canTrack: t
2054
- }) => {
2055
- var n;
2056
- try {
2057
- return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
2058
- } catch (o) {
2059
- B.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
2060
- return;
2061
- }
2062
- }, Te = async (e) => $e(e), On = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(R).join("; "), jn = [
2063
- ["secure", ""],
2064
- ["SameSite", "None"]
2065
- ], Nn = ({
2066
- name: e,
2067
- value: t,
2068
- expires: n
2069
- }) => {
2070
- const r = (C() ? location.protocol === "https:" : !0) ? jn : [[]], i = n ? [["expires", n.toUTCString()]] : [[]], s = [
2071
- [e, t],
2072
- ...i,
2073
- ["path", "/"],
2074
- ["domain", Pn(window.location.hostname)],
2075
- ...r
2076
- ];
2077
- return On(s);
2078
- }, xe = async ({
2079
- name: e,
2080
- value: t,
2081
- expires: n,
2082
- canTrack: o
2083
- }) => {
2084
- try {
2085
- if (!o)
2086
- return;
2087
- const r = Nn({ name: e, value: t, expires: n });
2088
- document.cookie = r;
2089
- } catch (r) {
2090
- B.warn("[COOKIE] SET error: ", (r == null ? void 0 : r.message) || r);
2091
- }
2092
- }, Fn = "builder.tests", ne = (e) => `${Fn}.${e}`, Un = ({ contentId: e }) => Te({ name: ne(e), canTrack: !0 }), Mn = ({ contentId: e }) => $e({ name: ne(e), canTrack: !0 }), Wn = ({
2093
- contentId: e,
2094
- value: t
2095
- }) => xe({ name: ne(e), value: t, canTrack: !0 }), Ie = (e) => R(e.id) && R(e.variations) && Object.keys(e.variations).length > 0, Ln = ({
2096
- id: e,
2097
- variations: t
2098
- }) => {
2099
- var r;
2100
- let n = 0;
2101
- const o = Math.random();
2102
- for (const i in t) {
2103
- const s = (r = t[i]) == null ? void 0 : r.testRatio;
2104
- if (n += s, o < n)
2105
- return i;
2106
- }
2107
- return e;
2108
- }, Re = (e) => {
2109
- const t = Ln(e);
2110
- return Wn({
2111
- contentId: e.id,
2112
- value: t
2113
- }).catch((n) => {
2114
- B.error("could not store A/B test variation: ", n);
2115
- }), t;
2116
- }, Ee = ({
2117
- item: e,
2118
- testGroupId: t
2119
- }) => {
2120
- const n = e.variations[t];
2121
- return t === e.id || !n ? {
2122
- testVariationId: e.id,
2123
- testVariationName: "Default"
2124
- } : {
2125
- data: n.data,
2126
- testVariationId: n.id,
2127
- testVariationName: n.name || (n.id === e.id ? "Default" : "")
2128
- };
2129
- }, Hn = ({
2130
- item: e,
2131
- canTrack: t
2132
- }) => {
2133
- if (!t)
2134
- return e;
2135
- if (!e)
2136
- return;
2137
- if (!Ie(e))
2138
- return e;
2139
- const n = Mn({
2140
- contentId: e.id
2141
- }) || Re({
2142
- variations: e.variations,
2143
- id: e.id
2144
- }), o = Ee({ item: e, testGroupId: n });
2145
- return {
2146
- ...e,
2147
- ...o
2148
- };
2149
- }, Kn = async ({
2150
- item: e,
2151
- canTrack: t
2152
- }) => {
2153
- if (!t || !Ie(e))
2154
- return e;
2155
- const o = await Un({
2156
- contentId: e.id
2157
- }) || Re({
2158
- variations: e.variations,
2159
- id: e.id
2160
- }), r = Ee({ item: e, testGroupId: o });
2161
- return {
2162
- ...e,
2163
- ...r
2164
- };
2165
- }, X = (e) => R(e) ? e : !0;
2166
- function zn() {
2167
- return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
2168
- }
2169
- function Dn() {
2170
- const e = zn().fetch;
2171
- if (typeof e > "u")
2172
- throw console.warn(
2173
- `Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
2174
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`
2175
- ), new Error("Builder SDK could not find a global `fetch` function");
2176
- return e;
2177
- }
2178
- const Ae = Dn();
2179
- function Q(e, t = null, n = ".") {
2180
- return Object.keys(e).reduce((o, r) => {
2181
- const i = e[r], s = [t, r].filter(Boolean).join(n);
2182
- return [
2183
- typeof i == "object",
2184
- i !== null,
2185
- !(Array.isArray(i) && i.length === 0)
2186
- ].every(Boolean) ? { ...o, ...Q(i, s, n) } : { ...o, [s]: i };
2187
- }, {});
2188
- }
2189
- const ae = "builder.", qn = "options.", Gn = (e) => {
2190
- const t = {};
2191
- return e.forEach((n, o) => {
2192
- t[o] = n;
2193
- }), t;
2194
- }, Jn = (e) => {
2195
- if (!e)
2196
- return {};
2197
- const t = Ve(e), n = {};
2198
- return Object.keys(t).forEach((o) => {
2199
- if (o.startsWith(ae)) {
2200
- const r = o.replace(ae, "").replace(qn, "");
2201
- n[r] = t[o];
2202
- }
2203
- }), n;
2204
- }, Yn = () => {
2205
- if (!C())
2206
- return {};
2207
- const e = new URLSearchParams(window.location.search);
2208
- return Jn(e);
2209
- }, Ve = (e) => e instanceof URLSearchParams ? Gn(e) : e, Xn = "v3", Be = (e) => {
2210
- const {
2211
- limit: t = 30,
2212
- userAttributes: n,
2213
- query: o,
2214
- noTraverse: r = !1,
2215
- model: i,
2216
- apiKey: s,
2217
- includeRefs: l = !0,
2218
- enrich: a,
2219
- locale: c,
2220
- apiVersion: u = Xn
2221
- } = e;
2222
- if (!s)
2223
- throw new Error("Missing API key");
2224
- if (!["v2", "v3"].includes(u))
2225
- throw new Error(
2226
- `Invalid apiVersion: expected 'v2' or 'v3', received '${u}'`
2227
- );
2228
- const p = new URL(
2229
- `https://cdn.builder.io/api/${u}/content/${i}?apiKey=${s}&limit=${t}&noTraverse=${r}&includeRefs=${l}${c ? `&locale=${c}` : ""}${a ? `&enrich=${a}` : ""}`
2230
- ), h = {
2231
- ...Yn(),
2232
- ...Ve(e.options || {})
2233
- }, k = Q(h);
2234
- for (const S in k)
2235
- p.searchParams.set(S, String(k[S]));
2236
- if (n && p.searchParams.set("userAttributes", JSON.stringify(n)), o) {
2237
- const S = Q({ query: o });
2238
- for (const w in S)
2239
- p.searchParams.set(w, JSON.stringify(S[w]));
2240
- }
2241
- return p;
2242
- }, _e = (e) => "results" in e;
2243
- async function Pe(e) {
2244
- const t = await eo({ ...e, limit: 1 });
2245
- return t && _e(t) && t.results[0] || null;
2246
- }
2247
- const Qn = async (e) => {
2248
- const t = Be(e);
2249
- return await (await Ae(t.href)).json();
2250
- }, Zn = async (e, t) => {
2251
- const n = X(e.canTrack);
2252
- if (!n || !(C() || E === "reactNative"))
2253
- return t;
2254
- try {
2255
- const o = [];
2256
- for (const r of t.results)
2257
- o.push(await Kn({ item: r, canTrack: n }));
2258
- t.results = o;
2259
- } catch (o) {
2260
- B.error("Could not process A/B tests. ", o);
2261
- }
2262
- return t;
2263
- };
2264
- async function eo(e) {
2265
- try {
2266
- const t = Be(e), n = await Qn(e);
2267
- return _e(n) ? Zn(e, n) : (B.error("Error fetching data. ", { url: t, content: n, options: e }), n);
2268
- } catch (t) {
2269
- return B.error("Error fetching data. ", t), null;
2270
- }
2271
- }
2272
- function to() {
2273
- return !C() || V() ? !1 : Boolean(location.search.indexOf("builder.preview=") !== -1);
2274
- }
2275
- const no = [], oo = ({
2276
- component: e,
2277
- ...t
2278
- }) => ({
2279
- type: "builder.registerComponent",
2280
- data: io(t)
2281
- }), ro = (e) => typeof e == "function" ? z(e) : H(e), io = ({
2282
- inputs: e,
2283
- ...t
2284
- }) => ({
2285
- ...H(t),
2286
- inputs: e == null ? void 0 : e.map(
2287
- (n) => Object.entries(n).reduce(
2288
- (o, [r, i]) => ({
2289
- ...o,
2290
- [r]: ro(i)
2291
- }),
2292
- {}
2293
- )
2294
- )
2295
- });
2296
- function so() {
2297
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
2298
- const t = Math.random() * 16 | 0;
2299
- return (e == "x" ? t : t & 3 | 8).toString(16);
2300
- });
2301
- }
2302
- function Oe() {
2303
- return so().replace(/-/g, "");
2304
- }
2305
- const je = "builderSessionId", ao = async ({
2306
- canTrack: e
2307
- }) => {
2308
- if (!e)
2309
- return;
2310
- const t = await Te({
2311
- name: je,
2312
- canTrack: e
2313
- });
2314
- if (R(t))
2315
- return t;
2316
- {
2317
- const n = lo();
2318
- return co({ id: n, canTrack: e }), n;
2319
- }
2320
- }, lo = () => Oe(), co = ({
2321
- id: e,
2322
- canTrack: t
2323
- }) => xe({ name: je, value: e, canTrack: t }), Ne = () => C() && typeof localStorage < "u" ? localStorage : void 0, uo = ({
2324
- key: e,
2325
- canTrack: t
2326
- }) => {
2327
- var n;
2328
- try {
2329
- return t ? (n = Ne()) == null ? void 0 : n.getItem(e) : void 0;
2330
- } catch (o) {
2331
- console.debug("[LocalStorage] GET error: ", o);
2332
- return;
2333
- }
2334
- }, po = ({
2335
- key: e,
2336
- canTrack: t,
2337
- value: n
2338
- }) => {
2339
- var o;
2340
- try {
2341
- t && ((o = Ne()) == null || o.setItem(e, n));
2342
- } catch (r) {
2343
- console.debug("[LocalStorage] SET error: ", r);
2344
- }
2345
- }, Fe = "builderVisitorId", mo = ({ canTrack: e }) => {
2346
- if (!e)
2347
- return;
2348
- const t = uo({
2349
- key: Fe,
2350
- canTrack: e
2351
- });
2352
- if (R(t))
2353
- return t;
2354
- {
2355
- const n = ho();
2356
- return fo({ id: n, canTrack: e }), n;
2357
- }
2358
- }, ho = () => Oe(), fo = ({
2359
- id: e,
2360
- canTrack: t
2361
- }) => po({
2362
- key: Fe,
2363
- value: e,
2364
- canTrack: t
2365
- }), go = () => {
2366
- if (C()) {
2367
- const e = new URL(location.href);
2368
- return e.pathname === "" && (e.pathname = "/"), e;
2369
- } else
2370
- return console.warn("Cannot get location for tracking in non-browser environment"), null;
2371
- }, bo = () => typeof navigator == "object" && navigator.userAgent || "", yo = () => {
2372
- const e = bo(), t = {
2373
- Android() {
2374
- return e.match(/Android/i);
2375
- },
2376
- BlackBerry() {
2377
- return e.match(/BlackBerry/i);
2378
- },
2379
- iOS() {
2380
- return e.match(/iPhone|iPod/i);
2381
- },
2382
- Opera() {
2383
- return e.match(/Opera Mini/i);
2384
- },
2385
- Windows() {
2386
- return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
2387
- },
2388
- any() {
2389
- return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || E === "reactNative";
2390
- }
2391
- }, n = e.match(/Tablet|iPad/i), o = go();
2392
- return {
2393
- urlPath: o == null ? void 0 : o.pathname,
2394
- host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
2395
- device: n ? "tablet" : t.any() ? "mobile" : "desktop"
2396
- };
2397
- }, ko = async ({
2398
- canTrack: e
2399
- }) => {
2400
- if (!e)
2401
- return { visitorId: void 0, sessionId: void 0 };
2402
- const t = await ao({ canTrack: e }), n = mo({ canTrack: e });
2403
- return {
2404
- sessionId: t,
2405
- visitorId: n
2406
- };
2407
- }, So = async ({
2408
- type: e,
2409
- canTrack: t,
2410
- apiKey: n,
2411
- metadata: o,
2412
- ...r
2413
- }) => ({
2414
- type: e,
2415
- data: {
2416
- ...r,
2417
- metadata: {
2418
- url: location.href,
2419
- ...o
2420
- },
2421
- ...await ko({ canTrack: t }),
2422
- userAttributes: yo(),
2423
- ownerId: n
2424
- }
2425
- });
2426
- async function Z(e) {
2427
- if (!e.apiKey) {
2428
- B.error(
2429
- "Missing API key for track call. Please provide your API key."
2430
- );
2431
- return;
2432
- }
2433
- if (!!e.canTrack && !V() && !!(C() || E === "reactNative"))
2434
- return fetch("https://cdn.builder.io/api/v1/track", {
2435
- method: "POST",
2436
- body: JSON.stringify({
2437
- events: [await So(e)]
2438
- }),
2439
- headers: {
2440
- "content-type": "application/json"
2441
- },
2442
- mode: "cors"
2443
- }).catch((t) => {
2444
- console.error("Failed to track: ", t);
2445
- });
2446
- }
2447
- const Jo = (e) => Z({ ...e, canTrack: !0 }), vo = (e) => {
2448
- var i, s;
2449
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = (s = e.fileUrl) != null ? s : (i = e == null ? void 0 : e.files) == null ? void 0 : i.regular;
2450
- let r = "";
2451
- if (o && t && n && (r += `
2452
- @font-face {
2453
- font-family: "${t}";
2454
- src: local("${n}"), url('${o}') format('woff2');
2455
- font-display: fallback;
2456
- font-weight: 400;
2457
- }
2458
- `.trim()), e.files)
2459
- for (const l in e.files) {
2460
- if (!(String(Number(l)) === l))
2461
- continue;
2462
- const c = e.files[l];
2463
- c && c !== o && (r += `
2464
- @font-face {
2465
- font-family: "${t}";
2466
- src: url('${c}') format('woff2');
2467
- font-display: fallback;
2468
- font-weight: ${l};
2469
- }
2470
- `.trim());
2471
- }
2472
- return r;
2473
- }, Co = ({ customFonts: e }) => {
2474
- var t;
2475
- return ((t = e == null ? void 0 : e.map((n) => vo(n))) == null ? void 0 : t.join(" ")) || "";
2476
- }, wo = ({
2477
- cssCode: e,
2478
- contentId: t
2479
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", $o = f({
2480
- name: "render-content-styles",
2481
- components: { InlinedStyles: K },
2482
- props: ["cssCode", "contentId", "customFonts"],
2483
- data() {
2484
- return {
2485
- injectedStyles: `
2486
- ${wo({
2487
- cssCode: this.cssCode,
2488
- contentId: this.contentId
2489
- })}
2490
- ${Co({
2491
- customFonts: this.customFonts
2492
- })}
2493
-
2494
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2495
- margin: 0;
2496
- }
2497
- .builder-text > p, .builder-text > .builder-paragraph {
2498
- color: inherit;
2499
- line-height: inherit;
2500
- letter-spacing: inherit;
2501
- font-weight: inherit;
2502
- font-size: inherit;
2503
- text-align: inherit;
2504
- font-family: inherit;
2505
- }
2506
- `.trim()
2507
- };
2508
- }
2509
- });
2510
- function To(e, t, n, o, r, i) {
2511
- const s = b("inlined-styles");
2512
- return d(), g(s, { styles: e.injectedStyles }, null, 8, ["styles"]);
2513
- }
2514
- const xo = /* @__PURE__ */ y($o, [["render", To]]), Io = "0.4.5", le = {};
2515
- function Ro(e, t) {
2516
- let n = le[e];
2517
- if (n || (n = le[e] = []), n.push(t), C()) {
2518
- const o = {
2519
- type: "builder.register",
2520
- data: {
2521
- type: e,
2522
- info: t
2523
- }
2524
- };
2525
- try {
2526
- parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
2527
- } catch (r) {
2528
- console.debug("Could not postmessage", r);
2529
- }
2530
- }
2531
- }
2532
- const Eo = () => {
2533
- Ro("insertMenu", {
2534
- name: "_default",
2535
- default: !0,
2536
- items: [
2537
- { name: "Box" },
2538
- { name: "Text" },
2539
- { name: "Image" },
2540
- { name: "Columns" },
2541
- { name: "Core:Section" },
2542
- { name: "Core:Button" },
2543
- { name: "Embed" },
2544
- { name: "Custom Code" }
2545
- ]
2546
- });
2547
- };
2548
- let ce = !1;
2549
- const Ao = (e = {}) => {
2550
- var t, n;
2551
- ce || (ce = !0, C() && ((t = window.parent) == null || t.postMessage(
2552
- {
2553
- type: "builder.sdkInfo",
2554
- data: {
2555
- target: E,
2556
- version: Io,
2557
- supportsPatchUpdates: !1,
2558
- supportsAddBlockScoping: !0,
2559
- supportsCustomBreakpoints: !0
2560
- }
2561
- },
2562
- "*"
2563
- ), (n = window.parent) == null || n.postMessage(
2564
- {
2565
- type: "builder.updateContent",
2566
- data: {
2567
- options: e
2568
- }
2569
- },
2570
- "*"
2571
- ), window.addEventListener("message", ({ data: o }) => {
2572
- var r, i;
2573
- if (!!(o != null && o.type))
2574
- switch (o.type) {
2575
- case "builder.evaluate": {
2576
- const s = o.data.text, l = o.data.arguments || [], a = o.data.id, c = new Function(s);
2577
- let u, p = null;
2578
- try {
2579
- u = c.apply(null, l);
2580
- } catch (h) {
2581
- p = h;
2582
- }
2583
- p ? (r = window.parent) == null || r.postMessage(
2584
- {
2585
- type: "builder.evaluateError",
2586
- data: { id: a, error: p.message }
2587
- },
2588
- "*"
2589
- ) : u && typeof u.then == "function" ? u.then((h) => {
2590
- var k;
2591
- (k = window.parent) == null || k.postMessage(
2592
- {
2593
- type: "builder.evaluateResult",
2594
- data: { id: a, result: h }
2595
- },
2596
- "*"
2597
- );
2598
- }).catch(console.error) : (i = window.parent) == null || i.postMessage(
2599
- {
2600
- type: "builder.evaluateResult",
2601
- data: { result: u, id: a }
2602
- },
2603
- "*"
2604
- );
2605
- break;
2606
- }
2607
- }
2608
- })));
2609
- };
2610
- function de(e) {
2611
- return Math.round(e * 1e3) / 1e3;
2612
- }
2613
- const Vo = (e, t, n = !0) => {
2614
- if (!(e instanceof HTMLElement))
2615
- return null;
2616
- let o = n ? e : e.parentElement;
2617
- do {
2618
- if (!o)
2619
- return null;
2620
- if (t(o))
2621
- return o;
2622
- } while (o = o.parentElement);
2623
- return null;
2624
- }, Bo = (e) => Vo(e, (t) => {
2625
- const n = t.getAttribute("builder-id") || t.id;
2626
- return Boolean((n == null ? void 0 : n.indexOf("builder-")) === 0);
2627
- }), ue = ({
2628
- event: e,
2629
- target: t
2630
- }) => {
2631
- const n = t.getBoundingClientRect(), o = e.clientX - n.left, r = e.clientY - n.top, i = de(o / n.width), s = de(r / n.height);
2632
- return {
2633
- x: i,
2634
- y: s
2635
- };
2636
- }, _o = (e) => {
2637
- const t = e.target, n = t && Bo(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2638
- return {
2639
- targetBuilderElement: o || void 0,
2640
- metadata: {
2641
- targetOffset: t ? ue({ event: e, target: t }) : void 0,
2642
- builderTargetOffset: n ? ue({ event: e, target: n }) : void 0,
2643
- builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
2644
- }
2645
- };
2646
- }, Po = ({
2647
- content: e,
2648
- data: t,
2649
- locale: n
2650
- }) => {
2651
- var i, s, l;
2652
- const o = {};
2653
- (s = (i = e == null ? void 0 : e.data) == null ? void 0 : i.inputs) == null || s.forEach((a) => {
2654
- var c;
2655
- a.name && a.defaultValue !== void 0 && ((c = e == null ? void 0 : e.data) == null ? void 0 : c.state) && e.data.state[a.name] === void 0 && (o[a.name] = a.defaultValue);
2656
- });
2657
- const r = {
2658
- ...(l = e == null ? void 0 : e.data) == null ? void 0 : l.state,
2659
- ...t,
2660
- ...n ? { locale: n } : {}
2661
- };
2662
- return { ...o, ...r };
2663
- }, Oo = ({
2664
- content: e,
2665
- data: t
2666
- }) => e ? {
2667
- ...e,
2668
- data: {
2669
- ...e == null ? void 0 : e.data,
2670
- ...t
2671
- },
2672
- meta: e == null ? void 0 : e.meta
2673
- } : void 0, jo = We, Ue = f({
2674
- render() {
2675
- return me("script", { id: this.id, innerHTML: this.scriptStr });
2676
- },
2677
- name: "inlined-script",
2678
- props: ["scriptStr", "id"]
2679
- }), No = f({
2680
- name: "render-content",
2681
- components: {
2682
- InlinedScript: Ue,
2683
- RenderContentStyles: xo,
2684
- RenderBlocks: Se
2685
- },
2686
- props: [
2687
- "canTrack",
2688
- "model",
2689
- "context",
2690
- "apiKey",
2691
- "content",
2692
- "data",
2693
- "locale",
2694
- "apiVersion",
2695
- "customComponents",
2696
- "showContent",
2697
- "classNameProp",
2698
- "isSsrAbTest",
2699
- "includeRefs",
2700
- "enrich"
2701
- ],
2702
- data() {
2703
- var e, t;
2704
- return {
2705
- forceReRenderCount: 0,
2706
- overrideContent: null,
2707
- update: 0,
2708
- canTrackToUse: R(this.canTrack) ? this.canTrack : !0,
2709
- httpReqsData: {},
2710
- clicked: !1,
2711
- scriptStr: Qt({
2712
- variationId: (e = this.content) == null ? void 0 : e.testVariationId,
2713
- contentId: (t = this.content) == null ? void 0 : t.id
2714
- }),
2715
- builderContextSignal: {
2716
- content: Oo({
2717
- content: this.content,
2718
- data: this.data
2719
- }),
2720
- localState: void 0,
2721
- rootState: Po({
2722
- content: this.content,
2723
- data: this.data,
2724
- locale: this.locale
2725
- }),
2726
- rootSetState: this.contentSetState,
2727
- context: this.context || {},
2728
- apiKey: this.apiKey,
2729
- apiVersion: this.apiVersion,
2730
- registeredComponents: [
2731
- ..._n(),
2732
- ...no,
2733
- ...this.customComponents || []
2734
- ].reduce(
2735
- (n, { component: o, ...r }) => ({
2736
- ...n,
2737
- [r.name]: {
2738
- component: jo(o),
2739
- ...r
2740
- }
2741
- }),
2742
- {}
2743
- ),
2744
- inheritedStyles: {}
2745
- },
2746
- builderContext: j,
2747
- TARGET: E
2748
- };
2749
- },
2750
- provide() {
2751
- const e = this;
2752
- return {
2753
- [j.key]: e.builderContextSignal
2754
- };
2755
- },
2756
- mounted() {
2757
- var e, t;
2758
- if (this.apiKey || B.error(
2759
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2760
- ), C()) {
2761
- if (V() && (this.forceReRenderCount = this.forceReRenderCount + 1, Eo(), Ao({
2762
- ...this.locale ? {
2763
- locale: this.locale
2764
- } : {},
2765
- ...this.includeRefs ? {
2766
- includeRefs: this.includeRefs
2767
- } : {},
2768
- ...this.enrich ? {
2769
- enrich: this.enrich
2770
- } : {}
2771
- }), Object.values(
2772
- this.builderContextSignal.registeredComponents
2773
- ).forEach((n) => {
2774
- var r;
2775
- const o = oo(n);
2776
- (r = window.parent) == null || r.postMessage(o, "*");
2777
- }), window.addEventListener("message", this.processMessage), window.addEventListener(
2778
- "builder:component:stateChangeListenerActivated",
2779
- this.emitStateUpdate
2780
- )), this.builderContextSignal.content) {
2781
- const n = (e = this.builderContextSignal.content) == null ? void 0 : e.testVariationId, o = (t = this.builderContextSignal.content) == null ? void 0 : t.id;
2782
- Z({
2783
- type: "impression",
2784
- canTrack: this.canTrackToUse,
2785
- contentId: o,
2786
- apiKey: this.apiKey,
2787
- variationId: n !== o ? n : void 0
2788
- });
2789
- }
2790
- if (to()) {
2791
- const n = new URL(location.href).searchParams, o = n.get("builder.preview"), r = n.get(
2792
- `builder.preview.${o}`
2793
- ), i = n.get("apiKey") || n.get("builder.space");
2794
- o === this.model && i === this.apiKey && (!this.content || r === this.content.id) && Pe({
2795
- model: this.model,
2796
- apiKey: this.apiKey,
2797
- apiVersion: this.apiVersion
2798
- }).then((s) => {
2799
- s && this.mergeNewContent(s);
2800
- });
2801
- }
2802
- this.evaluateJsCode(), this.runHttpRequests(), this.emitStateUpdate();
2803
- }
2804
- },
2805
- watch: {
2806
- onUpdateHook0: {
2807
- handler() {
2808
- this.content && this.mergeNewContent(this.content);
2809
- },
2810
- immediate: !0
2811
- },
2812
- onUpdateHook1: {
2813
- handler() {
2814
- this.evaluateJsCode();
2815
- },
2816
- immediate: !0
2817
- },
2818
- onUpdateHook2: {
2819
- handler() {
2820
- this.runHttpRequests();
2821
- },
2822
- immediate: !0
2823
- },
2824
- onUpdateHook3: {
2825
- handler() {
2826
- this.emitStateUpdate();
2827
- },
2828
- immediate: !0
2829
- }
2830
- },
2831
- unmounted() {
2832
- C() && (window.removeEventListener("message", this.processMessage), window.removeEventListener(
2833
- "builder:component:stateChangeListenerActivated",
2834
- this.emitStateUpdate
2835
- ));
2836
- },
2837
- computed: {
2838
- onUpdateHook0() {
2839
- return {
2840
- 0: this.content
2841
- };
2842
- },
2843
- onUpdateHook1() {
2844
- var e, t;
2845
- return {
2846
- 0: (t = (e = this.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : t.jsCode,
2847
- 1: this.builderContextSignal.rootState
2848
- };
2849
- },
2850
- onUpdateHook2() {
2851
- var e, t;
2852
- return {
2853
- 0: (t = (e = this.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : t.httpRequests
2854
- };
2855
- },
2856
- onUpdateHook3() {
2857
- return {
2858
- 0: this.builderContextSignal.rootState
2859
- };
2860
- }
2861
- },
2862
- methods: {
2863
- mergeNewContent(e) {
2864
- var t, n, o, r, i;
2865
- this.builderContextSignal.content = {
2866
- ...this.builderContextSignal.content,
2867
- ...e,
2868
- data: {
2869
- ...(t = this.builderContextSignal.content) == null ? void 0 : t.data,
2870
- ...e == null ? void 0 : e.data
2871
- },
2872
- meta: {
2873
- ...(n = this.builderContextSignal.content) == null ? void 0 : n.meta,
2874
- ...e == null ? void 0 : e.meta,
2875
- breakpoints: ((o = e == null ? void 0 : e.meta) == null ? void 0 : o.breakpoints) || ((i = (r = this.builderContextSignal.content) == null ? void 0 : r.meta) == null ? void 0 : i.breakpoints)
2876
- }
2877
- };
2878
- },
2879
- setBreakpoints(e) {
2880
- var t;
2881
- this.builderContextSignal.content = {
2882
- ...this.builderContextSignal.content,
2883
- meta: {
2884
- ...(t = this.builderContextSignal.content) == null ? void 0 : t.meta,
2885
- breakpoints: e
2886
- }
2887
- };
2888
- },
2889
- contentSetState(e) {
2890
- this.builderContextSignal.rootState = e;
2891
- },
2892
- processMessage(e) {
2893
- var n;
2894
- const { data: t } = e;
2895
- if (t)
2896
- switch (t.type) {
2897
- case "builder.configureSdk": {
2898
- const o = t.data, { breakpoints: r, contentId: i } = o;
2899
- if (!i || i !== ((n = this.builderContextSignal.content) == null ? void 0 : n.id))
2900
- return;
2901
- r && this.setBreakpoints(r), this.forceReRenderCount = this.forceReRenderCount + 1;
2902
- break;
2903
- }
2904
- case "builder.contentUpdate": {
2905
- const o = t.data, r = o.key || o.alias || o.entry || o.modelName, i = o.data;
2906
- r === this.model && (this.mergeNewContent(i), this.forceReRenderCount = this.forceReRenderCount + 1);
2907
- break;
2908
- }
2909
- }
2910
- },
2911
- evaluateJsCode() {
2912
- var t, n;
2913
- const e = (n = (t = this.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : n.jsCode;
2914
- e && F({
2915
- code: e,
2916
- context: this.context || {},
2917
- localState: void 0,
2918
- rootState: this.builderContextSignal.rootState,
2919
- rootSetState: this.contentSetState
2920
- });
2921
- },
2922
- onClick(e) {
2923
- var t, n;
2924
- if (this.builderContextSignal.content) {
2925
- const o = (t = this.builderContextSignal.content) == null ? void 0 : t.testVariationId, r = (n = this.builderContextSignal.content) == null ? void 0 : n.id;
2926
- Z({
2927
- type: "click",
2928
- canTrack: this.canTrackToUse,
2929
- contentId: r,
2930
- apiKey: this.apiKey,
2931
- variationId: o !== r ? o : void 0,
2932
- ..._o(e),
2933
- unique: !this.clicked
2934
- });
2935
- }
2936
- this.clicked || (this.clicked = !0);
2937
- },
2938
- evalExpression(e) {
2939
- return e.replace(
2940
- /{{([^}]+)}}/g,
2941
- (t, n) => F({
2942
- code: n,
2943
- context: this.context || {},
2944
- localState: void 0,
2945
- rootState: this.builderContextSignal.rootState,
2946
- rootSetState: this.contentSetState
2947
- })
2948
- );
2949
- },
2950
- handleRequest({ url: e, key: t }) {
2951
- Ae(e).then((n) => n.json()).then((n) => {
2952
- const o = {
2953
- ...this.builderContextSignal.rootState,
2954
- [t]: n
2955
- };
2956
- this.contentSetState(o);
2957
- }).catch((n) => {
2958
- console.error("error fetching dynamic data", e, n);
2959
- });
2960
- },
2961
- runHttpRequests() {
2962
- var t, n, o;
2963
- const e = (o = (n = (t = this.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : n.httpRequests) != null ? o : {};
2964
- Object.entries(e).forEach(([r, i]) => {
2965
- if (i && (!this.httpReqsData[r] || V())) {
2966
- const s = this.evalExpression(i);
2967
- this.handleRequest({
2968
- url: s,
2969
- key: r
2970
- });
2971
- }
2972
- });
2973
- },
2974
- emitStateUpdate() {
2975
- V() && window.dispatchEvent(
2976
- new CustomEvent(
2977
- "builder:component:stateChange",
2978
- {
2979
- detail: {
2980
- state: this.builderContextSignal.rootState,
2981
- ref: {
2982
- name: this.model
2983
- }
2984
- }
2985
- }
2986
- )
2987
- );
2988
- },
2989
- _classStringToObject(e) {
2990
- const t = {};
2991
- if (typeof e != "string")
2992
- return t;
2993
- const n = e.trim().split(/\s+/);
2994
- for (const o of n)
2995
- t[o] = !0;
2996
- return t;
2997
- }
2998
- }
2999
- }), Fo = ["builder-content-id", "builder-model"];
3000
- function Uo(e, t, n, o, r, i) {
3001
- var c, u, p, h, k, S, w, I;
3002
- const s = b("inlined-script"), l = b("render-content-styles"), a = b("render-blocks");
3003
- return e.builderContextSignal.content ? (d(), m("div", T({
3004
- key: 0,
3005
- ref: "elementRef",
3006
- onClick: t[0] || (t[0] = (_) => e.onClick(_)),
3007
- "builder-content-id": (c = e.builderContextSignal.content) == null ? void 0 : c.id,
3008
- "builder-model": e.model,
3009
- class: e._classStringToObject(e.classNameProp)
3010
- }, {
3011
- ...e.TARGET === "reactNative" ? {
3012
- dataSet: {
3013
- "builder-content-id": ""
3014
- }
3015
- } : {},
3016
- ...e.showContent ? {} : {
3017
- hidden: !0,
3018
- "aria-hidden": !0
3019
- }
3020
- }), [
3021
- e.isSsrAbTest ? (d(), g(s, {
3022
- key: 0,
3023
- scriptStr: e.scriptStr
3024
- }, null, 8, ["scriptStr"])) : v("", !0),
3025
- e.TARGET !== "reactNative" ? (d(), g(l, {
3026
- key: 1,
3027
- contentId: (u = e.builderContextSignal.content) == null ? void 0 : u.id,
3028
- cssCode: (h = (p = e.builderContextSignal.content) == null ? void 0 : p.data) == null ? void 0 : h.cssCode,
3029
- customFonts: (S = (k = e.builderContextSignal.content) == null ? void 0 : k.data) == null ? void 0 : S.customFonts
3030
- }, null, 8, ["contentId", "cssCode", "customFonts"])) : v("", !0),
3031
- (d(), g(a, {
3032
- blocks: (I = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : I.blocks,
3033
- key: e.forceReRenderCount
3034
- }, null, 8, ["blocks"]))
3035
- ], 16, Fo)) : v("", !0);
3036
- }
3037
- const Mo = /* @__PURE__ */ y(No, [["render", Uo]]), Wo = f({
3038
- name: "render-content-variants",
3039
- components: {
3040
- InlinedScript: Ue,
3041
- InlinedStyles: K,
3042
- RenderContent: Mo
3043
- },
3044
- props: [
3045
- "canTrack",
3046
- "content",
3047
- "__isNestedRender",
3048
- "model",
3049
- "data",
3050
- "context",
3051
- "apiKey",
3052
- "apiVersion",
3053
- "customComponents",
3054
- "locale",
3055
- "includeRefs",
3056
- "enrich"
3057
- ],
3058
- data() {
3059
- var e;
3060
- return {
3061
- shouldRenderVariants: Dt({
3062
- canTrack: X(this.canTrack),
3063
- content: this.content
3064
- }),
3065
- variantScriptStr: Xt(
3066
- M(this.content).map((t) => ({
3067
- id: t.testVariationId,
3068
- testRatio: t.testRatio
3069
- })),
3070
- ((e = this.content) == null ? void 0 : e.id) || ""
3071
- ),
3072
- hideVariantsStyleString: M(this.content).map((t) => `.variant-${t.testVariationId} { display: none; } `).join(""),
3073
- getScriptString: Yt,
3074
- getVariants: M,
3075
- getDefaultCanTrack: X,
3076
- handleABTestingSync: Hn,
3077
- TARGET: E
3078
- };
3079
- },
3080
- mounted() {
3081
- this.shouldRenderVariants = !1;
3082
- }
3083
- });
3084
- function Lo(e, t, n, o, r, i) {
3085
- var c, u;
3086
- const s = b("inlined-script"), l = b("inlined-styles"), a = b("render-content");
3087
- return d(), m($, null, [
3088
- !e.__isNestedRender && e.TARGET !== "reactNative" ? (d(), g(s, {
3089
- key: 0,
3090
- scriptStr: e.getScriptString()
3091
- }, null, 8, ["scriptStr"])) : v("", !0),
3092
- e.shouldRenderVariants ? (d(), m($, { key: 1 }, [
3093
- O(l, {
3094
- id: `variants-styles-${(c = e.content) == null ? void 0 : c.id}`,
3095
- styles: e.hideVariantsStyleString
3096
- }, null, 8, ["id", "styles"]),
3097
- O(s, { scriptStr: e.variantScriptStr }, null, 8, ["scriptStr"]),
3098
- (d(!0), m($, null, A(e.getVariants(e.content), (p, h) => (d(), g(a, {
3099
- key: p.testVariationId,
3100
- content: p,
3101
- showContent: !1,
3102
- classNameProp: void 0,
3103
- model: e.model,
3104
- data: e.data,
3105
- context: e.context,
3106
- apiKey: e.apiKey,
3107
- apiVersion: e.apiVersion,
3108
- customComponents: e.customComponents,
3109
- canTrack: e.canTrack,
3110
- locale: e.locale,
3111
- includeRefs: e.includeRefs,
3112
- enrich: e.enrich,
3113
- isSsrAbTest: e.shouldRenderVariants
3114
- }, null, 8, ["content", "model", "data", "context", "apiKey", "apiVersion", "customComponents", "canTrack", "locale", "includeRefs", "enrich", "isSsrAbTest"]))), 128))
3115
- ], 64)) : v("", !0),
3116
- O(a, T({
3117
- content: e.shouldRenderVariants ? e.content : e.handleABTestingSync({
3118
- item: e.content,
3119
- canTrack: e.getDefaultCanTrack(e.canTrack)
3120
- }),
3121
- classNameProp: `variant-${(u = e.content) == null ? void 0 : u.id}`,
3122
- showContent: !0,
3123
- model: e.model,
3124
- data: e.data,
3125
- context: e.context,
3126
- apiKey: e.apiKey,
3127
- apiVersion: e.apiVersion,
3128
- customComponents: e.customComponents,
3129
- canTrack: e.canTrack,
3130
- locale: e.locale,
3131
- includeRefs: e.includeRefs,
3132
- enrich: e.enrich,
3133
- isSsrAbTest: e.shouldRenderVariants
3134
- }, {
3135
- key: e.shouldRenderVariants.toString()
3136
- }), null, 16, ["content", "classNameProp", "model", "data", "context", "apiKey", "apiVersion", "customComponents", "canTrack", "locale", "includeRefs", "enrich", "isSsrAbTest"])
3137
- ], 64);
3138
- }
3139
- const Ho = /* @__PURE__ */ y(Wo, [["render", Lo]]), Ko = f({
3140
- name: "builder-symbol",
3141
- components: { RenderContentVariants: Ho },
3142
- props: ["attributes", "symbol", "dynamic"],
3143
- data() {
3144
- var e, t, n;
3145
- return {
3146
- className: [
3147
- ...Object.keys(this.attributes.class),
3148
- "builder-symbol",
3149
- (e = this.symbol) != null && e.inline ? "builder-inline-symbol" : void 0,
3150
- ((t = this.symbol) == null ? void 0 : t.dynamic) || this.dynamic ? "builder-dynamic-symbol" : void 0
3151
- ].filter(Boolean).join(" "),
3152
- contentToUse: (n = this.symbol) == null ? void 0 : n.content
3153
- };
3154
- },
3155
- inject: {
3156
- builderContext: j.key
3157
- },
3158
- mounted() {
3159
- this.fetchContent();
3160
- },
3161
- watch: {
3162
- onUpdateHook0: {
3163
- handler() {
3164
- this.fetchContent();
3165
- },
3166
- immediate: !0
3167
- }
3168
- },
3169
- computed: {
3170
- onUpdateHook0() {
3171
- return {
3172
- 0: this.symbol
3173
- };
3174
- }
3175
- },
3176
- methods: {
3177
- fetchContent() {
3178
- var e, t, n;
3179
- !this.contentToUse && ((e = this.symbol) == null ? void 0 : e.model) && ((t = this.builderContext) == null ? void 0 : t.apiKey) && Pe({
3180
- model: this.symbol.model,
3181
- apiKey: this.builderContext.apiKey,
3182
- apiVersion: this.builderContext.apiVersion,
3183
- ...((n = this.symbol) == null ? void 0 : n.entry) && {
3184
- query: {
3185
- id: this.symbol.entry
3186
- }
3187
- }
3188
- }).then((o) => {
3189
- o && (this.contentToUse = o);
3190
- }).catch((o) => {
3191
- B.error("Could not fetch symbol content: ", o);
3192
- });
3193
- },
3194
- filterAttrs: function(t = {}, n) {
3195
- const o = "v-on:";
3196
- return Object.keys(t).filter((r) => {
3197
- if (!t[r])
3198
- return !1;
3199
- const i = r.startsWith(o);
3200
- return n ? i : !i;
3201
- }).reduce(
3202
- (r, i) => ({
3203
- ...r,
3204
- [i.replace(o, "")]: t[i]
3205
- }),
3206
- {}
3207
- );
3208
- },
3209
- _classStringToObject(e) {
3210
- const t = {};
3211
- if (typeof e != "string")
3212
- return t;
3213
- const n = e.trim().split(/\s+/);
3214
- for (const o of n)
3215
- t[o] = !0;
3216
- return t;
3217
- }
3218
- }
3219
- }), zo = ["dataSet"];
3220
- function Do(e, t, n, o, r, i) {
3221
- var l, a, c, u;
3222
- const s = b("render-content-variants");
3223
- return d(), m("div", T({
3224
- dataSet: {
3225
- class: e.className
3226
- },
3227
- class: e._classStringToObject(e.className)
3228
- }, e.filterAttrs(e.attributes, !1), P(e.filterAttrs(e.attributes, !0), !0)), [
3229
- O(s, {
3230
- __isNestedRender: !0,
3231
- apiVersion: e.builderContext.apiVersion,
3232
- apiKey: e.builderContext.apiKey,
3233
- context: e.builderContext.context,
3234
- customComponents: Object.values(e.builderContext.registeredComponents),
3235
- data: {
3236
- ...(l = e.symbol) == null ? void 0 : l.data,
3237
- ...e.builderContext.localState,
3238
- ...(c = (a = e.contentToUse) == null ? void 0 : a.data) == null ? void 0 : c.state
3239
- },
3240
- model: (u = e.symbol) == null ? void 0 : u.model,
3241
- content: e.contentToUse
3242
- }, null, 8, ["apiVersion", "apiKey", "context", "customComponents", "data", "model", "content"])
3243
- ], 16, zo);
3244
- }
3245
- const qo = /* @__PURE__ */ y(Ko, [["render", Do]]), pe = {};
3246
- function Yo(e) {
3247
- if (C()) {
3248
- Object.assign(pe, e);
3249
- const t = {
3250
- type: "builder.settingsChange",
3251
- data: pe
3252
- };
3253
- parent.postMessage(t, "*");
3254
- }
3255
- }
1
+ import { k as a, C as n, F as o, I as r, l as i, o as g, S as m, m as l, n as d, V as C, f as c, g as p, j as S, h as u, i as R, d as k, p as B, r as f, s as h, t as x } from "./index.52e5e57e.js";
2
+ import "vue";
3256
3
  export {
3257
- ze as Button,
3258
- Vt as Columns,
3259
- Pt as Fragment,
3260
- Lt as Image,
3261
- Se as RenderBlocks,
3262
- Ho as RenderContent,
3263
- zt as Section,
3264
- qo as Symbol,
3265
- dn as Text,
3266
- fn as Video,
3267
- oo as createRegisterComponentMessage,
3268
- eo as getAllContent,
3269
- Jn as getBuilderSearchParams,
3270
- Pe as getContent,
3271
- V as isEditing,
3272
- to as isPreviewing,
3273
- Zn as processContentResult,
3274
- Ro as register,
3275
- Yo as setEditorSettings,
3276
- Jo as track
4
+ a as Button,
5
+ n as Columns,
6
+ o as Fragment,
7
+ r as Image,
8
+ i as RenderBlocks,
9
+ g as RenderContent,
10
+ m as Section,
11
+ l as Symbol,
12
+ d as Text,
13
+ C as Video,
14
+ c as createRegisterComponentMessage,
15
+ p as getAllContent,
16
+ S as getBuilderSearchParams,
17
+ u as getContent,
18
+ R as isEditing,
19
+ k as isPreviewing,
20
+ B as processContentResult,
21
+ f as register,
22
+ h as setEditorSettings,
23
+ x as track
3277
24
  };