import secrets


def spoiler(help_text: str, button_text="🕵️ Show Hint") -> str:
    """
    HTML boilerplate for spoiler element in challenge descriptions.
    """
    div_id = secrets.token_hex(5)
    return f"""
            <div>
            <div id="{div_id}-help" class="d-none">
                <hr/>
                {help_text}
            </div>
            <div id="{div_id}-button" class="btn btn-outline-info btn-sm">{button_text}</div>
            <script>
            document.getElementById("{div_id}-button").addEventListener("click", function(){{
                document.getElementById("{div_id}-button").classList.add("d-none");
                document.getElementById("{div_id}-help").classList.remove("d-none");
            }});
            </script>
            </div>
            """