<div ng-bind-html="item.descriptionHtml"></div>

<div ng-if="item.isOpen">
  <br />
  <br />

  <div ng-show="item.extendedSummaryHtml">
    <div ng-bind-html="item.extendedSummaryHtml"></div>
    <br />
    <br />
  </div>

  <div ng-show="item.analyzeTopic">
    <span
      >{{ item.analyzeTopic}} ({{ item.analyzeTopicProbe | number:2 }})</span
    >
    <br />
    <br />
  </div>

  <div
    ng-if="!item.mentionedItems && item.mentionedPersons"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_CONNECTED_PERSONS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="mentionedPerson in item.mentionedPersons | limitTo: item.topMentionedPersonsCount"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedPerson.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{mentionedPerson.name}}</a
          >
        </div>
        <span ng-show="!$last">,</span>
      </div>
      <span
        ng-hide="!item.mentionedPersons.length || item.topMentionedPersonsCount >= item.mentionedPersons.length"
        ng-click="vm.showMoreMentionedItems($event, item, 'persons')"
        class="show-more"
      >
        ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
      </span>
    </div>
  </div>

  <div
    ng-if="item.mentionedItems && item.mentionedItems.persons && item.mentionedItems.persons.items"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_CONNECTED_PERSONS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="mentionedPerson in item.mentionedItems.persons.items | limitTo: item.mentionedItems.persons.topCnt"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedPerson.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{mentionedPerson.name}}</a
          >
        </div>
        <span ng-show="!$last">,</span>
      </div>
      <span
        ng-hide="!item.mentionedItems.persons.items.length || item.mentionedItems.persons.topCnt >= item.mentionedItems.persons.items.length"
        ng-click="vm.showMoreMentionedItems($event, item, 'persons')"
        class="show-more"
      >
        ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
      </span>
    </div>
  </div>

  <div
    ng-if="!item.mentionedItems && item.mentionedOrgs"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_CONNECTED_ORGS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="mentionedOrg in item.mentionedOrgs | limitTo: item.topMentionedOrgsCount"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedOrg.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{mentionedOrg.name}}</a
          >
        </div>
        <span ng-show="!$last">,</span>
      </div>
      <span
        ng-hide="!item.mentionedOrgs.length || item.topMentionedOrgsCount >= item.mentionedOrgs.length"
        ng-click="vm.showMoreMentionedItems($event, item, 'orgs')"
        class="show-more"
      >
        ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
      </span>
    </div>
  </div>

  <div
    ng-if="item.mentionedItems && item.mentionedItems.orgs && item.mentionedItems.orgs.items"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_CONNECTED_ORGS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="mentionedOrg in item.mentionedItems.orgs.items | limitTo: item.mentionedItems.orgs.topCnt"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedOrg.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{mentionedOrg.name}}</a
          >
        </div>
        <span ng-show="!$last">,</span>
      </div>
      <span
        ng-hide="!item.mentionedItems.orgs.items.length || item.mentionedItems.orgs.topCnt >= item.mentionedItems.orgs.items.length"
        ng-click="vm.showMoreMentionedItems($event, item, 'orgs')"
        class="show-more"
      >
        ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
      </span>
    </div>
  </div>

  <div
    ng-if="!item.mentionedItems && item.mentionedLocs"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_LOCATIONS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="mentionedLoc in item.mentionedLocs | limitTo: item.topMentionedLocsCount"
        style="display: inline"
      >
        <div class="list-item">
          <span class="mentioned-item">{{mentionedLoc.name}}</span>
        </div>
        <!-- <span ng-show="!$last">,</span> -->
      </div>
      <span
        ng-hide="!item.mentionedLocs.length || item.topMentionedLocsCount >= item.mentionedLocs.length"
        ng-click="vm.showMoreMentionedItems($event, item, 'locations')"
        class="show-more"
      >
        ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
      </span>
    </div>
  </div>

  <div
    ng-if="item.mentionedItems && item.mentionedItems.locs && item.mentionedItems.locs.items"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_LOCATIONS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="mentionedLoc in item.mentionedItems.locs.items | limitTo: item.mentionedItems.locs.topCnt"
        style="display: inline"
      >
        <div class="list-item">
          <span class="mentioned-item">{{mentionedLoc.name}}</span>
        </div>
        <!-- <span ng-show="!$last">,</span> -->
      </div>
      <span
        ng-hide="!item.mentionedItems.locs.items.length || item.mentionedItems.locs.topCnt >= item.mentionedItems.locs.items.length"
        ng-click="vm.showMoreMentionedItems($event, item, 'locations')"
        class="show-more"
      >
        ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
      </span>
    </div>
  </div>

  <div
    ng-if="!item.analyzeItems && item.analyzeRiskPersons"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_RISK_PERSONS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="riskPerson in item.analyzeRiskPersons"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', riskPerson.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{riskPerson.name}}</a
          >
          <a
            class="no-link-link"
            ng-if="riskPerson.db_id && (Array.isArray(riskPerson.db_id) ? riskPerson.db_id.length : riskPerson.db_id !== -1)"
            ng-click="vm.openListItemModalInfo('google', riskPerson.db_id)"
            title="{{ 'ID: ' + (Array.isArray(riskPerson.db_id) ? riskPerson.db_id.join(', ') : riskPerson.db_id) }}"
          >
            <i class="material-icons" style="font-size: 20px">info_outline</i>
          </a>
        </div>
        <span ng-show="!$last">,</span>
      </div>
    </div>
  </div>

  <div
    ng-if="item.analyzeItems && item.analyzeItems.riskPersons"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_RISK_PERSONS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="riskPerson in item.analyzeItems.riskPersons"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', riskPerson.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{riskPerson.name}}</a
          >
          <a
            class="no-link-link"
            ng-if="riskPerson.db_id && (Array.isArray(riskPerson.db_id) ? riskPerson.db_id.length : riskPerson.db_id !== -1)"
            ng-click="vm.openListItemModalInfo('google', riskPerson.db_id)"
            title="{{ 'ID: ' + (Array.isArray(riskPerson.db_id) ? riskPerson.db_id.join(', ') : riskPerson.db_id) }}"
          >
            <i class="material-icons" style="font-size: 20px">info_outline</i>
          </a>
        </div>
        <span ng-show="!$last">,</span>
      </div>
    </div>
  </div>

  <div
    ng-if="!item.analyzeItems && item.analyzeRiskOrgs"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_RISK_ORGS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div ng-repeat="riskOrg in item.analyzeRiskOrgs" style="display: inline">
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', riskOrg.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{riskOrg.name}}</a
          >
          <a
            class="no-link-link"
            ng-if="riskOrg.db_id && (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.length : riskOrg.db_id !== -1)"
            ng-click="vm.openListItemModalInfo('google', riskOrg.db_id)"
            title="{{ 'ID: ' + (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.join(', ') : riskOrg.db_id) }}"
          >
            <i class="material-icons" style="font-size: 20px">info_outline</i>
          </a>
        </div>
        <span ng-show="!$last">,</span>
      </div>
    </div>
  </div>

  <div
    ng-if="item.analyzeItems && item.analyzeItems.riskOrgs"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_RISK_ORGS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="riskOrg in item.analyzeItems.riskOrgs"
        style="display: inline"
      >
        <div class="list-item">
          <a
            class="no-link-link"
            ng-click="vm.openNamecheckMediaSearchTabs('google', riskOrg.name, item.itemInfo && item.itemInfo.itemId ? item.itemInfo.itemId : '', item.personInfo && item.personInfo.personId ? item.personInfo.personId : '', item.id)"
            >{{riskOrg.name}}</a
          >
          <a
            class="no-link-link"
            ng-if="riskOrg.db_id && (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.length : riskOrg.db_id !== -1)"
            ng-click="vm.openListItemModalInfo('google', riskOrg.db_id)"
            title="{{ 'ID: ' + (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.join(', ') : riskOrg.db_id) }}"
          >
            <i class="material-icons" style="font-size: 20px">info_outline</i>
          </a>
        </div>
        <span ng-show="!$last">,</span>
      </div>
    </div>
  </div>

  <!-- <div ng-if="item.analyzeNgrams" class="items-container">
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_NGRAMS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div ng-repeat="ngramObj in item.analyzeNgrams" style="display: inline">
        <div class="list-item">
          <span class="keyword">{{ngramObj.ngram}}</span>
        </div>
        <span ng-show="!$last">,</span>
      </div>
    </div>
  </div> -->

  <div
    ng-if="!item.analyzeItems && item.analyzeKeywords"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_NGRAMS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div ng-repeat="keyword in item.analyzeKeywords" style="display: inline">
        <div class="list-item">
          <span class="keyword">{{keyword}}</span>
        </div>
        <!-- <span ng-show="!$last">,</span> -->
      </div>
    </div>
  </div>

  <div
    ng-if="item.analyzeItems && item.analyzeItems.keywords"
    class="items-container"
  >
    <div class="item-label">
      <label>{{ 'MEDIA_SEARCH_NGRAMS' | translate }}:</label>
    </div>
    <div class="list-items-container">
      <div
        ng-repeat="keyword in item.analyzeItems.keywords"
        style="display: inline"
      >
        <div class="list-item">
          <span class="keyword">{{keyword}}</span>
        </div>
        <!-- <span ng-show="!$last">,</span> -->
      </div>
    </div>
  </div>
</div>
