{% trans_default_domain 'users' %}
<div {{ attributes.defaults(stimulus_controller(this.shortName)) }}>
   <div class="cookiebar-simple" {{ stimulus_target(this.shortName, 'simple') }} aria-hidden="true" style="display: none;">
      <p>
         {{ 'cookie.bar.info'|trans({'%path%': this.getCookiesUrl})|raw }}
      </p>
      <div class="cookiebar-btns cookiebar-btns-simple">
         {% if dbcfg.cookie_bar.show_reject_btn|default('N') == 'Y' %}
            <button type="button" class="btn btn-primary"
                  {{ stimulus_action(this.shortName, 'rejectAll', 'click') }}>
               {{ 'cookie.bar.button.refuse.all'|trans }}
            </button>
         {% endif %}
         <button type="button" class="btn cookiebar-more btn-primary"
                 aria-expanded="true"
                 aria-controls="{{ this.shortName }}-advanced"
                 data-{{ this.shortName }}-preselect-param="{{ dbcfg.cookie_bar.preselect|default('Y') }}"
               {{ stimulus_target(this.shortName, 'showAdvancedButton') }}
               {{ stimulus_action(this.shortName, 'showAdvanced', 'click') }}>
            {{ 'cookie.bar.button.settings'|trans }}
         </button>
         <button type="button" class="btn btn-primary"
               {{ stimulus_action(this.shortName, 'simpleAccept', 'click') }}>
            {{ 'cookie.bar.button.accept.all'|trans }}
         </button>
      </div>
   </div>

   <div id="{{ this.shortName }}-advanced" class="cookiebar-advanced"
        aria-hidden="false"
         {{ stimulus_target(this.shortName, 'advanced') }}>
      <p>{{ 'cookie.bar.adjust.preferences'|trans({'%path%': this.getCookiesUrl})|raw }}</p>

      <div class="consent">
         <strong>{{ 'cookie.bar.necessary'|trans }}</strong>
         <div>
            <p id="{{ this.shortName }}-info-neccessary">{{ 'cookie.bar.necessary.info'|trans }}</p>
            <div class="custom-control custom-toggle">
               <input class="custom-control-input" id="necessary" type="checkbox" checked disabled
                      aria-labelledby="{{ this.shortName }}-info-neccessary">
               <label class="custom-toggle-handle" for="necessary">
                  <span class="sr-only">{{ 'cookie.bar.necessary'|trans }}</span>
               </label>
            </div>
         </div>
      </div>

      <div class="consent">
         <strong>{{ 'cookie.bar.preferred'|trans }}</strong>
         <div>
            <p id="{{ this.shortName }}-info-preferred">{{ 'cookie.bar.preferred.info'|trans }}</p>
            <div class="custom-control custom-toggle">
               <input class="custom-control-input" id="personalization_and_functionality_storage" type="checkbox"
                      value="personalization_and_functionality_storage" name="social-media"
                      aria-labelledby="{{ this.shortName }}-info-preferred"
                     {{ stimulus_target(this.shortName, 'checkbox') }}>
               <label class="custom-toggle-handle" for="personalization_and_functionality_storage">
                  <span class="sr-only">{{ 'cookie.bar.preferred'|trans }}</span>
               </label>
            </div>
         </div>
      </div>

      <div class="consent">
         <strong>{{ 'cookie.bar.statistical'|trans }}</strong>
         <div>
            <p id="{{ this.shortName }}-info-statistical">{{ 'cookie.bar.statistical.info'|trans }}</p>
            <div class="custom-control custom-toggle">
               <input class="custom-control-input" id="analytics_storage" type="checkbox"
                      value="analytics_storage" name="social-media"
                      aria-labelledby="{{ this.shortName }}-info-statistical"
                     {{ stimulus_target(this.shortName, 'checkbox') }}>
               <label class="custom-toggle-handle" for="analytics_storage">
                  <span class="sr-only">{{ 'cookie.bar.statistical'|trans }}</span>
               </label>
            </div>
         </div>
      </div>

      <div class="consent">
         <strong>{{ 'cookie.bar.advertising'|trans }}</strong>
         <div>
            <p id="{{ this.shortName }}-info-advertising">{{ 'cookie.bar.advertising.info'|trans }}</p>
            <div class="custom-control custom-toggle">
               <input class="custom-control-input" id="ad_storage" type="checkbox"
                      value="ad_storage" name="social-media"
                      aria-labelledby="{{ this.shortName }}-info-advertising"
                     {{ stimulus_target(this.shortName, 'checkbox') }}>
               <label class="custom-toggle-handle" for="ad_storage">
                  <span class="sr-only">{{ 'cookie.bar.advertising'|trans }}</span>
               </label>
            </div>
         </div>
      </div>

      <div class="cookiebar-btns cookiebar-btns-advanced">
         <button type="button" class="btn btn-primary"
               {{ stimulus_action(this.shortName, 'rejectAll', 'click') }}>
            {{ 'cookie.bar.button.refuse.all'|trans }}
         </button>
         <button type="button" class="btn btn-primary"
               {{ stimulus_action(this.shortName, 'advancedAccept', 'click') }}>
            {{ 'cookie.bar.button.accept.selected'|trans }}
         </button>
         <button type="button" class="btn btn-primary"
               {{ stimulus_action(this.shortName, 'simpleAccept', 'click') }}>
            {{ 'cookie.bar.button.accept.all'|trans }}
         </button>
      </div>
   </div>

   <twig:block name="content"></twig:block>
</div>
