<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();

if (isset($_REQUEST["IFRAME"]) && $_REQUEST["IFRAME"] === "Y") {
    /*
    Все настройки
    https://dev.1c-bitrix.ru/api_d7/bitrix/ui/sidepanel_wrapper/view_params.php
    */
    $APPLICATION->IncludeComponent(
        'bitrix:ui.sidepanel.wrapper',
        '',
        [
            'POPUP_COMPONENT_NAME' => 'bazarow:bazarow.feedmail',
            'POPUP_COMPONENT_TEMPLATE_NAME' => '',
            'POPUP_COMPONENT_PARAMS' => [
                'BULLETIN_NAME' => $arResult['NAME'],
                'AJAX_MODE' => 'Y',
                'BULLETIN_OWNER_MAIL' => $arResult['ADD_OWNER']['EMAIL'],
                'BULLETIN_URL' => $arResult['CANONICAL_PAGE_URL'],
                'BYER_ID' => $USER->GetID(),
                'SELLER_ID' => $arResult['ADD_OWNER']['ID']
            ],
            'USE_UI_TOOLBAR' => 'N',
            'USE_PADDING' => false,
            'PLAIN_VIEW' => true, // Убираем заголовок
            'PAGE_MODE' => false,
        ]
    );
}
?>



<script>
    $('.show_panel').click(function () {
        BX.SidePanel.Instance.open("<?=$arResult['CANONICAL_PAGE_URL']?>", {
            requestMethod: "post",
            width: 500,
            cacheable: true,
            mobileFriendly: true,
            allowChangeHistory: false,
            label: {
                text: "Закрыть",
                color: "#FFFFFF",
                bgColor: "#E2AE00",
                opacity: 80
            },
        });
    });
</script>
