import React, { useRef, useState } from "react"; import styled, { createGlobalStyle } from "styled-components"; import Interweave from "interweave"; import { IButtonProps, MaybeElement, Button, Alignment, Position, } from "@blueprintjs/core"; import { Popover2 } from "@blueprintjs/popover2"; import { IconName } from "@blueprintjs/icons"; import { ComponentProps } from "widgets/BaseComponent"; import { useScript, ScriptStatus } from "utils/hooks/useScript"; import { GOOGLE_RECAPTCHA_KEY_ERROR, GOOGLE_RECAPTCHA_DOMAIN_ERROR, createMessage, } from "constants/messages"; import { ThemeProp, Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; import ReCAPTCHA from "react-google-recaptcha"; import { Colors } from "../../../constants/Colors"; import _ from "lodash"; import { ButtonBoxShadow, ButtonBoxShadowTypes, ButtonBorderRadius, ButtonBorderRadiusTypes, ButtonVariant, ButtonVariantTypes, ButtonPlacement, } from "components/constants"; import { getCustomBackgroundColor, getCustomBorderColor, getCustomHoverColor, getCustomTextColor, getCustomJustifyContent, getAlignText, } from "widgets/WidgetUtils"; const RecaptchaWrapper = styled.div` position: relative; .grecaptcha-badge { visibility: hidden; } `; const ToolTipWrapper = styled.div` height: 100%; && .bp3-popover2-target { height: 100%; width: 100%; & > div { height: 100%; } } `; const TooltipStyles = createGlobalStyle` .btnTooltipContainer { .bp3-popover2-content { max-width: 350px; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 0px; } } `; type ButtonContainerProps = { disabled?: boolean; }; const ButtonContainer = styled.div` display: flex; align-items: center; justify-content: center; height: 100%; ${({ disabled }) => disabled && "cursor: not-allowed;"} & > button { height: 100%; } `; const StyledButton = styled((props) => (