import{a as H}from"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import"./chunk-JUDWAYYT.js";import{a as B}from"./chunk-5OT2MLHH.js";import{a as G}from"./chunk-4IRXRL4C.js";import"./chunk-LAJI7RPC.js";import{a as M}from"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{a as $}from"./chunk-4MZCYQX4.js";import{b as j,c as q,d as X}from"./chunk-YOJ4KGSB.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import{a as F}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Fb as z,J as D,K as O,Kb as L,L as C,Ob as A,a as Z,c,d as m,l as w,m as P,o as U,wb as N}from"./chunk-YSQLW2JA.js";import"./chunk-NVJ2ZZFT.js";import{Dc as a,Fb as v,Mg as b,Ng as d,Qf as k,Te as y,af as I,bb as S,bh as _,cd as E,dd as T,g as V,gg as r,hd as l,hg as h,jg as f,wa as u,ya as x}from"./chunk-SKPDQO4E.js";var Y=`<div class="h-100">
  <side-navigation #sideNavigation>
    <ng-template side-navigation-nav>
      <div>
        <div class="row">
          <div class="col-12 mb-2 b-b-1 py-3">
            <nz-switch [(ngModel)]="visibleSingleUserReport" (ngModelChange)="onReportModeChanged($event)"
              nzSize="small"
              title="{{ ( visibleSingleUserReport ? 'REPORT.USERS_REPORT':'REPORT.SINGLE_USER_REPORT') | translate }}">
            </nz-switch>
            <label class="report-form-label ms-2 cursor-pointer" (click)="visibleSingleUserReport=!visibleSingleUserReport">{{ ( visibleSingleUserReport ?
              'REPORT.SINGLE_USER_REPORT':'REPORT.USERS_REPORT') | translate }}</label>
          </div>

          <!-- IDENTITY MULTI -->
          <div class="col-12" *ngIf="permissionSearchIdentity && permissionReportDetailed"
            [hidden]="visibleSingleUserReport">
            <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>
          <!-- END -->

          <!-- IDENTITY SINGLE -->
          <div class="col-12" *ngIf="permissionSearchIdentity && permissionReportDetailed"
            [hidden]="!visibleSingleUserReport">
            <label class="report-form-label">{{'IDENTITY.TITLE' | translate : languageService.userTranslate}}</label>
            <armon-select-search query="identity" [allowMulti]="false" [(ngModel)]="singleFilter.userId">
            </armon-select-search>
          </div>
          <!-- END -->

          <div class="col-12" *ngIf="permissionSearchOrganizationUnit && permissionReportDetailed"
            [hidden]="visibleSingleUserReport">
            <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"
            [hidden]="visibleSingleUserReport">
            <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 mb-2" *ngIf="filter" [hidden]="visibleSingleUserReport">
            <label class="report-form-label">{{'REPORT.USER_STATUS' | translate}}</label>
            <armon-identity-status [(ngModel)]="filter.status"></armon-identity-status>
          </div>
          <div class="col-12 mt-2">
            <label class="report-form-label">{{'REPORT.ACCESS_CONTROL_POINTS' | translate}}</label>
            <armon-select-search query="point" [allowMulti]="true" [(ngModel)]="filter.accessControlPointIds"
              [hidden]="visibleSingleUserReport">
            </armon-select-search>
            <armon-select-search query="point" [allowMulti]="true" [(ngModel)]="singleFilter.accessControlPointIds"
              [hidden]="!visibleSingleUserReport">
            </armon-select-search>
          </div>
          <div class="col-12" *ngIf="permissionSearchRegion && permissionReportDetailed">
            <label class="report-form-label">{{'REPORT.REGION' | translate}}</label>
            <armon-select-search query="region" [allowMulti]="true" [(ngModel)]="filter.regionIds"
              [hidden]="visibleSingleUserReport">
            </armon-select-search>
            <armon-select-search query="region" [allowMulti]="true" [(ngModel)]="singleFilter.regionIds"
              [hidden]="!visibleSingleUserReport">
            </armon-select-search>
          </div>

        </div>

        <div class="centered filterButtons">
          <!-- MULTI USER -->
          <button class="btn btn-success btn-sm me-2" [hidden]="visibleSingleUserReport"
            (click)="onGetExcelClicked($event)">{{'BUTTON.EXCEL'
            | translate}}</button>
          <button class="btn btn-primary btn-sm" [hidden]="visibleSingleUserReport"
            (click)="onGetReportClicked($event)">{{'REPORT.GET_REPORT' |
            translate}}</button>
          <!-- END -->

          <!-- SINGLE USER -->
          <button class="btn btn-success btn-sm me-2" [hidden]="!visibleSingleUserReport"
            *ngIf="singleFilter && singleFilter.userId" (click)="onSingleGetExcelClicked($event)">{{'BUTTON.EXCEL'
            | translate}}</button>
          <button class="btn btn-primary btn-sm" [hidden]="!visibleSingleUserReport"
            (click)="onSingleGetReportClicked($event)" [disabled]="!singleFilter.userId">{{'REPORT.GET_REPORT' |
            translate}}</button>
          <!-- END -->
        </div>
        <div class="row mt-3" *ngIf="permissionSearchIdentity && permissionReportDetailed && visibleSingleUserReport">
          <div class="col-12 mt-3">
            <label class="report-form-label">{{'PACS.USERS_LIST' | translate}}</label>
          </div>
          <div class="col-12 mt-2">
            <armon-identity-filter [enableDetailSearch]="false" [enableIdentitySelection]="true"
              [identitySelectionTake]="5" (identitySelected)="onListIdentitySelected($event)"></armon-identity-filter>
          </div>
        </div>
      </div>
    </ng-template>
    <ng-template side-navigation-content>
      <div class="report-data-container">
        <div class="row">
          <div class="col-12">
            <div class="row">
              <div class="col-12 d-none d-md-block">
                <armon-report-template-panel [reportType]="reportTemplateType" [templateId]="reportTemplateId"
                  [filter]="filter" *ngIf="!visibleSingleUserReport" (templateLoaded)="onTemplateLoaded($event)">
                </armon-report-template-panel>

                <armon-report-template-panel [reportType]="reportSingleTemplateType" [filter]="singleFilter"
                  *ngIf="visibleSingleUserReport" [templateId]="reportTemplateId"
                  [saveEnabled]="singleFilter && singleFilter.userId && singleFilter.userId"
                  (templateLoaded)="onSingleTemplateLoaded($event)"></armon-report-template-panel>
              </div>
            </div>
          </div>
        </div>
        <div class="row report-filter-container">
          <div class="col-12" style="min-height:0;">
            <div class="row">
              <div class="col-12">
                <armon-date-picker [options]="datePickerOptions" (selectionChanged)="onDateSelectionChanged($event)"
                  [hidden]="visibleSingleUserReport">
                </armon-date-picker>
                <armon-date-picker [options]="singleDatePickerOptions"
                  (selectionChanged)="onSingleDateSelectionChanged($event)" [hidden]="!visibleSingleUserReport">
                </armon-date-picker>
                <div class="row mt-5" *ngIf="visibleSingleUserReport && !singleResult && !singleFilter.userId">
                  <div class="col-12">
                    <nz-empty [nzNotFoundContent]="contentTpl"
                      [nzNotFoundImage]="'./assets/images/empty/search_user.png'">
                      <ng-template #contentTpl>
                        <span> {{'REPORT.ENTEREXIT_SELECT_USER_INFO'|translate}}</span>
                      </ng-template>
                    </nz-empty>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="row report-data-table-container" id="report-data-table-container">
          <div class="col-12 mb-3 mt-2" *ngIf="visibleSingleUserReport && singleResult && singleResult.userCaptions">
            <armon-captionlines [captionlines]="singleResult.userCaptions"></armon-captionlines>
          </div>
          <!-- USERS -->
          <div class="col-12" [hidden]="visibleSingleUserReport">
            <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.ENTEREXIT_FIRST_ENTRY' | translate}}</th>
                  <th>{{'REPORT.ENTEREXIT_LAST_EXIT' | translate}}</th>
                </tr>
              </ng-template>
              <ng-template pTemplate="body" let-record>
                <tr class="data-row">
                  <td>
                    <armon-captionlines *ngIf="record.userCaptions" [showBorder]="false"
                      [captionlines]="record.userCaptions"></armon-captionlines>
                  </td>
                  <td>
                    <div class="report-multi-data-cell">
                      <span class="main-text text-bold" *ngIf="record.firstUtc">{{record.firstUtcHourText}}
                        <armon-local-date [dateUtc]="record.firstUtc"></armon-local-date>
                      </span>
                      <span class="sub-text" *ngIf="!record.firstUtc">{{'REPORT.REPORT_NO_RECORD' | translate}}</span>
                      <span class="sub-text mt-2"
                        *ngIf="record.firstAccessControlPoint">{{record.firstAccessControlPoint.name}}</span>
                    </div>
                  </td>
                  <td>
                    <div class="report-multi-data-cell">
                      <span class="main-text text-bold" *ngIf="record.lastUtc">{{record.lastUtcHourText}}
                        <armon-local-date [dateUtc]="record.lastUtc"></armon-local-date>
                      </span>
                      <span class="sub-text" *ngIf="!record.lastUtc">{{'REPORT.REPORT_NO_RECORD' | translate}}</span>
                      <span class="sub-text mt-2"
                        *ngIf="record.lastAccessControlPoint">{{record.lastAccessControlPoint.name}}</span>
                    </div>
                  </td>
                </tr>
              </ng-template>
            </p-table>
          </div>
          <!-- USERS -->

          <!-- SINGLE USER -->
          <div class="col-12" [hidden]="!visibleSingleUserReport" *ngIf="singleResult">
            <p-table [value]="singleRecords" dataKey="id" [responsive]="true" rowExpandMode="single">
              <ng-template pTemplate="header">
                <tr>
                  <th>{{'REPORT.DATE' | translate}}</th>
                  <th>{{'REPORT.ENTEREXIT_FIRST_ENTRY' | translate}}</th>
                  <th>{{'REPORT.ENTEREXIT_LAST_EXIT' | translate}}</th>
                </tr>
              </ng-template>
              <ng-template pTemplate="body" let-record>
                <tr class="data-row">
                  <td>
                    <div class="identity-cell">
                      <span class="main-text" *ngIf="record.date">{{record.dateText}}</span>
                    </div>
                  </td>
                  <td>
                    <div class="report-multi-data-cell">
                      <span class="main-text text-bold" *ngIf="record.firstUtc">{{record.firstUtcHourText}}
                        <armon-local-date [dateUtc]="record.firstUtc"></armon-local-date>
                      </span>
                      <span class="sub-text" *ngIf="!record.firstUtc">{{'REPORT.REPORT_NO_RECORD' | translate}}</span>
                      <span class="sub-text mt-2"
                        *ngIf="record.firstAccessControlPoint">{{record.firstAccessControlPoint.name}}</span>
                    </div>
                  </td>
                  <td>
                    <div class="report-multi-data-cell">
                      <span class="main-text text-bold" *ngIf="record.lastUtc">{{record.lastUtcHourText}}
                        <armon-local-date [dateUtc]="record.lastUtc"></armon-local-date>
                      </span>
                      <span class="sub-text" *ngIf="!record.lastUtc">{{'REPORT.REPORT_NO_RECORD' | translate}}</span>
                      <span class="sub-text mt-2"
                        *ngIf="record.lastAccessControlPoint">{{record.lastAccessControlPoint.name}}</span>
                    </div>
                  </td>
                </tr>
              </ng-template>
            </p-table>
          </div>
          <!-- SINGLE USER -->

          <div class="col-12 mb-3 mt-3">
            <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="'report-data-table-container'"
              (pageChanged)="pageChanged($event)" [hidden]="visibleSingleUserReport"></armon-pagination>
            <armon-pagination [paginationResponse]="singlePaginationResponse" *ngIf="singleResult"
              [scrollDomId]="'report-data-table-container'" (pageChanged)="singlePageChanged($event)"
              [hidden]="!visibleSingleUserReport"></armon-pagination>
          </div>
        </div>
      </div>
    </ng-template>
  </side-navigation>
</div>`;var J=`.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}.snapshot-container,.snapshot-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}.snapshot-container span,.snapshot-failed-container span{font-size:.588rem;line-height:.5rem}.snapshot-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 R=V(Z());var ee=function(p,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(p,e,t,i);else for(var g=p.length-1;g>=0;g--)(s=p[g])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},K=class{interactionService;reportService;authService;translate;languageService;route;filter;result;records=[];singleFilter;singleResult;singleRecords=[];permissionSearchUserGroup;permissionSearchIdentity;permissionSearchOrganizationUnit;permissionSearchRegion;permissionReportDetailed;visibleSingleUserReport=!1;paginationResponse=new d;paginationRequest=new b;singlePaginationResponse=new d;singlePaginationRequest=new b;datePickerOptions=new h;singleDatePickerOptions=new h;reportTemplateType=m.FirstAndLastAccessLogs;reportSingleTemplateType=m.FirstAndLastAccessLogsForSingleUser;reportTemplateId;sideNavigation;constructor(e,t,i,o,n,s){this.interactionService=e,this.reportService=t,this.authService=i,this.translate=o,this.languageService=n,this.route=s}ngOnInit(){this.checkPermissions(),this.datePickerOptions.items=[{type:r.Today,selected:!0},{type:r.Yesterday},{type:r.SelectDay}],this.singleDatePickerOptions.items=[{type:r.LastMonth,selected:!0},{type:r.Last3Months},{type:r.PreviousMonth,hasDivider:!0},{type:r.CurrentMonth},{type:r.Custom}],this.createFilter(),this.createSingleFilter()}ngAfterViewInit(){this.route.queryParams.subscribe(e=>{e&&e[c.ReportTemplateId]&&e[c.ReportTemplateId]!=""&&(this.reportTemplateId=e[c.ReportTemplateId],this.visibleSingleUserReport=+e[c.ReportTemplateType]==m.FirstAndLastAccessLogsForSingleUser),this.reportTemplateId||this.fetchReportData()})}ngOnDestroy(){}createFilter(){this.filter=O.getEmptyModel(),this.setDateSelection(this._lastDatePickerSelection?this._lastDatePickerSelection:f.getDateSelection(this.datePickerOptions.items[0]))}createSingleFilter(){this.singleFilter=C.getEmptyModel(),this.setSingleDateSelection(this._lastSingleDatePickerSelection?this._lastSingleDatePickerSelection:f.getDateSelection(this.singleDatePickerOptions.items[0]))}_lastDatePickerSelection;setDateSelection(e){this.filter.dateRange.startDateTime=e.startDate,this.filter.dateRange.endDateTime=e.endDate,this._lastDatePickerSelection=e}_lastSingleDatePickerSelection;setSingleDateSelection(e){this.singleFilter.dateRange.startDateTime=e.startDate,this.singleFilter.dateRange.endDateTime=e.endDate,this._lastSingleDatePickerSelection=e}onGetReportClicked(e){this.sideNavigation.hideLeftClicked(),this.fetchReportData()}onSingleGetReportClicked(e=null){this.sideNavigation.hideLeftClicked(),this.fetchSingleReportData()}onGetExcelClicked(e){this.reportService.exportEnterExitLogsAsExcel(this.filter).subscribe(t=>{this.translate.get(["PAGES.REPORT_ENTER_EXIT"]).subscribe(i=>{R.default.saveAs(t,i["PAGES.REPORT_ENTER_EXIT"]+" "+a.fromJSDate(this.filter.dateRange.startDateTime).toLocaleString(a.DATE_HUGE)+".xlsx")})})}onSingleGetExcelClicked(e){this.singleFilter.userId&&this.reportService.exportSingleEnterExitLogsAsExcel(this.singleFilter).subscribe(t=>{this.translate.get(["PAGES.REPORT_ENTER_EXIT"]).subscribe(i=>{R.default.saveAs(t,i["PAGES.REPORT_ENTER_EXIT"]+" "+a.fromJSDate(this.singleFilter.dateRange.startDateTime).toLocaleString(a.DATE_HUGE)+"-"+a.fromJSDate(this.singleFilter.dateRange.endDateTime).toLocaleString(a.DATE_HUGE)+".xlsx")})})}fetchReportData(){this.permissionReportDetailed&&this.reportService.getEnterExitLogs(this.filter).subscribe(e=>{this.storeAccessLogsResult(e)})}fetchSingleReportData(){this.singleResult=null,this.singleRecords=[],this.permissionReportDetailed&&this.singleFilter.userId&&this.reportService.getSingleEnterExitLogs(this.singleFilter).subscribe(e=>{this.storeSingleAccessLogsResult(e)})}storeAccessLogsResult(e){this.result=e,this.records=e.items||[],this.paginationResponse=new d,this.paginationResponse=e.pagination}storeSingleAccessLogsResult(e){this.singleResult=e,this.singleRecords=e.items||[],this.singlePaginationResponse=new d,this.singlePaginationResponse=e.pagination}checkPermissions(){this.permissionSearchUserGroup=this.authService.checkPermission(l.USERGROUP.getRead()),this.permissionSearchIdentity=this.authService.checkPermission(l.IDENTITY.getReadBasic()),this.permissionSearchOrganizationUnit=this.authService.checkPermission(l.ORGANIZATIONUNIT.getReadBasic()),this.permissionSearchRegion=this.authService.checkPermission(l.REGION.getRead()),this.permissionReportDetailed=this.authService.checkPermission(l.ACCESSLOG.getReportDetailed())&&(this.permissionSearchIdentity||this.permissionSearchOrganizationUnit||this.permissionSearchUserGroup)}pageChanged(e){this.filter.pagination.skip=e.skip,this.filter.pagination.take=e.take,this.fetchReportData()}singlePageChanged(e){this.singleFilter.pagination.skip=e.skip,this.singleFilter.pagination.take=e.take,this.fetchSingleReportData()}onDateSelectionChanged(e){this.setDateSelection(e),this.filter.pagination.skip=0,this.fetchReportData()}onSingleDateSelectionChanged(e){this.setSingleDateSelection(e),this.singleFilter.pagination.skip=0,this.fetchSingleReportData()}onListIdentitySelected(e){this.singleFilter.userId=e.id,this.onSingleGetReportClicked()}onReportModeChanged(e){this.visibleSingleUserReport?this.fetchSingleReportData():this.fetchReportData()}onTemplateLoaded(e){e.filter&&(this.createFilter(),Object.assign(this.filter,e.filter)),setTimeout(()=>{this.fetchReportData()},1e3)}onSingleTemplateLoaded(e){e.filter&&(this.createSingleFilter(),Object.assign(this.singleFilter,e.filter)),setTimeout(()=>{this.fetchSingleReportData()},1e3)}static ctorParameters=()=>[{type:k},{type:D},{type:A},{type:E},{type:I},{type:v}];static propDecorators={sideNavigation:[{type:u,args:["sideNavigation",{static:!0}]}]}};K=ee([x({selector:"armon-report-enter-exit",template:Y,standalone:!0,imports:[X,j,z,y,S,N,U,P,H,q,L,w,_,M,B,$,G,F,T],styles:[J]})],K);export{K as ReportEnterExitComponent};
