# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .allowlist_item import AllowlistItem
from .embed_variant import EmbedVariant
from .widget_config_output_avatar import WidgetConfigOutputAvatar
from .widget_config_output_syntax_highlight_theme import WidgetConfigOutputSyntaxHighlightTheme
from .widget_end_feedback_config import WidgetEndFeedbackConfig
from .widget_expandable import WidgetExpandable
from .widget_feedback_mode import WidgetFeedbackMode
from .widget_language_preset import WidgetLanguagePreset
from .widget_placement import WidgetPlacement
from .widget_styles import WidgetStyles
from .widget_text_contents import WidgetTextContents


class WidgetConfig(UncheckedBaseModel):
    variant: typing.Optional[EmbedVariant] = pydantic.Field(default=None)
    """
    The variant of the widget
    """

    placement: typing.Optional[WidgetPlacement] = pydantic.Field(default=None)
    """
    The placement of the widget on the screen
    """

    expandable: typing.Optional[WidgetExpandable] = pydantic.Field(default=None)
    """
    Whether the widget is expandable
    """

    avatar: typing.Optional[WidgetConfigOutputAvatar] = pydantic.Field(default=None)
    """
    The avatar of the widget
    """

    feedback_mode: typing.Optional[WidgetFeedbackMode] = pydantic.Field(default=None)
    """
    The feedback mode of the widget
    """

    end_feedback: typing.Optional[WidgetEndFeedbackConfig] = pydantic.Field(default=None)
    """
    Configuration for feedback collected at the end of the conversation
    """

    bg_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The background color of the widget
    """

    text_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text color of the widget
    """

    btn_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The button color of the widget
    """

    btn_text_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The button text color of the widget
    """

    border_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The border color of the widget
    """

    focus_color: typing.Optional[str] = pydantic.Field(default=None)
    """
    The focus color of the widget
    """

    border_radius: typing.Optional[int] = pydantic.Field(default=None)
    """
    The border radius of the widget
    """

    btn_radius: typing.Optional[int] = pydantic.Field(default=None)
    """
    The button radius of the widget
    """

    action_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The action text of the widget
    """

    start_call_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The start call text of the widget
    """

    end_call_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The end call text of the widget
    """

    expand_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The expand text of the widget
    """

    listening_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display when the agent is listening
    """

    speaking_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display when the agent is speaking
    """

    shareable_page_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display when sharing
    """

    shareable_page_show_terms: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show terms and conditions on the shareable page
    """

    terms_text: typing.Optional[str] = pydantic.Field(default=None)
    """
    The text to display for terms and conditions
    """

    terms_html: typing.Optional[str] = pydantic.Field(default=None)
    """
    The HTML to display for terms and conditions
    """

    terms_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    The key to display for terms and conditions
    """

    show_avatar_when_collapsed: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show the avatar when the widget is collapsed
    """

    disable_banner: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to disable the banner
    """

    override_link: typing.Optional[str] = pydantic.Field(default=None)
    """
    The override link for the widget
    """

    markdown_link_allowed_hosts: typing.Optional[typing.List[AllowlistItem]] = pydantic.Field(default=None)
    """
    List of allowed hostnames for clickable markdown links. Use { hostname: '*' } to allow any domain. Empty means no links are allowed.
    """

    markdown_link_include_www: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to automatically include www. variants of allowed hosts
    """

    markdown_link_allow_http: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to allow http:// in addition to https:// for allowed hosts
    """

    mic_muting_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to enable mic muting
    """

    transcript_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget should show the conversation transcript as it goes on
    """

    text_input_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the user should be able to send text messages
    """

    conversation_mode_toggle_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to enable the conversation mode toggle in the widget
    """

    default_expanded: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget should be expanded by default
    """

    always_expanded: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget should always be expanded
    """

    dismissible: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget can be dismissed by the user
    """

    show_agent_status: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show agent working/done/error status during tool use
    """

    show_conversation_id: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show the conversation ID after disconnection.
    """

    strip_audio_tags: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to strip audio markup from messages.
    """

    syntax_highlight_theme: typing.Optional[WidgetConfigOutputSyntaxHighlightTheme] = pydantic.Field(default=None)
    """
    Theme for code block syntax highlighting. Defaults to auto-detection by the widget when not set.
    """

    text_contents: typing.Optional[WidgetTextContents] = pydantic.Field(default=None)
    """
    Text contents of the widget
    """

    styles: typing.Optional[WidgetStyles] = pydantic.Field(default=None)
    """
    Styles for the widget
    """

    language_selector: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to show the language selector
    """

    supports_text_only: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the widget can switch to text only mode
    """

    custom_avatar_path: typing.Optional[str] = pydantic.Field(default=None)
    """
    The custom avatar path
    """

    language_presets: typing.Optional[typing.Dict[str, WidgetLanguagePreset]] = pydantic.Field(default=None)
    """
    Language presets for the widget
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
