{{-- lean wrapper for 2 pane page --}}
<!doctype html>
<html lang="en" class="h-100">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <link href="/css/app.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">
    <link href="/v-splitter-px/v-splitter.css" rel="stylesheet" >
    <script src="/v-splitter-px/v-splitter.js"></script>
    <link rel="stylesheet" href="{{ asset('/css/toastr.min.css') }}">
    <script src="{{ asset('js/toastr.min.js') }}" type="application/javascript"></script>
    <title>Leadership Health</title>
</head>
<body class="h-100">
    <div class="row mx-0 h-100">
        <div class="col-9 px-0 app-left-panel">
            <iframe id="stag_mcp_lhs" src="/blank" frameborder="0" class="h-100 w-100"></iframe>
        </div>
        <div class="col-3 border-left app-right-panel pr-1">
            <iframe id="stag_mcp_rhs" src="/pro/meet" frameborder="0" class="h-100 w-100"></iframe>
        </div>
    </div>
    <script>
        initVSplitter('stag-mc-main', $('.app-left-panel'), $('.app-right-panel'));
        window.openInLHS = function(_url) {
            $('#stag_mcp_lhs')[0].contentWindow.fastLoad(_url, true, false);
            return false;
        };
        window.openInRHS = function(_url) {
            $('#stag_mcp_rhs').attr('src', _url);
            return false;
        };
        window.openInLHS = function(_url) {
            $('#stag_mcp_lhs')[0].contentWindow.fastLoad(_url);
            return false;
        }
        window.ensureRHS = function() {
            if(!$('#stag_mcp_rhs').length) window.location.reload();
        };
        window.toggleRHS = function() {
            var body = $('body'), leftPanel = $('.app-left-panel'), result = '';
            if(!body.is('.stag_rhs_collapsed')) {
                body.addClass('stag_rhs_collapsed');
                leftPanel.attr('data-prev-style', leftPanel.attr('style'));
                leftPanel.attr('style', '');
                leftPanel.removeClass('col-9').addClass('col-12');
                result = 'collapsed';
            }
            else {
                if(leftPanel.attr('data-prev-style')) {
                    leftPanel.attr('style', leftPanel.attr('data-prev-style'));
                }
                leftPanel.attr('data-prev-style', '');
                leftPanel.removeClass('col-12').addClass('col-9');
                body.removeClass('stag_rhs_collapsed');
                result = 'expanded';
            }
            window.localStorage.stagRHS = result;
            return result;
        };
        window.showRHS = function() {
            var body = $('body'), leftPanel = $('.app-left-panel');
            if(body.is('.stag_rhs_collapsed')) {
                if(leftPanel.attr('data-prev-style')) {
                    leftPanel.attr('style', leftPanel.attr('data-prev-style'));
                }
                leftPanel.attr('data-prev-style', '');
                leftPanel.removeClass('col-12').addClass('col-9');
                body.removeClass('stag_rhs_collapsed');
                window.localStorage.stagRHS = 'expanded';
                return 'expanded';
            }
        };
        window.hideRHS = function() {
            var body = $('body'), leftPanel = $('.app-left-panel');
            if(!body.is('.stag_rhs_collapsed')) {
                body.addClass('stag_rhs_collapsed');
                leftPanel.attr('data-prev-style', leftPanel.attr('style'));
                leftPanel.attr('style', '');
                leftPanel.removeClass('col-9').addClass('col-12');
                window.localStorage.stagRHS = 'collapsed';
                result = 'collapsed';
            }
        };
        $(document).ready(function() {
            var body = $('body'), leftPanel = $('.app-left-panel');
            if(!{{$pro->is_enrolled_as_mcp ? 1 : 0}}) {
                if(!body.is('.stag_rhs_collapsed')) {
                    body.addClass('stag_rhs_collapsed');
                    leftPanel.attr('data-prev-style', leftPanel.attr('style'));
                    leftPanel.attr('style', '');
                    leftPanel.removeClass('col-9').addClass('col-12');
                    window.localStorage.stagRHS = 'collapsed';
                    return 'collapsed';
                }
            }
            if(window.localStorage.stagRHS === 'collapsed') {
                window.hideRHS();
            }
            else {
                window.showRHS();
            }
        });
    </script>
</body>
</html>
