@builder.io/sdk-react 2.0.22 → 2.0.24-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 (490) hide show
  1. package/lib/browser/blocks-exports.cjs +25 -25
  2. package/lib/browser/blocks-exports.mjs +535 -563
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/{server-entry-5770bca9.cjs → server-entry-3855428f.cjs} +1 -1
  6. package/lib/browser/{server-entry-b83ba684.js → server-entry-e7cbd2fc.js} +1 -1
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{accordion-78c3d81b.js → accordion-57df597a.js} +1 -1
  10. package/lib/edge/{accordion-80133dd8.cjs → accordion-91147fe9.cjs} +1 -1
  11. package/lib/edge/{blocks-852d317b.js → blocks-228052f4.js} +21 -19
  12. package/lib/edge/blocks-2a92a0c1.cjs +12 -0
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +2 -2
  15. package/lib/edge/{button-0a729557.js → button-d681583e.js} +2 -2
  16. package/lib/edge/{button-a97c0d05.cjs → button-ff78ab2a.cjs} +1 -1
  17. package/lib/edge/{columns-2bd50130.cjs → columns-354a8faf.cjs} +1 -1
  18. package/lib/edge/{columns-1149d23a.js → columns-59392fea.js} +4 -4
  19. package/lib/edge/{content-variants-86962b96.js → content-variants-983cfed6.js} +13 -18
  20. package/lib/edge/{content-variants-cbd84920.cjs → content-variants-f22b14d7.cjs} +4 -4
  21. package/lib/edge/{evaluate-46f56681.js → evaluate-b7da3191.js} +706 -726
  22. package/lib/edge/{evaluate-617e3bee.cjs → evaluate-f8347208.cjs} +11 -11
  23. package/lib/edge/form-2c8b99e2.cjs +1 -0
  24. package/lib/edge/form-52e60b8b.js +180 -0
  25. package/lib/edge/{get-class-prop-name-6e4205e7.js → get-class-prop-name-8c8a1b1c.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-dc89023a.cjs → get-class-prop-name-956dc1ac.cjs} +1 -1
  27. package/lib/edge/{img-70b9d719.cjs → img-9e702744.cjs} +1 -1
  28. package/lib/edge/{img-0bc990ef.js → img-ce324880.js} +1 -1
  29. package/lib/edge/index.cjs +1 -1
  30. package/lib/edge/index.mjs +1 -1
  31. package/lib/edge/{input-21071030.cjs → input-09bbebbb.cjs} +1 -1
  32. package/lib/edge/{input-3689c63d.js → input-c5dda333.js} +1 -1
  33. package/lib/edge/{select-cb7c2f44.cjs → select-235baf48.cjs} +1 -1
  34. package/lib/edge/{select-65ebd3fd.js → select-8936ea79.js} +1 -1
  35. package/lib/edge/{server-entry-9d83b8e5.js → server-entry-b3befa52.js} +1 -1
  36. package/lib/edge/{server-entry-8ce6f347.cjs → server-entry-f0d7962f.cjs} +1 -1
  37. package/lib/edge/server-entry.cjs +1 -1
  38. package/lib/edge/server-entry.mjs +1 -1
  39. package/lib/edge/{slot-21cc91d8.cjs → slot-eb173f0a.cjs} +1 -1
  40. package/lib/edge/{slot-e5f3b92d.js → slot-f274570e.js} +4 -4
  41. package/lib/edge/{symbol-56e5b927.js → symbol-0deda8a7.js} +2 -2
  42. package/lib/edge/{symbol-0cc07e41.cjs → symbol-73a9d7cb.cjs} +1 -1
  43. package/lib/edge/{tabs-9390d611.cjs → tabs-4e5783b2.cjs} +1 -1
  44. package/lib/edge/{tabs-0e6f6b5b.js → tabs-791385cc.js} +4 -4
  45. package/lib/edge/{text-b68c0d5a.js → text-0a14d566.js} +8 -9
  46. package/lib/edge/text-3dd73c6e.cjs +1 -0
  47. package/lib/node/blocks-exports.cjs +25 -25
  48. package/lib/node/blocks-exports.mjs +555 -583
  49. package/lib/node/index.cjs +1 -1
  50. package/lib/node/index.mjs +2 -2
  51. package/lib/node/init.cjs +1 -1
  52. package/lib/node/init.mjs +4 -3
  53. package/lib/node/{server-entry-52b8f10a.cjs → server-entry-a7139d8f.cjs} +1 -1
  54. package/lib/node/{server-entry-5b32494d.js → server-entry-fa11b353.js} +1 -1
  55. package/lib/node/server-entry.cjs +1 -1
  56. package/lib/node/server-entry.mjs +1 -1
  57. package/lib/node/{should-force-browser-runtime-in-node-253f1726.cjs → should-force-browser-runtime-in-node-0bf7076b.cjs} +1 -1
  58. package/lib/node/{should-force-browser-runtime-in-node-68bc74aa.js → should-force-browser-runtime-in-node-ddb84649.js} +1 -1
  59. package/package.json +3 -2
  60. package/types/blocks/textarea/component-info.d.ts +2 -0
  61. package/types/blocks/textarea/index.d.ts +1 -0
  62. package/types/blocks/textarea/textarea.d.ts +13 -0
  63. package/types/cjs/blocks/BaseText.d.cts +6 -0
  64. package/types/cjs/blocks/button/button.d.cts +4 -0
  65. package/types/cjs/blocks/button/button.types.d.cts +7 -0
  66. package/types/cjs/blocks/button/component-info.d.cts +2 -0
  67. package/types/cjs/blocks/button/index.d.cts +1 -0
  68. package/types/cjs/blocks/columns/columns.d.cts +4 -0
  69. package/types/cjs/blocks/columns/columns.types.d.cts +15 -0
  70. package/types/cjs/blocks/columns/component-info.d.cts +2 -0
  71. package/types/cjs/blocks/columns/helpers.d.cts +1 -0
  72. package/types/cjs/blocks/columns/index.d.cts +1 -0
  73. package/types/cjs/blocks/custom-code/component-info.d.cts +2 -0
  74. package/types/cjs/blocks/custom-code/custom-code.d.cts +7 -0
  75. package/types/cjs/blocks/custom-code/index.d.cts +1 -0
  76. package/types/cjs/blocks/embed/component-info.d.cts +2 -0
  77. package/types/cjs/blocks/embed/embed.d.cts +6 -0
  78. package/types/cjs/blocks/embed/helpers.d.cts +1 -0
  79. package/types/cjs/blocks/embed/index.d.cts +1 -0
  80. package/types/cjs/blocks/form/form/component-info.d.cts +2 -0
  81. package/types/cjs/blocks/form/form/form.d.cts +33 -0
  82. package/types/cjs/blocks/form/form/index.d.cts +1 -0
  83. package/types/cjs/blocks/form/input/component-info.d.cts +2 -0
  84. package/types/cjs/blocks/form/input/index.d.cts +1 -0
  85. package/types/cjs/blocks/form/input/input.d.cts +15 -0
  86. package/types/cjs/blocks/form/select/component-info.d.cts +2 -0
  87. package/types/cjs/blocks/form/select/index.d.cts +1 -0
  88. package/types/cjs/blocks/form/select/select.d.cts +16 -0
  89. package/types/cjs/blocks/form/submit-button/component-info.d.cts +2 -0
  90. package/types/cjs/blocks/form/submit-button/index.d.cts +1 -0
  91. package/types/cjs/blocks/form/submit-button/submit-button.d.cts +10 -0
  92. package/types/cjs/blocks/fragment/component-info.d.cts +2 -0
  93. package/types/cjs/blocks/fragment/fragment.d.cts +4 -0
  94. package/types/cjs/blocks/fragment/fragment.types.d.cts +5 -0
  95. package/types/cjs/blocks/fragment/index.d.cts +1 -0
  96. package/types/cjs/blocks/helpers.d.cts +13 -0
  97. package/types/cjs/blocks/image/component-info.d.cts +2 -0
  98. package/types/cjs/blocks/image/image.d.cts +4 -0
  99. package/types/cjs/blocks/image/image.helpers.d.cts +1 -0
  100. package/types/cjs/blocks/image/image.types.d.cts +19 -0
  101. package/types/cjs/blocks/image/index.d.cts +1 -0
  102. package/types/cjs/blocks/img/component-info.d.cts +2 -0
  103. package/types/cjs/blocks/img/img.d.cts +14 -0
  104. package/types/cjs/blocks/img/index.d.cts +1 -0
  105. package/types/cjs/blocks/raw-text/component-info.d.cts +2 -0
  106. package/types/cjs/blocks/raw-text/index.d.cts +1 -0
  107. package/types/cjs/blocks/raw-text/raw-text.d.cts +7 -0
  108. package/types/cjs/blocks/section/component-info.d.cts +2 -0
  109. package/types/cjs/blocks/section/index.d.cts +1 -0
  110. package/types/cjs/blocks/section/section.d.cts +4 -0
  111. package/types/cjs/blocks/section/section.types.d.cts +6 -0
  112. package/types/cjs/blocks/slot/component-info.d.cts +2 -0
  113. package/types/cjs/blocks/slot/index.d.cts +1 -0
  114. package/types/cjs/blocks/slot/slot.d.cts +8 -0
  115. package/types/cjs/blocks/symbol/component-info.d.cts +2 -0
  116. package/types/cjs/blocks/symbol/index.d.cts +1 -0
  117. package/types/cjs/blocks/symbol/symbol.d.cts +4 -0
  118. package/types/cjs/blocks/symbol/symbol.helpers.d.cts +14 -0
  119. package/types/cjs/blocks/symbol/symbol.types.d.cts +18 -0
  120. package/types/cjs/blocks/tabs/component-info.d.cts +2 -0
  121. package/types/cjs/blocks/tabs/index.d.cts +1 -0
  122. package/types/cjs/blocks/tabs/tabs.d.cts +4 -0
  123. package/types/cjs/blocks/tabs/tabs.types.d.cts +13 -0
  124. package/types/cjs/blocks/text/component-info.d.cts +2 -0
  125. package/types/cjs/blocks/text/index.d.cts +1 -0
  126. package/types/cjs/blocks/text/text.d.cts +4 -0
  127. package/types/cjs/blocks/text/text.types.d.cts +4 -0
  128. package/types/cjs/blocks/textarea/component-info.d.cts +2 -0
  129. package/types/cjs/blocks/textarea/index.d.cts +1 -0
  130. package/types/cjs/blocks/textarea/textarea.d.cts +13 -0
  131. package/types/cjs/blocks/video/component-info.d.cts +2 -0
  132. package/types/cjs/blocks/video/index.d.cts +1 -0
  133. package/types/cjs/blocks/video/video.d.cts +4 -0
  134. package/types/cjs/blocks/video/video.types.d.cts +21 -0
  135. package/types/cjs/components/block/animator.d.cts +5 -0
  136. package/types/cjs/components/block/block.d.cts +11 -0
  137. package/types/cjs/components/block/block.helpers.d.cts +18 -0
  138. package/types/cjs/components/block/components/block-styles.d.cts +9 -0
  139. package/types/cjs/components/block/components/block-wrapper.d.cts +15 -0
  140. package/types/cjs/components/block/components/component-ref/component-ref.d.cts +4 -0
  141. package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.cts +31 -0
  142. package/types/cjs/components/block/components/interactive-element.d.cts +14 -0
  143. package/types/cjs/components/block/components/repeated-block.d.cts +8 -0
  144. package/types/cjs/components/block/types.d.cts +6 -0
  145. package/types/cjs/components/blocks/blocks-wrapper.d.cts +19 -0
  146. package/types/cjs/components/blocks/blocks.d.cts +4 -0
  147. package/types/cjs/components/blocks/blocks.types.d.cts +7 -0
  148. package/types/cjs/components/blocks/index.d.cts +1 -0
  149. package/types/cjs/components/content/components/enable-editor.d.cts +10 -0
  150. package/types/cjs/components/content/components/styles.d.cts +10 -0
  151. package/types/cjs/components/content/components/styles.helpers.d.cts +17 -0
  152. package/types/cjs/components/content/content.d.cts +4 -0
  153. package/types/cjs/components/content/content.helpers.d.cts +7 -0
  154. package/types/cjs/components/content/content.types.d.cts +13 -0
  155. package/types/cjs/components/content/contentProps.types.d.cts +17 -0
  156. package/types/cjs/components/content/index.d.cts +1 -0
  157. package/types/cjs/components/content/wrap-component-ref.d.cts +6 -0
  158. package/types/cjs/components/content-variants/content-variants.d.cts +10 -0
  159. package/types/cjs/components/content-variants/content-variants.types.d.cts +71 -0
  160. package/types/cjs/components/content-variants/helpers.d.cts +41 -0
  161. package/types/cjs/components/content-variants/index.d.cts +1 -0
  162. package/types/cjs/components/content-variants/inlined-fns.d.cts +14 -0
  163. package/types/cjs/components/dynamic-div.d.cts +15 -0
  164. package/types/cjs/components/dynamic-renderer/dynamic-renderer.d.cts +9 -0
  165. package/types/cjs/components/dynamic-renderer/dynamic-renderer.helpers.d.cts +1 -0
  166. package/types/cjs/components/error-boundary.d.cts +11 -0
  167. package/types/cjs/components/inlined-script.d.cts +7 -0
  168. package/types/cjs/components/inlined-styles.d.cts +7 -0
  169. package/types/cjs/constants/builder-registered-components.d.cts +6 -0
  170. package/types/cjs/constants/device-sizes.d.cts +13 -0
  171. package/types/cjs/constants/extra-components.d.cts +7 -0
  172. package/types/cjs/constants/sdk-version.d.cts +1 -0
  173. package/types/cjs/constants/target.d.cts +2 -0
  174. package/types/cjs/context/builder.context.d.cts +3 -0
  175. package/types/cjs/context/components.context.d.cts +3 -0
  176. package/types/cjs/context/index.d.cts +1 -0
  177. package/types/cjs/context/types.d.cts +36 -0
  178. package/types/cjs/functions/apply-patch-with-mutation.d.cts +10 -0
  179. package/types/cjs/functions/camel-to-kebab-case.d.cts +1 -0
  180. package/types/cjs/functions/deopt.d.cts +4 -0
  181. package/types/cjs/functions/evaluate/browser-runtime/browser.d.cts +8 -0
  182. package/types/cjs/functions/evaluate/browser-runtime/index.d.cts +1 -0
  183. package/types/cjs/functions/evaluate/choose-eval.d.cts +6 -0
  184. package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.cts +2 -0
  185. package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.cts +2 -0
  186. package/types/cjs/functions/evaluate/edge-runtime/index.d.cts +1 -0
  187. package/types/cjs/functions/evaluate/evaluate.d.cts +4 -0
  188. package/types/cjs/functions/evaluate/helpers.d.cts +25 -0
  189. package/types/cjs/functions/evaluate/index.d.cts +1 -0
  190. package/types/cjs/functions/evaluate/node-runtime/index.d.cts +1 -0
  191. package/types/cjs/functions/evaluate/node-runtime/init.d.cts +13 -0
  192. package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.cts +11 -0
  193. package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.cts +6 -0
  194. package/types/cjs/functions/evaluate/placeholder-runtime.d.cts +2 -0
  195. package/types/cjs/functions/evaluate/should-force-browser-runtime-in-node.d.cts +1 -0
  196. package/types/cjs/functions/event-handler-name.d.cts +1 -0
  197. package/types/cjs/functions/extract-text-styles.d.cts +4 -0
  198. package/types/cjs/functions/fast-clone.d.cts +4 -0
  199. package/types/cjs/functions/fetch-builder-props.d.cts +53 -0
  200. package/types/cjs/functions/get-block-actions-handler.d.cts +8 -0
  201. package/types/cjs/functions/get-block-actions.d.cts +10 -0
  202. package/types/cjs/functions/get-block-component-options.d.cts +2 -0
  203. package/types/cjs/functions/get-block-properties.d.cts +10 -0
  204. package/types/cjs/functions/get-builder-search-params/index.d.cts +9 -0
  205. package/types/cjs/functions/get-class-prop-name.d.cts +1 -0
  206. package/types/cjs/functions/get-content/generate-content-url.d.cts +2 -0
  207. package/types/cjs/functions/get-content/index.d.cts +18 -0
  208. package/types/cjs/functions/get-content/types.d.cts +139 -0
  209. package/types/cjs/functions/get-env.d.cts +2 -0
  210. package/types/cjs/functions/get-fetch.d.cts +1 -0
  211. package/types/cjs/functions/get-global-this.d.cts +4 -0
  212. package/types/cjs/functions/get-processed-block.d.cts +10 -0
  213. package/types/cjs/functions/get-style.d.cts +12 -0
  214. package/types/cjs/functions/get.d.cts +1 -0
  215. package/types/cjs/functions/is-browser.d.cts +1 -0
  216. package/types/cjs/functions/is-edge-runtime.d.cts +4 -0
  217. package/types/cjs/functions/is-editing.d.cts +2 -0
  218. package/types/cjs/functions/is-from-trusted-host.d.cts +3 -0
  219. package/types/cjs/functions/is-iframe.d.cts +1 -0
  220. package/types/cjs/functions/is-node-runtime.d.cts +4 -0
  221. package/types/cjs/functions/is-previewing.d.cts +2 -0
  222. package/types/cjs/functions/on-change.d.cts +7 -0
  223. package/types/cjs/functions/register-component.d.cts +6 -0
  224. package/types/cjs/functions/register.d.cts +16 -0
  225. package/types/cjs/functions/set-editor-settings.d.cts +4 -0
  226. package/types/cjs/functions/set.d.cts +7 -0
  227. package/types/cjs/functions/track/helpers.d.cts +5 -0
  228. package/types/cjs/functions/track/index.d.cts +51 -0
  229. package/types/cjs/functions/track/interaction.d.cts +13 -0
  230. package/types/cjs/functions/transform-block-properties.d.cts +7 -0
  231. package/types/cjs/functions/transform-block.d.cts +2 -0
  232. package/types/cjs/functions/transform-style-property.d.cts +7 -0
  233. package/types/cjs/helpers/ab-tests.d.cts +9 -0
  234. package/types/cjs/helpers/canTrack.d.cts +1 -0
  235. package/types/cjs/helpers/cookie.d.cts +19 -0
  236. package/types/cjs/helpers/css.d.cts +7 -0
  237. package/types/cjs/helpers/flatten.d.cts +16 -0
  238. package/types/cjs/helpers/localStorage.d.cts +9 -0
  239. package/types/cjs/helpers/logger.d.cts +7 -0
  240. package/types/cjs/helpers/nullable.d.cts +2 -0
  241. package/types/cjs/helpers/omit.d.cts +1 -0
  242. package/types/cjs/helpers/preview-lru-cache/get.d.cts +2 -0
  243. package/types/cjs/helpers/preview-lru-cache/helpers.d.cts +1 -0
  244. package/types/cjs/helpers/preview-lru-cache/init.d.cts +6 -0
  245. package/types/cjs/helpers/preview-lru-cache/set.d.cts +7 -0
  246. package/types/cjs/helpers/preview-lru-cache/types.d.cts +1 -0
  247. package/types/cjs/helpers/search/search.d.cts +5 -0
  248. package/types/cjs/helpers/sessionId.d.cts +6 -0
  249. package/types/cjs/helpers/subscribe-to-editor.d.cts +35 -0
  250. package/types/cjs/helpers/time.d.cts +1 -0
  251. package/types/cjs/helpers/url.d.cts +6 -0
  252. package/types/cjs/helpers/uuid.d.cts +8 -0
  253. package/types/cjs/helpers/visitorId.d.cts +6 -0
  254. package/types/cjs/index-helpers/blocks-exports.d.cts +14 -0
  255. package/types/cjs/index-helpers/top-of-file.d.cts +1 -0
  256. package/types/cjs/index.d.cts +10 -0
  257. package/types/cjs/scripts/init-editing.d.cts +7 -0
  258. package/types/cjs/server-index.d.cts +39 -0
  259. package/types/cjs/types/api-version.d.cts +2 -0
  260. package/types/cjs/types/builder-block.d.cts +84 -0
  261. package/types/cjs/types/builder-content.d.cts +44 -0
  262. package/types/cjs/types/builder-props.d.cts +12 -0
  263. package/types/cjs/types/can-track.d.cts +3 -0
  264. package/types/cjs/types/components.d.cts +110 -0
  265. package/types/cjs/types/deep-partial.d.cts +3 -0
  266. package/types/cjs/types/element.d.cts +59 -0
  267. package/types/cjs/types/enforced-partials.d.cts +26 -0
  268. package/types/cjs/types/input.d.cts +122 -0
  269. package/types/cjs/types/targets.d.cts +1 -0
  270. package/types/cjs/types/typescript.d.cts +8 -0
  271. package/types/components/blocks/blocks-wrapper.d.ts +1 -0
  272. package/types/components/blocks/blocks.types.d.ts +2 -1
  273. package/types/constants/sdk-version.d.ts +1 -1
  274. package/types/esm/blocks/BaseText.d.mts +6 -0
  275. package/types/esm/blocks/button/button.d.mts +4 -0
  276. package/types/esm/blocks/button/button.types.d.mts +7 -0
  277. package/types/esm/blocks/button/component-info.d.mts +2 -0
  278. package/types/esm/blocks/button/index.d.mts +1 -0
  279. package/types/esm/blocks/columns/columns.d.mts +4 -0
  280. package/types/esm/blocks/columns/columns.types.d.mts +15 -0
  281. package/types/esm/blocks/columns/component-info.d.mts +2 -0
  282. package/types/esm/blocks/columns/helpers.d.mts +1 -0
  283. package/types/esm/blocks/columns/index.d.mts +1 -0
  284. package/types/esm/blocks/custom-code/component-info.d.mts +2 -0
  285. package/types/esm/blocks/custom-code/custom-code.d.mts +7 -0
  286. package/types/esm/blocks/custom-code/index.d.mts +1 -0
  287. package/types/esm/blocks/embed/component-info.d.mts +2 -0
  288. package/types/esm/blocks/embed/embed.d.mts +6 -0
  289. package/types/esm/blocks/embed/helpers.d.mts +1 -0
  290. package/types/esm/blocks/embed/index.d.mts +1 -0
  291. package/types/esm/blocks/form/form/component-info.d.mts +2 -0
  292. package/types/esm/blocks/form/form/form.d.mts +33 -0
  293. package/types/esm/blocks/form/form/index.d.mts +1 -0
  294. package/types/esm/blocks/form/input/component-info.d.mts +2 -0
  295. package/types/esm/blocks/form/input/index.d.mts +1 -0
  296. package/types/esm/blocks/form/input/input.d.mts +15 -0
  297. package/types/esm/blocks/form/select/component-info.d.mts +2 -0
  298. package/types/esm/blocks/form/select/index.d.mts +1 -0
  299. package/types/esm/blocks/form/select/select.d.mts +16 -0
  300. package/types/esm/blocks/form/submit-button/component-info.d.mts +2 -0
  301. package/types/esm/blocks/form/submit-button/index.d.mts +1 -0
  302. package/types/esm/blocks/form/submit-button/submit-button.d.mts +10 -0
  303. package/types/esm/blocks/fragment/component-info.d.mts +2 -0
  304. package/types/esm/blocks/fragment/fragment.d.mts +4 -0
  305. package/types/esm/blocks/fragment/fragment.types.d.mts +5 -0
  306. package/types/esm/blocks/fragment/index.d.mts +1 -0
  307. package/types/esm/blocks/helpers.d.mts +13 -0
  308. package/types/esm/blocks/image/component-info.d.mts +2 -0
  309. package/types/esm/blocks/image/image.d.mts +4 -0
  310. package/types/esm/blocks/image/image.helpers.d.mts +1 -0
  311. package/types/esm/blocks/image/image.types.d.mts +19 -0
  312. package/types/esm/blocks/image/index.d.mts +1 -0
  313. package/types/esm/blocks/img/component-info.d.mts +2 -0
  314. package/types/esm/blocks/img/img.d.mts +14 -0
  315. package/types/esm/blocks/img/index.d.mts +1 -0
  316. package/types/esm/blocks/raw-text/component-info.d.mts +2 -0
  317. package/types/esm/blocks/raw-text/index.d.mts +1 -0
  318. package/types/esm/blocks/raw-text/raw-text.d.mts +7 -0
  319. package/types/esm/blocks/section/component-info.d.mts +2 -0
  320. package/types/esm/blocks/section/index.d.mts +1 -0
  321. package/types/esm/blocks/section/section.d.mts +4 -0
  322. package/types/esm/blocks/section/section.types.d.mts +6 -0
  323. package/types/esm/blocks/slot/component-info.d.mts +2 -0
  324. package/types/esm/blocks/slot/index.d.mts +1 -0
  325. package/types/esm/blocks/slot/slot.d.mts +8 -0
  326. package/types/esm/blocks/symbol/component-info.d.mts +2 -0
  327. package/types/esm/blocks/symbol/index.d.mts +1 -0
  328. package/types/esm/blocks/symbol/symbol.d.mts +4 -0
  329. package/types/esm/blocks/symbol/symbol.helpers.d.mts +14 -0
  330. package/types/esm/blocks/symbol/symbol.types.d.mts +18 -0
  331. package/types/esm/blocks/tabs/component-info.d.mts +2 -0
  332. package/types/esm/blocks/tabs/index.d.mts +1 -0
  333. package/types/esm/blocks/tabs/tabs.d.mts +4 -0
  334. package/types/esm/blocks/tabs/tabs.types.d.mts +13 -0
  335. package/types/esm/blocks/text/component-info.d.mts +2 -0
  336. package/types/esm/blocks/text/index.d.mts +1 -0
  337. package/types/esm/blocks/text/text.d.mts +4 -0
  338. package/types/esm/blocks/text/text.types.d.mts +4 -0
  339. package/types/esm/blocks/textarea/component-info.d.mts +2 -0
  340. package/types/esm/blocks/textarea/index.d.mts +1 -0
  341. package/types/esm/blocks/textarea/textarea.d.mts +13 -0
  342. package/types/esm/blocks/video/component-info.d.mts +2 -0
  343. package/types/esm/blocks/video/index.d.mts +1 -0
  344. package/types/esm/blocks/video/video.d.mts +4 -0
  345. package/types/esm/blocks/video/video.types.d.mts +21 -0
  346. package/types/esm/components/block/animator.d.mts +5 -0
  347. package/types/esm/components/block/block.d.mts +11 -0
  348. package/types/esm/components/block/block.helpers.d.mts +18 -0
  349. package/types/esm/components/block/components/block-styles.d.mts +9 -0
  350. package/types/esm/components/block/components/block-wrapper.d.mts +15 -0
  351. package/types/esm/components/block/components/component-ref/component-ref.d.mts +4 -0
  352. package/types/esm/components/block/components/component-ref/component-ref.helpers.d.mts +31 -0
  353. package/types/esm/components/block/components/interactive-element.d.mts +14 -0
  354. package/types/esm/components/block/components/repeated-block.d.mts +8 -0
  355. package/types/esm/components/block/types.d.mts +6 -0
  356. package/types/esm/components/blocks/blocks-wrapper.d.mts +19 -0
  357. package/types/esm/components/blocks/blocks.d.mts +4 -0
  358. package/types/esm/components/blocks/blocks.types.d.mts +7 -0
  359. package/types/esm/components/blocks/index.d.mts +1 -0
  360. package/types/esm/components/content/components/enable-editor.d.mts +10 -0
  361. package/types/esm/components/content/components/styles.d.mts +10 -0
  362. package/types/esm/components/content/components/styles.helpers.d.mts +17 -0
  363. package/types/esm/components/content/content.d.mts +4 -0
  364. package/types/esm/components/content/content.helpers.d.mts +7 -0
  365. package/types/esm/components/content/content.types.d.mts +13 -0
  366. package/types/esm/components/content/contentProps.types.d.mts +17 -0
  367. package/types/esm/components/content/index.d.mts +1 -0
  368. package/types/esm/components/content/wrap-component-ref.d.mts +6 -0
  369. package/types/esm/components/content-variants/content-variants.d.mts +10 -0
  370. package/types/esm/components/content-variants/content-variants.types.d.mts +71 -0
  371. package/types/esm/components/content-variants/helpers.d.mts +41 -0
  372. package/types/esm/components/content-variants/index.d.mts +1 -0
  373. package/types/esm/components/content-variants/inlined-fns.d.mts +14 -0
  374. package/types/esm/components/dynamic-div.d.mts +15 -0
  375. package/types/esm/components/dynamic-renderer/dynamic-renderer.d.mts +9 -0
  376. package/types/esm/components/dynamic-renderer/dynamic-renderer.helpers.d.mts +1 -0
  377. package/types/esm/components/error-boundary.d.mts +11 -0
  378. package/types/esm/components/inlined-script.d.mts +7 -0
  379. package/types/esm/components/inlined-styles.d.mts +7 -0
  380. package/types/esm/constants/builder-registered-components.d.mts +6 -0
  381. package/types/esm/constants/device-sizes.d.mts +13 -0
  382. package/types/esm/constants/extra-components.d.mts +7 -0
  383. package/types/esm/constants/sdk-version.d.mts +1 -0
  384. package/types/esm/constants/target.d.mts +2 -0
  385. package/types/esm/context/builder.context.d.mts +3 -0
  386. package/types/esm/context/components.context.d.mts +3 -0
  387. package/types/esm/context/index.d.mts +1 -0
  388. package/types/esm/context/types.d.mts +36 -0
  389. package/types/esm/functions/apply-patch-with-mutation.d.mts +10 -0
  390. package/types/esm/functions/camel-to-kebab-case.d.mts +1 -0
  391. package/types/esm/functions/deopt.d.mts +4 -0
  392. package/types/esm/functions/evaluate/browser-runtime/browser.d.mts +8 -0
  393. package/types/esm/functions/evaluate/browser-runtime/index.d.mts +1 -0
  394. package/types/esm/functions/evaluate/choose-eval.d.mts +6 -0
  395. package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.mts +2 -0
  396. package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.mts +2 -0
  397. package/types/esm/functions/evaluate/edge-runtime/index.d.mts +1 -0
  398. package/types/esm/functions/evaluate/evaluate.d.mts +4 -0
  399. package/types/esm/functions/evaluate/helpers.d.mts +25 -0
  400. package/types/esm/functions/evaluate/index.d.mts +1 -0
  401. package/types/esm/functions/evaluate/node-runtime/index.d.mts +1 -0
  402. package/types/esm/functions/evaluate/node-runtime/init.d.mts +13 -0
  403. package/types/esm/functions/evaluate/node-runtime/node-runtime.d.mts +11 -0
  404. package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.mts +6 -0
  405. package/types/esm/functions/evaluate/placeholder-runtime.d.mts +2 -0
  406. package/types/esm/functions/evaluate/should-force-browser-runtime-in-node.d.mts +1 -0
  407. package/types/esm/functions/event-handler-name.d.mts +1 -0
  408. package/types/esm/functions/extract-text-styles.d.mts +4 -0
  409. package/types/esm/functions/fast-clone.d.mts +4 -0
  410. package/types/esm/functions/fetch-builder-props.d.mts +53 -0
  411. package/types/esm/functions/get-block-actions-handler.d.mts +8 -0
  412. package/types/esm/functions/get-block-actions.d.mts +10 -0
  413. package/types/esm/functions/get-block-component-options.d.mts +2 -0
  414. package/types/esm/functions/get-block-properties.d.mts +10 -0
  415. package/types/esm/functions/get-builder-search-params/index.d.mts +9 -0
  416. package/types/esm/functions/get-class-prop-name.d.mts +1 -0
  417. package/types/esm/functions/get-content/generate-content-url.d.mts +2 -0
  418. package/types/esm/functions/get-content/index.d.mts +18 -0
  419. package/types/esm/functions/get-content/types.d.mts +139 -0
  420. package/types/esm/functions/get-env.d.mts +2 -0
  421. package/types/esm/functions/get-fetch.d.mts +1 -0
  422. package/types/esm/functions/get-global-this.d.mts +4 -0
  423. package/types/esm/functions/get-processed-block.d.mts +10 -0
  424. package/types/esm/functions/get-style.d.mts +12 -0
  425. package/types/esm/functions/get.d.mts +1 -0
  426. package/types/esm/functions/is-browser.d.mts +1 -0
  427. package/types/esm/functions/is-edge-runtime.d.mts +4 -0
  428. package/types/esm/functions/is-editing.d.mts +2 -0
  429. package/types/esm/functions/is-from-trusted-host.d.mts +3 -0
  430. package/types/esm/functions/is-iframe.d.mts +1 -0
  431. package/types/esm/functions/is-node-runtime.d.mts +4 -0
  432. package/types/esm/functions/is-previewing.d.mts +2 -0
  433. package/types/esm/functions/on-change.d.mts +7 -0
  434. package/types/esm/functions/register-component.d.mts +6 -0
  435. package/types/esm/functions/register.d.mts +16 -0
  436. package/types/esm/functions/set-editor-settings.d.mts +4 -0
  437. package/types/esm/functions/set.d.mts +7 -0
  438. package/types/esm/functions/track/helpers.d.mts +5 -0
  439. package/types/esm/functions/track/index.d.mts +51 -0
  440. package/types/esm/functions/track/interaction.d.mts +13 -0
  441. package/types/esm/functions/transform-block-properties.d.mts +7 -0
  442. package/types/esm/functions/transform-block.d.mts +2 -0
  443. package/types/esm/functions/transform-style-property.d.mts +7 -0
  444. package/types/esm/helpers/ab-tests.d.mts +9 -0
  445. package/types/esm/helpers/canTrack.d.mts +1 -0
  446. package/types/esm/helpers/cookie.d.mts +19 -0
  447. package/types/esm/helpers/css.d.mts +7 -0
  448. package/types/esm/helpers/flatten.d.mts +16 -0
  449. package/types/esm/helpers/localStorage.d.mts +9 -0
  450. package/types/esm/helpers/logger.d.mts +7 -0
  451. package/types/esm/helpers/nullable.d.mts +2 -0
  452. package/types/esm/helpers/omit.d.mts +1 -0
  453. package/types/esm/helpers/preview-lru-cache/get.d.mts +2 -0
  454. package/types/esm/helpers/preview-lru-cache/helpers.d.mts +1 -0
  455. package/types/esm/helpers/preview-lru-cache/init.d.mts +6 -0
  456. package/types/esm/helpers/preview-lru-cache/set.d.mts +7 -0
  457. package/types/esm/helpers/preview-lru-cache/types.d.mts +1 -0
  458. package/types/esm/helpers/search/search.d.mts +5 -0
  459. package/types/esm/helpers/sessionId.d.mts +6 -0
  460. package/types/esm/helpers/subscribe-to-editor.d.mts +35 -0
  461. package/types/esm/helpers/time.d.mts +1 -0
  462. package/types/esm/helpers/url.d.mts +6 -0
  463. package/types/esm/helpers/uuid.d.mts +8 -0
  464. package/types/esm/helpers/visitorId.d.mts +6 -0
  465. package/types/esm/index-helpers/blocks-exports.d.mts +14 -0
  466. package/types/esm/index-helpers/top-of-file.d.mts +1 -0
  467. package/types/esm/index.d.mts +10 -0
  468. package/types/esm/index.d.mts.d.mts +10 -0
  469. package/types/esm/scripts/init-editing.d.mts +7 -0
  470. package/types/esm/server-index.d.mts +39 -0
  471. package/types/esm/types/api-version.d.mts +2 -0
  472. package/types/esm/types/builder-block.d.mts +84 -0
  473. package/types/esm/types/builder-content.d.mts +44 -0
  474. package/types/esm/types/builder-props.d.mts +12 -0
  475. package/types/esm/types/can-track.d.mts +3 -0
  476. package/types/esm/types/components.d.mts +110 -0
  477. package/types/esm/types/deep-partial.d.mts +3 -0
  478. package/types/esm/types/element.d.mts +59 -0
  479. package/types/esm/types/enforced-partials.d.mts +26 -0
  480. package/types/esm/types/input.d.mts +122 -0
  481. package/types/esm/types/targets.d.mts +1 -0
  482. package/types/esm/types/typescript.d.mts +8 -0
  483. package/types/functions/evaluate/evaluate.d.ts +2 -1
  484. package/types/functions/evaluate/helpers.d.ts +0 -1
  485. package/types/functions/evaluate/node-runtime/init.d.ts +2 -0
  486. package/types/helpers/sdk-headers.d.ts +5 -0
  487. package/lib/edge/blocks-5084bbec.cjs +0 -12
  488. package/lib/edge/form-1811c08f.js +0 -183
  489. package/lib/edge/form-c42561fb.cjs +0 -1
  490. package/lib/edge/text-baaedac7.cjs +0 -1
@@ -0,0 +1,59 @@
1
+ type JSONValue = string | number | boolean | JSONObject | JSONArray;
2
+ interface JSONObject {
3
+ [x: string]: JSONValue;
4
+ }
5
+ interface JSONArray extends Array<JSONValue> {
6
+ }
7
+ /** @todo typedoc this */
8
+ export interface BuilderElement {
9
+ '@type': '@builder.io/sdk:Element';
10
+ '@version'?: number;
11
+ id?: string;
12
+ tagName?: string;
13
+ layerName?: string;
14
+ groupLocked?: boolean;
15
+ layerLocked?: boolean;
16
+ /** @todo make alias for properties.class */
17
+ class?: string;
18
+ children?: BuilderElement[];
19
+ responsiveStyles?: {
20
+ large?: Partial<CSSStyleDeclaration>;
21
+ medium?: Partial<CSSStyleDeclaration>;
22
+ small?: Partial<CSSStyleDeclaration>;
23
+ /** @deprecated */
24
+ xsmall?: Partial<CSSStyleDeclaration>;
25
+ };
26
+ component?: {
27
+ name: string;
28
+ options?: any;
29
+ tag?: string;
30
+ };
31
+ bindings?: {
32
+ [key: string]: string;
33
+ };
34
+ meta?: {
35
+ [key: string]: JSONValue;
36
+ };
37
+ actions?: {
38
+ [key: string]: string;
39
+ };
40
+ properties?: {
41
+ [key: string]: string;
42
+ };
43
+ code?: {
44
+ bindings?: {
45
+ [key: string]: string;
46
+ };
47
+ actions?: {
48
+ [key: string]: string;
49
+ };
50
+ };
51
+ repeat?: {
52
+ collection: string;
53
+ itemName?: string;
54
+ } | null;
55
+ animations?: Animation[];
56
+ }
57
+ interface Animation {
58
+ }
59
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { Prettify } from './typescript.js';
2
+ /**
3
+ * Lol Typescript
4
+ * https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
5
+ */
6
+ type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
7
+ type OptionalFieldsOnly<T> = {
8
+ [K in keyof T as T[K] extends Required<T>[K] ? IfAny<T[K], K, never> : K]: T[K];
9
+ };
10
+ type RequiredFieldsOnly<T> = {
11
+ [K in keyof T as T[K] extends Required<T>[K] ? IfAny<T[K], never, K> : never]: T[K];
12
+ };
13
+ type Enforced<T> = {
14
+ [K in keyof T]-?: T[K];
15
+ };
16
+ type AndUndefined<T> = {
17
+ [K in keyof T]: T[K] | undefined;
18
+ };
19
+ /**
20
+ * Enforce that all optional fields are undefined
21
+ * @example
22
+ * type Foo = { a: string, b?: number }
23
+ * type Bar = EnforcePartials<Foo> // { a: string, b: number | undefined }
24
+ */
25
+ export type EnforcePartials<From> = Prettify<AndUndefined<Enforced<OptionalFieldsOnly<From>>> & RequiredFieldsOnly<From>>;
26
+ export {};
@@ -0,0 +1,122 @@
1
+ export interface Input {
2
+ /** This is the name of the component prop this input represents */
3
+ name: string;
4
+ /** A friendlier name to show in the UI if the component prop name is not ideal for end users */
5
+ friendlyName?: string;
6
+ /** @hidden @deprecated */
7
+ description?: string;
8
+ /** A default value to use */
9
+ defaultValue?: any;
10
+ /**
11
+ * The type of input to use, such as 'text'
12
+ *
13
+ * See all available inputs [here](https://www.builder.io/c/docs/custom-react-components#input-types)
14
+ * and you can create your own custom input types and associated editor UIs with [plugins](https://www.builder.io/c/docs/extending/plugins)
15
+ */
16
+ type: string;
17
+ /** Is this input mandatory or not */
18
+ required?: boolean;
19
+ /** @hidden */
20
+ autoFocus?: boolean;
21
+ subFields?: Input[];
22
+ /**
23
+ * Additional text to render in the UI to give guidance on how to use this
24
+ *
25
+ * @example
26
+ * ```js
27
+ * helperText: 'Be sure to use a proper URL, starting with "https://"'
28
+ * 111
29
+ */
30
+ helperText?: string;
31
+ /** @hidden */
32
+ allowedFileTypes?: string[];
33
+ /** @hidden */
34
+ imageHeight?: number;
35
+ /** @hidden */
36
+ imageWidth?: number;
37
+ /** @hidden */
38
+ mediaHeight?: number;
39
+ /** @hidden */
40
+ mediaWidth?: number;
41
+ /** @hidden */
42
+ hideFromUI?: boolean;
43
+ /** @hidden */
44
+ modelId?: string;
45
+ /**
46
+ * Number field type validation maximum accepted input
47
+ */
48
+ max?: number;
49
+ /**
50
+ * Number field type validation minimum accepted input
51
+ */
52
+ min?: number;
53
+ /**
54
+ * Number field type step size when using arrows
55
+ */
56
+ step?: number;
57
+ /**
58
+ * Set this to `true` to show the editor for this input when
59
+ * children of this component are selected. This is useful for things
60
+ * like Tabs, such that users may not always select the Tabs component
61
+ * directly but will still be looking for how to add additional tabs
62
+ */
63
+ broadcast?: boolean;
64
+ /**
65
+ * Set this to `true` to show the editor for this input when
66
+ * group locked parents of this component are selected. This is useful
67
+ * to bubble up important inputs for locked groups, like text and images
68
+ */
69
+ bubble?: boolean;
70
+ /**
71
+ * Set this to `true` if you want this component to be translatable
72
+ */
73
+ localized?: boolean;
74
+ /** @hidden */
75
+ options?: {
76
+ [key: string]: any;
77
+ };
78
+ /**
79
+ * For "text" input type, specifying an enum will show a dropdown of options instead
80
+ */
81
+ enum?: string[] | {
82
+ label: string;
83
+ value: any;
84
+ helperText?: string;
85
+ }[];
86
+ /** Regex field validation for all string types (text, longText, html, url, etc) */
87
+ regex?: {
88
+ /** pattern to test, like "^\/[a-z]$" */
89
+ pattern: string;
90
+ /** flags for the RegExp constructor, e.g. "gi" */
91
+ options?: string;
92
+ /**
93
+ * Friendly message to display to end-users if the regex fails, e.g.
94
+ * "You must use a relative url starting with '/...' "
95
+ */
96
+ message: string;
97
+ };
98
+ /**
99
+ * Set this to `true` to put this under the "show more" section of
100
+ * the options editor. Useful for things that are more advanced
101
+ * or more rarely used and don't need to be too prominent
102
+ */
103
+ advanced?: boolean;
104
+ /** @hidden */
105
+ /** @hidden */
106
+ code?: boolean;
107
+ /** @hidden */
108
+ richText?: boolean;
109
+ /** @hidden */
110
+ showIf?: ((options: Map<string, any>) => boolean) | string;
111
+ /** @hidden */
112
+ copyOnAdd?: boolean;
113
+ /**
114
+ * Use optionally with inputs of type `reference`. Restricts the content entry picker to a specific model by name.
115
+ */
116
+ model?: string;
117
+ valueType?: {
118
+ type?: string;
119
+ };
120
+ onChange?: ((options: Map<string, any>) => void | Promise<void>) | string;
121
+ meta?: Record<string, any>;
122
+ }
@@ -0,0 +1 @@
1
+ export type Target = 'vue' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid' | 'rsc' | 'angular';
@@ -0,0 +1,8 @@
1
+ export type Nullable<T> = T | null | undefined;
2
+ export type Dictionary<T> = {
3
+ [key: string]: T;
4
+ };
5
+ export type Overwrite<T, U> = keyof U extends keyof T ? Pick<T, Exclude<keyof T, keyof U>> & U : never;
6
+ export type Prettify<T> = {
7
+ [K in keyof T]: T[K];
8
+ } & {};
@@ -1,4 +1,5 @@
1
1
  import type { EvaluatorArgs } from './helpers';
2
2
  type EvalValue = unknown;
3
- export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression, enableCache }: EvaluatorArgs): EvalValue;
3
+ export declare const getSimpleExpressionGetPath: (code: string) => string;
4
+ export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression }: EvaluatorArgs): EvalValue;
4
5
  export {};
@@ -3,7 +3,6 @@ import { getUserAttributes } from '../track/helpers';
3
3
  export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
4
4
  event?: Event;
5
5
  isExpression?: boolean;
6
- enableCache: boolean;
7
6
  };
8
7
  export type BuilderGlobals = {
9
8
  isEditing: boolean | undefined;
@@ -1,3 +1,4 @@
1
+ import { setIvm } from './node-runtime';
1
2
  import type { IsolateOptions } from 'isolated-vm';
2
3
  /**
3
4
  * This function initializes the SDK on a Node server. It handles importing the
@@ -12,3 +13,4 @@ import type { IsolateOptions } from 'isolated-vm';
12
13
  export declare const initializeNodeRuntime: (args?: {
13
14
  ivmIsolateOptions?: IsolateOptions;
14
15
  }) => void;
16
+ export { setIvm };
@@ -0,0 +1,5 @@
1
+ export declare const getSdkHeaders: () => {
2
+ 'X-Builder-SDK': any;
3
+ 'X-Builder-SDK-GEN': string;
4
+ 'X-Builder-SDK-Version': string;
5
+ };
@@ -1,12 +0,0 @@
1
- "use strict";const c=require("react/jsx-runtime"),g=require("react"),T=require("./blocks-exports.cjs"),x=require("./server-entry-8ce6f347.cjs"),j=require("./evaluate-617e3bee.cjs"),G=require("./get-class-prop-name-dc89023a.cjs"),V=require("./dynamic-renderer-b29b45ca.cjs"),N=g.createContext({registeredComponents:{}});function Z(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}function J(e,...t){const n=Object.assign({},e);for(const r of t)delete n[r];return n}const E=e=>JSON.parse(JSON.stringify(e)),$=(e,t,n)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((o,s,l)=>Object(o[s])===o[s]?o[s]:o[s]=Math.abs(Number(r[l+1]))>>0===+r[l+1]?[]:{},e)[r[r.length-1]]=n,e};function w(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>w(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=w(e[n]));return t}const Q=["svelte","vue","angular","qwik","solid"].includes(x.TARGET),X=e=>{if(Q){const t=E(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=w(J(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},Y=({block:e,context:t,localState:n,rootState:r,rootSetState:o})=>{if(!e.bindings)return e;const s=X(e);for(const l in e.bindings){const d=e.bindings[l],f=j.evaluate({code:d,localState:n,rootState:r,rootSetState:o,context:t,enableCache:!0});$(s,l,f)}return s};function ee({block:e,context:t,shouldEvaluateBindings:n,localState:r,rootState:o,rootSetState:s}){const l=e;return n?Y({block:l,localState:r,rootState:o,rootSetState:s,context:t}):l}const B=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function te(e,t,n={}){let r,o,s,l=null,d=0;const f=function(){d=n.leading===!1?0:Date.now(),l=null,s=e.apply(r,o),l||(r=o=null)};return function(){const a=Date.now();!d&&n.leading===!1&&(d=a);const m=t-(a-d);return r=this,o=arguments,m<=0||m>t?(l&&(clearTimeout(l),l=null),d=a,s=e.apply(r,o),l||(r=o=null)):!l&&n.trailing!==!1&&(l=setTimeout(f,m)),s}}function S(e,...t){const n=Object(e);for(let r=1;r<arguments.length;r++){const o=arguments[r];if(o!=null)for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])}return n}function ne(e){for(const t of e)switch(t.trigger){case"pageLoad":M(t);break;case"scrollInView":re(t);break}}function D(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function F(e,t){const n=oe(e),r=getComputedStyle(t),o=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,l=[o,s];for(const d of l)for(const f of n)f in d||(d[f]=r[f])}function oe(e){const t=[];for(const n of e.steps)for(const r in n.styles)t.indexOf(r)===-1&&t.push(r);return t}function M(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){D(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{F(e,n),n.style.transition="none",n.style.transitionDelay="0",S(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${B(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),S(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function re(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){D(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{F(e,n);let r=!1,o=!1;function s(){!r&&d(n)?(r=!0,o=!0,setTimeout(()=>{S(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",l),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&r&&!o&&!d(n)&&(r=!1,S(n.style,e.steps[0].styles))}const l=te(s,200,{leading:!1});function d(m){const p=m.getBoundingClientRect(),k=window.innerHeight,i=(e.thresholdPercent||0)/100*k;return p.bottom>i&&p.top<k-i}const f=e.steps[0].styles;function a(){S(n.style,f)}a(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${B(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",l,{capture:!0,passive:!0}),s()})}const L=e=>Object.entries(e).map(([n,r])=>{if(typeof r=="string")return`${B(n)}: ${r};`}).filter(x.checkIsDefined),se=e=>L(e).join(`
2
- `),v=({mediaQuery:e,className:t,styles:n})=>{const r=`.${t} {
3
- ${se(n)}
4
- }`;return e?`${e} {
5
- ${r}
6
- }`:r};function ce({style:e}){return e}const le=({block:e,context:t})=>_(ce({style:e.style||{},context:t,block:e}));function _(e){switch(x.TARGET){case"svelte":case"vue":case"solid":case"angular":return L(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const ie=({block:e,registeredComponents:t})=>{var o;const n=(o=e.component)==null?void 0:o.name;if(!n)return null;const r=t[n];if(r)return r;console.warn(`
7
- Could not find a registered component named "${n}".
8
- If you registered it, is the file that registered it imported by the file that needs to render it?`)},ae=({block:e,context:t})=>{const{repeat:n,...r}=e;if(!(n!=null&&n.collection))return;const o=j.evaluate({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const s=n.collection.split(".").pop(),l=n.itemName||(s?s+"Item":"item");return o.map((f,a)=>({context:{...t,localState:{...t.localState,$index:a,$item:f,[l]:f,[`$${l}Index`]:a}},block:r}))},ue=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},de=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},fe=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},me=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},q={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},I=(e,t=q)=>`@media (max-width: ${t[e].max}px)`,H=({small:e,medium:t})=>{const n=E(q);if(!e||!t)return n;const r=Math.floor(e/2);n.small={max:e,min:r,default:r+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const s=n.medium.max+1;return n.large={max:2e3,min:s,default:s+1},n};function U(e){return c.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function he(e){function t(){const r=e.block;return x.checkIsDefined(r.hide)?!r.hide:x.checkIsDefined(r.show)?r.show:!0}function n(){var h,y,A;const r=e.block,o=r.responsiveStyles,s=e.context.content,l=H(((h=s==null?void 0:s.meta)==null?void 0:h.breakpoints)||{}),d=o==null?void 0:o.large,f=o==null?void 0:o.medium,a=o==null?void 0:o.small,m=r.id;if(!m)return"";const p=d?v({className:m,styles:d}):"",k=f?v({className:m,styles:f,mediaQuery:I("medium",l)}):"",C=a?v({className:m,styles:a,mediaQuery:I("small",l)}):"",i=r.animations&&r.animations.find(P=>P.trigger==="hover");let u="";if(i){const P=((A=(y=i.steps)==null?void 0:y[1])==null?void 0:A.styles)||{};u=v({className:`${m}:hover`,styles:{...P,transition:`all ${i.duration}s ${B(i.easing)}`,transitionDelay:i.delay?`${i.delay}s`:"0s"}})||""}return[p,k,C,u].join(" ")}return c.jsx(c.Fragment,{children:n()&&t()?c.jsx(c.Fragment,{children:c.jsx(U,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function ge(e){return e.charAt(0).toUpperCase()+e.slice(1)}const xe=e=>`on${ge(e)}`,ye=(e,t)=>n=>j.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function z(e){var r;const t={},n=(r=e.block.actions)!=null?r:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const s=n[o];let l=xe(o);if(e.stripPrefix)switch(x.TARGET){case"vue":l=l.replace("v-on:","");break;case"svelte":l=l.replace("on:","");break}t[l]=ye(s,e)}return t}function pe({properties:e}){return e}const ke=e=>({href:e.href});function R({block:e,context:t}){var r;const n={...ke(e),...e.properties,"builder-id":e.id,style:le({block:e,context:t}),[G.getClassPropName()]:[e.id,"builder-block",e.class,(r=e.properties)==null?void 0:r.class].filter(Boolean).join(" ")};return pe({properties:n,context:t,block:e})}function Ce(e){return c.jsx(V.DynamicRenderer,{TagName:e.Wrapper,attributes:R({block:e.block,context:e.context}),actionAttributes:z({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function Se(e){return g.useEffect(()=>{},[]),c.jsx(c.Fragment,{children:e.children})}function be(e){function t(){return e.includeBlockProps?{...R({block:e.block,context:e.context}),...z({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return c.jsx(c.Fragment,{children:e.Wrapper.load?c.jsx(c.Fragment,{children:c.jsx(Se,{load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:t(),children:e.children})}):c.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})})}const ve=({componentOptions:e,builderBlock:t,context:n,componentRef:r,includeBlockProps:o,isInteractive:s,contextValue:l})=>{const d={...e,...o?{attributes:R({block:t,context:l})}:{}};return s?{Wrapper:r,block:t,context:n,wrapperProps:e,includeBlockProps:o}:d};function O(e){var r;const[t,n]=g.useState(()=>e.isInteractive?be:e.componentRef);return c.jsx(c.Fragment,{children:e.componentRef?c.jsx(c.Fragment,{children:c.jsx(t,{...ve({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(r=e.blockChildren)==null?void 0:r.map(o=>c.jsx(b,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function W(e){const[t,n]=g.useState(()=>e.repeatContext);return c.jsx(T.BuilderContext.Provider,{value:t,children:c.jsx(b,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function b(e){var m,p,k,C;function t(){return ae({block:e.block,context:e.context})}const[n,r]=g.useState(()=>({value:null,update:!1}));function o(){var u;if(n.value&&!n.update&&!x.isPreviewing())return n.value;const i=(u=e.block.repeat)!=null&&u.collection?e.block:ee({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return n.value=i,n.update=!1,i}function s(){return ie({block:o(),registeredComponents:e.registeredComponents})}function l(){var u;return e.block.tagName==="a"||((u=o().properties)==null?void 0:u.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"}function d(){var h,y;if((h=e.block.repeat)!=null&&h.collection)return!!((y=t==null?void 0:t())!=null&&y.length);const i="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!i}function f(){var u,h;return!((u=s==null?void 0:s())!=null&&u.component)&&!t()?(h=o().children)!=null?h:[]:[]}function a(){var i,u,h,y;return{blockChildren:(i=o().children)!=null?i:[],componentRef:(u=s==null?void 0:s())==null?void 0:u.component,componentOptions:{...Z(o()),...fe(s(),o()),...me(s(),e.context),...ue(s(),e.linkComponent),...de(s(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((h=s==null?void 0:s())==null?void 0:h.noWrap)===!0,isInteractive:!((y=s==null?void 0:s())!=null&&y.isRSC&&x.TARGET==="rsc")}}return g.useEffect(()=>{const i=o().id,u=o().animations;u&&i&&ne(u.map(h=>({...h,elementId:i})))},[]),g.useEffect(()=>{n.update=!0}),c.jsx(c.Fragment,{children:d()?c.jsxs(c.Fragment,{children:[c.jsx(he,{block:o(),context:e.context}),(m=s==null?void 0:s())!=null&&m.noWrap?t()?c.jsx(c.Fragment,{children:(C=t())==null?void 0:C.map((i,u)=>c.jsx(W,{repeatContext:i.context,block:i.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},u))}):c.jsx(O,{componentRef:a().componentRef,componentOptions:a().componentOptions,blockChildren:a().blockChildren,context:a().context,registeredComponents:a().registeredComponents,linkComponent:a().linkComponent,builderBlock:a().builderBlock,includeBlockProps:a().includeBlockProps,isInteractive:a().isInteractive}):c.jsx(c.Fragment,{children:t()?c.jsx(c.Fragment,{children:(k=t())==null?void 0:k.map((i,u)=>c.jsx(W,{repeatContext:i.context,block:i.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},u))}):c.jsxs(Ce,{Wrapper:l(),block:o(),context:e.context,children:[c.jsx(O,{componentRef:a().componentRef,componentOptions:a().componentOptions,blockChildren:a().blockChildren,context:a().context,registeredComponents:a().registeredComponents,linkComponent:a().linkComponent,builderBlock:a().builderBlock,includeBlockProps:a().includeBlockProps,isInteractive:a().isInteractive}),(p=f())==null?void 0:p.map(i=>c.jsx(b,{block:i,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},i.id))]})})]}):null})}function Be(e){const t=g.useRef(null);function n(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function r(){var s,l;x.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((l=window.parent)==null||l.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var s,l;x.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((l=window.parent)==null||l.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return g.useEffect(()=>{},[]),c.jsxs(c.Fragment,{children:[c.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-77bdc7c6","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>r(),onMouseEnter:s=>o(),onKeyPress:s=>r(),...e.BlocksWrapperProps,children:e.children}),c.jsx("style",{children:`.props-blocks-wrapper-77bdc7c6 {
9
- display: flex;
10
- flex-direction: column;
11
- align-items: stretch;
12
- }`})]})}function K(e){var r,o,s;const t=g.useContext(T.BuilderContext),n=g.useContext(N);return c.jsx(Be,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:((r=e.context)==null?void 0:r.BlocksWrapper)||t.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||t.BlocksWrapperProps,children:e.blocks?c.jsx(c.Fragment,{children:(s=e.blocks)==null?void 0:s.map(l=>c.jsx(b,{block:l,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},l.id))}):null})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));exports.Block=b;exports.Blocks=K;exports.ComponentsContext=N;exports.InlinedStyles=U;exports.blocks=Pe;exports.fastClone=E;exports.getSizesForBreakpoints=H;exports.mapStyleObjToStrIfNeeded=_;exports.set=$;exports.triggerAnimation=M;
@@ -1,183 +0,0 @@
1
- import { jsxs as N, Fragment as w, jsx as u } from "react/jsx-runtime";
2
- import { useRef as J, useState as y } from "react";
3
- import { Block as O, Blocks as S, set as U } from "./blocks-852d317b.js";
4
- import { isEditing as j } from "./server-entry-9d83b8e5.js";
5
- import "./blocks-exports.mjs";
6
- import "./evaluate-46f56681.js";
7
- import "./get-class-prop-name-6e4205e7.js";
8
- import "./dynamic-renderer-8b343325.js";
9
- const R = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], $ = () => {
10
- const e = process.env.NODE_ENV || "production";
11
- return R.includes(e) ? e : "production";
12
- }, L = (e, i, v) => {
13
- const s = String.prototype.split.call(i, /[,[\].]+?/).filter(Boolean).reduce((a, b) => a != null ? a[b] : a, e);
14
- return s === void 0 || s === e ? v : s;
15
- };
16
- function Q(e) {
17
- var E, x;
18
- const i = J(null), [v, s] = y(() => "unsubmitted"), [a, b] = y(() => null), [q, F] = y(() => "");
19
- function D(o) {
20
- var m, f;
21
- const c = {
22
- ...e.builderContext.rootState,
23
- ...o
24
- };
25
- e.builderContext.rootSetState ? (f = (m = e.builderContext).rootSetState) == null || f.call(m, c) : e.builderContext.rootState = c;
26
- }
27
- function h() {
28
- return j() && e.previewState || v;
29
- }
30
- function P(o) {
31
- var m;
32
- const c = e.sendWithJs || e.sendSubmissionsTo === "email";
33
- if (e.sendSubmissionsTo === "zapier")
34
- o.preventDefault();
35
- else if (c) {
36
- if (!(e.action || e.sendSubmissionsTo === "email")) {
37
- o.preventDefault();
38
- return;
39
- }
40
- o.preventDefault();
41
- const f = o.currentTarget || o.target, C = e.customHeaders || {};
42
- let g;
43
- const A = new FormData(f), k = Array.from(f.querySelectorAll("input,select,textarea")).filter((t) => !!t.name).map((t) => {
44
- let n;
45
- const l = t.name;
46
- if (t instanceof HTMLInputElement)
47
- if (t.type === "radio") {
48
- if (t.checked)
49
- return n = t.name, {
50
- key: l,
51
- value: n
52
- };
53
- } else if (t.type === "checkbox")
54
- n = t.checked;
55
- else if (t.type === "number" || t.type === "range") {
56
- const r = t.valueAsNumber;
57
- isNaN(r) || (n = r);
58
- } else
59
- t.type === "file" ? n = t.files : n = t.value;
60
- else
61
- n = t.value;
62
- return {
63
- key: l,
64
- value: n
65
- };
66
- });
67
- let d = e.contentType;
68
- if (e.sendSubmissionsTo === "email" && (d = "multipart/form-data"), Array.from(k).forEach(({ value: t }) => {
69
- (t instanceof File || Array.isArray(t) && t[0] instanceof File || t instanceof FileList) && (d = "multipart/form-data");
70
- }), d !== "application/json")
71
- g = A;
72
- else {
73
- const t = {};
74
- Array.from(k).forEach(({ value: n, key: l }) => {
75
- U(t, l, n);
76
- }), g = JSON.stringify(t);
77
- }
78
- d && d !== "multipart/form-data" && (c && ((m = e.action) != null && m.includes("zapier.com")) || (C["content-type"] = d));
79
- const M = new CustomEvent("presubmit", { detail: { body: g } });
80
- if (i.current && (i.current.dispatchEvent(M), M.defaultPrevented))
81
- return;
82
- s("sending");
83
- const B = `${$() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
84
- e.sendSubmissionsToEmail || ""
85
- )}&name=${encodeURIComponent(e.name || "")}`;
86
- fetch(
87
- e.sendSubmissionsTo === "email" ? B : e.action,
88
- { body: g, headers: C, method: e.method || "post" }
89
- ).then(
90
- async (t) => {
91
- let n;
92
- const l = t.headers.get("content-type");
93
- if (l && l.indexOf("application/json") !== -1 ? n = await t.json() : n = await t.text(), !t.ok && e.errorMessagePath) {
94
- let r = L(n, e.errorMessagePath);
95
- r && (typeof r != "string" && (r = JSON.stringify(r)), F(r), D({ formErrorMessage: r }));
96
- }
97
- if (b(n), s(t.ok ? "success" : "error"), t.ok) {
98
- const r = new CustomEvent("submit:success", {
99
- detail: { res: t, body: n }
100
- });
101
- if (i.current) {
102
- if (i.current.dispatchEvent(r), r.defaultPrevented)
103
- return;
104
- e.resetFormOnSubmit !== !1 && i.current.reset();
105
- }
106
- if (e.successUrl)
107
- if (i.current) {
108
- const T = new CustomEvent("route", {
109
- detail: { url: e.successUrl }
110
- });
111
- i.current.dispatchEvent(T), T.defaultPrevented || (location.href = e.successUrl);
112
- } else
113
- location.href = e.successUrl;
114
- }
115
- },
116
- (t) => {
117
- const n = new CustomEvent("submit:error", {
118
- detail: { error: t }
119
- });
120
- i.current && (i.current.dispatchEvent(n), n.defaultPrevented) || (b(t), s("error"));
121
- }
122
- );
123
- }
124
- }
125
- return /* @__PURE__ */ N(w, { children: [
126
- " ",
127
- /* @__PURE__ */ N(
128
- "form",
129
- {
130
- validate: e.validate,
131
- ref: i,
132
- action: !e.sendWithJs && e.action,
133
- method: e.method,
134
- name: e.name,
135
- onSubmit: (o) => P(o),
136
- ...e.attributes,
137
- children: [
138
- e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ u(w, { children: (x = (E = e.builderBlock) == null ? void 0 : E.children) == null ? void 0 : x.map((o, c) => /* @__PURE__ */ u(
139
- O,
140
- {
141
- block: o,
142
- context: e.builderContext,
143
- registeredComponents: e.builderComponents,
144
- linkComponent: e.builderLinkComponent
145
- },
146
- `form-block-${c}`
147
- )) }) : null,
148
- h() === "error" ? /* @__PURE__ */ u(
149
- S,
150
- {
151
- path: "errorMessage",
152
- blocks: e.errorMessage,
153
- context: e.builderContext
154
- }
155
- ) : null,
156
- h() === "sending" ? /* @__PURE__ */ u(
157
- S,
158
- {
159
- path: "sendingMessage",
160
- blocks: e.sendingMessage,
161
- context: e.builderContext
162
- }
163
- ) : null,
164
- h() === "error" && a ? /* @__PURE__ */ u("pre", { className: "builder-form-error-text pre-3a20f614", children: JSON.stringify(a, null, 2) }) : null,
165
- h() === "success" ? /* @__PURE__ */ u(
166
- S,
167
- {
168
- path: "successMessage",
169
- blocks: e.successMessage,
170
- context: e.builderContext
171
- }
172
- ) : null
173
- ]
174
- }
175
- ),
176
- " ",
177
- /* @__PURE__ */ u("style", { children: ".pre-3a20f614 { padding: 10px; color: red; text-align: center; }" }),
178
- " "
179
- ] });
180
- }
181
- export {
182
- Q as default
183
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),b=require("./blocks-5084bbec.cjs"),P=require("./server-entry-8ce6f347.cjs");require("./blocks-exports.cjs");require("./evaluate-617e3bee.cjs");require("./get-class-prop-name-dc89023a.cjs");require("./dynamic-renderer-b29b45ca.cjs");const B=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return B.includes(e)?e:"production"},A=(e,i,S)=>{const a=String.prototype.split.call(i,/[,[\].]+?/).filter(Boolean).reduce((c,h)=>c!=null?c[h]:c,e);return a===void 0||a===e?S:a};function O(e){var x,E;const i=y.useRef(null),[S,a]=y.useState(()=>"unsubmitted"),[c,h]=y.useState(()=>null),[J,T]=y.useState(()=>"");function q(s){var f,m;const u={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(m=(f=e.builderContext).rootSetState)==null||m.call(f,u):e.builderContext.rootState=u}function g(){return P.isEditing()&&e.previewState||S}function F(s){var f;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const m=s.currentTarget||s.target,k=e.customHeaders||{};let v;const N=new FormData(m),C=Array.from(m.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const l=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:l,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const r=t.valueAsNumber;isNaN(r)||(n=r)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:l,value:n}});let d=e.contentType;if(e.sendSubmissionsTo==="email"&&(d="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(d="multipart/form-data")}),d!=="application/json")v=N;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{b.set(t,l,n)}),v=JSON.stringify(t)}d&&d!=="multipart/form-data"&&(u&&((f=e.action)!=null&&f.includes("zapier.com"))||(k["content-type"]=d));const j=new CustomEvent("presubmit",{detail:{body:v}});if(i.current&&(i.current.dispatchEvent(j),j.defaultPrevented))return;a("sending");const w=`${D()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:v,headers:k,method:e.method||"post"}).then(async t=>{let n;const l=t.headers.get("content-type");if(l&&l.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let r=A(n,e.errorMessagePath);r&&(typeof r!="string"&&(r=JSON.stringify(r)),T(r),q({formErrorMessage:r}))}if(h(n),a(t.ok?"success":"error"),t.ok){const r=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(i.current){if(i.current.dispatchEvent(r),r.defaultPrevented)return;e.resetFormOnSubmit!==!1&&i.current.reset()}if(e.successUrl)if(i.current){const M=new CustomEvent("route",{detail:{url:e.successUrl}});i.current.dispatchEvent(M),M.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});i.current&&(i.current.dispatchEvent(n),n.defaultPrevented)||(h(t),a("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:i,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>F(s),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(E=(x=e.builderBlock)==null?void 0:x.children)==null?void 0:E.map((s,u)=>o.jsx(b.Block,{block:s,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null,g()==="error"?o.jsx(b.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(b.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&c?o.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(c,null,2)}):null,g()==="success"?o.jsx(b.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-617e3bee.cjs");require("./server-entry-8ce6f347.cjs");function x(e){function n(){var t;const o=e.builderContext,{context:r,localState:a,rootState:c,rootSetState:l}=o;return String(((t=e.text)==null?void 0:t.toString())||"").replace(/{{([^}]+)}}/g,(d,u)=>s.evaluate({code:u,context:r,localState:a,rootState:c,rootSetState:l,enableCache:!1}))}return i.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:n()},style:{outline:"none"}})}exports.default=x;