from django import template
from django.utils.safestring import mark_safe

from taxonomy.helpers import sub_industry_map_json

register = template.Library()


@register.simple_tag
def industry_tree_script():
    """<script> tag that exposes the master industry tree to industry-cascade.js."""
    return mark_safe(f'<script>window.PEZA_INDUSTRY_TREE = {sub_industry_map_json()};</script>')
