public static function options($options, $selected = []): string
    {
        $html     = '';
        $selected = array_flip($selected);

        foreach ($options as $value => $name) {
            $html .= is_array($name)
                ? self::tag('optgroup', ['label' => $value], self::options($name, $selected))
                : self::tag('option', ['value' => $value] + (isset($selected[$value]) ? ['selected' => 'selected'] : []), $name);
        }

        return $html;
    }