<?php

class __Mustache_ff1f12e78bb4d2d71f6db485baa1697d extends Mustache_Template
{
    private $lambdaHelper;

    public function renderInternal(Mustache_Context $context, $indent = '')
    {
        $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
        $buffer = '';

        if ($partial = $this->mustache->loadPartial('theme_boost/head')) {
            $buffer .= $partial->renderInternal($context);
        }
        $buffer .= $indent . '
';
        $buffer .= $indent . '<body ';
        $value = $this->resolveValue($context->find('bodyattributes'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '>
';
        if ($partial = $this->mustache->loadPartial('theme_moove/moove/accessibilitybar')) {
            $buffer .= $partial->renderInternal($context);
        }
        $buffer .= $indent . '
';
        if ($partial = $this->mustache->loadPartial('core/local/toast/wrapper')) {
            $buffer .= $partial->renderInternal($context);
        }
        $buffer .= $indent . '
';
        $buffer .= $indent . '<div id="page-wrapper" class="d-print-block">
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '    ';
        $value = $this->resolveValue($context->findDot('output.standard_top_of_body_html'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '
';
        if ($partial = $this->mustache->loadPartial('theme_moove/navbar')) {
            $buffer .= $partial->renderInternal($context, $indent . '    ');
        }
        $value = $context->find('courseindex');
        $buffer .= $this->section9710329be45fafd8954b98d344b9a098($context, $indent, $value);
        $value = $context->find('hasblocks');
        $buffer .= $this->section4aaed2b6f1ec12f9858540c0b87d8693($context, $indent, $value);
        $buffer .= '    <div id="page" data-region="mainpage" data-usertour="scroller" class="drawers ';
        $value = $context->find('courseindexopen');
        $buffer .= $this->section6b40e2748488de16028fd4032111cc9b($context, $indent, $value);
        $buffer .= ' ';
        $value = $context->find('blockdraweropen');
        $buffer .= $this->section05ab28b93094b30436e1224de5468efa($context, $indent, $value);
        $buffer .= ' drag-container">
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '        ';
        $value = $this->resolveValue($context->findDot('output.full_header'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '        <div id="topofscroll" class="main-inner">
';
        $buffer .= $indent . '            <div class="drawer-toggles d-flex">
';
        $value = $context->find('courseindex');
        $buffer .= $this->section0eadb161ff0a57ff31836e56223bc96c($context, $indent, $value);
        $value = $context->find('hasblocks');
        $buffer .= $this->section94c73faf1c9634654fc54727e5648ac4($context, $indent, $value);
        $buffer .= $indent . '            </div>
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '            <div id="page-content" class="pb-3 d-print-block">
';
        $buffer .= $indent . '                <div id="region-main-box">
';
        $value = $context->find('hasregionmainsettingsmenu');
        $buffer .= $this->section4833668e3ab64a52de8319d62eeb9a0d($context, $indent, $value);
        $buffer .= $indent . '                    <div id="region-main">
';
        $buffer .= $indent . '
';
        $value = $context->find('hasregionmainsettingsmenu');
        $buffer .= $this->sectionBfb58dd1d13a295db43bf0266e3aa6ee($context, $indent, $value);
        $buffer .= $indent . '                        ';
        $value = $this->resolveValue($context->findDot('output.course_content_header'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $value = $context->find('headercontent');
        $buffer .= $this->section72a93137fa43b727f40759a358d07ffb($context, $indent, $value);
        $value = $context->find('overflow');
        $buffer .= $this->sectionD1a531f5a89e5a3e9617c88ef195a6bf($context, $indent, $value);
        $buffer .= $indent . '                        ';
        $value = $this->resolveValue($context->findDot('output.main_content'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '                        ';
        $value = $this->resolveValue($context->findDot('output.activity_navigation'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '                        ';
        $value = $this->resolveValue($context->findDot('output.course_content_footer'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '                    </div>
';
        $buffer .= $indent . '                </div>
';
        $buffer .= $indent . '            </div>
';
        $buffer .= $indent . '        </div>
';
        $buffer .= $indent . '    </div>
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '
';
        if ($partial = $this->mustache->loadPartial('theme_moove/footer')) {
            $buffer .= $partial->renderInternal($context, $indent . '    ');
        }
        $buffer .= $indent . '
';
        $buffer .= $indent . '    ';
        $value = $this->resolveValue($context->findDot('output.standard_after_main_region_html'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '</div>
';
        $buffer .= $indent . '
';
        $value = $context->find('mostrar_chatbot_profesor');
        $buffer .= $this->section5f56eefde7134ca3ae4b04d58f734ef7($context, $indent, $value);
        $buffer .= $indent . '
';
        $buffer .= $indent . '
';
        $buffer .= $indent . '</body>
';
        $buffer .= $indent . '</html>
';
        $value = $context->find('js');
        $buffer .= $this->sectionD6941b231183d81625a3128b7ad2db7b($context, $indent, $value);

        return $buffer;
    }

    private function section14c724f5a6859d4cc56d9befdffaeac5(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'show';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'show';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionD8c059d8e564034fcd5a4fcfed7ed8eb(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'closecourseindex, core';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'closecourseindex, core';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section9710329be45fafd8954b98d344b9a098(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
        {{< theme_boost/drawer }}
            {{$id}}theme_boost-drawers-courseindex{{/id}}
            {{$drawerheadercontent}}
                {{> theme_boost/courseindexdrawercontrols}}
            {{/drawerheadercontent}}
            {{$drawerclasses}}drawer drawer-left {{#courseindexopen}}show{{/courseindexopen}}{{/drawerclasses}}
            {{$drawercontent}}
                {{{courseindex}}}
            {{/drawercontent}}
            {{$drawerpreferencename}}drawer-open-index{{/drawerpreferencename}}
            {{$drawerstate}}show-drawer-left{{/drawerstate}}
            {{$tooltipplacement}}right{{/tooltipplacement}}
            {{$closebuttontext}}{{#str}}closecourseindex, core{{/str}}{{/closebuttontext}}
        {{/ theme_boost/drawer}}
    ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '        ';
                if ($parent = $this->mustache->loadPartial('theme_boost/drawer')) {
                    $context->pushBlockContext(array(
                        'id' => array($this, 'blockEfc32b531594d5d62ec9c68e35a53dc3'),
                        'drawerheadercontent' => array($this, 'blockA515fe1a11236ac39d9f95662b1587b1'),
                        'drawerclasses' => array($this, 'block0dcbcdb48783bd0043cc25a3ecb99947'),
                        'drawercontent' => array($this, 'blockD56da21f9a4b20987f95cec76380b378'),
                        'drawerpreferencename' => array($this, 'block24fc4cc7410bc884a3b9fba5f26dc7b9'),
                        'drawerstate' => array($this, 'blockBd5099c9b82bf8a4037bbd56bb374a89'),
                        'tooltipplacement' => array($this, 'block2a81b037a416792e91b78e41049f49f9'),
                        'closebuttontext' => array($this, 'block9ac4e5859f44816b862545bc2c6e6a46'),
                    ));
                    $buffer .= $parent->renderInternal($context, $indent);
                    $context->popBlockContext();
                }
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section1cb47d3ed9b97c6d6d496d2358bec253(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = ' show';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= ' show';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section1bd0cc4642e36d67e46c9dd550f1fa06(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '1';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= '1';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section31618380a8d2d407a8b2acf35dd449a4(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'closeblockdrawer, core';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'closeblockdrawer, core';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section4aaed2b6f1ec12f9858540c0b87d8693(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
        {{< theme_boost/drawer }}
            {{$id}}theme_boost-drawers-blocks{{/id}}
            {{$drawerclasses}}drawer drawer-right{{#blockdraweropen}} show{{/blockdraweropen}}{{/drawerclasses}}
            {{$drawercontent}}
                <div class="d-print-none">
                    {{{ addblockbutton }}}
                    {{{ sidepreblocks }}}
                </div>
            {{/drawercontent}}
            {{$drawerpreferencename}}drawer-open-block{{/drawerpreferencename}}
            {{$forceopen}}{{#forceblockdraweropen}}1{{/forceblockdraweropen}}{{/forceopen}}
            {{$drawerstate}}show-drawer-right{{/drawerstate}}
            {{$tooltipplacement}}left{{/tooltipplacement}}
            {{$drawercloseonresize}}1{{/drawercloseonresize}}
            {{$closebuttontext}}{{#str}}closeblockdrawer, core{{/str}}{{/closebuttontext}}
        {{/ theme_boost/drawer}}
    ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= '        ';
                if ($parent = $this->mustache->loadPartial('theme_boost/drawer')) {
                    $context->pushBlockContext(array(
                        'id' => array($this, 'block4ca482bf2f4c0292197ede951a52b02e'),
                        'drawerclasses' => array($this, 'block874d06fc7c30c807dc0ee7226cad4ec8'),
                        'drawercontent' => array($this, 'block653705e011aee4da136ef3634b4ebefd'),
                        'drawerpreferencename' => array($this, 'block59146569a56c3d2642fa2e8224817be0'),
                        'forceopen' => array($this, 'block13847ba3219919ecdb2378620735177c'),
                        'drawerstate' => array($this, 'block0ea572ae0e89f9c5cc1dc5d7238a50d5'),
                        'tooltipplacement' => array($this, 'blockC945de95615645c65d6b2f192042e6ea'),
                        'drawercloseonresize' => array($this, 'blockE052079a625ca42b568ba24af19cc7eb'),
                        'closebuttontext' => array($this, 'blockC879444321d250421c3438099ae68173'),
                    ));
                    $buffer .= $parent->renderInternal($context, $indent);
                    $context->popBlockContext();
                }
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section6b40e2748488de16028fd4032111cc9b(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'show-drawer-left';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'show-drawer-left';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section05ab28b93094b30436e1224de5468efa(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'show-drawer-right';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'show-drawer-right';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionAfaaa3dab86fd46a075d917e3ce891f0(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'opendrawerindex, core';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'opendrawerindex, core';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section3feaf801d4aa0a811fe41c3427e53335(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = ' t/index_drawer, moodle ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= ' t/index_drawer, moodle ';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section0eadb161ff0a57ff31836e56223bc96c(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
                    <div class="drawer-toggler drawer-left-toggle open-nav d-print-none">
                        <button
                            class="btn icon-no-margin"
                            data-toggler="drawers"
                            data-action="toggle"
                            data-target="theme_boost-drawers-courseindex"
                            data-toggle="tooltip"
                            data-placement="right"
                            title="{{#str}}opendrawerindex, core{{/str}}"
                        >
                            <span class="sr-only">{{#str}}opendrawerindex, core{{/str}}</span>
                            {{#pix}} t/index_drawer, moodle {{/pix}}
                        </button>
                    </div>
                ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '                    <div class="drawer-toggler drawer-left-toggle open-nav d-print-none">
';
                $buffer .= $indent . '                        <button
';
                $buffer .= $indent . '                            class="btn icon-no-margin"
';
                $buffer .= $indent . '                            data-toggler="drawers"
';
                $buffer .= $indent . '                            data-action="toggle"
';
                $buffer .= $indent . '                            data-target="theme_boost-drawers-courseindex"
';
                $buffer .= $indent . '                            data-toggle="tooltip"
';
                $buffer .= $indent . '                            data-placement="right"
';
                $buffer .= $indent . '                            title="';
                $value = $context->find('str');
                $buffer .= $this->sectionAfaaa3dab86fd46a075d917e3ce891f0($context, $indent, $value);
                $buffer .= '"
';
                $buffer .= $indent . '                        >
';
                $buffer .= $indent . '                            <span class="sr-only">';
                $value = $context->find('str');
                $buffer .= $this->sectionAfaaa3dab86fd46a075d917e3ce891f0($context, $indent, $value);
                $buffer .= '</span>
';
                $buffer .= $indent . '                            ';
                $value = $context->find('pix');
                $buffer .= $this->section3feaf801d4aa0a811fe41c3427e53335($context, $indent, $value);
                $buffer .= '
';
                $buffer .= $indent . '                        </button>
';
                $buffer .= $indent . '                    </div>
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section245ba37b5a58f162a63e0d10700eb739(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'opendrawerblocks, core';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'opendrawerblocks, core';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section0bf870995ed49a0bb4a766ed18e0f142(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 't/blocks_drawer, core';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 't/blocks_drawer, core';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionD277bad9387573c58f79f77fc705e8dd(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 't/blocks_drawer_rtl, core';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 't/blocks_drawer_rtl, core';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section94c73faf1c9634654fc54727e5648ac4(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
                    <div class="drawer-toggler drawer-right-toggle ms-auto d-print-none">
                        <button
                            class="btn icon-no-margin"
                            data-toggler="drawers"
                            data-action="toggle"
                            data-target="theme_boost-drawers-blocks"
                            data-toggle="tooltip"
                            data-placement="right"
                            title="{{#str}}opendrawerblocks, core{{/str}}"
                        >
                            <span class="sr-only">{{#str}}opendrawerblocks, core{{/str}}</span>
                            <span class="dir-rtl-hide">{{#pix}}t/blocks_drawer, core{{/pix}}</span>
                            <span class="dir-ltr-hide">{{#pix}}t/blocks_drawer_rtl, core{{/pix}}</span>
                        </button>
                    </div>
                ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '                    <div class="drawer-toggler drawer-right-toggle ms-auto d-print-none">
';
                $buffer .= $indent . '                        <button
';
                $buffer .= $indent . '                            class="btn icon-no-margin"
';
                $buffer .= $indent . '                            data-toggler="drawers"
';
                $buffer .= $indent . '                            data-action="toggle"
';
                $buffer .= $indent . '                            data-target="theme_boost-drawers-blocks"
';
                $buffer .= $indent . '                            data-toggle="tooltip"
';
                $buffer .= $indent . '                            data-placement="right"
';
                $buffer .= $indent . '                            title="';
                $value = $context->find('str');
                $buffer .= $this->section245ba37b5a58f162a63e0d10700eb739($context, $indent, $value);
                $buffer .= '"
';
                $buffer .= $indent . '                        >
';
                $buffer .= $indent . '                            <span class="sr-only">';
                $value = $context->find('str');
                $buffer .= $this->section245ba37b5a58f162a63e0d10700eb739($context, $indent, $value);
                $buffer .= '</span>
';
                $buffer .= $indent . '                            <span class="dir-rtl-hide">';
                $value = $context->find('pix');
                $buffer .= $this->section0bf870995ed49a0bb4a766ed18e0f142($context, $indent, $value);
                $buffer .= '</span>
';
                $buffer .= $indent . '                            <span class="dir-ltr-hide">';
                $value = $context->find('pix');
                $buffer .= $this->sectionD277bad9387573c58f79f77fc705e8dd($context, $indent, $value);
                $buffer .= '</span>
';
                $buffer .= $indent . '                        </button>
';
                $buffer .= $indent . '                    </div>
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section4833668e3ab64a52de8319d62eeb9a0d(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
                    <div id="region-main-settings-menu" class="d-print-none">
                        <div> {{{ regionmainsettingsmenu }}} </div>
                    </div>
                    ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '                    <div id="region-main-settings-menu" class="d-print-none">
';
                $buffer .= $indent . '                        <div> ';
                $value = $this->resolveValue($context->find('regionmainsettingsmenu'), $context);
                $buffer .= ($value === null ? '' : $value);
                $buffer .= ' </div>
';
                $buffer .= $indent . '                    </div>
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionBfb58dd1d13a295db43bf0266e3aa6ee(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
                            <div class="region_main_settings_menu_proxy"></div>
                        ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '                            <div class="region_main_settings_menu_proxy"></div>
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section72a93137fa43b727f40759a358d07ffb(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
                            {{> core/activity_header }}
                        ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                if ($partial = $this->mustache->loadPartial('core/activity_header')) {
                    $buffer .= $partial->renderInternal($context, $indent . '                            ');
                }
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionD1a531f5a89e5a3e9617c88ef195a6bf(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
                            <div class="container-fluid tertiary-navigation">
                                <div class="navitem">
                                    {{> core/url_select}}
                                </div>
                            </div>
                        ';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '                            <div class="container-fluid tertiary-navigation">
';
                $buffer .= $indent . '                                <div class="navitem">
';
                if ($partial = $this->mustache->loadPartial('core/url_select')) {
                    $buffer .= $partial->renderInternal($context, $indent . '                                    ');
                }
                $buffer .= $indent . '                                </div>
';
                $buffer .= $indent . '                            </div>
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section5f56eefde7134ca3ae4b04d58f734ef7(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
<link href="https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css" rel="stylesheet" />

<style>
  /* Cambiar color primario de rosa a azul */
  :root {
    --chat--color-primary: #1C64F2;
    --chat--color-primary-shade-50: #1856c2;
    --chat--color-primary-shade-100: #144a9e;
  }

  /* ===== Contenedor flotante propio de Iris ===== */
  #iris-float-wrapper {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  /* Barra de arrastre + botones */
  #iris-drag-bar {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }
  #iris-drag-bar:active { cursor: grabbing; }

  /* Botón principal "Conversa con Iris" */
  #iris-open-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 48px;
    background: #1C64F2;
    color: #fff;
    border: none;
    border-radius: 25px 0 0 25px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
  }
  #iris-open-btn:hover { background: #1856c2; }
  #iris-open-btn svg {
    width: 22px; height: 22px; fill: #fff; flex-shrink: 0;
  }

  /* Botón X para cerrar/ocultar */
  #iris-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 48px;
    background: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 0 25px 25px 0;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
  }
  #iris-close-btn:hover { background: #c53030; }

  /* Ocultar el botón original de n8n */
  .chat-window-toggle {
    display: none !important;
  }

  /* Ventana de chat: justo arriba del botón */
  .chat-window {
    z-index: 100000 !important;
    position: fixed !important;
    bottom: 90px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    max-height: calc(100vh - 100px) !important;
  }
</style>

<!-- Contenedor flotante propio -->
<div id="iris-float-wrapper">
  <div id="iris-drag-bar">
    <button id="iris-open-btn" title="Conversa con Iris">
      <svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/></svg>
      Conversa con Iris
    </button>
    <button id="iris-close-btn" title="Ocultar">✕</button>
  </div>
</div>

<div id="n8n-chat"></div>

<script>
(function() {
  // Cargar el chat de n8n de forma aislada para evitar conflicto con RequireJS de Moodle.
  // Se usa setTimeout para esperar a que RequireJS termine su inicialización.
  setTimeout(function() {
    var chatUrl = \'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js\';

    // Guardar referencia a define de RequireJS y desactivarlo temporalmente
    var origDefine = window.define;
    var origRequire = window.require;
    window.define = undefined;
    window.require = undefined;

    import(/* webpackIgnore: true */ chatUrl).then(function(module) {
      // Restaurar RequireJS inmediatamente
      window.define = origDefine;
      window.require = origRequire;

      module.createChat({
        webhookUrl: \'https://n8n.innova.edu.ec/webhook/eb50aa3d-5f60-43b7-8164-305afc75d2a1/chat\',
        webhookConfig: {
          method: \'POST\',
          headers: {}
        },
        target: \'#n8n-chat\',
        mode: \'window\',
        chatInputKey: \'chatInput\',
        chatSessionKey: \'sessionId\',
        loadPreviousSession: true,
        metadata: {},
        showWelcomeScreen: false,
        defaultLanguage: \'en\',
        initialMessages: [
          \'¡Hola! Soy tu asistente virtual de Maya Educación con Inteligencia Artificial. 👋\',
          \'Estoy aquí para ayudarte con cualquier pregunta o duda que tengas sobre temas académicos.\'
        ],
        i18n: {
          en: {
            title: \'Hola Soy Iris 👋\',
            subtitle: "¿En qué puedo ayudarte hoy?",
            footer: \'\',
            getStarted: \'Nueva Conversación\',
            inputPlaceholder: \'Escribe tu pregunta...\',
          },
        },
        enableStreaming: false,
      });
    }).catch(function(err) {
      // Restaurar RequireJS en caso de error también
      window.define = origDefine;
      window.require = origRequire;
      console.error(\'Error al cargar el chat de Iris:\', err);
    });
  }, 1000);
})();
</script>

<script type="text/javascript">
(function() {
  document.addEventListener(\'DOMContentLoaded\', function() {
    var wrapper   = document.getElementById(\'iris-float-wrapper\');
    var openBtn   = document.getElementById(\'iris-open-btn\');
    var closeBtn  = document.getElementById(\'iris-close-btn\');
    var dragBar   = document.getElementById(\'iris-drag-bar\');
    if (!wrapper || !openBtn || !closeBtn || !dragBar) return;

    // =========================================
    // 1. Botón X: Ocultar el wrapper completo
    // =========================================
    closeBtn.addEventListener(\'click\', function(e) {
      e.stopPropagation();
      e.preventDefault();
      wrapper.style.display = \'none\';
      // Ocultar chat directamente sin pasar por el toggle
      var chatWin = document.querySelector(\'.chat-window\');
      if (chatWin) chatWin.style.display = \'none\';
    });

    // =========================================
    // 2. Botón abrir: Simular clic en toggle de n8n
    // =========================================
    openBtn.addEventListener(\'click\', function() {
      var n8nToggle = document.querySelector(\'.chat-window-toggle\');
      if (n8nToggle) n8nToggle.click();
    });

    // =========================================
    // 3. Inyectar botón ✕ en la cabecera del chat
    // =========================================
    function injectChatClose() {
      var chatWin = document.querySelector(\'.chat-window\');
      if (!chatWin || chatWin.querySelector(\'#iris-chat-x\')) return;

      var header = chatWin.querySelector(\'.chat-header\') ||
                   chatWin.querySelector(\'[class*="header"]\') ||
                   chatWin.firstElementChild;
      if (!header) return;

      header.style.position = \'relative\';

      var xBtn = document.createElement(\'button\');
      xBtn.id = \'iris-chat-x\';
      xBtn.innerHTML = \'✕\';
      xBtn.title = \'Cerrar chat\';
      xBtn.style.cssText = \'position:absolute;top:10px;right:10px;background:rgba(255,255,255,0.2);color:#fff;border:none;border-radius:50%;width:28px;height:28px;font-size:15px;font-weight:bold;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:10;transition:background 0.2s;\';

      xBtn.addEventListener(\'mouseenter\', function() { this.style.background = \'rgba(255,255,255,0.4)\'; });
      xBtn.addEventListener(\'mouseleave\', function() { this.style.background = \'rgba(255,255,255,0.2)\'; });

      xBtn.addEventListener(\'click\', function(e) {
        e.stopPropagation();
        var n8nToggle = document.querySelector(\'.chat-window-toggle\');
        if (n8nToggle) n8nToggle.click();
      });

      header.appendChild(xBtn);
    }

    // Observar para inyectar el botón cuando el chat aparezca
    var chatXObs = new MutationObserver(function() {
      var chatWin = document.querySelector(\'.chat-window\');
      if (chatWin && !chatWin.querySelector(\'#iris-chat-x\')) {
        injectChatClose();
      }
    });
    chatXObs.observe(document.body, { childList: true, subtree: true });

    // =========================================
    // 4. Drag & Drop del wrapper
    // =========================================
    var isDragging = false;
    var startX = 0, startY = 0;
    var origLeft = 0, origTop = 0;

    function initPosition() {
      var rect = wrapper.getBoundingClientRect();
      wrapper.style.top    = rect.top + \'px\';
      wrapper.style.left   = rect.left + \'px\';
      wrapper.style.bottom = \'auto\';
      wrapper.style.right  = \'auto\';
    }
    setTimeout(initPosition, 500);

    dragBar.addEventListener(\'mousedown\', function(e) {
      if (e.target === closeBtn || e.target === openBtn) return;
      e.preventDefault();
      isDragging = false;
      startX = e.clientX;
      startY = e.clientY;
      var rect = wrapper.getBoundingClientRect();
      origLeft = rect.left;
      origTop  = rect.top;
      dragBar.style.cursor = \'grabbing\';
      document.addEventListener(\'mousemove\', onMouseMove);
      document.addEventListener(\'mouseup\', onMouseUp);
    });

    function onMouseMove(e) {
      e.preventDefault();
      var dx = e.clientX - startX;
      var dy = e.clientY - startY;
      if (Math.abs(dx) > 3 || Math.abs(dy) > 3) isDragging = true;

      var newLeft = origLeft + dx;
      var newTop  = origTop + dy;
      var w = wrapper.offsetWidth;
      var h = wrapper.offsetHeight;
      if (newLeft < 0) newLeft = 0;
      if (newTop < 0)  newTop = 0;
      if (newLeft + w > window.innerWidth)  newLeft = window.innerWidth - w;
      if (newTop + h > window.innerHeight)  newTop = window.innerHeight - h;

      wrapper.style.left   = newLeft + \'px\';
      wrapper.style.top    = newTop + \'px\';
      wrapper.style.bottom = \'auto\';
      wrapper.style.right  = \'auto\';
    }

    function onMouseUp() {
      document.removeEventListener(\'mousemove\', onMouseMove);
      document.removeEventListener(\'mouseup\', onMouseUp);
      dragBar.style.cursor = \'grab\';
      setTimeout(function() { isDragging = false; }, 100);
    }

    // Touch events
    dragBar.addEventListener(\'touchstart\', function(e) {
      if (e.target === closeBtn || e.target === openBtn) return;
      var touch = e.touches[0];
      isDragging = false;
      startX = touch.clientX;
      startY = touch.clientY;
      var rect = wrapper.getBoundingClientRect();
      origLeft = rect.left;
      origTop  = rect.top;
      document.addEventListener(\'touchmove\', onTouchMove, {passive: false});
      document.addEventListener(\'touchend\', onTouchEnd);
    }, {passive: false});

    function onTouchMove(e) {
      var touch = e.touches[0];
      var dx = touch.clientX - startX;
      var dy = touch.clientY - startY;
      if (Math.abs(dx) > 3 || Math.abs(dy) > 3) {
        isDragging = true;
        if (e.cancelable) e.preventDefault();
      }
      var newLeft = origLeft + dx;
      var newTop  = origTop + dy;
      var w = wrapper.offsetWidth;
      var h = wrapper.offsetHeight;
      if (newLeft < 0) newLeft = 0;
      if (newTop < 0)  newTop = 0;
      if (newLeft + w > window.innerWidth)  newLeft = window.innerWidth - w;
      if (newTop + h > window.innerHeight)  newTop = window.innerHeight - h;

      wrapper.style.left   = newLeft + \'px\';
      wrapper.style.top    = newTop + \'px\';
      wrapper.style.bottom = \'auto\';
      wrapper.style.right  = \'auto\';
    }

    function onTouchEnd() {
      document.removeEventListener(\'touchmove\', onTouchMove);
      document.removeEventListener(\'touchend\', onTouchEnd);
      setTimeout(function() { isDragging = false; }, 100);
    }
  });
})();
</script>
';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '<link href="https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css" rel="stylesheet" />
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '<style>
';
                $buffer .= $indent . '  /* Cambiar color primario de rosa a azul */
';
                $buffer .= $indent . '  :root {
';
                $buffer .= $indent . '    --chat--color-primary: #1C64F2;
';
                $buffer .= $indent . '    --chat--color-primary-shade-50: #1856c2;
';
                $buffer .= $indent . '    --chat--color-primary-shade-100: #144a9e;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '  /* ===== Contenedor flotante propio de Iris ===== */
';
                $buffer .= $indent . '  #iris-float-wrapper {
';
                $buffer .= $indent . '    position: fixed;
';
                $buffer .= $indent . '    bottom: 30px;
';
                $buffer .= $indent . '    right: 20px;
';
                $buffer .= $indent . '    z-index: 99999;
';
                $buffer .= $indent . '    display: flex;
';
                $buffer .= $indent . '    flex-direction: column;
';
                $buffer .= $indent . '    align-items: flex-end;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '  /* Barra de arrastre + botones */
';
                $buffer .= $indent . '  #iris-drag-bar {
';
                $buffer .= $indent . '    display: flex;
';
                $buffer .= $indent . '    align-items: center;
';
                $buffer .= $indent . '    gap: 0;
';
                $buffer .= $indent . '    cursor: grab;
';
                $buffer .= $indent . '    user-select: none;
';
                $buffer .= $indent . '    -webkit-user-select: none;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '  #iris-drag-bar:active { cursor: grabbing; }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '  /* Botón principal "Conversa con Iris" */
';
                $buffer .= $indent . '  #iris-open-btn {
';
                $buffer .= $indent . '    display: flex;
';
                $buffer .= $indent . '    align-items: center;
';
                $buffer .= $indent . '    gap: 8px;
';
                $buffer .= $indent . '    padding: 0 18px;
';
                $buffer .= $indent . '    height: 48px;
';
                $buffer .= $indent . '    background: #1C64F2;
';
                $buffer .= $indent . '    color: #fff;
';
                $buffer .= $indent . '    border: none;
';
                $buffer .= $indent . '    border-radius: 25px 0 0 25px;
';
                $buffer .= $indent . '    font-weight: bold;
';
                $buffer .= $indent . '    font-size: 14px;
';
                $buffer .= $indent . '    cursor: pointer;
';
                $buffer .= $indent . '    white-space: nowrap;
';
                $buffer .= $indent . '    transition: background 0.2s;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '  #iris-open-btn:hover { background: #1856c2; }
';
                $buffer .= $indent . '  #iris-open-btn svg {
';
                $buffer .= $indent . '    width: 22px; height: 22px; fill: #fff; flex-shrink: 0;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '  /* Botón X para cerrar/ocultar */
';
                $buffer .= $indent . '  #iris-close-btn {
';
                $buffer .= $indent . '    display: flex;
';
                $buffer .= $indent . '    align-items: center;
';
                $buffer .= $indent . '    justify-content: center;
';
                $buffer .= $indent . '    width: 36px;
';
                $buffer .= $indent . '    height: 48px;
';
                $buffer .= $indent . '    background: #e53e3e;
';
                $buffer .= $indent . '    color: #fff;
';
                $buffer .= $indent . '    border: none;
';
                $buffer .= $indent . '    border-radius: 0 25px 25px 0;
';
                $buffer .= $indent . '    font-size: 20px;
';
                $buffer .= $indent . '    font-weight: bold;
';
                $buffer .= $indent . '    cursor: pointer;
';
                $buffer .= $indent . '    transition: background 0.2s;
';
                $buffer .= $indent . '    line-height: 1;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '  #iris-close-btn:hover { background: #c53030; }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '  /* Ocultar el botón original de n8n */
';
                $buffer .= $indent . '  .chat-window-toggle {
';
                $buffer .= $indent . '    display: none !important;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '  /* Ventana de chat: justo arriba del botón */
';
                $buffer .= $indent . '  .chat-window {
';
                $buffer .= $indent . '    z-index: 100000 !important;
';
                $buffer .= $indent . '    position: fixed !important;
';
                $buffer .= $indent . '    bottom: 90px !important;
';
                $buffer .= $indent . '    right: 20px !important;
';
                $buffer .= $indent . '    top: auto !important;
';
                $buffer .= $indent . '    left: auto !important;
';
                $buffer .= $indent . '    max-height: calc(100vh - 100px) !important;
';
                $buffer .= $indent . '  }
';
                $buffer .= $indent . '</style>
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '<!-- Contenedor flotante propio -->
';
                $buffer .= $indent . '<div id="iris-float-wrapper">
';
                $buffer .= $indent . '  <div id="iris-drag-bar">
';
                $buffer .= $indent . '    <button id="iris-open-btn" title="Conversa con Iris">
';
                $buffer .= $indent . '      <svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/></svg>
';
                $buffer .= $indent . '      Conversa con Iris
';
                $buffer .= $indent . '    </button>
';
                $buffer .= $indent . '    <button id="iris-close-btn" title="Ocultar">✕</button>
';
                $buffer .= $indent . '  </div>
';
                $buffer .= $indent . '</div>
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '<div id="n8n-chat"></div>
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '<script>
';
                $buffer .= $indent . '(function() {
';
                $buffer .= $indent . '  // Cargar el chat de n8n de forma aislada para evitar conflicto con RequireJS de Moodle.
';
                $buffer .= $indent . '  // Se usa setTimeout para esperar a que RequireJS termine su inicialización.
';
                $buffer .= $indent . '  setTimeout(function() {
';
                $buffer .= $indent . '    var chatUrl = \'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js\';
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // Guardar referencia a define de RequireJS y desactivarlo temporalmente
';
                $buffer .= $indent . '    var origDefine = window.define;
';
                $buffer .= $indent . '    var origRequire = window.require;
';
                $buffer .= $indent . '    window.define = undefined;
';
                $buffer .= $indent . '    window.require = undefined;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    import(/* webpackIgnore: true */ chatUrl).then(function(module) {
';
                $buffer .= $indent . '      // Restaurar RequireJS inmediatamente
';
                $buffer .= $indent . '      window.define = origDefine;
';
                $buffer .= $indent . '      window.require = origRequire;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      module.createChat({
';
                $buffer .= $indent . '        webhookUrl: \'https://n8n.innova.edu.ec/webhook/eb50aa3d-5f60-43b7-8164-305afc75d2a1/chat\',
';
                $buffer .= $indent . '        webhookConfig: {
';
                $buffer .= $indent . '          method: \'POST\',
';
                $buffer .= $indent . '          headers: {}
';
                $buffer .= $indent . '        },
';
                $buffer .= $indent . '        target: \'#n8n-chat\',
';
                $buffer .= $indent . '        mode: \'window\',
';
                $buffer .= $indent . '        chatInputKey: \'chatInput\',
';
                $buffer .= $indent . '        chatSessionKey: \'sessionId\',
';
                $buffer .= $indent . '        loadPreviousSession: true,
';
                $buffer .= $indent . '        metadata: {},
';
                $buffer .= $indent . '        showWelcomeScreen: false,
';
                $buffer .= $indent . '        defaultLanguage: \'en\',
';
                $buffer .= $indent . '        initialMessages: [
';
                $buffer .= $indent . '          \'¡Hola! Soy tu asistente virtual de Maya Educación con Inteligencia Artificial. 👋\',
';
                $buffer .= $indent . '          \'Estoy aquí para ayudarte con cualquier pregunta o duda que tengas sobre temas académicos.\'
';
                $buffer .= $indent . '        ],
';
                $buffer .= $indent . '        i18n: {
';
                $buffer .= $indent . '          en: {
';
                $buffer .= $indent . '            title: \'Hola Soy Iris 👋\',
';
                $buffer .= $indent . '            subtitle: "¿En qué puedo ayudarte hoy?",
';
                $buffer .= $indent . '            footer: \'\',
';
                $buffer .= $indent . '            getStarted: \'Nueva Conversación\',
';
                $buffer .= $indent . '            inputPlaceholder: \'Escribe tu pregunta...\',
';
                $buffer .= $indent . '          },
';
                $buffer .= $indent . '        },
';
                $buffer .= $indent . '        enableStreaming: false,
';
                $buffer .= $indent . '      });
';
                $buffer .= $indent . '    }).catch(function(err) {
';
                $buffer .= $indent . '      // Restaurar RequireJS en caso de error también
';
                $buffer .= $indent . '      window.define = origDefine;
';
                $buffer .= $indent . '      window.require = origRequire;
';
                $buffer .= $indent . '      console.error(\'Error al cargar el chat de Iris:\', err);
';
                $buffer .= $indent . '    });
';
                $buffer .= $indent . '  }, 1000);
';
                $buffer .= $indent . '})();
';
                $buffer .= $indent . '</script>
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '<script type="text/javascript">
';
                $buffer .= $indent . '(function() {
';
                $buffer .= $indent . '  document.addEventListener(\'DOMContentLoaded\', function() {
';
                $buffer .= $indent . '    var wrapper   = document.getElementById(\'iris-float-wrapper\');
';
                $buffer .= $indent . '    var openBtn   = document.getElementById(\'iris-open-btn\');
';
                $buffer .= $indent . '    var closeBtn  = document.getElementById(\'iris-close-btn\');
';
                $buffer .= $indent . '    var dragBar   = document.getElementById(\'iris-drag-bar\');
';
                $buffer .= $indent . '    if (!wrapper || !openBtn || !closeBtn || !dragBar) return;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    // 1. Botón X: Ocultar el wrapper completo
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    closeBtn.addEventListener(\'click\', function(e) {
';
                $buffer .= $indent . '      e.stopPropagation();
';
                $buffer .= $indent . '      e.preventDefault();
';
                $buffer .= $indent . '      wrapper.style.display = \'none\';
';
                $buffer .= $indent . '      // Ocultar chat directamente sin pasar por el toggle
';
                $buffer .= $indent . '      var chatWin = document.querySelector(\'.chat-window\');
';
                $buffer .= $indent . '      if (chatWin) chatWin.style.display = \'none\';
';
                $buffer .= $indent . '    });
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    // 2. Botón abrir: Simular clic en toggle de n8n
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    openBtn.addEventListener(\'click\', function() {
';
                $buffer .= $indent . '      var n8nToggle = document.querySelector(\'.chat-window-toggle\');
';
                $buffer .= $indent . '      if (n8nToggle) n8nToggle.click();
';
                $buffer .= $indent . '    });
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    // 3. Inyectar botón ✕ en la cabecera del chat
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    function injectChatClose() {
';
                $buffer .= $indent . '      var chatWin = document.querySelector(\'.chat-window\');
';
                $buffer .= $indent . '      if (!chatWin || chatWin.querySelector(\'#iris-chat-x\')) return;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      var header = chatWin.querySelector(\'.chat-header\') ||
';
                $buffer .= $indent . '                   chatWin.querySelector(\'[class*="header"]\') ||
';
                $buffer .= $indent . '                   chatWin.firstElementChild;
';
                $buffer .= $indent . '      if (!header) return;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      header.style.position = \'relative\';
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      var xBtn = document.createElement(\'button\');
';
                $buffer .= $indent . '      xBtn.id = \'iris-chat-x\';
';
                $buffer .= $indent . '      xBtn.innerHTML = \'✕\';
';
                $buffer .= $indent . '      xBtn.title = \'Cerrar chat\';
';
                $buffer .= $indent . '      xBtn.style.cssText = \'position:absolute;top:10px;right:10px;background:rgba(255,255,255,0.2);color:#fff;border:none;border-radius:50%;width:28px;height:28px;font-size:15px;font-weight:bold;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:10;transition:background 0.2s;\';
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      xBtn.addEventListener(\'mouseenter\', function() { this.style.background = \'rgba(255,255,255,0.4)\'; });
';
                $buffer .= $indent . '      xBtn.addEventListener(\'mouseleave\', function() { this.style.background = \'rgba(255,255,255,0.2)\'; });
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      xBtn.addEventListener(\'click\', function(e) {
';
                $buffer .= $indent . '        e.stopPropagation();
';
                $buffer .= $indent . '        var n8nToggle = document.querySelector(\'.chat-window-toggle\');
';
                $buffer .= $indent . '        if (n8nToggle) n8nToggle.click();
';
                $buffer .= $indent . '      });
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      header.appendChild(xBtn);
';
                $buffer .= $indent . '    }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // Observar para inyectar el botón cuando el chat aparezca
';
                $buffer .= $indent . '    var chatXObs = new MutationObserver(function() {
';
                $buffer .= $indent . '      var chatWin = document.querySelector(\'.chat-window\');
';
                $buffer .= $indent . '      if (chatWin && !chatWin.querySelector(\'#iris-chat-x\')) {
';
                $buffer .= $indent . '        injectChatClose();
';
                $buffer .= $indent . '      }
';
                $buffer .= $indent . '    });
';
                $buffer .= $indent . '    chatXObs.observe(document.body, { childList: true, subtree: true });
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    // 4. Drag & Drop del wrapper
';
                $buffer .= $indent . '    // =========================================
';
                $buffer .= $indent . '    var isDragging = false;
';
                $buffer .= $indent . '    var startX = 0, startY = 0;
';
                $buffer .= $indent . '    var origLeft = 0, origTop = 0;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    function initPosition() {
';
                $buffer .= $indent . '      var rect = wrapper.getBoundingClientRect();
';
                $buffer .= $indent . '      wrapper.style.top    = rect.top + \'px\';
';
                $buffer .= $indent . '      wrapper.style.left   = rect.left + \'px\';
';
                $buffer .= $indent . '      wrapper.style.bottom = \'auto\';
';
                $buffer .= $indent . '      wrapper.style.right  = \'auto\';
';
                $buffer .= $indent . '    }
';
                $buffer .= $indent . '    setTimeout(initPosition, 500);
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    dragBar.addEventListener(\'mousedown\', function(e) {
';
                $buffer .= $indent . '      if (e.target === closeBtn || e.target === openBtn) return;
';
                $buffer .= $indent . '      e.preventDefault();
';
                $buffer .= $indent . '      isDragging = false;
';
                $buffer .= $indent . '      startX = e.clientX;
';
                $buffer .= $indent . '      startY = e.clientY;
';
                $buffer .= $indent . '      var rect = wrapper.getBoundingClientRect();
';
                $buffer .= $indent . '      origLeft = rect.left;
';
                $buffer .= $indent . '      origTop  = rect.top;
';
                $buffer .= $indent . '      dragBar.style.cursor = \'grabbing\';
';
                $buffer .= $indent . '      document.addEventListener(\'mousemove\', onMouseMove);
';
                $buffer .= $indent . '      document.addEventListener(\'mouseup\', onMouseUp);
';
                $buffer .= $indent . '    });
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    function onMouseMove(e) {
';
                $buffer .= $indent . '      e.preventDefault();
';
                $buffer .= $indent . '      var dx = e.clientX - startX;
';
                $buffer .= $indent . '      var dy = e.clientY - startY;
';
                $buffer .= $indent . '      if (Math.abs(dx) > 3 || Math.abs(dy) > 3) isDragging = true;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      var newLeft = origLeft + dx;
';
                $buffer .= $indent . '      var newTop  = origTop + dy;
';
                $buffer .= $indent . '      var w = wrapper.offsetWidth;
';
                $buffer .= $indent . '      var h = wrapper.offsetHeight;
';
                $buffer .= $indent . '      if (newLeft < 0) newLeft = 0;
';
                $buffer .= $indent . '      if (newTop < 0)  newTop = 0;
';
                $buffer .= $indent . '      if (newLeft + w > window.innerWidth)  newLeft = window.innerWidth - w;
';
                $buffer .= $indent . '      if (newTop + h > window.innerHeight)  newTop = window.innerHeight - h;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      wrapper.style.left   = newLeft + \'px\';
';
                $buffer .= $indent . '      wrapper.style.top    = newTop + \'px\';
';
                $buffer .= $indent . '      wrapper.style.bottom = \'auto\';
';
                $buffer .= $indent . '      wrapper.style.right  = \'auto\';
';
                $buffer .= $indent . '    }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    function onMouseUp() {
';
                $buffer .= $indent . '      document.removeEventListener(\'mousemove\', onMouseMove);
';
                $buffer .= $indent . '      document.removeEventListener(\'mouseup\', onMouseUp);
';
                $buffer .= $indent . '      dragBar.style.cursor = \'grab\';
';
                $buffer .= $indent . '      setTimeout(function() { isDragging = false; }, 100);
';
                $buffer .= $indent . '    }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    // Touch events
';
                $buffer .= $indent . '    dragBar.addEventListener(\'touchstart\', function(e) {
';
                $buffer .= $indent . '      if (e.target === closeBtn || e.target === openBtn) return;
';
                $buffer .= $indent . '      var touch = e.touches[0];
';
                $buffer .= $indent . '      isDragging = false;
';
                $buffer .= $indent . '      startX = touch.clientX;
';
                $buffer .= $indent . '      startY = touch.clientY;
';
                $buffer .= $indent . '      var rect = wrapper.getBoundingClientRect();
';
                $buffer .= $indent . '      origLeft = rect.left;
';
                $buffer .= $indent . '      origTop  = rect.top;
';
                $buffer .= $indent . '      document.addEventListener(\'touchmove\', onTouchMove, {passive: false});
';
                $buffer .= $indent . '      document.addEventListener(\'touchend\', onTouchEnd);
';
                $buffer .= $indent . '    }, {passive: false});
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    function onTouchMove(e) {
';
                $buffer .= $indent . '      var touch = e.touches[0];
';
                $buffer .= $indent . '      var dx = touch.clientX - startX;
';
                $buffer .= $indent . '      var dy = touch.clientY - startY;
';
                $buffer .= $indent . '      if (Math.abs(dx) > 3 || Math.abs(dy) > 3) {
';
                $buffer .= $indent . '        isDragging = true;
';
                $buffer .= $indent . '        if (e.cancelable) e.preventDefault();
';
                $buffer .= $indent . '      }
';
                $buffer .= $indent . '      var newLeft = origLeft + dx;
';
                $buffer .= $indent . '      var newTop  = origTop + dy;
';
                $buffer .= $indent . '      var w = wrapper.offsetWidth;
';
                $buffer .= $indent . '      var h = wrapper.offsetHeight;
';
                $buffer .= $indent . '      if (newLeft < 0) newLeft = 0;
';
                $buffer .= $indent . '      if (newTop < 0)  newTop = 0;
';
                $buffer .= $indent . '      if (newLeft + w > window.innerWidth)  newLeft = window.innerWidth - w;
';
                $buffer .= $indent . '      if (newTop + h > window.innerHeight)  newTop = window.innerHeight - h;
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '      wrapper.style.left   = newLeft + \'px\';
';
                $buffer .= $indent . '      wrapper.style.top    = newTop + \'px\';
';
                $buffer .= $indent . '      wrapper.style.bottom = \'auto\';
';
                $buffer .= $indent . '      wrapper.style.right  = \'auto\';
';
                $buffer .= $indent . '    }
';
                $buffer .= $indent . '
';
                $buffer .= $indent . '    function onTouchEnd() {
';
                $buffer .= $indent . '      document.removeEventListener(\'touchmove\', onTouchMove);
';
                $buffer .= $indent . '      document.removeEventListener(\'touchend\', onTouchEnd);
';
                $buffer .= $indent . '      setTimeout(function() { isDragging = false; }, 100);
';
                $buffer .= $indent . '    }
';
                $buffer .= $indent . '  });
';
                $buffer .= $indent . '})();
';
                $buffer .= $indent . '</script>
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionD6941b231183d81625a3128b7ad2db7b(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '
M.util.js_pending(\'theme_boost/loader\');
require([\'theme_boost/loader\', \'theme_boost/drawer\'], function(Loader, Drawer) {
    Drawer.init();
    M.util.js_complete(\'theme_boost/loader\');
});
';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . 'M.util.js_pending(\'theme_boost/loader\');
';
                $buffer .= $indent . 'require([\'theme_boost/loader\', \'theme_boost/drawer\'], function(Loader, Drawer) {
';
                $buffer .= $indent . '    Drawer.init();
';
                $buffer .= $indent . '    M.util.js_complete(\'theme_boost/loader\');
';
                $buffer .= $indent . '});
';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    public function blockEfc32b531594d5d62ec9c68e35a53dc3($context)
    {
        $indent = $buffer = '';
        $buffer .= 'theme_boost-drawers-courseindex';
    
        return $buffer;
    }

    public function blockA515fe1a11236ac39d9f95662b1587b1($context)
    {
        $indent = $buffer = '';
        if ($partial = $this->mustache->loadPartial('theme_boost/courseindexdrawercontrols')) {
            $buffer .= $partial->renderInternal($context, $indent . '                ');
        }
    
        return $buffer;
    }

    public function block0dcbcdb48783bd0043cc25a3ecb99947($context)
    {
        $indent = $buffer = '';
        $buffer .= 'drawer drawer-left ';
        $value = $context->find('courseindexopen');
        $buffer .= $this->section14c724f5a6859d4cc56d9befdffaeac5($context, $indent, $value);
    
        return $buffer;
    }

    public function blockD56da21f9a4b20987f95cec76380b378($context)
    {
        $indent = $buffer = '';
        $buffer .= '                ';
        $value = $this->resolveValue($context->find('courseindex'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
    
        return $buffer;
    }

    public function block24fc4cc7410bc884a3b9fba5f26dc7b9($context)
    {
        $indent = $buffer = '';
        $buffer .= $indent . 'drawer-open-index';
    
        return $buffer;
    }

    public function blockBd5099c9b82bf8a4037bbd56bb374a89($context)
    {
        $indent = $buffer = '';
        $buffer .= 'show-drawer-left';
    
        return $buffer;
    }

    public function block2a81b037a416792e91b78e41049f49f9($context)
    {
        $indent = $buffer = '';
        $buffer .= 'right';
    
        return $buffer;
    }

    public function block9ac4e5859f44816b862545bc2c6e6a46($context)
    {
        $indent = $buffer = '';
        $value = $context->find('str');
        $buffer .= $this->sectionD8c059d8e564034fcd5a4fcfed7ed8eb($context, $indent, $value);
    
        return $buffer;
    }

    public function block4ca482bf2f4c0292197ede951a52b02e($context)
    {
        $indent = $buffer = '';
        $buffer .= 'theme_boost-drawers-blocks';
    
        return $buffer;
    }

    public function block874d06fc7c30c807dc0ee7226cad4ec8($context)
    {
        $indent = $buffer = '';
        $buffer .= 'drawer drawer-right';
        $value = $context->find('blockdraweropen');
        $buffer .= $this->section1cb47d3ed9b97c6d6d496d2358bec253($context, $indent, $value);
    
        return $buffer;
    }

    public function block653705e011aee4da136ef3634b4ebefd($context)
    {
        $indent = $buffer = '';
        $buffer .= '                <div class="d-print-none">
';
        $buffer .= $indent . '                    ';
        $value = $this->resolveValue($context->find('addblockbutton'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '                    ';
        $value = $this->resolveValue($context->find('sidepreblocks'), $context);
        $buffer .= ($value === null ? '' : $value);
        $buffer .= '
';
        $buffer .= $indent . '                </div>
';
    
        return $buffer;
    }

    public function block59146569a56c3d2642fa2e8224817be0($context)
    {
        $indent = $buffer = '';
        $buffer .= $indent . 'drawer-open-block';
    
        return $buffer;
    }

    public function block13847ba3219919ecdb2378620735177c($context)
    {
        $indent = $buffer = '';
        $value = $context->find('forceblockdraweropen');
        $buffer .= $this->section1bd0cc4642e36d67e46c9dd550f1fa06($context, $indent, $value);
    
        return $buffer;
    }

    public function block0ea572ae0e89f9c5cc1dc5d7238a50d5($context)
    {
        $indent = $buffer = '';
        $buffer .= 'show-drawer-right';
    
        return $buffer;
    }

    public function blockC945de95615645c65d6b2f192042e6ea($context)
    {
        $indent = $buffer = '';
        $buffer .= 'left';
    
        return $buffer;
    }

    public function blockE052079a625ca42b568ba24af19cc7eb($context)
    {
        $indent = $buffer = '';
        $buffer .= '1';
    
        return $buffer;
    }

    public function blockC879444321d250421c3438099ae68173($context)
    {
        $indent = $buffer = '';
        $value = $context->find('str');
        $buffer .= $this->section31618380a8d2d407a8b2acf35dd449a4($context, $indent, $value);
    
        return $buffer;
    }
}
