{{#*inline "type-entry"}}
<div class="type-entry">
    <label>
        <dnd5e-checkbox value="{{ @key }}" data-action="setType" {{ checked chosen }}
                        {{ disabled @root.isLocked.types }}></dnd5e-checkbox>
        <span>{{ localize label }}</span>
    </label>
</div>
{{/inline}}

<div class="flexcol" {{#unless showTypes}}hidden{{/unless}}>
    {{#each types}}
    {{#if children}}
    <div class="type-group collapsible">
        <div class="type-group-header">
            <label>
                <dnd5e-checkbox data-action="setType" {{ checked chosen }}
                                {{ disabled @root.isLocked.types }}></dnd5e-checkbox>
                <span>{{ localize label }}</span>
            </label>
            <div data-action="toggleCollapse"><i class="fa-solid fa-caret-down"></i></div>
        </div>
        <div class="collapsible-content">
            <div class="wrapper">
                {{#each children}}
                {{> "type-entry" }}
                {{/each}}
            </div>
        </div>
    </div>
    {{else}}
    {{> "type-entry" }}
    {{/if}}
    {{/each}}
</div>
