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AAA7D,cACpB,UACA,CACAb,UAAA,WACA+E,GAAA,KACAC,GAAA,KACAC,GAAA,OACAC,GAAA,MACAC,KAAA,OACAC,OAAA,eACAC,YAAA,MACAC,aAAA,qBACAC,eAAA,uBAGoBb,EAAA7D,cACpB,UACA,CACAb,UAAA,WACA+E,GAAA,KACAC,GAAA,KACAC,GAAA,OACAC,GAAA,MACAC,KAAA,OACAC,OAAA,eACAC,YAAA,MACAC,aAAA,qBACAC,eAAA,uBAGoBb,EAAA7D,cACpB,UACA,CACAb,UAAA,WACA+E,GAAA,KACAC,GAAA,KACAC,GAAA,OACAC,GAAA,MACAC,KAAA,OACAC,OAAA,eACAC,YAAA,MACAC,aAAA,qBACAC,eAAA,uBAIA,2DC7EAC,EAAA,CACA,GACAC,MAAA,CACA,0XACA,qIAEAd,QAAA,WAEA,IACAc,MAAA,CACA,kcAEAd,QAAA,aAEA,IACAc,MAAA,CACA,2WAEAd,QAAA,aAEA,IACAc,MAAA,CACA,2YAEAd,QAAA,aAEA,IACAc,MAAA,CACA,qbAEAd,QAAA,cAGA,SAAAe,GAAAC,KAA4BA,EAAA,MAAA7K,IAC5B,MAAA2K,MAAUA,EAAAd,QAAAA,IAAmB,EAAAiB,EAAAC,GAAiBL,EAAA,iBAAAG,EAAAA,EAAA,IAC9C,OAAyB9D,EAAAhB,cAAoB+E,EAAAE,EAAI,CAAIH,OAAAhB,aAAA7J,GAAyB2K,EAAAM,IAAA,CAAAC,EAAAC,IAAsCpE,EAAAhB,cAAmB,QAAWqF,IAAAD,EAAAD,IAAAb,KAAA,kBAClJ","sources":["webpack://@logos/commerceweb-frontend/./Scripts/site/components/builder/custom-components/email-capture-form/register.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/builder/custom-components/email-capture-form/builder-email-capture-form.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/builder/custom-components/email-capture-form/mailing-lists-api-impl.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/builder/custom-components/email-capture-form/index.jsx","webpack://@logos/commerceweb-frontend/./node_modules/@faithlife/commerce-components/dist/chunk-2FO5O72K.js","webpack://@logos/commerceweb-frontend/./node_modules/@faithlife/commerce-components/dist/chunk-OSFUBHKT.js","webpack://@logos/commerceweb-frontend/./node_modules/@faithlife/commerce-components/dist/chunk-U6OW6NDI.js","webpack://@logos/commerceweb-frontend/./node_modules/@faithlife/commerce-components/dist/chunk-V34PAT5C.js","webpack://@logos/commerceweb-frontend/./node_modules/@faithlife/commerce-components/dist/chunk-WVFM6QOD.js"],"sourcesContent":["import { Builder, withChildren } from '@builder.io/react';\n\nimport { createBuilderEmailCaptureFormComponent } from './builder-email-capture-form';\n\nexport function register(MailingListsApiImpl) {\n\tconst BuilderEmailCaptureForm = createBuilderEmailCaptureFormComponent(MailingListsApiImpl);\n\tregisterEmailCaptureFormWithBuilder(BuilderEmailCaptureForm);\n}\n\nexport function registerEmailCaptureFormWithBuilder(EmailCaptureForm) {\n\tBuilder.registerComponent(withChildren(EmailCaptureForm), {\n\t\tname: 'EmailCaptureForm',\n\t\tfriendlyName: 'Email Capture Form',\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tname: 'buttonLabel',\n\t\t\t\tfriendlyName: 'Button Label',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefaultValue: 'Submit',\n\t\t\t\thelperText: 'Text displayed on the submit button.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'buttonSuccessLabel',\n\t\t\t\tfriendlyName: 'Button Success Label',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefaultValue: 'Success!',\n\t\t\t\thelperText: 'Text displayed on the submit button after successful submission.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'instructionText',\n\t\t\t\tfriendlyName: 'Instruction Text',\n\t\t\t\ttype: 'string',\n\t\t\t\thelperText: 'Optional instructional copy shown above the input fields.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'finePrintText',\n\t\t\t\tfriendlyName: 'Fine Print Text',\n\t\t\t\ttype: 'string',\n\t\t\t\thelperText: 'Optional fine print shown below the CTA button.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'salesforcePreferences',\n\t\t\t\tfriendlyName: 'Salesforce Preferences',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefaultValue: 'Logos,Logos_English',\n\t\t\t\thelperText: 'Comma-separated list of mailing lists to enroll subscribers in.',\n\t\t\t\tadvanced: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'formName',\n\t\t\t\tfriendlyName: 'Form Name',\n\t\t\t\ttype: 'string',\n\t\t\t\thelperText: 'Optional name of the form to be passed to MailingListsAPI.',\n\t\t\t\tadvanced: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'dataExtensionKey',\n\t\t\t\tfriendlyName: 'Data Extension Key',\n\t\t\t\ttype: 'string',\n\t\t\t\thelperText: 'Optional Data Extension Key to be passed to MailingListsAPI.',\n\t\t\t\tadvanced: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'redirectUrl',\n\t\t\t\tfriendlyName: 'Redirect URL',\n\t\t\t\ttype: 'string',\n\t\t\t\thelperText:\n\t\t\t\t\t'Optional URL to redirect to after form submission. Defaults to the current page URL if not specified.',\n\t\t\t\tadvanced: true,\n\t\t\t},\n\t\t],\n\t\tcanHaveChildren: true,\n\t\tdefaultChildren: [\n\t\t\t{\n\t\t\t\t'@type': '@builder.io/sdk:Element',\n\t\t\t\tlayerName: 'First Name',\n\t\t\t\tcomponent: {\n\t\t\t\t\tname: 'TextInput',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tlabelText: 'First Name',\n\t\t\t\t\t\tname: 'first_name',\n\t\t\t\t\t\tinputType: 'text',\n\t\t\t\t\t\tplaceholderText: 'Enter your first name',\n\t\t\t\t\t\tisRequired: true,\n\t\t\t\t\t\terrorMessages: [{ match: 'valueMissing', message: 'First name is required' }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t'@type': '@builder.io/sdk:Element',\n\t\t\t\tlayerName: 'Last Name',\n\t\t\t\tcomponent: {\n\t\t\t\t\tname: 'TextInput',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tlabelText: 'Last Name',\n\t\t\t\t\t\tname: 'last_name',\n\t\t\t\t\t\tinputType: 'text',\n\t\t\t\t\t\tplaceholderText: 'Enter your last name',\n\t\t\t\t\t\tisRequired: true,\n\t\t\t\t\t\terrorMessages: [{ match: 'valueMissing', message: 'Last name is required' }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t'@type': '@builder.io/sdk:Element',\n\t\t\t\tlayerName: 'Email',\n\t\t\t\tcomponent: {\n\t\t\t\t\tname: 'TextInput',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tlabelText: 'Email',\n\t\t\t\t\t\tname: 'email',\n\t\t\t\t\t\tinputType: 'email',\n\t\t\t\t\t\tplaceholderText: 'Enter your email address',\n\t\t\t\t\t\tisRequired: true,\n\t\t\t\t\t\terrorMessages: [\n\t\t\t\t\t\t\t{ match: 'valueMissing', message: 'Email is required' },\n\t\t\t\t\t\t\t{ match: 'typeMismatch', message: 'Please enter a valid email address' },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t});\n}\n","import React from 'react';\nimport { Builder } from '@builder.io/react';\n\nfunction validateBuilderEmailCaptureFormProps(props) {\n\tconst { salesforcePreferences } = props;\n\n\tif (!salesforcePreferences) {\n\t\treturn {\n\t\t\tvalid: false,\n\t\t\tmessage: 'Salesforce Preferences is required',\n\t\t};\n\t}\n\treturn {\n\t\tvalid: true,\n\t\tsalesforcePreferences,\n\t\t...props,\n\t};\n}\n\nexport function createBuilderEmailCaptureFormComponent(MailingListsApiImpl) {\n\tfunction BuilderEmailCaptureForm(props) {\n\t\tconst result = validateBuilderEmailCaptureFormProps(props);\n\n\t\tif (result.valid) {\n\t\t\tconst { valid: _valid, message: _message, ...rest } = result;\n\n\t\t\treturn <MailingListsApiImpl {...rest} />;\n\t\t}\n\n\t\tif (Builder.isEditing) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\tborderLeftWidth: '4px',\n\t\t\t\t\t\tborderColor: '#ed8936',\n\t\t\t\t\t\tbackgroundColor: '#fefcbf',\n\t\t\t\t\t\tpadding: '12px',\n\t\t\t\t\t\tcolor: '#dd6b20',\n\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{'Form configuration is not valid: '} {result.message}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn BuilderEmailCaptureForm;\n}\n","import React, { useContext, useEffect, useState } from 'react';\n\nimport { EmailCaptureForm } from '@faithlife/commerce-components';\nimport { RouteContext } from '../../../../route-context';\nimport { useLocation } from '../../../../location';\n\nexport function MailingListsApiImpl(props) {\n\tconst { routes } = useContext(RouteContext);\n\tconst action = routes?.MailingListsSubscribe;\n\tconst { href, isQueryStringReady } = useLocation();\n\tconst [currentUrl, setCurrentUrl] = useState('');\n\tuseEffect(() => {\n\t\tif (isQueryStringReady) {\n\t\t\tsetCurrentUrl(window.location.href);\n\t\t}\n\t}, [href, isQueryStringReady]);\n\n\tasync function handleSubmit(formData) {\n\t\tconst response = await fetch(action, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t\t},\n\t\t\tbody: new URLSearchParams(formData).toString(),\n\t\t});\n\t\tif (!response.ok) {\n\t\t\tthrow new Error('Something went wrong. Please try again.');\n\t\t}\n\t}\n\n\treturn (\n\t\t<EmailCaptureForm\n\t\t\taction={action}\n\t\t\t{...(!props.redirectUrl && { onSubmit: handleSubmit })}\n\t\t\tsuccessResetMs={3000}\n\t\t\t{...props}\n\t\t>\n\t\t\t{props.children}\n\t\t\t<input type=\"hidden\" name=\"form_name\" value={props.formName} />\n\t\t\t<input type=\"hidden\" name=\"salesforce_preferences\" value={props.salesforcePreferences} />\n\t\t\t<input type=\"hidden\" name=\"url\" value={props.redirectUrl || currentUrl} />\n\t\t\t{props.dataExtensionKey && <input type=\"hidden\" name=\"DataExtensionKey\" value={props.dataExtensionKey} />}\n\t\t</EmailCaptureForm>\n\t);\n}\n","import { MailingListsApiImpl } from './mailing-lists-api-impl';\nimport { register } from './register';\n\nregister(MailingListsApiImpl);\n","import {\n  ProgressIndicator\n} from \"./chunk-V34PAT5C.js\";\nimport {\n  Button\n} from \"./chunk-NXVEBOBO.js\";\nimport {\n  ConfirmationIcon\n} from \"./chunk-WVFM6QOD.js\";\nimport {\n  commerceResourceDefaults,\n  useResources\n} from \"./chunk-A263RQU4.js\";\nimport {\n  Typography\n} from \"./chunk-P4MY4MXU.js\";\nimport {\n  cn\n} from \"./chunk-NZVMNINS.js\";\n\n// src/components/stateful-action-button/component.tsx\nimport React, { forwardRef } from \"react\";\nvar StatefulActionButton = forwardRef(\n  ({\n    state = \"default\",\n    label,\n    successLabel,\n    className,\n    disabled,\n    \"data-testid\": testId,\n    ...props\n  }, ref) => {\n    const resources = {\n      ...commerceResourceDefaults.statefulActionButton,\n      ...useResources().statefulActionButton\n    };\n    const resolvedLabel = label ?? resources.label ?? commerceResourceDefaults.statefulActionButton.label;\n    const resolvedSuccessLabel = successLabel ?? resources.successLabel ?? commerceResourceDefaults.statefulActionButton.successLabel;\n    const isLoading = state === \"loading\";\n    const isSuccess = state === \"success\";\n    return /* @__PURE__ */ React.createElement(\n      Button,\n      {\n        ref,\n        disabled: isLoading || disabled,\n        variant: isSuccess ? \"secondary\" : \"primary\",\n        className: cn(\"tw-preflight\", className),\n        \"aria-busy\": isLoading,\n        \"data-testid\": testId,\n        ...props\n      },\n      /* @__PURE__ */ React.createElement(\"div\", { className: \"gap-sp8 flex items-center\" }, isLoading && /* @__PURE__ */ React.createElement(ProgressIndicator, { variant: \"inverse\", \"aria-hidden\": true }), isSuccess ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(\"span\", { className: \"flex h-[18px] items-center justify-center\" }, /* @__PURE__ */ React.createElement(\n        ConfirmationIcon,\n        {\n          className: \"text-status-success h-[24px] w-[24px] shrink-0\",\n          \"aria-hidden\": \"true\"\n        }\n      )), /* @__PURE__ */ React.createElement(Typography, { variant: \"ui1\", tag: \"span\", className: \"whitespace-nowrap\" }, resolvedSuccessLabel)) : /* @__PURE__ */ React.createElement(Typography, { variant: \"ui1\", tag: \"span\", className: \"whitespace-nowrap\" }, resolvedLabel))\n    );\n  }\n);\nStatefulActionButton.displayName = \"StatefulActionButton\";\n\nexport {\n  StatefulActionButton\n};\n//# sourceMappingURL=chunk-2FO5O72K.js.map","import {\n  cn\n} from \"./chunk-NZVMNINS.js\";\n\n// src/components/basic-form/component.tsx\nimport React from \"react\";\nimport * as Form from \"@radix-ui/react-form\";\nvar BasicForm = React.forwardRef(function BasicForm2({ className, \"data-testid\": dataTestId, children, action, method, onSubmit, ...props }, ref) {\n  return /* @__PURE__ */ React.createElement(\n    Form.Root,\n    {\n      ref,\n      className: cn(\"tw-preflight\", className),\n      \"data-testid\": dataTestId,\n      action,\n      method,\n      onSubmit,\n      ...props\n    },\n    children\n  );\n});\n\nexport {\n  BasicForm\n};\n//# sourceMappingURL=chunk-OSFUBHKT.js.map","import {\n  StatefulActionButton\n} from \"./chunk-2FO5O72K.js\";\nimport {\n  BasicForm\n} from \"./chunk-OSFUBHKT.js\";\nimport {\n  ErrorIcon\n} from \"./chunk-ICYG44B4.js\";\nimport {\n  Typography\n} from \"./chunk-P4MY4MXU.js\";\nimport {\n  cn\n} from \"./chunk-NZVMNINS.js\";\n\n// src/components/email-capture-form/component.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nfunction EmailCaptureForm({\n  children,\n  action,\n  className,\n  \"data-testid\": dataTestId,\n  buttonLabel,\n  buttonSuccessLabel,\n  instructionText,\n  finePrintText,\n  successResetMs = 3e3,\n  onSubmit\n}) {\n  const formRef = useRef(null);\n  const [buttonState, setButtonState] = useState(\"default\");\n  const [errorMessage, setErrorMessage] = useState(null);\n  const resetTimerRef = useRef(null);\n  useEffect(() => {\n    return () => {\n      if (resetTimerRef.current) {\n        clearTimeout(resetTimerRef.current);\n      }\n    };\n  }, []);\n  const handleSubmit = useCallback(\n    async (e) => {\n      if (!onSubmit) return;\n      e.preventDefault();\n      const form = formRef.current;\n      if (!form) return;\n      const formData = new FormData(form);\n      setButtonState(\"loading\");\n      setErrorMessage(null);\n      try {\n        await onSubmit(formData);\n        form.reset();\n        setButtonState(\"success\");\n        resetTimerRef.current = setTimeout(() => {\n          resetTimerRef.current = null;\n          setButtonState(\"default\");\n        }, successResetMs);\n      } catch (error) {\n        setButtonState(\"default\");\n        if (error instanceof Error && error.message) {\n          setErrorMessage(error.message);\n        }\n      }\n    },\n    [onSubmit, successResetMs]\n  );\n  return /* @__PURE__ */ React.createElement(\n    BasicForm,\n    {\n      ref: formRef,\n      className: cn(\"gap-sp18 flex flex-col\", className),\n      \"data-testid\": dataTestId,\n      action,\n      method: \"post\",\n      onSubmit: handleSubmit\n    },\n    errorMessage && /* @__PURE__ */ React.createElement(\"div\", { className: \"gap-sp8 flex items-center\" }, /* @__PURE__ */ React.createElement(ErrorIcon, { className: \"text-error\" }), /* @__PURE__ */ React.createElement(Typography, { variant: \"finePrint\", className: \"text-error\", role: \"alert\" }, errorMessage)),\n    /* @__PURE__ */ React.createElement(\"div\", { className: \"flex w-full flex-col\" }, instructionText && /* @__PURE__ */ React.createElement(Typography, { className: \"text-foreground-secondary\", variant: \"ui3\" }, instructionText), children && /* @__PURE__ */ React.createElement(\"div\", { className: \"mt-sp24 sm:mt-sp30 md:mt-sp36 gap-sp18 flex w-full flex-col\" }, children), /* @__PURE__ */ React.createElement(\n      StatefulActionButton,\n      {\n        type: \"submit\",\n        state: buttonState,\n        label: buttonLabel,\n        successLabel: buttonSuccessLabel,\n        className: \"mt-sp24 sm:mt-sp30 md:mt-sp36 w-full\"\n      }\n    ), finePrintText && /* @__PURE__ */ React.createElement(\n      Typography,\n      {\n        className: \"mt-sp24 sm:mt-sp30 md:mt-sp36 text-foreground-secondary italic\",\n        variant: \"finePrint\"\n      },\n      finePrintText\n    ))\n  );\n}\nEmailCaptureForm.displayName = \"EmailCaptureForm\";\n\nexport {\n  EmailCaptureForm\n};\n//# sourceMappingURL=chunk-U6OW6NDI.js.map","import {\n  commerceResourceDefaults,\n  useResources\n} from \"./chunk-A263RQU4.js\";\nimport {\n  cn\n} from \"./chunk-NZVMNINS.js\";\n\n// src/components/progress-indicator/component.tsx\nimport React from \"react\";\nimport \"./animation-OZAJB7LQ.css\";\nvar TEXT_COLOR_CLASS_BY_VARIANT = {\n  default: \"text-action-primary\",\n  inverse: \"text-white\"\n};\nfunction ProgressIndicator({\n  className,\n  variant = \"default\",\n  \"aria-label\": ariaLabel,\n  \"aria-hidden\": ariaHidden,\n  role\n}) {\n  const resources = { ...commerceResourceDefaults.common, ...useResources().common };\n  return /* @__PURE__ */ React.createElement(\n    \"svg\",\n    {\n      \"data-testid\": \"progress-indicator\",\n      viewBox: \"0 0 48 48\",\n      xmlns: \"http://www.w3.org/2000/svg\",\n      \"aria-hidden\": ariaHidden ? true : void 0,\n      \"aria-label\": ariaHidden ? void 0 : ariaLabel ?? resources.progressIndicatorLabel ?? commerceResourceDefaults.common.progressIndicatorLabel,\n      role: role ?? (ariaHidden ? void 0 : \"img\"),\n      className: cn(\n        \"tw-preflight h-[18px] w-[18px] shrink-0\",\n        TEXT_COLOR_CLASS_BY_VARIANT[variant],\n        className\n      )\n    },\n    /* @__PURE__ */ React.createElement(\n      \"ellipse\",\n      {\n        className: \"pi-dot-3\",\n        cx: \"24\",\n        cy: \"36\",\n        rx: \"19.8\",\n        ry: \"9.9\",\n        fill: \"none\",\n        stroke: \"currentColor\",\n        strokeWidth: \"1.5\",\n        vectorEffect: \"non-scaling-stroke\",\n        shapeRendering: \"geometricPrecision\"\n      }\n    ),\n    /* @__PURE__ */ React.createElement(\n      \"ellipse\",\n      {\n        className: \"pi-dot-2\",\n        cx: \"24\",\n        cy: \"24\",\n        rx: \"19.8\",\n        ry: \"9.9\",\n        fill: \"none\",\n        stroke: \"currentColor\",\n        strokeWidth: \"1.5\",\n        vectorEffect: \"non-scaling-stroke\",\n        shapeRendering: \"geometricPrecision\"\n      }\n    ),\n    /* @__PURE__ */ React.createElement(\n      \"ellipse\",\n      {\n        className: \"pi-dot-1\",\n        cx: \"24\",\n        cy: \"12\",\n        rx: \"19.8\",\n        ry: \"9.9\",\n        fill: \"none\",\n        stroke: \"currentColor\",\n        strokeWidth: \"1.5\",\n        vectorEffect: \"non-scaling-stroke\",\n        shapeRendering: \"geometricPrecision\"\n      }\n    )\n  );\n}\n\nexport {\n  ProgressIndicator\n};\n//# sourceMappingURL=chunk-V34PAT5C.js.map","import {\n  Icon,\n  selectIconVariant\n} from \"./chunk-5AEEBCQE.js\";\n\n// src/icons/status/confirmation-icon.tsx\nimport React from \"react\";\nvar VARIANTS = {\n  \"8\": {\n    paths: [\n      \"M8.16491 4.50054C8.16491 2.47649 6.52456 0.83528 4.50054 0.835085C2.47637 0.835085 0.835085 2.47637 0.835085 4.50054C0.835285 6.52455 2.47649 8.16491 4.50054 8.16491C6.52443 8.16472 8.16471 6.52443 8.16491 4.50054ZM9 4.50054C8.9998 6.98563 6.98564 8.9998 4.50054 9C2.01528 9 0.000200127 6.98575 0 4.50054C0 2.01516 2.01516 0 4.50054 0C6.98576 0.000195249 9 2.01528 9 4.50054Z\",\n      \"M6.44545 2.88329L4.36605 6.78035L3.49794 6.83798L1.93838 4.61109L2.77096 3.94346L3.85432 5.49076L5.54181 2.33092L6.44545 2.88329Z\"\n    ],\n    viewBox: \"0 0 9 9\"\n  },\n  \"12\": {\n    paths: [\n      \"M11.8511 6.5C11.8511 3.54476 9.45525 1.14892 6.5 1.14892C3.54475 1.14892 1.14892 3.54476 1.14892 6.5C1.14892 9.45524 3.54476 11.8511 6.5 11.8511C9.45524 11.8511 11.8511 9.45524 11.8511 6.5ZM9.17449 4.12221L6.10019 9.44804H5.10489L3.8213 7.22596L4.81661 6.65151L5.60149 8.0119L8.18024 3.54775L9.17449 4.12221ZM13 6.5C13 10.0899 10.0899 13 6.5 13C2.91007 13 5.83058e-06 10.0899 0 6.5C0 2.91007 2.91007 5.55292e-07 6.5 0C10.0899 0 13 2.91007 13 6.5Z\"\n    ],\n    viewBox: \"0 0 13 13\"\n  },\n  \"16\": {\n    paths: [\n      \"M15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1.00001 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8ZM11.1885 4.87695L7.29688 11.6182H6.43066L4.80664 8.80469L5.67285 8.30469L6.86328 10.3672L10.3232 4.37695L11.1885 4.87695ZM16 8C16 12.4183 12.4183 16 8 16C3.58173 16 7.47336e-06 12.4183 0 8C0 3.58172 3.58172 1.80391e-06 8 0C12.4183 0 16 3.58172 16 8Z\"\n    ],\n    viewBox: \"0 0 16 16\"\n  },\n  \"24\": {\n    paths: [\n      \"M22.5 12C22.5 6.20101 17.799 1.5 12 1.5C6.20101 1.5 1.5 6.20101 1.5 12C1.50001 17.799 6.20102 22.5 12 22.5C17.799 22.5 22.5 17.799 22.5 12ZM16.7832 7.31543L10.9453 17.4277H9.64648L7.20996 13.207L8.50879 12.457L10.2959 15.5527L15.4844 6.56543L16.7832 7.31543ZM24 12C24 18.6274 18.6274 24 12 24C5.37259 24 1.13389e-05 18.6274 0 12C0 5.37258 5.37259 2.57702e-06 12 0C18.6274 0 24 5.37258 24 12Z\"\n    ],\n    viewBox: \"0 0 24 24\"\n  },\n  \"32\": {\n    paths: [\n      \"M30.25 16C30.25 8.12994 23.8701 1.75 16 1.75C8.12994 1.75 1.75 8.12994 1.75 16C1.75001 23.87 8.12995 30.25 16 30.25C23.8701 30.25 30.25 23.8701 30.25 16ZM22.1611 9.62988L14.377 23.1113H13.0781L9.83008 17.4844L11.1289 16.7344L13.7275 21.2363L20.8623 8.87988L22.1611 9.62988ZM31.75 16C31.75 24.6985 24.6985 31.75 16 31.75C7.30152 31.75 0.250015 24.6985 0.25 16C0.25 7.30151 7.30152 0.250004 16 0.25C24.6985 0.25 31.75 7.30151 31.75 16Z\"\n    ],\n    viewBox: \"0 0 32 32\"\n  }\n};\nfunction ConfirmationIcon({ size = 24, ...props }) {\n  const { paths, viewBox } = selectIconVariant(VARIANTS, typeof size === \"number\" ? size : 24);\n  return /* @__PURE__ */ React.createElement(Icon, { size, viewBox, ...props }, paths.map((d, i) => /* @__PURE__ */ React.createElement(\"path\", { key: i, d, fill: \"currentColor\" })));\n}\n\nexport {\n  ConfirmationIcon\n};\n//# sourceMappingURL=chunk-WVFM6QOD.js.map"],"names":["BuilderEmailCaptureForm","MailingListsApiImpl","props","result","salesforcePreferences","valid","message","validateBuilderEmailCaptureFormProps","_valid","_message","rest","React","Builder","isEditing","style","borderRadius","borderLeftWidth","borderColor","backgroundColor","padding","color","fontSize","createBuilderEmailCaptureFormComponent","routes","useContext","RouteContext","action","MailingListsSubscribe","href","isQueryStringReady","useLocation","currentUrl","setCurrentUrl","useState","useEffect","window","location","EmailCaptureForm","_extends","redirectUrl","onSubmit","async","formData","fetch","method","headers","body","URLSearchParams","toString","ok","Error","successResetMs","children","type","name","value","formName","dataExtensionKey","registerComponent","withChildren","friendlyName","inputs","defaultValue","helperText","required","advanced","canHaveChildren","defaultChildren","layerName","component","options","labelText","inputType","placeholderText","isRequired","errorMessages","match","register","StatefulActionButton","react__WEBPACK_IMPORTED_MODULE_6__","forwardRef","state","label","successLabel","className","disabled","testId","ref","resources","_chunk_A263RQU4_js__WEBPACK_IMPORTED_MODULE_3__","SS","statefulActionButton","fn","resolvedLabel","resolvedSuccessLabel","isLoading","isSuccess","createElement","_chunk_NXVEBOBO_js__WEBPACK_IMPORTED_MODULE_1__","$n","variant","_chunk_NZVMNINS_js__WEBPACK_IMPORTED_MODULE_5__","cn","_chunk_V34PAT5C_js__WEBPACK_IMPORTED_MODULE_0__","Z","Fragment","_chunk_WVFM6QOD_js__WEBPACK_IMPORTED_MODULE_2__","D","_chunk_P4MY4MXU_js__WEBPACK_IMPORTED_MODULE_4__","o","tag","displayName","BasicForm","react__WEBPACK_IMPORTED_MODULE_1__","dataTestId","_radix_ui_react_form__WEBPACK_IMPORTED_MODULE_2__","bL","_chunk_NZVMNINS_js__WEBPACK_IMPORTED_MODULE_0__","buttonLabel","buttonSuccessLabel","instructionText","finePrintText","formRef","react__WEBPACK_IMPORTED_MODULE_5__","useRef","buttonState","setButtonState","errorMessage","setErrorMessage","resetTimerRef","current","clearTimeout","handleSubmit","useCallback","e","preventDefault","form","FormData","reset","setTimeout","error","_chunk_OSFUBHKT_js__WEBPACK_IMPORTED_MODULE_1__","p","_chunk_NZVMNINS_js__WEBPACK_IMPORTED_MODULE_4__","_chunk_ICYG44B4_js__WEBPACK_IMPORTED_MODULE_2__","IJ","_chunk_P4MY4MXU_js__WEBPACK_IMPORTED_MODULE_3__","role","_chunk_2FO5O72K_js__WEBPACK_IMPORTED_MODULE_0__","r","TEXT_COLOR_CLASS_BY_VARIANT","default","inverse","ProgressIndicator","ariaLabel","ariaHidden","chunk_A263RQU4","common","react","viewBox","xmlns","progressIndicatorLabel","chunk_NZVMNINS","cx","cy","rx","ry","fill","stroke","strokeWidth","vectorEffect","shapeRendering","VARIANTS","paths","ConfirmationIcon","size","_chunk_5AEEBCQE_js__WEBPACK_IMPORTED_MODULE_0__","z","I","map","d","i","key"],"sourceRoot":""}