<div class="content">
    <section class="feat-section major" data-group-id="{{section.id}}">
        <header>
            {{localize "PF2E.Kingmaker.Kingdom.BuildHeader"}}
            <button type="button" data-action="builder">
                <i class="fa-solid fa-fw fa-crown"></i>{{localize "PF2E.Kingmaker.KingdomBuilder.Builder"}}
            </button>
        </header>
        <ol class="feats-list">
            {{#if kingdom.build.charter}}
                {{> kingdomCHG letter="C" item=kingdom.build.charter type="charter"}}
            {{/if}}
            {{#if kingdom.build.heartland}}
                {{> kingdomCHG letter="H" item=kingdom.build.heartland type="heartland"}}
            {{/if}}
            {{#if kingdom.build.government}}
                {{> kingdomCHG letter="G" item=kingdom.build.government type="government"}}
            {{/if}}
        </ol>
    </section>

    {{#each feats as |section|}}
        <section class="feat-section major" data-group-id="{{section.id}}">
            <header>
                {{localize section.label}}
                <div class="controls">
                    {{#if (eq section.id "bonus")}}
                        <button type="button" data-action="create-feat">
                            <i class="fa-solid fa-fw fa-plus"></i>{{localize "PF2E.Actor.Character.CreateFeat"}}
                        </button>
                    {{/if}}
                    {{#if section.featFilter}}
                        <button type="button" data-action="browse-feats">
                            <i class="fa-solid fa-fw fa-search"></i>{{localize "PF2E.BrowseLabel"}}
                        </button>
                    {{/if}}
                </div>
            </header>
            <ol class="feats-list" data-foundry-list>
                {{#each section.feats as |featSlot|}}
                    {{> "systems/pf2e/templates/actors/character/partials/feat-slot.hbs" featSlot=featSlot featFilter=section.featFilter}}
                {{/each}}
            </ol>
        </section>
    {{/each}}
</div>

{{#*inline "kingdomCHG"}}
    <li class="slot expandable" data-item-summary-id="kingdom-{{letter}}">
        <div class="item-name">
            <div class="feat-slot-title">{{letter}}</div>
            <div class="item-image framed">
                <img class="item-icon" src="{{item.img}}" alt="{{item.name}}">
                <i class="fa-solid fa-message"></i>
            </div>
            <h4><a data-action="toggle-summary">{{item.name}}</a></h4>
        </div>
        <div class="item-controls">
            {{#if @root.editable}}
                <a data-action="builder" data-tab="{{type}}" data-tooltip="PF2E.EditItemTitle"><i class="fa-solid fa-fw fa-edit"></i></a>
            {{/if}}
        </div>
        <div class="item-summary" hidden="hidden">
            {{{item.description}}}
            {{> "systems/pf2e/templates/actors/party/kingdom/partials/build-entry-boosts.hbs" buildEntry=item}}
        </div>
    </li>
{{/inline}}
