import{a as le}from"./chunk-PMJFQIXL.js";import"./chunk-MNVOJIXC.js";import{a as ie}from"./chunk-H6QPU4XN.js";import{a as te}from"./chunk-IMWNGRKR.js";import"./chunk-5WJM4RWS.js";import"./chunk-UZB7YFT6.js";import{a as ae}from"./chunk-JUDWAYYT.js";import{a as de}from"./chunk-5OT2MLHH.js";import{a as oe}from"./chunk-4IRXRL4C.js";import"./chunk-LAJI7RPC.js";import{a as ee}from"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{a as ce}from"./chunk-4MZCYQX4.js";import{b as re,c as ne,d as se}from"./chunk-YOJ4KGSB.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import{a as Q}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{J as H,Kb as X,Ob as K,Rb as Z,a as Se,c as t,d as z,l as P,o as L,s as N,v as M,wb as $,y as U}from"./chunk-YSQLW2JA.js";import{F,I as j,J as V,id as W}from"./chunk-NVJ2ZZFT.js";import{Dc as i,Fb as T,Hb as v,Ig as G,Mg as B,Nc as C,Ng as g,Pd as y,Qf as A,Tb as p,Te as _,Wb as c,Yg as Y,ab as b,af as D,bb as x,bh as q,cd as O,dd as I,eh as J,fb as R,g as ue,gg as m,hd as s,hg as k,jb as E,jg as w,wa as h,ya as S}from"./chunk-SKPDQO4E.js";var pe=`<div class="h-100">
  <side-navigation #sideNavigation *ngIf="visibleComponent">
    <ng-template side-navigation-nav>
      <div>
        <div class="row">
          <div class="col-12">
            <label class="report-form-label">{{'REPORT.STATUS' | translate}}</label>
            <nz-select class="w-100" [(ngModel)]="filter.accessResult" nzSize="small">
              <nz-option *ngFor="let option of accessResultTypes" [nzValue]="option.type" [nzLabel]="option.description |
                  translate"></nz-option>
            </nz-select>
          </div>
          <div class="col-12">
            <label class="report-form-label">{{'REPORT.DIRECTION' | translate}}</label>
            <nz-select class="w-100" [(ngModel)]="filter.direction" nzSize="small">
              <nz-option *ngFor="let option of directionTypes" [nzValue]="option.type" [nzLabel]="option.description |
                  translate"></nz-option>
            </nz-select>
          </div>
          <div class="col-12" *ngIf="permissionSearchIdentity && permissionReportDetailed">
            <label class="report-form-label">{{'REPORT.IDENTITIES' | translate : languageService.userTranslate}}</label>
            <armon-select-search query="identity" [allowMulti]="true" [(ngModel)]="filter.userIds">
            </armon-select-search>
          </div>
          <div class="col-12" *ngIf="permissionSearchOrganizationUnit && permissionReportDetailed">
            <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
            <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="filter.organizationUnitIds">
            </armon-select-search>
            <label class="report-checkbox-label" nz-checkbox
              *ngIf="filter.organizationUnitIds && filter.organizationUnitIds.length > 0"
              [(ngModel)]="filter.filterOrganizationUnitMembersHierarchically">{{'REPORT.SHOW_HIERARCHICALLY' |
              translate}}</label>
          </div>
          <div class="col-12" *ngIf="permissionSearchUserGroup && permissionReportDetailed">
            <label class="report-form-label">{{'REPORT.USER_GROUPS' | translate :
              languageService.userTranslate}}</label>
            <armon-select-search query="group" [allowMulti]="true" [(ngModel)]="filter.userGroupIds">
            </armon-select-search>
          </div>
          <div class="col-12">
            <label class="report-form-label">{{'CREDENTIAL.TITLE_TYPE' | translate}}</label>
            <nz-select class="w-100" [(ngModel)]="filter.credentialTypes" nzSize="small" nzMode="multiple">
              <nz-option *ngFor="let credentialType of credentialTypes" [nzValue]="credentialType.type" [nzLabel]="credentialType.description |
                  translate"></nz-option>
            </nz-select>
          </div>
          <div class="col-12">
            <label class="report-form-label">{{'REPORT.REGIONS' | translate}}</label>
            <armon-select-search query="region" [allowMulti]="true" [(ngModel)]="filter.regionIds">
            </armon-select-search>
          </div>
          <div class="col-12">
            <label class="report-form-label">{{'REPORT.ACCESS_CONTROL_POINTS' | translate}}</label>
            <armon-select-search query="point" [allowMulti]="true" [(ngModel)]="filter.accessControlPointIds">
            </armon-select-search>
          </div>
          <div class="col-12">
            <label class="report-form-label">{{'REPORT.ACCESS_REASONS' | translate}}</label>
            <armon-select-search query="reason" [allowMulti]="true" [(ngModel)]="filter.reasons">
            </armon-select-search>
          </div>
          <div class="col-12" *ngIf="permissionSearchIdentity && permissionReportDetailed">
            <label class="report-form-label">{{'IDENTITY.TITLE_CREDENTIAL' | translate}}</label>
            <armon-search-text-input [(ngModel)]="filter.credentialData" [minLength]="3" placeholder="COMMON.SEARCH">
            </armon-search-text-input>
          </div>
          <div class="col-12 mb-3" *ngIf="permissionSearchIdentity && permissionReportDetailed">
            <label class="report-form-label">{{'REPORT.MANUAL_RECORD_CREATOR' | translate :
              languageService.userTranslate}}</label>
            <armon-select-search query="identity" [allowMulti]="false" [allowClear]="true"
              [(ngModel)]="filter.manualRecordCreatorUserId">
            </armon-select-search>
          </div>
          <div class="col-12" *ngIf="permissionReportDetailed">
            <label class="report-checkbox-label" nz-checkbox
              [(ngModel)]="filter.showOnlyVisitors">{{'REPORT.ACCESS_LOGS_ONLY_VISITORS' | translate}}</label>
          </div>
          <div class="col-12" *ngIf="permissionReportDetailed">
            <label class="report-checkbox-label" nz-checkbox
              [(ngModel)]="filter.showOnlyExitButtons">{{'REPORT.ACCESS_LOGS_ONLY_EXIT_BUTTONS' | translate}}</label>
          </div>
          <div class="col-12">
            <label class="report-checkbox-label" nz-checkbox
              [(ngModel)]="filter.showOnlyRemoteAccess">{{'REPORT.ACCESS_LOGS_ONLY_REMOTE_ACCESS' | translate}}</label>
          </div>
          <div class="col-12">
            <label class="report-checkbox-label" nz-checkbox
              [(ngModel)]="filter.showOnlyManuallyInserted">{{'REPORT.ACCESS_LOGS_ONLY_MANUALLY_INSERTED' |
              translate}}</label>
          </div>
        </div>

        <!-- Buttons for filtering state -->
        <div class="centered filterButtons">
          <button nz-dropdown [nzDropdownMenu]="menuPrint" class="btn btn-success btn-sm me-2"
            *ngIf="permissionReportDetailed">
            {{'BUTTON.DOWNLOAD' | translate}}
            <cds-icon shape="angle" direction="down"></cds-icon>
          </button>
          <nz-dropdown-menu #menuPrint="nzDropdownMenu">
            <ul nz-menu>
              <li nz-menu-item (click)="onGetExcelClicked($event)">{{'BUTTON.EXCEL'|translate}}</li>
              <li nz-menu-item (click)="onGetPDFClicked($event)">{{'BUTTON.PDF'|translate}}</li>
            </ul>
          </nz-dropdown-menu>
          <button class="btn btn-primary btn-sm" (click)="onGetReportClicked($event)">{{'REPORT.GET_REPORT' |
            translate}}</button>
        </div>

      </div>
    </ng-template>
    <ng-template side-navigation-content>
      <div class="report-data-container">
        <div class="row report-filter-container">
          <div class="col-12" style="min-height:0;">
            <armon-report-template-panel [reportType]="reportTemplateType" *ngIf="permissionReportDetailed"
              [templateId]="reportTemplateId" class="d-none d-md-block" [filter]="filter"
              (templateLoaded)="onTemplateLoaded($event)">
            </armon-report-template-panel>
            <div class="row">
              <div class="col-12">
                <armon-date-picker #datePicker [options]="datePickerOptions"
                  (selectionChanged)="onDateSelectionChanged($event)">
                </armon-date-picker>
              </div>
            </div>
          </div>
        </div>
        <div class="row pt-5" *ngIf="records && records.length==0">
          <div class="col-12">
            <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
              <ng-template #contentTpl>
                <span>{{'ACCESS_LOG.REPORT_NO_RECORD'|translate:lastDatePickerData}}</span>
              </ng-template>
            </nz-empty>
          </div>
        </div>
        <div class="row report-data-table-container" id="report-data-table-container"
          *ngIf="records && records.length>0">
          <div class="col-12">
            <p-table [value]="records" dataKey="id" [responsive]="true" rowExpandMode="single">
              <ng-template pTemplate="header">
                <tr>
                  <th>{{'REPORT.ACCESS_LOGS_HEADER_FULLNAME' | translate}}</th>
                  <th>{{'REPORT.ACCESS_LOGS_HEADER_ACCESS_TIME' | translate}}</th>
                  <th>{{'REPORT.ACCESS_LOGS_HEADER_ACCESS_POINT' | translate}}</th>
                  <th>{{'REPORT.ACCESS_LOGS_HEADER_STATUS' | translate}}</th>
                </tr>
              </ng-template>
              <ng-template pTemplate="body" let-record let-rowData let-expanded="expanded">
                <tr [pRowToggler]="rowData" [attr.expanded]="expanded" class="data-row">
                  <td>
                    <div class="identity-cell">
                      <span class="main-text"
                        *ngIf="record.identity && !record.userCaptions">{{record.identity.fullName}}</span>
                      <span class="sub-text">{{((record.identity && !record.userCaptions) ?
                        record.identity.organizationUnitNames : '')}}</span>
                      <span class="main-text ms-2"
                        *ngIf="!record.identity && record.isExitButton">{{'REPORT.ACCESS_LOGS_USER_EXIT_BUTTON'|translate}}</span>
                      <span *ngIf="!record.identity && !record.isExitButton" class="main-text ms-2">
                        {{'REPORT.ACCESS_LOGS_UNKNOWN_USER'|translate}}
                        <cds-icon shape="warning-standard" class="color-error" style="width: 12px; height: 12px;">
                        </cds-icon>
                      </span>
                      <span class="sub-text ms-2"
                        *ngIf="!record.identity && !record.isExitButton && record.unknownCredentialData">
                        {{record.unknownCredentialData}}
                      </span>
                      <armon-captionlines *ngIf="record.userCaptions" [showBorder]="false"
                        [isVisitor]="record.isVisitor" [captionlines]="record.userCaptions"></armon-captionlines>
                    </div>
                  </td>
                  <td>
                    <div class="report-multi-data-cell">
                      <span class="title-text fw-medium">{{record.utcHourText}}<armon-local-date [dateUtc]="record.utc">
                        </armon-local-date></span>
                      <span class="sub-text">{{record.utcText}}</span>
                    </div>
                  </td>
                  <td>
                    <div class="d-flex">
                      <div *ngIf="record.mobileAuthenticated" class="d-flex align-items-center me-2 pe-1 b-r-1">
                        <cds-icon shape="mobile_authenticated" style="width: 28px; height: 28px;" nz-tooltip
                          nzTooltipTitle="{{'REPORT.ACCESS_LOGS_MOBILE_AUTHENTICATED'|translate}}"
                          class="color-success"></cds-icon>
                      </div>
                      <div class="d-flex flex-column flex-grow-1">
                        <div>
                          {{(record.accessControlPoint ? record.accessControlPoint.name : '')}}
                        </div>
                        <div class="sensor-info-container"
                          *ngIf="permissionReportDetailed && record.hasSnapshot && record.hasReportSnapshot">
                          <cds-icon shape="camera" size="sm" class="me-2"></cds-icon>
                          <span>{{'CAMERA.LOG_SNAPSHOT'|translate}}</span>
                        </div>
                        <div class="sensor-info-failed-container"
                          *ngIf="permissionReportDetailed && record.hasSnapshot && !record.hasReportSnapshot">
                          <cds-icon shape="error-standard" size="sm" class="me-2"></cds-icon>
                          <span>{{'CAMERA.NO_LOG_SNAPSHOT'|translate}}</span>
                        </div>
                        <div class="sensor-info-container" *ngIf="record.hasCounterSensorData">
                          <cds-icon shape="status-sensor" size="sm" class="me-2"></cds-icon>
                          <span>{{'REPORT.ACCESS_LOGS_HAS_COUNTER_SENSOR_DATA'|translate}}</span>
                        </div>
                        <div class="sensor-info-container" *ngIf="record.hasStatusSensorData">
                          <cds-icon shape="status-sensor" size="sm" class="me-2"></cds-icon>
                          <span>{{'REPORT.ACCESS_LOGS_HAS_STATUS_SENSOR_DATA'|translate}}</span>
                        </div>
                      </div>
                    </div>
                  </td>
                  <td>
                    <span class="d-flex resultItemStatus">
                      <div [ngStyle]="{background: record.statusColor}"></div>
                      <cds-icon nz-tooltip
                        nzTooltipTitle="{{record.statusDescription | translate:record.statusDescriptionData}}"
                        [attr.shape]="record.directionIcon" size="sm"></cds-icon>
                      <cds-icon nz-tooltip nzTooltipTitle="{{'REPORT.ACCESS_LOGS_BY_VISITOR' | translate}}"
                        shape="id-badge" size="sm" *ngIf="record.isVisitor"></cds-icon>
                      <cds-icon nz-tooltip nzTooltipTitle="{{'REPORT.ACCESS_LOGS_REMOTE_ACCESS' | translate}}"
                        shape="open-remotely" size="sm" *ngIf="record.isRemoteAccess"></cds-icon>
                      <cds-icon nz-tooltip nzTooltipTitle="{{'REPORT.ACCESS_LOGS_MANUAL' | translate}}" shape="note"
                        size="sm" *ngIf="record.isManuallyLogged"></cds-icon>
                      <cds-icon nz-tooltip nzTooltipTitle="{{'REPORT.ACCESS_LOGS_EXIT_BUTTON' | translate}}"
                        shape="cursor-hand-click" size="sm" *ngIf="record.isExitButton"></cds-icon>
                      <span class="mx-2">{{record.statusInfo | translate}}</span>
                    </span>
                    <armon-credential-tags *ngIf="record.credentials && record.credentials.length>0"
                      [credentials]="record.credentials"></armon-credential-tags>
                  </td>
                </tr>
              </ng-template>
              <ng-template pTemplate="rowexpansion" let-record>
                <tr>
                  <td [attr.colspan]="4" class="expanded-row">
                    <div class="detail-row-container py-2 text-sm">
                      <div>
                        <cds-icon [attr.shape]="record.directionIcon" class="me-1"></cds-icon>
                        <span>{{record.statusDescription | translate:record.statusDescriptionData}}</span>
                      </div>
                      <div *ngIf="record.isVisitor">
                        <cds-icon shape="id-badge" class="me-1"></cds-icon>
                        {{'REPORT.ACCESS_LOGS_BY_VISITOR' | translate}}
                      </div>
                      <div *ngIf="record.isRemoteAccess">
                        <cds-icon shape="open-remotely" class="me-1"></cds-icon>
                        {{'REPORT.ACCESS_LOGS_REMOTE_ACCESS' | translate}}
                      </div>
                      <div *ngIf="record.mobileAuthenticated">
                        <cds-icon shape="mobile_authenticated" class="me-1"></cds-icon>
                        {{'REPORT.ACCESS_LOGS_MOBILE_AUTHENTICATED' | translate}}
                      </div>
                      <div *ngIf="record.isManuallyLogged" class="d-flex flex-column mt-3">
                        <div class="d-flex align-items-center">
                          <cds-icon shape="note" class="me-1"></cds-icon>
                          <span>{{'REPORT.ACCESS_LOGS_MANUAL' | translate}}</span>
                          <span *ngIf="record.insertionDate" class="ms-2">({{record.insertionDate |
                            date:'short'}})</span>
                          <button class="btn btn-sm btn-outline-danger ms-2"
                            (click)="onDeleteManulRecordClicked(record)" *ngIf="visibleDeleteManualRecord">
                            <cds-icon shape="exclamation-triangle" solid class="cds-icon-18 me-1"></cds-icon>
                            {{'REPORT.ACCESS_LOGS_DELETE_MANUAL'
                            | translate}}
                          </button>
                        </div>
                        <div *ngIf="record.manualRecordCreatorCaptions" class="d-flex flex-column ps-2">
                          <span class="text-sm mt-3 mb-2">{{'REPORT.MANUAL_RECORD_CREATOR' | translate :
                            languageService.userTranslate}}</span>
                          <armon-captionlines [showBorder]="false" [captionlines]="record.manualRecordCreatorCaptions">
                          </armon-captionlines>
                        </div>
                      </div>
                      <div *ngIf="record.isExitButton">
                        <cds-icon shape="cursor-hand-click" class="me-1"></cds-icon>
                        {{'REPORT.ACCESS_LOGS_EXIT_BUTTON' | translate}}
                      </div>

                      <ng-container *ngIf="record.hasCounterSensorData">
                        <ng-container *ngFor="let sensorData of record.counterSensorData">
                          <span>
                            <cds-icon shape="status-sensor" size="sm" class="me-2"></cds-icon>
                            <span>{{'REPORT.ACCESS_LOGS_COUNTER_SENSOR_INFO'|translate:sensorData}} -
                              {{sensorData.reasonText|translate}}</span>
                          </span>
                        </ng-container>
                      </ng-container>


                      <ng-container *ngIf="record.hasStatusSensorData">
                        <ng-container *ngFor="let sensorData of record.statusSensorData">
                          <span>
                            <cds-icon shape="status-sensor" size="sm" class="me-2"></cds-icon>
                            <span>{{'REPORT.ACCESS_LOGS_STATUS_SENSOR_INFO'|translate:sensorData}} -
                              {{sensorData.reasonText|translate}}</span>
                          </span>
                        </ng-container>
                      </ng-container>

                      <div class="d-flex my-2">
                        <ng-container *ngIf="permissionReportDetailed && record.snapshots && record.snapshots.length>0">
                          <armon-camera-snapshot-gallery [snapshots]="record.snapshots" class="me-2">
                          </armon-camera-snapshot-gallery>
                        </ng-container>
                        <ng-container *ngIf="record.location && record.location.isValid">
                          <div class="p-2 me-2">
                            <armon-map-open-layers [location]="record.location"></armon-map-open-layers>
                          </div>
                        </ng-container>
                      </div>

                    </div>
                  </td>
                </tr>
              </ng-template>
            </p-table>
          </div>
          <div class="col-12 my-3">
            <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="'report-data-table-container'"
              (pageChanged)="pageChanged($event)"></armon-pagination>
          </div>
        </div>
      </div>
    </ng-template>
  </side-navigation>
</div>`;var me=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}.filterArea{background:#fff;border:1px solid rgb(235,235,235);padding:12px;border-radius:4px;box-shadow:0 3px 6px #ebebeb;-moz-transition:width .25s ease;-webkit-transition:width .25s ease;-o-transition:width .25s ease;transition:width .25s ease}.filterArea>div:first-child>p:first-child{margin-top:0}.filterSummary>p:first-child{margin-top:0}.filterContent>div{margin-bottom:12px}.filterContent clr-checkbox{margin-top:12px}.filterButtons{margin-top:12px}.filterSmallButtons>button:last-child{margin-right:0!important}.filterMoreInfo p{margin-top:0}.filterMoreInfo div{margin-bottom:8px}.filterMoreInfo div:last-child{margin-bottom:0}.resultArea{position:relative}.resultDisabled{position:absolute;width:100%;height:100%;background:linear-gradient(to top,#f3f4f6,transparent 150%)}.required:after{content:"*";font-size:1.1em;color:#c92100;margin-left:6px}.report-data-container{height:100%;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.report-data-container .report-filter-container{margin-bottom:.2rem}.report-data-container .report-data-table-container{overflow-y:auto;overflow-x:hidden;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:0;display:block}.report-multi-data-cell{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;line-height:initial!important}.report-multi-data-cell .title-text{font-size:1.008rem}.report-multi-data-cell .main-text{font-size:.84rem}.report-multi-data-cell .sub-text{font-size:.672rem;color:#aaa}.report-form-label{font-size:.672rem;line-height:.84rem;font-weight:500;margin-top:.3rem;margin-bottom:.1rem!important}.report-form-label label{margin-bottom:0!important}.report-form-icon{position:absolute;color:#0a2a5a;right:15px;bottom:6px;cursor:pointer}.report-checkbox-label{font-size:.672rem}:host .identity-cell{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .identity-cell .main-text{font-size:.714rem}:host .identity-cell .sub-text{font-size:.588rem;color:#aaa}.resultItemStatus{align-items:center}.resultItemStatus>div{height:10px;width:10px;border-radius:50%;margin-right:4px}.resultItemIcons{padding-left:.3rem}.resultItemIcons>cds-icon{margin:0 6px}.sensor-info-container,.sensor-info-failed-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;-moz-align-items:flex-end;align-items:flex-end;padding-top:3px}.sensor-info-container span,.sensor-info-failed-container span{font-size:.588rem;line-height:.5rem}.sensor-info-failed-container{color:#c82602}.detail-row-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.detail-row-container .snapshot-detail-container{margin-top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.detail-row-container .snapshot-detail-container .snapshot-detail-item{margin-right:6px}.detail-row-container .snapshot-detail-container .snapshot-detail-item img{height:120px;width:auto}.detail-row-container .snapshot-detail-container .snapshot-detail-item .base-no-image,.detail-row-container .snapshot-detail-container .snapshot-detail-item .no-image[status="2"],.detail-row-container .snapshot-detail-container .snapshot-detail-item .no-image[status="0"]{height:120px;width:160px;background-color:#000;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;padding:12px}.detail-row-container .snapshot-detail-container .snapshot-detail-item .base-no-image span,.detail-row-container .snapshot-detail-container .snapshot-detail-item .no-image[status="2"] span,.detail-row-container .snapshot-detail-container .snapshot-detail-item .no-image[status="0"] span{margin-top:6px;text-align:center;font-size:.588rem;line-height:.55rem}.detail-row-container .snapshot-detail-container .snapshot-detail-item .no-image[status="0"]{color:#42bafb}.detail-row-container .snapshot-detail-container .snapshot-detail-item .no-image[status="2"]{color:#fd8166}
`;var u=ue(Se());var Re=function(f,e,o,r){var a=arguments.length,n=a<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,o):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(f,e,o,r);else for(var d=f.length-1;d>=0;d--)(l=f[d])&&(n=(a<3?l(n):a>3?l(e,o,n):l(e,o))||n);return a>3&&n&&Object.defineProperty(e,o,n),n},fe=class{interactionService;reportService;accessControlPointService;authService;translate;sessionService;languageService;router;route;filter;lastResult;records=[];credentialTypes;permissionSearchUserGroup;permissionSearchIdentity;permissionSearchOrganizationUnit;permissionSearchRegion;permissionReportDetailed;visibleDeleteManualRecord=!1;reportTemplateType=z.AccessLogs;reportTemplateId;paginationResponse=new g;paginationRequest=new B;datePickerOptions=new k;visibleComponent=!1;datePicker;sideNavigation;routerState;constructor(e,o,r,a,n,l,d,he,ge){this.interactionService=e,this.reportService=o,this.accessControlPointService=r,this.authService=a,this.translate=n,this.sessionService=l,this.languageService=d,this.router=he,this.route=ge,this.visibleDeleteManualRecord=this.authService.checkPermission(s.ACCESSLOG.getDeleteManualLog()),this.routerState=this.router.getCurrentNavigation().extras.state,this.initializeSubscriptions()}get directionTypes(){return j}get accessResultTypes(){return F}ngOnInit(){this.checkPermissions();let e=[];this.sessionService.currentOrganizationCredentialTypes.forEach(o=>{e.push(G.find(r=>r.type==o))}),this.credentialTypes=e,this.datePickerOptions.items=[{type:m.Today,selected:!0,currentTimeForEnd:!0},{type:m.Yesterday},{type:m.SelectDay},{type:m.CustomWithTimer}],this.createFilter(),this.visibleComponent=!0}ngAfterViewInit(){this.route.queryParams.subscribe(e=>{e&&(e[t.OrganizationUnitId]&&e[t.OrganizationUnitId]!=""?this.filter.organizationUnitIds=[e[t.OrganizationUnitId]]:!c(this.routerState?.organizationUnitIds)&&!p(this.routerState?.organizationUnitIds)&&(this.filter.organizationUnitIds=this.routerState.organizationUnitIds),e[t.AccessControlPointId]&&e[t.AccessControlPointId]!=""?this.filter.accessControlPointIds=[e[t.AccessControlPointId]]:!c(this.routerState?.accessControlPointIds)&&!p(this.routerState?.accessControlPointIds)&&(this.filter.accessControlPointIds=this.routerState.accessControlPointIds),e[t.UserGroupId]&&e[t.UserGroupId]!=""?this.filter.userGroupIds=[e[t.UserGroupId]]:!c(this.routerState?.userGroupIds)&&!p(this.routerState?.userGroupIds)&&(this.filter.userGroupIds=this.routerState.userGroupIds),e[t.RegionId]&&e[t.RegionId]!=""?this.filter.regionIds=[e[t.RegionId]]:!c(this.routerState?.regionIds)&&!p(this.routerState?.regionIds)&&(this.filter.regionIds=this.routerState.regionIds),e[t.organizationUnitHierarchically]&&e[t.organizationUnitHierarchically]!=""?this.filter.filterOrganizationUnitMembersHierarchically=e[t.organizationUnitHierarchically]=="true":c(this.routerState?.organizationUnitHierarchically)||(this.filter.filterOrganizationUnitMembersHierarchically=this.routerState.organizationUnitHierarchically),e[t.UserId]&&e[t.UserId]!=""&&(this.filter.userIds=[e[t.UserId]]),e[t.ReportTemplateId]&&e[t.ReportTemplateId]!=""&&(this.reportTemplateId=e[t.ReportTemplateId]),e[t.StartDate]&&e[t.EndDate]&&e[t.StartDate]!==""&&e[t.EndDate]!==""&&this.setDateSelection(this.datePicker.setPickerItemAndDate(3,[i.fromISO(e[t.StartDate]).toJSDate(),i.fromISO(e[t.EndDate]).toJSDate()]))),this.reportTemplateId||this.fetchReportData()})}ngOnDestroy(){}createFilter(){this.permissionReportDetailed?this.filter=V.getEmptyModel():this.filter=W.getEmptyModel(),this.setDateSelection(this._lastDatePickerSelection?this._lastDatePickerSelection:w.getDateSelection(this.datePickerOptions.items[0]))}_lastDatePickerSelection;lastDatePickerData;setDateSelection(e){this.filter.startUtc=e.startDate,this.filter.endUtc=e.endDate,this.lastDatePickerData={dateRange:i.fromJSDate(this.filter.startUtc).toLocaleString(i.DATETIME_MED_WITH_SECONDS)+" - "+i.fromJSDate(this.filter.endUtc).toLocaleString(i.DATETIME_MED_WITH_SECONDS)},this._lastDatePickerSelection=e}onGetReportClicked(e){this.sideNavigation&&this.sideNavigation.hideLeftClicked(),this.filter.skip=0,this.fetchReportData()}onGetExcelClicked(e){this.reportService.exportAccessLogsAsExcel(this.filter).subscribe(o=>{this.translate.get(["PAGES.REPORT_ACCESS_LOGS"]).subscribe(r=>{u.default.saveAs(o,r["PAGES.REPORT_ACCESS_LOGS"]+" "+i.fromJSDate(this.filter.startUtc).toLocaleString(i.DATETIME_MED)+" "+i.fromJSDate(this.filter.endUtc).toLocaleString(i.DATETIME_MED)+".xlsx")})})}onGetPDFClicked(e){this.reportService.exportAccessLogsAsPDF(this.filter).subscribe(o=>{this.translate.get(["PAGES.REPORT_ACCESS_LOGS"]).subscribe(r=>{u.default.saveAs(o,r["PAGES.REPORT_ACCESS_LOGS"]+" "+i.fromJSDate(this.filter.startUtc).toLocaleString(i.DATETIME_MED)+" "+i.fromJSDate(this.filter.endUtc).toLocaleString(i.DATETIME_MED)+".pdf")})})}onDeleteManulRecordClicked(e){this.interactionService.showDialog("REPORT.ACCESS_LOGS_DELETE_MANUAL","ACCESSCONTROLPOINT.APPROVE_FOR_MANUAL_RECORD_DELETE",null,null,!0,"BUTTON.YES","BUTTON.NO",!0,()=>{this.accessControlPointService.deleteManualRecord(e.id).subscribe(o=>{this.interactionService.showMessage("ACCESSCONTROLPOINT.MANUAL_RECORD_DELETE_SUCCEED",null,C.Success),this.fetchReportData()})})}initializeSubscriptions(){}fetchReportData(){this.permissionReportDetailed?this.reportService.getAccessLogs(this.filter).subscribe(e=>{this.storeAccessLogsResult(e)}):this.reportService.getMyAccessLogs(this.filter).subscribe(e=>{this.storeAccessLogsResult(e)})}storeAccessLogsResult(e){this.lastResult=e,this.records=e.items||[],this.paginationResponse=new g,this.paginationResponse.total=e.total,this.paginationResponse.take=e.take,this.paginationResponse.skip=e.skip}checkPermissions(){this.permissionSearchUserGroup=this.authService.checkPermission(s.USERGROUP.getRead()),this.permissionSearchIdentity=this.authService.checkPermission(s.IDENTITY.getReadBasic()),this.permissionSearchOrganizationUnit=this.authService.checkPermission(s.ORGANIZATIONUNIT.getReadBasic()),this.permissionSearchRegion=this.authService.checkPermission(s.REGION.getRead()),this.permissionReportDetailed=this.authService.checkPermission(s.ACCESSLOG.getReportDetailed())}onTemplateLoaded(e){e.filter&&(this.createFilter(),Object.assign(this.filter,e.filter)),setTimeout(()=>{this.fetchReportData()},1e3)}pageChanged(e){this.filter.skip=e.skip,this.filter.take=e.take,this.fetchReportData()}onDateSelectionChanged(e){this.filter.skip=0,this.setDateSelection(e),this.fetchReportData()}static ctorParameters=()=>[{type:A},{type:H},{type:Z},{type:K},{type:O},{type:y},{type:D},{type:v},{type:T}];static propDecorators={datePicker:[{type:h,args:["datePicker"]}],sideNavigation:[{type:h,args:["sideNavigation",{static:!1}]}]}};fe=Re([S({selector:"armon-report-access-logs",template:pe,standalone:!0,imports:[x,se,re,J,_,b,$,L,ae,U,M,N,ne,X,P,q,de,ce,ee,oe,Y,R,ie,te,le,Q,E,I],styles:[me]})],fe);export{fe as ReportAccessLogsComponent};
