<div>
  <a
    href="{{ item['linkUrl'] }}"
    ng-class="{'no-link-link' : true }"
    target="_blank"
  >
    <span
      ng-if="item.isFromExtraSource || item.isFromAlephOccrp || item.isFromOpenSanctions || item.isFromOpenCorporates || item.matchItem"
      ng-bind-html="item.titleHtml"
    ></span>

    <span
      ng-if="item.isFromSearchEngine || item.isFromGoogleNewsRss || item.isFromStockMarket"
      ng-bind-html="item.titleHtml"
      tooltip="#tooltipImg"
      data-img="{{ item.wordCloudImgBase64 }}"
      data-img-type="svg"
    ></span>
  </a>

  <div>
    <span
      ng-if="item['language']"
      class="flag-icon"
      ng-class="'flag-icon-' + item['language']"
    ></span>
    {{ item['domain'] }}
  </div>
</div>

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

  <div class="ms-summary" ng-bind-html="item.descriptionHtml"></div>
  <br />
  <br />

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

  <div ng-if="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 mentioned-item"
            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">&nbsp;&nbsp;&nbsp;</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.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 mentioned-item"
            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">&nbsp;&nbsp;&nbsp;</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.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">&nbsp;&nbsp;&nbsp;</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.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 risk-item"
            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 && riskPerson.db_id !== -1"
            ng-click="vm.openListItemModalInfo('google', riskPerson.db_id)"
            title="{{ 'ID: ' + riskPerson.db_id }}"
          >
            <i class="material-icons" style="font-size: 20px">info_outline</i>
          </a>
        </div>
        <span ng-show="!$last">&nbsp;&nbsp;&nbsp;</span>
      </div>
    </div>
  </div>

  <div ng-if="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 risk-item"
            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 && riskOrg.db_id !== -1"
            ng-click="vm.openListItemModalInfo('google', riskOrg.db_id)"
            title="{{ 'ID: ' + riskOrg.db_id }}"
          >
            <i class="material-icons" style="font-size: 20px">info_outline</i>
          </a>
        </div>
        <span ng-show="!$last">&nbsp;&nbsp;&nbsp;</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">&nbsp;&nbsp;&nbsp;</span>
      </div>
    </div>
  </div>
</div>
