<div id="TipInfoBox" class="card card-default" data-ng-init="collapsed = true">
  <div class="card-header clearfix" data-ng-click="collapsed = !collapsed; $event.stopPropagation();">
    <span data-translate>Identity</span>
    <span class="float-right">
      <i data-ng-if="!collapsed" class="fa-solid fa-chevron-up" data-uib-tooltip="{{'Collapse' | translate}}"></i>
      <i data-ng-if="collapsed" class="fa-solid fa-chevron-down" data-uib-tooltip="{{'Expand' | translate}}"></i>
    </span>
  </div>
  <div class="card-body" data-ng-show="!collapsed">
    <div data-ng-if="tip.iar && tip.iar.reply !== 'authorized'">
      <div>
        <label data-translate>Access to the whistleblower's identity has been requested to the custodian.</label>
      </div>
      <div>
        <label data-translate>Date of the request</label><span>:</span>
        <span>{{tip.iar.request_date | date:'dd-MM-yyyy HH:mm'}}</span>
      </div>
      <div>
        <label data-translate>Request status</label><span>:</span>
        <span data-ng-switch="tip.iar.reply">
          <span data-ng-switch-when="pending" data-translate>Waiting for authorization</span>
          <span data-ng-switch-when="denied" data-translate>Denied</span>
        </span>
      </div>
      <div data-ng-if="tip.iar && tip.iar.reply == 'denied'"><label data-translate>Reply motivation</label>:<span>{{tip.iar.reply_motivation}}</span></div>
    </div>
    <span data-ng-if="!tip.data.whistleblower_identity_provided">-</span>
    <div data-ng-if="tip.data.whistleblower_identity_provided">
      <div data-ng-if="tip.iar && tip.iar.reply === 'authorized'">
        <div data-ng-repeat="field in whistleblower_identity_field.children | orderBy:['y', 'x']">
          <span data-ng-init="fieldAnswers=tip.data.whistleblower_identity" data-ng-include="'views/partials/tip_field.html'"></span>
        </div>
      </div>
      <div data-ng-if="!tip.iar || tip.iar.reply === 'denied'">
        <button data-ng-if="tip.custodian" class="btn btn-sm btn-primary" data-ng-click="file_identity_access_request()" data-translate>Request access to the whistleblower's identity</button>
        <button data-ng-if="!tip.custodian" class="btn btn-sm btn-primary" data-ng-click="access_identity()" data-translate>Show</button>
      </div>
    </div>
  </div>
</div>
