<div class="correlation__row">
    <div class="correlation__key">
        {$base_params['description']}<span class="help_bt" h_id="{$base_params['help']}"></span>:
    </div>
    <div style="text-align: left; padding: 3px; display: flex; flex-direction: row; align-items: center; gap: 10px;">
        <select class="form-control form-control-200 dont_use_chosen" name="calc_params[{$tpl_num}][{$base_params['name']}]">
            {foreach from=$type_params['values'] key=calc_id item=calc}
                <option value="{$calc_id}" {if $calc_id == $base_params['set_params']}selected{/if} link="{$calc.link}">
                    {$calc.name}
                </option>
            {/foreach}
        </select>
        <div class="iconDiv"></div>
    </div>
</div>

<script>
document.querySelectorAll('.iconDiv').forEach(div => {
    div.addEventListener('click', () => {
        const select = div.previousElementSibling;
        const selectedOption = select.options[select.selectedIndex];
        const link = selectedOption.getAttribute('link');
        if (link) {
            window.open(link, '_blank');
        }
    });
});
</script>
