<?php
/**
 * File: app/Admin/config/chatbot.php
 *
 * @package KimaAI
 * @since 1.1.0
 */

use KimaAI\ChatBot\ChatbotTheme;
use KimaAI\Helper;

$kimaai_reasoning_model_ids = array_merge(
  Helper::aiModelIdsWithParam('openai', 'reasoning'),
  Helper::aiModelIdsWithParam('openrouter', 'reasoning'),
  Helper::aiModelIdsWithParam('replicate', 'reasoning'),
  Helper::aiModelIdsWithParam('ollama', 'reasoning'),
);

return [
  'order' => 2,
  'schema' => [
    'type' => 'object',
    'isOpen' => true,
    'title' => __('ChatBot', 'kimaai'),
    'icon' => 'RobotWink',
    'properties' => [
      'appearance' => [
        'type' => 'object',
        'title' => __('Appearance', 'kimaai'),
        'link' => 'chatbot-appearance',
        'pageTitle' => __('Chatbot Appearance', 'kimaai'),
        'pageDescription' => __('In this page you can change the chatbot appearance', 'kimaai'),
        'preview' => [
          'component' => 'ChatbotPreview',
          'width' => '500px',
        ],
        'sections' => [
          'general' => [
            'title' => __('General', 'kimaai'),
            'description' => __('Configure the general appearance settings for the chatbot.', 'kimaai'),
          ],
          'avatar' => [
            'title' => __('Icon & Avatar', 'kimaai'),
            'description' => __('Configure the chatbot icon, AI and user avatars.', 'kimaai'),
          ],
          'colors' => [
            'title' => __('Colors', 'kimaai'),
            'description' => __('Customize the colors used in the chatbot interface.', 'kimaai'),
          ],
          'chatbotWording' => [
            'title' => __('Chatbot Wording', 'kimaai'),
            'description' => __('Customize the wording used in the chatbot interface.', 'kimaai'),
          ],
          'attentionPopover' => [
            'title' => __('Attention Popover', 'kimaai'),
            'description' => __('Customize the appearance and wording of the attention popover before the chatbot is opened.', 'kimaai'),
          ],
        ],
        'properties' => [
          'isEnable' => [
            'section' => 'general',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Global Chatbot', 'kimaai'),
              'checked' => true,
              'description' => __('Enable globally. If disabled, use the [kimaai_chatbot] shortcode on specific pages.', 'kimaai'),
            ],
          ],
          'position' => [
            'section' => 'general',
            'type' => 'string',
            'default' => 'right',
            'component' => 'RadioGroupField',
            'props' => [
              'legend' => __('Position', 'kimaai'),
              'name' => 'chat-position',
              'options' => [
                [
                  'value' => 'left',
                  'label' => __('Left', 'kimaai'),
                ],
                [
                  'value' => 'right',
                  'label' => __('Right', 'kimaai'),
                ],
              ],
              'description' => __('Choose the position of the chatbot.', 'kimaai'),
            ],
          ],
          'offset' => [
            'section' => 'general',
            'type' => 'object',
            'properties' => [
              'bottom' => [
                'type' => 'string',
                'default' => '24px',
              ],
              'right' => [
                'type' => 'string',
                'default' => '24px',
              ],
              // We have to define top and left so the schema is valid, but we won't use them
              'top' => [
                'type' => 'string',
                'default' => '',
              ],
              'left' => [
                'type' => 'string',
                'default' => '',
              ],
            ],
            'component' => 'BoxControlField',
            'defaultValue' => [
              'bottom' => '50px',
              'right' => '50px',
            ],
            'props' => [
              'label' => __('Offset from bottom and side (Left/Right)', 'kimaai'),
              'description' => __('Adjust the chatbot offset from the bottom and left/right edges of the screen.', 'kimaai'),
              // We need to set the defaultValue here for the BoxControlField to work.
              'sides' => ['bottom', 'right'],
              'units' => [
                [
                  'value' => 'px',
                  'label' => 'px',
                  'default' => true,
                ],
                [
                  'value' => 'rem',
                  'label' => 'rem',
                ],
                [
                  'value' => '%',
                  'label' => '%',
                ],
              ],
              'resetValues' => [
                'bottom' => '50px',
                'right' => '50px',
              ],
              'onlyPremium' => !Helper::isPremium(),
            ],
          ],
          'showMessageCopyButton' => [
            'section' => 'general',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Show message copy button', 'kimaai'),
              'description' => __('Enable or disable the copy button for each AI message in the chatbot.', 'kimaai'),
              'checked' => true,
            ],
          ],
          'icon' => [
            'section' => 'avatar',
            'type' => 'string',
            'default' => 'PNGKimaAIIcon',
            'component' => 'RadioGroupField',
            'props' => [
              'legend' => __('Icon', 'kimaai'),
              'name' => 'chat-icon',
              'options' => [
                [
                  'value' => 'PNGKimaAIIcon',
                  'icon' => 'PNGKimaAIIcon',
                ],
                [
                  'value' => 'RobotColorOne',
                  'icon' => 'RobotColorOne',
                ],
                [
                  'value' => 'RobotColorTwo',
                  'icon' => 'RobotColorTwo',
                ],
                [
                  'value' => 'RobotColorThree',
                  'icon' => 'RobotColorThree',
                ],
                [
                  'value' => 'PNGRobotIconOne',
                  'icon' => 'PNGRobotIconOne',
                ],
                [
                  'value' => 'PNGRobotIconTwo',
                  'icon' => 'PNGRobotIconTwo',
                ],
                [
                  'value' => 'PNGRobotIconThree',
                  'icon' => 'PNGRobotIconThree',
                ],
                [
                  'value' => 'PNGRobotIconFour',
                  'icon' => 'PNGRobotIconFour',
                ],
                [
                  'value' => 'PNGMessage',
                  'icon' => 'PNGMessage',
                ],
                [
                  'value' => 'custom',
                  'label' => __('Custom', 'kimaai'),
                ],
              ],
              'description' => __('Choose the chat icon that will be shown in the chatbot.', 'kimaai'),
            ],
          ],
          'customIconUrl' => [
            'section' => 'avatar',
            'type' => 'string',
            'default' => '',
            'component' => 'TextField',
            'condition' => [
              'field' => 'icon',
              'operator' => '=',
              'value' => 'custom',
            ],
            'props' => [
              'type' => 'url',
              'label' => __('Custom Icon URL', 'kimaai'),
              'description' => __('Enter the URL of a custom icon (PNG or SVG) to be used for the chatbot when Custom is selected above. Suggested size: 90x90 px.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
          ],
          'showHeaderIcon' => [
            'section' => 'avatar',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Show icon in chat header', 'kimaai'),
              'description' => __('Enable or disable the chatbot icon in the open chat header.', 'kimaai'),
              'checked' => true,
            ],
          ],
          'aiAvatarIcon' => [
            'section' => 'avatar',
            'type' => 'string',
            'default' => 'none',
            'component' => 'RadioGroupField',
            'props' => [
              'legend' => __('AI Avatar', 'kimaai'),
              'name' => 'ai-avatar',
              'options' => [
                [
                  'value' => 'none',
                  'icon' => 'close',
                ],
                [
                  'value' => 'PNGKimaAIIcon',
                  'icon' => 'PNGKimaAIIcon',
                ],
                [
                  'value' => 'RobotColorOne',
                  'icon' => 'RobotColorOne',
                ],
                [
                  'value' => 'RobotColorTwo',
                  'icon' => 'RobotColorTwo',
                ],
                [
                  'value' => 'RobotColorThree',
                  'icon' => 'RobotColorThree',
                ],
                [
                  'value' => 'PNGRobotIconOne',
                  'icon' => 'PNGRobotIconOne',
                ],
                [
                  'value' => 'PNGRobotIconTwo',
                  'icon' => 'PNGRobotIconTwo',
                ],
                [
                  'value' => 'PNGRobotIconThree',
                  'icon' => 'PNGRobotIconThree',
                ],
                [
                  'value' => 'PNGRobotIconFour',
                  'icon' => 'PNGRobotIconFour',
                ],
                [
                  'value' => 'PNGMessage',
                  'icon' => 'PNGMessage',
                ],
                [
                  'value' => 'custom',
                  'label' => __('Custom', 'kimaai'),
                ],
              ],
              'description' => __('Choose the AI avatar icon that will be shown in the chatbot.', 'kimaai'),
            ],
          ],
          'aiAvatarUrl' => [
            'section' => 'avatar',
            'type' => 'string',
            'default' => '',
            'component' => 'TextField',
            'condition' => [
              'field' => 'aiAvatarIcon',
              'operator' => '=',
              'value' => 'custom',
            ],
            'props' => [
              'type' => 'url',
              'label' => __('Custom AI Avatar URL', 'kimaai'),
              'description' => __('Enter the URL of a custom icon (PNG or SVG) to be used for the AI avatar in the chatbot when Custom is selected above. Suggested size: 90x90 px.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
          ],
          'userAvatarIcon' => [
            'section' => 'avatar',
            'type' => 'string',
            'default' => 'none',
            'component' => 'RadioGroupField',
            'props' => [
              'legend' => __('User Avatar', 'kimaai'),
              'name' => 'user-avatar',
              'options' => [
                [
                  'value' => 'none',
                  'icon' => 'close',
                ],
                [
                  'value' => 'UserIcon',
                  'icon' => 'UserIcon',
                ],
                [
                  'value' => 'UserCircleIcon',
                  'icon' => 'UserCircleIcon',
                ],
                [
                  'value' => 'PNGMessage',
                  'icon' => 'PNGMessage',
                ],
                [
                  'value' => 'custom',
                  'label' => __('Custom', 'kimaai'),
                ],
              ],
              'description' => __('Choose the user avatar icon that will be shown in the chatbot.', 'kimaai'),
            ],
          ],
          'userAvatarUrl' => [
            'section' => 'avatar',
            'type' => 'string',
            'default' => '',
            'component' => 'TextField',
            'condition' => [
              'field' => 'userAvatarIcon',
              'operator' => '=',
              'value' => 'custom',
            ],
            'props' => [
              'type' => 'url',
              'label' => __('Custom User Avatar URL', 'kimaai'),
              'description' => __('Enter the URL of a custom icon (PNG or SVG) to be used for the user avatar in the chatbot when Custom is selected above. Suggested size: 90x90 px.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
          ],
          'bodyBgColor' => [
            'section' => 'colors',
            'type' => 'string',
            'default' => '#4545f9',
            'component' => 'ColorField',
            'condition' => [
              'field' => 'theme',
              'operator' => '=',
              'value' => '__hidden_legacy_colors__',
            ],
            'props' => [
              'title' => __('Body background Color', 'kimaai'),
              'description' => __('Choose a color for the chatbot body background.', 'kimaai'),
            ],
          ],
          'bodyTextColor' => [
            'section' => 'colors',
            'type' => 'string',
            'default' => '#ffffff',
            'component' => 'ColorField',
            'condition' => [
              'field' => 'theme',
              'operator' => '=',
              'value' => '__hidden_legacy_colors__',
            ],
            'props' => [
              'title' => __('Body Text Color', 'kimaai'),
              'description' => __('Choose a color for the chatbot body text.', 'kimaai'),
            ],
          ],
          'userMessageBgColor' => [
            'section' => 'colors',
            'type' => 'string',
            'default' => '#4545f9',
            'component' => 'ColorField',
            'condition' => [
              'field' => 'theme',
              'operator' => '=',
              'value' => '__hidden_legacy_colors__',
            ],
            'props' => [
              'title' => __('User Message Background Color', 'kimaai'),
              'description' => __('Choose a color for the user messages background.', 'kimaai'),
            ],
          ],
          'userMessageTextColor' => [
            'section' => 'colors',
            'type' => 'string',
            'default' => '#ffffff',
            'component' => 'ColorField',
            'condition' => [
              'field' => 'theme',
              'operator' => '=',
              'value' => '__hidden_legacy_colors__',
            ],
            'props' => [
              'title' => __('User Message Text Color', 'kimaai'),
              'description' => __('Choose a color for the user messages text.', 'kimaai'),
            ],
          ],
          'aiMessageBgColor' => [
            'section' => 'colors',
            'type' => 'string',
            'default' => '#f3f5ff',
            'component' => 'ColorField',
            'condition' => [
              'field' => 'theme',
              'operator' => '=',
              'value' => '__hidden_legacy_colors__',
            ],
            'props' => [
              'title' => __('AI Message Background Color', 'kimaai'),
              'description' => __('Choose a color for the AI messages background.', 'kimaai'),
            ],
          ],
          'aiMessageTextColor' => [
            'section' => 'colors',
            'type' => 'string',
            'default' => '#000000',
            'component' => 'ColorField',
            'condition' => [
              'field' => 'theme',
              'operator' => '=',
              'value' => '__hidden_legacy_colors__',
            ],
            'props' => [
              'title' => __('AI Message Text Color', 'kimaai'),
              'description' => __('Choose a color for the AI messages text.', 'kimaai'),
            ],
          ],
          'theme' => [
            'section' => 'colors',
            'type' => 'object',
            'default' => ChatbotTheme::defaultTheme(),
            'properties' => [
              'version' => [
                'type' => 'integer',
                'default' => 2,
              ],
              'mode' => [
                'type' => 'string',
                'default' => 'light',
              ],
              'style' => [
                'type' => 'string',
                'default' => 'classic',
              ],
              'colorPreset' => [
                'type' => 'string',
                'default' => 'default',
              ],
              'colors' => [
                'type' => 'object',
                'properties' => [
                  'primary' => [
                    'type' => 'string',
                    'default' => '#4545f9',
                  ],
                  'accent' => [
                    'type' => 'string',
                    'default' => '#818cf8',
                  ],
                  'surface' => [
                    'type' => 'string',
                    'default' => '#ffffff',
                  ],
                  'neutral' => [
                    'type' => 'string',
                    'default' => '#111827',
                  ],
                ],
              ],
              'darkColors' => [
                'type' => 'object',
                'properties' => [
                  'accent' => [
                    'type' => 'string',
                    'default' => '#818cf8',
                  ],
                  'surface' => [
                    'type' => 'string',
                    'default' => '#0f172a',
                  ],
                  'neutral' => [
                    'type' => 'string',
                    'default' => '#f9fafb',
                  ],
                ],
              ],
              'advanced' => [
                'type' => 'object',
                'properties' => [
                  'bodyBackground' => ['type' => 'string', 'default' => null],
                  'bodyText' => ['type' => 'string', 'default' => null],
                  'headerBackground' => ['type' => 'string', 'default' => null],
                  'headerText' => ['type' => 'string', 'default' => null],
                  'aiMessageBackground' => ['type' => 'string', 'default' => null],
                  'aiMessageText' => ['type' => 'string', 'default' => null],
                  'userMessageBackground' => ['type' => 'string', 'default' => null],
                  'userMessageText' => ['type' => 'string', 'default' => null],
                  'inputBackground' => ['type' => 'string', 'default' => null],
                  'inputText' => ['type' => 'string', 'default' => null],
                  'footerBackground' => ['type' => 'string', 'default' => null],
                  'footerText' => ['type' => 'string', 'default' => null],
                  'border' => ['type' => 'string', 'default' => null],
                ],
              ],
            ],
            'component' => 'ChatbotThemeField',
            'props' => [
              'label' => __('Theme', 'kimaai'),
              'description' => __('Choose a chatbot theme, mode, and brand colors.', 'kimaai'),
              'modeOptions' => [
                ['value' => 'light', 'label' => __('Light', 'kimaai')],
                ['value' => 'dark', 'label' => __('Dark', 'kimaai')],
                ['value' => 'system', 'label' => __('System', 'kimaai')],
              ],
              'styleOptions' => array_values(array_map(
                fn($key, $style) => ['value' => $key, 'label' => $style['label']],
                array_keys(ChatbotTheme::styles()),
                ChatbotTheme::styles()
              )),
              'colorPresetOptions' => array_values(array_map(
                fn($key, $preset) => ['value' => $key, 'label' => $preset['label']],
                array_keys(ChatbotTheme::colorPresets()),
                ChatbotTheme::colorPresets()
              )),
              'colorFields' => [
                ['key' => 'primary', 'label' => __('Primary', 'kimaai')],
                ['key' => 'accent', 'label' => __('Accent', 'kimaai')],
                ['key' => 'surface', 'label' => __('Surface', 'kimaai')],
                ['key' => 'neutral', 'label' => __('Neutral', 'kimaai')],
              ],
              'advancedFields' => [
                ['key' => 'bodyBackground', 'label' => __('Body background', 'kimaai')],
                ['key' => 'bodyText', 'label' => __('Body text', 'kimaai')],
                ['key' => 'headerBackground', 'label' => __('Header background', 'kimaai')],
                ['key' => 'headerText', 'label' => __('Header text', 'kimaai')],
                ['key' => 'aiMessageBackground', 'label' => __('AI message background', 'kimaai')],
                ['key' => 'aiMessageText', 'label' => __('AI message text', 'kimaai')],
                ['key' => 'userMessageBackground', 'label' => __('User message background', 'kimaai')],
                ['key' => 'userMessageText', 'label' => __('User message text', 'kimaai')],
                ['key' => 'inputBackground', 'label' => __('Input background', 'kimaai')],
                ['key' => 'inputText', 'label' => __('Input text', 'kimaai')],
                ['key' => 'footerBackground', 'label' => __('Footer background', 'kimaai')],
                ['key' => 'footerText', 'label' => __('Footer text', 'kimaai')],
                ['key' => 'border', 'label' => __('Border', 'kimaai')],
              ],
            ],
          ],
          'chatTitle' => [
            'section' => 'chatbotWording',
            'type' => 'string',
            'default' => __('Talk to our AI agent:', 'kimaai'),
            'translate' => true,
            'component' => 'TextField',
            'props' => [
              'type' => 'text',
              'label' => __('Chat Title', 'kimaai'),
              'description' => __('Enter the title of the chatbot.', 'kimaai'),
            ],
          ],
          'chatName' => [
            'section' => 'chatbotWording',
            'type' => 'string',
            'default' => __('KimaAI', 'kimaai'),
            'translate' => true,
            'component' => 'TextField',
            'props' => [
              'type' => 'text',
              'label' => __('Chat Name', 'kimaai'),
              'description' => __('Enter the name of the chatbot.', 'kimaai'),
            ],
          ],
          'placeholder' => [
            'section' => 'chatbotWording',
            'type' => 'string',
            'default' => __('Ask me anything...', 'kimaai'),
            'translate' => true,
            'component' => 'TextField',
            'props' => [
              'type' => 'text',
              'label' => __('Chatbot Placeholder', 'kimaai'),
              'description' => __('Write the placeholder that will be shown in the chatbot input field.', 'kimaai'),
            ],
          ],
          'greeting' => [
            'section' => 'chatbotWording',
            'type' => 'string',
            'default' => __('Hello! How can I assist you today?', 'kimaai'),
            'translate' => true,
            'component' => 'TextareaField',
            'sanitize_callback' => 'wp_kses_post',
            'validate_callback' => 'rest_validate_request_arg',
            'props' => [
              'label' => __('Greeting', 'kimaai'),
              'description' => __('Write the greeting that the chatbot will show when it starts.', 'kimaai'),
            ],
          ],
          'disclaimer' => [
            'section' => 'chatbotWording',
            'type' => 'string',
            'default' => __("Don't believe everything KimaAI says 😬", 'kimaai'),
            'translate' => true,
            'component' => 'TextareaField',
            'sanitize_callback' => 'wp_kses_post',
            'validate_callback' => 'rest_validate_request_arg',
            'props' => [
              'label' => __('Disclaimer', 'kimaai'),
              'description' => __('Write the disclaimer message that will be shown in the chatbot.', 'kimaai'),
            ],
          ],
          'poweredBy' => [
            'section' => 'chatbotWording',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Show "Powered by KimaAI"', 'kimaai'),
              'checked' => true,
              'description' => __('Enable or disable the "Powered by KimaAI" message that is shown in the chatbot.', 'kimaai'),
            ],
          ],
          'attentionEnabled' => [
            'section' => 'attentionPopover',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Enable Attention Popover', 'kimaai'),
              'checked' => false,
              'description' => __('Enable or disable the attention popover before the chatbot is opened.', 'kimaai'),
            ],
          ],
          'attentionShowQuickActions' => [
            'section' => 'attentionPopover',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Show Quick Actions in Attention Popover', 'kimaai'),
              'checked' => false,
              'description' => __('Show defined quick action buttons in the attention popover.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
            'condition' => [
              'field' => 'attentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'attentionMessage' => [
            'section' => 'attentionPopover',
            'type' => 'string',
            'default' => __('Hi there! I am your AI assistant. How can I help you today?', 'kimaai'),
            'translate' => true,
            'component' => 'TextareaField',
            'sanitize_callback' => 'wp_kses_post',
            'validate_callback' => 'rest_validate_request_arg',
            'props' => [
              'label' => __('Attention Popover Message', 'kimaai'),
              'description' => __('Write the message that will be shown in the attention popover before the chatbot is opened.', 'kimaai'),
            ],
            'condition' => [
              'field' => 'attentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'attentionDelay' => [
            'section' => 'attentionPopover',
            'type' => 'integer',
            'default' => 5,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'label' => __('Attention Popover Delay (seconds)', 'kimaai'),
              'description' => __('Set the delay (in seconds) before showing the attention popover after the page loads.', 'kimaai'),
            ],
            'condition' => [
              'field' => 'attentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'attentionSound' => [
            'section' => 'attentionPopover',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Play Sound on Attention Popover', 'kimaai'),
              'checked' => false,
              'description' => __('Enable or disable the sound notification when the attention popover is shown.', 'kimaai'),
            ],
            'condition' => [
              'field' => 'attentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'attentionShowOnceWhenClickOnClose' => [
            'section' => 'attentionPopover',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Show Attention Popover Only Once', 'kimaai'),
              'checked' => false,
              'description' => __('If enabled, and the user closes the popover, it will not be shown again on subsequent page loads.', 'kimaai'),
            ],
            'condition' => [
              'field' => 'attentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'attentionShowOnceWhenInteracted' => [
            'section' => 'attentionPopover',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Hide After Interaction', 'kimaai'),
              'checked' => false,
              'description' => __('Hide the attention popover on later page loads after user interaction.', 'kimaai'),
            ],
            'condition' => [
              'field' => 'attentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
        ],
      ],
      'settings' => [
        'type' => 'object',
        'title' => __('Settings', 'kimaai'),
        'link' => 'chatbot-settings',
        'pageTitle' => __('Chatbot Settings', 'kimaai'),
        'pageDescription' => __('In this page you can configure the chatbot settings', 'kimaai'),
        'preview' => [
          'component' => 'ChatbotPreview',
          'width' => '500px',
        ],
        'sections' => [
          'llm' => [
            'title' => __('AI provider & model', 'kimaai'),
            'description' => __('Choose the provider and model for the chatbot.', 'kimaai'),
          ],
          'llmAdvanced' => [
            'title' => __('Advanced settings', 'kimaai'),
            'description' => __('Configure the advanced settings for the chatbot.', 'kimaai'),
          ],
          'chatbotInstructions' => [
            'title' => __('Chatbot Instructions', 'kimaai'),
            'description' => __('Customize the instructions that the chatbot will follow when interacting with the user.', 'kimaai'),
          ],
          'chatbotSecurity' => [
            'title' => __('Security & Privacy', 'kimaai'),
            'description' => __('Configure consent, privacy retention, and access controls for the chatbot.', 'kimaai'),
          ],
          'vectorDb' => [
            'title' => __('Vector DB (Knowledge Base)', 'kimaai'),
            'description' => __('Use the synced embeddings as a knowledge base for more accurate answers. PRO feature.', 'kimaai'),
          ],
          'tools' => [
            'title' => __('Function Tools', 'kimaai'),
            'description' => __('Select which custom functions the chatbot is allowed to call.', 'kimaai'),
          ],
          'feedback' => [
            'title' => __('Feedback', 'kimaai'),
            'description' => __('Enable or disable the feedback buttons in the chatbot interface.', 'kimaai'),
          ],
        ],
        'properties' => [
          'chatAiProvider' => [
            'section' => 'llm',
            'type' => 'string',
            'default' => 'default',
            'component' => 'SelectField',
            'props' => [
              'label' => __('AI Provider', 'kimaai'),
              'description' => __('Select the AI provider that will be used for the chatbot.', 'kimaai'),
              'options' => Helper::getAiEnvsOptions(true, true),
            ],
          ],
          'chatAiModel' => [
            'section' => 'llm',
            'type' => 'string',
            'default' => 'gpt-4o-mini',
            'component' => 'SelectField',
            'props' => [
              'label' => __('AI Model', 'kimaai'),
              'description' => __('Select the AI model that will be used for the chatbot.', 'kimaai'),
              'options' => Helper::aiProviderModelOptions('chatAiProvider', ['completion']),
            ],
          ],
          'reasoning' => [
            'section' => 'llm',
            'type' => 'string',
            'default' => 'medium',
            'component' => 'SelectField',
            'props' => [
              'label' => __('Reasoning level', 'kimaai'),
              'description' => __('Control how much reasoning effort the model uses.', 'kimaai'),
              'options' => array_merge(
                Helper::aiModelParamOptions('openai', 'reasoning', 'chatAiModel'),
                Helper::aiModelParamOptions('openrouter', 'reasoning', 'chatAiModel'),
                Helper::aiModelParamOptions('replicate', 'reasoning', 'chatAiModel'),
                Helper::aiModelParamOptions('ollama', 'reasoning', 'chatAiModel'),
              ),
            ],
            'condition' => [
              'field' => 'chatAiModel',
              'operator' => 'in',
              'value' => $kimaai_reasoning_model_ids,
            ],
          ],
          'verbosity' => [
            'section' => 'llm',
            'type' => 'string',
            'default' => 'medium',
            'component' => 'SelectField',
            'props' => [
              'label' => __('Verbosity', 'kimaai'),
              'description' => __('Control how concise or detailed the model is.', 'kimaai'),
              'options' => array_merge(
                Helper::aiModelParamOptions('openai', 'verbosity', 'chatAiModel'),
                Helper::aiModelParamOptions('openrouter', 'verbosity', 'chatAiModel'),
              ),
            ],
            'condition' => [
              'field' => 'chatAiModel',
              'operator' => 'in',
              'value' => array_merge(
                Helper::aiModelIdsWithParam('openai', 'verbosity'),
                Helper::aiModelIdsWithParam('openrouter', 'verbosity'),
              ),
            ],
          ],
          'temperature' => [
            'section' => 'llm',
            'type' => 'number',
            'default' => 0.7,
            'component' => 'RangeField',
            'props' => [
              'initialPosition' => 0.7,
              'min' => 0,
              'max' => 2,
              'step' => 0.1,
              'label' => __('Temperature', 'kimaai'),
              'description' => __('Set the temperature for the AI model. A higher value means more creative responses.', 'kimaai'),
            ],
            'condition' => [
              'field' => 'chatAiModel',
              'operator' => 'not_in',
              'value' => $kimaai_reasoning_model_ids,
            ],
          ],
          'streaming' => [
            'section' => 'llmAdvanced',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Enable Streaming Responses', 'kimaai'),
              'checked' => true,
              'description' => __('If enabled, the chatbot will receive and display the AI responses in real-time as they are generated.', 'kimaai'),
            ],
          ],
          'maxOutputTokens' => [
            'section' => 'llmAdvanced',
            'type' => 'integer',
            'default' => 1024,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'label' => __('Max Tokens', 'kimaai'),
              'description' => __('Set the maximum number of tokens that the AI model can generate in a single response.', 'kimaai'),
            ],
          ],
          'maxInputLength' => [
            'section' => 'llmAdvanced',
            'type' => 'integer',
            'default' => 512,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'label' => __('Max Input Length', 'kimaai'),
              'description' => __('Set the maximum length of the input that the user can write.', 'kimaai'),
            ],
          ],
          'maxContextLength' => [
            'section' => 'llmAdvanced',
            'type' => 'integer',
            'default' => 4096,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'label' => __('Max Context Length', 'kimaai'),
              'description' => __('Truncate the context (Content-Aware) to make sure it is below this number of characters.', 'kimaai'),
            ],
          ],
          'maxMessages' => [
            'section' => 'llmAdvanced',
            'type' => 'integer',
            'default' => 15,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'label' => __('Max Messages', 'kimaai'),
              'description' => __('Set the maximum number of historical messages that is sent to the AI model.', 'kimaai'),
            ],
          ],
          'instructions' => [
            'section' => 'chatbotInstructions',
            'type' => 'string',
            'default' => sprintf(
              /* translators: 1: site name, 2: site URL. */
              __('You are the AI assistant for %1$s under %2$s. Your job is to help visitors with questions about our business, services, products, policies, and website content.
Rules:
- Be friendly, professional, clear, and concise.
- Prefer facts from the current page first, then official website content, then connected knowledge sources.
- Never invent facts, prices, availability, guarantees, legal claims, or policies.
- If the answer is not clearly supported, say that clearly.
- When possible, guide the user to the most relevant page or suggest contacting our team.
- Stay focused on topics related to our business and website.
- When helpful, suggest a next step such as contacting support, requesting a quote, or visiting a related page.
Current page:
- URL: {post_url}
- Title: {post_title}
- Content: {post_content}', 'kimaai'),
              get_bloginfo('name'),
              get_bloginfo('url')
            ),
            'sanitize_callback' => 'wp_kses_post',
            'validate_callback' => 'rest_validate_request_arg',
            'component' => 'TextareaField',
            'props' => [
              'label' => __('Instructions', 'kimaai'),
              'description' => __('Write the instructions that the chatbot will follow when interacting with the user. 
              For content awareness, you can use the following placeholders: {post_url}, {post_title}, {post_content}', 'kimaai'),
            ],
          ],
          'awareness' => [
            'section' => 'chatbotInstructions',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Content Awareness', 'kimaai'),
              'checked' => false,
              'description' => __('Enable or disable the chatbot awareness - If enabled, the chatbot will understand the context of the post or page that the user is on.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
          ],
          'awarenessPostTypes' => [
            'section' => 'chatbotInstructions',
            'type' => 'array',
            'default' => ['post', 'page'],
            'component' => 'CheckboxGroupField',
            'props' => [
              'label' => __('Post Types', 'kimaai'),
              'description' => __('Choose which post types to be included in the chatbot awareness context.', 'kimaai'),
              'isMulti' => true,
              'options' => Helper::getPublicPageTypesForSelect(),
              'onlyPremium' => !Helper::isPremium(),
            ],
            'condition' => [
              'field' => 'awareness',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'allowedTools' => [
            'section' => 'tools',
            'type' => 'array',
            'default' => [],
            'component' => 'CheckboxGroupField',
            'props' => [
              'label' => __('Allowed Custom Functions', 'kimaai'),
              'description' => __('Only these functions will be exposed as tools to the AI.', 'kimaai'),
              'isMulti' => true,
              'options' => Helper::customFunctionsOptionsForSelect(),
              'onlyPremium' => !Helper::isPremium(),
            ],
            // Array of strings → sanitize = map(sanitize_text_field)
            'items' => [
              'type' => 'string',
            ],
          ],
          'vectorDbEnabled' => [
            'section' => 'vectorDb',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Use Vector DB', 'kimaai'),
              'checked' => false,
              'description' => __(
                'If enabled, the chatbot will query the Embeddings vector index and use the most relevant chunks as context for each answer.',
                'kimaai'
              ),
              'onlyPremium' => !Helper::isPremium(),
            ],
          ],
          'vectorDbEnv' => [
            'section' => 'vectorDb',
            'type' => 'string',
            'default' => 'none',
            'component' => 'SelectField',
            'props' => [
              'label' => __('Embedding environment', 'kimaai'),
              'description' => __(
                'Choose which embedding environment / collection to query. It should match the one you use on the “Sync” screen.',
                'kimaai'
              ),
              'options' => Helper::getEmbedEnvsOptions(),
              'onlyPremium' => !Helper::isPremium(),
            ],
            'condition' => [
              'field' => 'vectorDbEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'vectorDbTopK' => [
            'section' => 'vectorDb',
            'type' => 'integer',
            'default' => 5,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'label' => __('Max results per question', 'kimaai'),
              'description' => __('How many matching chunks to retrieve from the vector DB for each user message. 3–8 is recommended.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
            'condition' => [
              'field' => 'vectorDbEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'vectorDbMinScore' => [
            'section' => 'vectorDb',
            'type' => 'number',
            'default' => 0.0,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'step' => 0.01,
              'min' => 0,
              'max' => 1,
              'label' => __('Minimum similarity score', 'kimaai'),
              'description' => __('Ignore matches below this cosine similarity (0–1). Leave as 0 to accept all.', 'kimaai'),
              'onlyPremium' => !Helper::isPremium(),
            ],
            'condition' => [
              'field' => 'vectorDbEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'messageFeedback' => [
            'section' => 'feedback',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Message Feedback', 'kimaai'),
              'checked' => true,
              'description' => __('Enable or disable the thumbs up/down feedback buttons for each chatbot message.', 'kimaai'),
            ],
          ],
          'csatFeedback' => [
            'section' => 'feedback',
            'type' => 'boolean',
            'default' => true,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Session Feedback', 'kimaai'),
              'checked' => true,
              'description' => __('Enable or disable the session-level feedback form at the end of the chatbot session.', 'kimaai'),
            ],
          ],
          'gdprConsent' => [
            'section' => 'chatbotSecurity',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('GDPR Consent', 'kimaai'),
              'checked' => false,
              'description' => __('Enable or disable the GDPR consent checkbox in the chatbot form.', 'kimaai'),
            ],
          ],
          'gdprText' => [
            'section' => 'chatbotSecurity',
            'type' => 'string',
            'default' => __('By using this chatbot, you agree that this site and connected AI services may process your data.', 'kimaai'),
            'sanitize_callback' => 'wp_kses_post',
            'validate_callback' => 'rest_validate_request_arg',
            'component' => 'TextareaField',
            'translate' => true,
            'condition' => [
              'field' => 'gdprConsent',
              'operator' => '=',
              'value' => true,
            ],
            'props' => [
              'type' => 'text',
              'label' => __('GDPR Text', 'kimaai'),
              'description' => __('Write the GDPR consent text that will be shown to the user to agree before using the chatbot', 'kimaai'),
            ],
          ],
          'sessionRetentionEnabled' => [
            'section' => 'chatbotSecurity',
            'type' => 'boolean',
            'default' => false,
            'component' => 'ToggleField',
            'props' => [
              'label' => __('Session Retention Cleanup', 'kimaai'),
              'checked' => false,
              'description' => __('Automatically delete persisted chatbot sessions and feedback after a retention period.', 'kimaai'),
            ],
          ],
          'sessionRetentionMode' => [
            'section' => 'chatbotSecurity',
            'type' => 'string',
            'default' => '6_months',
            'component' => 'SelectField',
            'props' => [
              'label' => __('Retention Period', 'kimaai'),
              'description' => __('Choose how long persisted chatbot sessions should be kept before automatic cleanup runs.', 'kimaai'),
              'options' => [
                [
                  'value' => '6_months',
                  'label' => __('6 months', 'kimaai'),
                ],
                [
                  'value' => '1_year',
                  'label' => __('1 year', 'kimaai'),
                ],
                [
                  'value' => '2_years',
                  'label' => __('2 years', 'kimaai'),
                ],
                [
                  'value' => '5_years',
                  'label' => __('5 years', 'kimaai'),
                ],
                [
                  'value' => 'custom_days',
                  'label' => __('Custom days', 'kimaai'),
                ],
              ],
            ],
            'condition' => [
              'field' => 'sessionRetentionEnabled',
              'operator' => '=',
              'value' => true,
            ],
          ],
          'sessionRetentionDays' => [
            'section' => 'chatbotSecurity',
            'type' => 'integer',
            'default' => 0,
            'component' => 'TextField',
            'props' => [
              'type' => 'number',
              'min' => 1,
              'step' => 1,
              'label' => __('Custom Retention Days', 'kimaai'),
              'description' => __('Days to keep persisted chatbot sessions. Empty or invalid values disable cleanup.', 'kimaai'),
            ],
            'conditions' => [
              [
                'field' => 'sessionRetentionEnabled',
                'operator' => '=',
                'value' => true,
              ],
              [
                'field' => 'sessionRetentionMode',
                'operator' => '=',
                'value' => 'custom_days',
              ],
            ],
          ],
          'bannedWords' => [
            'section' => 'chatbotSecurity',
            'type' => 'string',
            'default' => '',
            'component' => 'TextareaField',
            'props' => [
              'label' => __('Banned Words', 'kimaai'),
              'description' => __('Reject queries containing these words; separate with commas.', 'kimaai'),
            ],
          ],
          'bannedIps' => [
            'section' => 'chatbotSecurity',
            'type' => 'string',
            'default' => '',
            'component' => 'TextareaField',
            'props' => [
              'label' => __('Block IPs', 'kimaai'),
              'description' => __('Block access from specified IP addresses or ranges using CIDR notation; separate with commas.', 'kimaai'),
            ],
          ],
        ],
      ],
      'quickActions' => [
        'type' => 'array',
        'saveType' => 'repeatable',
        'title' => __('Quick Actions', 'kimaai'),
        'link' => 'quick-actions',
        'pageTitle' => __('Chatbot Quick Actions', 'kimaai'),
        'pageDescription' => __('Add predefined quick action buttons that users can click to send common queries to the chatbot.', 'kimaai'),
        'onlyPremium' => !Helper::isPremium(),
        'items' => [
          'type' => 'object',
          'default' => [],
          'properties' => [
            'id' => [
              'type' => 'string',
              'default' => '',
            ],
            'placement' => [
              'type' => 'string',
              'default' => 'start',
              'component' => 'SelectField',
              'props' => [
                'label' => __('Placement', 'kimaai'),
                'description' => __('Where to show this quick action.', 'kimaai'),
                'options' => [
                  [
                    'value' => 'start',
                    'label' => __('Start of chat', 'kimaai'),
                  ],
                  [
                    'value' => 'after_message',
                    'label' => __('After bot message', 'kimaai'),
                  ],
                ],
              ],
            ],
            'keywords' => [
              'type' => 'string',
              'default' => '',
              'component' => 'TextField',
              'condition' => [
                'field' => 'placement',
                'operator' => '=',
                'value' => 'after_message',
              ],
              'props' => [
                'label' => __('Keywords (optional)', 'kimaai'),
                'description' => __('Comma-separated; only show when the bot message contains any keyword (case-insensitive). Leave empty to always show.', 'kimaai'),
              ],
            ],
            'label' => [
              'type' => 'string',
              'default' => '',
              'translate' => true,
              'component' => 'TextField',
              'props' => [
                'label' => __('Button label', 'kimaai'),
                'description' => __('Text shown on the quick action button.', 'kimaai'),
              ],
            ],
            'type' => [
              'type' => 'string',
              'default' => 'prefill',
              'component' => 'SelectField',
              'props' => [
                'label' => __('Action type', 'kimaai'),
                'description' => __('What happens when the user clicks the button.', 'kimaai'),
                'options' => [
                  [
                    'value' => 'link',
                    'label' => __('Open a link', 'kimaai'),
                  ],
                  [
                    'value' => 'message',
                    'label' => __('Send message immediately', 'kimaai'),
                  ],
                  [
                    'value' => 'prefill',
                    'label' => __('Prefill input', 'kimaai'),
                  ],
                  [
                    'value' => 'command',
                    'label' => __('Run command', 'kimaai'),
                  ],
                ],
              ],
            ],
            'linkUrl' => [
              'type' => 'string',
              'default' => '',
              'component' => 'TextField',
              'condition' => [
                'field' => 'type',
                'operator' => '=',
                'value' => 'link',
              ],
              'props' => [
                'type' => 'url',
                'label' => __('URL to open', 'kimaai'),
                'description' => __('The URL that will be opened when the user clicks the button.', 'kimaai'),
              ],
            ],
            'messageText' => [
              'type' => 'string',
              'default' => '',
              'translate' => true,
              'component' => 'TextareaField',
              'sanitize_callback' => 'wp_kses_post',
              'condition' => [
                'field' => 'type',
                'operator' => '=',
                'value' => 'message',
              ],
              'props' => [
                'label' => __('Message', 'kimaai'),
                'description' => __('Will be sent as if the user typed it.', 'kimaai'),
                'rows' => 3,
              ],
            ],
            'prefillText' => [
              'type' => 'string',
              'default' => '',
              'translate' => true,
              'component' => 'TextareaField',
              'sanitize_callback' => 'wp_kses_post',
              'condition' => [
                'field' => 'type',
                'operator' => '=',
                'value' => 'prefill',
              ],
              'props' => [
                'label' => __('Prefill text', 'kimaai'),
                'description' => __('Inserted into the input box.', 'kimaai'),
                'rows' => 3,
              ],
            ],
            'commandMode' => [
              'type' => 'string',
              'default' => 'none',
              'component' => 'SelectField',
              'condition' => [
                'field' => 'type',
                'operator' => 'in',
                'value' => ['prefill', 'command'],
              ],
              'props' => [
                'label' => __('Command mode', 'kimaai'),
                'description' => __('Attach a command to the next send (e.g. force a tool call).', 'kimaai'),
                'options' => [
                  [
                    'value' => 'none',
                    'label' => __('None', 'kimaai'),
                  ],
                  [
                    'value' => 'force_tool',
                    'label' => __('Force tool', 'kimaai'),
                  ],
                  [
                    'value' => 'callback',
                    'label' => __('Server callback', 'kimaai'),
                  ],
                ],
              ],
            ],
            'tool' => [
              'type' => 'string',
              'default' => '',
              'condition' => [
                'field' => 'commandMode',
                'operator' => '=',
                'value' => 'force_tool',
              ],
              'component' => 'SelectField',
              'props' => [
                'label' => __('Select tool to force', 'kimaai'),
                'description' => __('You must create the tools in the “Functions Calling” settings first.', 'kimaai'),
                'options' => Helper::customFunctionsOptionsForSelect(),
              ],
            ],
            'callback' => [
              'type' => 'string',
              'default' => '',
              'component' => 'TextField',
              'condition' => [
                'field' => 'commandMode',
                'operator' => '=',
                'value' => 'callback',
              ],
              'props' => [
                'label' => __('Callback name', 'kimaai'),
                'description' => __('Example: open_contact', 'kimaai'),
              ],
            ],
            'argsJson' => [
              'type' => 'string',
              'default' => '',
              'component' => 'TextareaField',
              'condition' => [
                'field' => 'commandMode',
                'operator' => '=',
                'value' => 'callback',
              ],
              'props' => [
                'label' => __('Callback args (JSON)', 'kimaai'),
                'description' => __('Optional JSON object passed as args.', 'kimaai'),
                'rows' => 4,
                'monospace' => true,
              ],
            ],
            'commandMessage' => [
              'type' => 'string',
              'default' => '',
              'translate' => true,
              'component' => 'TextareaField',
              'condition' => [
                'field' => 'type',
                'operator' => '=',
                'value' => 'command',
              ],
              'props' => [
                'label' => __('Command message', 'kimaai'),
                'description' => __('The message sent to the server/LLM when the command runs.', 'kimaai'),
                'rows' => 3,
              ],
            ],
            'parallel' => [
              'type' => 'boolean',
              'default' => false,
              'component' => 'ToggleField',
              'condition' => [
                'field' => 'commandMode',
                'operator' => '=',
                'value' => 'force_tool',
              ],
              'props' => [
                'label' => __('Parallel tool calls', 'kimaai'),
                'description' => __('If enabled, allow parallel tool calls for this command (advanced).', 'kimaai'),
                'checked' => false,
              ],
            ],
            'enabled' => [
              'type' => 'boolean',
              'default' => true,
              'component' => 'ToggleField',
              'props' => [
                'label' => __('Enabled', 'kimaai'),
                'description' => __('If disabled, this quick action will not be shown.', 'kimaai'),
                'checked' => true,
              ],
            ],
          ],
        ],
      ],
      'customFunctions' => [
        'type' => 'array',
        'saveType' => 'repeatable',
        'title' => __('Function calling', 'kimaai'),
        'link' => 'tools',
        'pageTitle' => __('Function or Tool calling', 'kimaai'),
        'pageDescription' => __(
          'Add PHP functions that the chatbot may call. 
           Provide a unique function name, a JSON schema for parameters, and the full function code. 
           Only grant access to selected functions in Chatbot → Settings.',
          'kimaai'
        ),
        'onlyPremium' => !Helper::isPremium(),
        'items' => [
          'type' => 'object',
          'default' => [],
          'properties' => [
            'id' => [
              'type' => 'string',
              'default' => '',
            ],
            'functionName' => [
              'type' => 'string',
              'default' => '',
              'required' => true,
              'sanitize_callback' => static function ($value) {
                // keep only [A-Za-z0-9_]
                $value = is_string($value) ? $value : '';
                $value = preg_replace('/[^A-Za-z0-9_]/', '', $value);
                return $value;
              },
              'validate_callback' => 'rest_validate_request_arg',
              'component' => 'TextField',
              'props' => [
                'label' => __('Function name', 'kimaai'),
                'description' => __('Must match the PHP function declared in your code, e.g. "get_product_price".', 'kimaai'),
              ],
            ],
            'description' => [
              'type' => 'string',
              'default' => '',
              'component' => 'TextField',
              'props' => [
                'label' => __('Description', 'kimaai'),
                'description' => __('What this function does. This is shown to the LLM.', 'kimaai'),
              ],
            ],
            'functionCode' => [
              'type' => 'string',
              'default' => "function my_function(array \$args) {\n  // your code\n  return ['ok' => true];\n}\n",
              // IMPORTANT: do NOT strip tags; we must store the raw PHP code
              'sanitize_callback' => [Helper::class, 'sanitizePhpCode'],
              'validate_callback' => 'rest_validate_request_arg',
              'component' => 'CodeEditorField',
              'props' => [
                'label' => __('Full PHP Function', 'kimaai'),
                'description' => __(
                  'Paste the whole PHP function. You can include "<?php" at the top or not; both are accepted.',
                  'kimaai'
                ),
                'rows' => 14,
                'monospace' => true,
              ],
            ],
            'enabled' => [
              'type' => 'boolean',
              'default' => true,
              'component' => 'ToggleField',
              'props' => [
                'label' => __('Enabled', 'kimaai'),
                'description' => __('If disabled, it will not appear as selectable in Chatbot settings.', 'kimaai'),
              ],
            ],
          ],
        ],
      ],
      'history' => [
        'type' => null,
        'title' => __('History', 'kimaai'),
        'link' => 'chatbot-history',
        'pageTitle' => __('Chatbot History', 'kimaai'),
        'pageDescription' => __('On this page, you can see the chatbot history', 'kimaai'),
        'component' => 'ChatbotHistory',
        'showSaveButton' => false,
      ],
    ],
  ],
];
