import{Bb as z,J as _,l as S,o as R,s as b,v as A,y as P}from"./chunk-YSQLW2JA.js";import{gd as M,hd as w}from"./chunk-NVJ2ZZFT.js";import{Aa as x,Cg as f,Qf as y,Te as g,ab as m,bb as p,bh as I,dd as d,gg as c,hg as v,jg as C,wa as h,ya as a}from"./chunk-SKPDQO4E.js";var D=`<div class="view-container">
  <div class="row">
    <div class="col-12 col-sm-6 col-lg-4 col-xl-3">
      <label class="report-form-label">{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>
      <armon-access-control-point-search #searchAccessControlPoints [multiselect]="false"
        (itemSelected)="onAccessControlPointSelected($event)" (itemRemoved)="onAccessControlPointRemoved($event)">
      </armon-access-control-point-search>
    </div>
    <div class="col-12 col-sm-6 col-lg-4 offset-lg-4 col-xl-3 offset-xl-6 d-flex justify-content-end align-items-end">
      <button nz-dropdown [nzDropdownMenu]="menuFilter" nzPlacement="bottomRight" class="btn btn-outline-primary btn-sm mb-2">
        {{'REPORT.FILTERS' | translate}}
        <cds-icon shape="angle" direction="down"></cds-icon>
      </button>
      <nz-dropdown-menu #menuFilter="nzDropdownMenu">
        <ul nz-menu>
          <li nz-menu-item>
            <label class="report-checkbox-label" nz-checkbox [(ngModel)]="selectionStatusSensor"
              (ngModelChange)="onModelChanged($event)">{{'REPORT.ACP_SUMMARY_STATUS_SENSOR' | translate}}</label>
          </li>
          <li nz-menu-item>
            <label class="report-checkbox-label" nz-checkbox [(ngModel)]="selectionCounterSensor"
              (ngModelChange)="onModelChanged($event)">{{'REPORT.ACP_SUMMARY_COUNTER_SENSOR' | translate}}</label>
          </li>
          <li nz-menu-item>
            <label class="report-checkbox-label" nz-checkbox [(ngModel)]="selectionExitButton"
              (ngModelChange)="onModelChanged($event)">{{'REPORT.ACP_SUMMARY_EXIT_BUTTON' | translate}}</label>
          </li>
          <li nz-menu-item>
            <label class="report-checkbox-label" nz-checkbox [(ngModel)]="selectionReaderAccess"
              (ngModelChange)="onModelChanged($event)">{{'REPORT.ACP_SUMMARY_READER_ACCESS' | translate}}</label>
          </li>
          <li nz-menu-item>
            <label class="report-checkbox-label" nz-checkbox [(ngModel)]="selectionRemoteAccess"
              (ngModelChange)="onModelChanged($event)">{{'REPORT.ACP_SUMMARY_REMOTE_ACCESS' | translate}}</label>
          </li>
        </ul>
      </nz-dropdown-menu>
    </div>
  </div>
  <div class="row">
    <div class="col-12">
      <armon-date-picker [options]="datePickerOptions" (selectionChanged)="onDateSelectionChanged($event)">
      </armon-date-picker>
    </div>
  </div>
  <div class="row my-3" *ngIf="summaryInfos">
    <div class="col-12 col-md-6 col-lg-4" *ngFor="let info of summaryInfos">
      <armon-analysis-access-control-point-activity-summary-item [summaryInfo]="info">
      </armon-analysis-access-control-point-activity-summary-item>
    </div>
  </div>
  <div class="row mt-5" *ngIf="!summaryInfos">
    <div class="col-12">
      <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/search_generic.png'">
        <ng-template #contentTpl>
          <span>{{'ANALYZE.ACP_SUMMARY_FILTER_INFO'|translate}}</span>
        </ng-template>
      </nz-empty>
    </div>
  </div>
</div>
`;var E="";var O=`<div class="bg-white w-100 d-flex p-3 my-2 mx-1 mx-md-0 mhs-15 rnd-2">
  <div class="d-flex flex-column align-items-center justify-content-between b-r-1 pe-3" style="max-width: 90px;">
    <cds-icon [attr.shape]="summaryInfo.icon" size="xl" class="color-gray my-3"></cds-icon>
    <div class="text-sm text-center color-gray">{{summaryInfo.typeDescription | translate}}</div>
  </div>
  <div class="flex-grow-1 d-flex justify-content-around px-3 align-items-center">
    <ng-container *ngFor="let item of summaryInfo.infoItems">
      <ng-container *ngIf="!item.hasMultipleValue">
        <div class="d-flex flex-column align-items-center">
          <span class="text-sm color-primary mb-3">{{item.description | translate}}</span>
          <span class="text-xxxl line-height-xxxl text-black-50">{{item.valuePrimary}}</span>
        </div>
      </ng-container>
      <ng-container *ngIf="item.hasMultipleValue">
        <div class="d-flex flex-column align-items-center">
          <span class="text-sm color-primary mb-3">{{item.description | translate}}</span>
          <span class="text-xs color-success">{{item.multipleValuePrimaryDescription | translate}}</span>
          <span class="text-xxxl line-height-xxxl color-success">{{item.valuePrimary}}</span>
          <span class="text-xs color-error mt-2">{{item.multipleValueSecondaryDescription | translate}}</span>
          <span class="text-xxxl line-height-xxxl color-error">{{item.valueSecondary}}</span>
        </div>
      </ng-container>
    </ng-container>
  </div>
</div>`;var k=`.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}.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}.summaryInfoType{width:130px}.summaryInfoType>cds-icon{color:#a9a9a9;margin-right:4px;border-right:1px solid darkgray;padding-right:4px;min-width:72px;color:#0a2a5a}.summaryInfoType>div{font-size:.714rem;line-height:.65rem;margin-left:6px;color:#0a2a5a}.summaryInfoValues{width:-webkit-calc(100% - 130px);width:-moz-calc(100% - 130px);width:calc(100% - 130px);margin:0}.summaryInfoValues>div{text-align:right}.singleValue>div:first-child{font-size:1.2rem;line-height:1.4rem}.singleValue>div:last-child{font-size:11px}.multipleValue>div{font-size:1.2rem;line-height:1.4rem}.multipleValue>div>span{font-size:10px}.multipleValue>div:last-child{font-size:11px}
`;var V=function(i,e,o,n){var s=arguments.length,t=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,e,o,n);else for(var r=i.length-1;r>=0;r--)(l=i[r])&&(t=(s<3?l(t):s>3?l(e,o,t):l(e,o))||t);return s>3&&t&&Object.defineProperty(e,o,t),t},u=class{summaryInfo;constructor(){}ngOnInit(){}static ctorParameters=()=>[];static propDecorators={summaryInfo:[{type:x}]}};u=V([a({selector:"armon-analysis-access-control-point-activity-summary-item",template:O,standalone:!0,imports:[m,p,d],styles:[k]})],u);var U=function(i,e,o,n){var s=arguments.length,t=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,e,o,n);else for(var r=i.length-1;r>=0;r--)(l=i[r])&&(t=(s<3?l(t):s>3?l(e,o,t):l(e,o))||t);return s>3&&t&&Object.defineProperty(e,o,t),t},T=class{interactionService;reportService;lastResult;summaryInfos=null;datePickerOptions=new v;selectionStartDate;selectionEndDate;selectionStatusSensor=!0;selectionCounterSensor=!0;selectionExitButton=!0;selectionReaderAccess=!0;selectionRemoteAccess=!0;selectionAccessControlPoints;constructor(e,o){this.interactionService=e,this.reportService=o}get selectedAccessControlPoint(){let e=this.selectionAccessControlPoints?this.selectionAccessControlPoints.getSelection()||[]:[];return e.length>0?e[0]:null}set selectedAccessControlPoint(e){e&&this.selectionAccessControlPoints&&this.selectionAccessControlPoints.setSelection([e])}get isValid(){return this.selectedAccessControlPoint&&(this.selectionStatusSensor||this.selectionCounterSensor||this.selectionReaderAccess||this.selectionRemoteAccess||this.selectionExitButton)}ngOnInit(){this.datePickerOptions.items=[{type:c.Today,selected:!0},{type:c.Yesterday},{type:c.SelectDay},{type:c.Custom}];let e=C.getDateSelection(this.datePickerOptions.items[0]);this.setDateSelection(e)}setDateSelection(e){this.selectionStartDate=e.startDate,this.selectionEndDate=e.endDate}getFilter(){let e=new w;return e.startDt=new f(this.selectionStartDate),e.endDt=new f(this.selectionEndDate),e.accessControlPoint=this.selectedAccessControlPoint,e.statusSensorLogs=this.selectionStatusSensor,e.counterSensorLogs=this.selectionCounterSensor,e.exitButtonAccessLogs=this.selectionExitButton,e.readerAccessLogs=this.selectionReaderAccess,e.remoteAccessLogs=this.selectionRemoteAccess,e}fetchReportData(e){this.isValid&&this.reportService.getAccessControlPointSummaryReport(e).subscribe(o=>{this.lastResult=o;let n=[];Object.keys(this.lastResult).forEach(t=>{this.lastResult[t]&&this.lastResult[t]instanceof M&&this.lastResult[t].info&&n.push(this.lastResult[t].info)}),this.summaryInfos=n})}onDateSelectionChanged(e){this.setDateSelection(e),this.fetchReportData(this.getFilter())}onAccessControlPointSelected(e){this.fetchReportData(this.getFilter())}onAccessControlPointRemoved(e){this.summaryInfos=null}onModelChanged(e){this.fetchReportData(this.getFilter())}static ctorParameters=()=>[{type:y},{type:_}];static propDecorators={selectionAccessControlPoints:[{type:h,args:["searchAccessControlPoints"]}]}};T=U([a({selector:"armon-analysis-access-control-point-activity",template:D,standalone:!0,imports:[z,P,A,b,R,g,S,p,m,u,I,d],styles:[E]})],T);export{T as AnalysisAccessControlPointActivityComponent};
