import{a as Le}from"./chunk-I5K7GPAI.js";import{a as De}from"./chunk-KPAQQQE2.js";import"./chunk-SSSZHUIR.js";import"./chunk-5HOZEP3O.js";import"./chunk-RB5TOXJE.js";import{a as Re}from"./chunk-XOY5UTVP.js";import{a as Ae,b as Ee}from"./chunk-5DQKN4SL.js";import{a as Ne}from"./chunk-D4RZOGGF.js";import{a as M}from"./chunk-5WJM4RWS.js";import{a as Oe,b as we,c as _e}from"./chunk-UZB7YFT6.js";import{b as Me,c as ke,d as Pe}from"./chunk-YOJ4KGSB.js";import"./chunk-CO3X7TQN.js";import{a as ye}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Db as Se,Ob as Y,Rb as Q,X as ge,bb as xe,db as te,rb as Te,s as B,v as q,wb as E,y as $}from"./chunk-YSQLW2JA.js";import{$c as be,E as fe,G as ue,Gc as ve,H as G,I as H,Uc as A,Vc as N,Wc as Ce,_b as lt,_c as Ie,ua as d,va as X}from"./chunk-NVJ2ZZFT.js";import{Aa as f,Ba as w,Fc as le,He as l,Id as x,Mg as de,Nc as j,Ng as ee,Pd as T,Qf as _,Rd as R,Sd as S,Se as h,Te as v,Ue as C,W as ne,_a as y,ab as u,af as ce,bb as m,bh as he,cb as re,db as ae,dc as b,dd as p,eh as W,g as st,gb as g,ha as O,hd as U,ic as ie,mg as me,ng as pe,wa as oe,wc as se,ya as c}from"./chunk-SKPDQO4E.js";var ze=`<div class="h-100">
  <side-navigation>
    <ng-template side-navigation-nav>
      <label class="report-form-label">{{'CAMERA.SEARCH' | translate}}</label>
      <armon-filter-input [maxLength]="20" (entryCompleted)="onFilterChanged($event)" placeholder="COMMON.SEARCH">
      </armon-filter-input>
    </ng-template>
    <ng-template side-navigation-content>
      <div class="row mb-3" *ngIf="permissionAddCamera">
        <div class="col-12 d-flex">
          <button class="btn btn-sm btn-primary" (click)="onAddCameraButtonClicked()">{{'CAMERA.ADD' |
            translate}}</button>
          <button class="btn btn-sm btn-outline-primary ms-auto"
            (click)="onWebRTCPreferencesClicked($event)">{{'CAMERA.WEBRTC_PREFERENCES' |
            translate}}</button>
        </div>
      </div>
      <ng-container *ngIf="cameras && cameras.length > 0">
        <div class="row" [@listAnimation]="cameras.length">
          <!-- List of cameras -->
          <div class="col-xxxl-4 col-xl-6 col-lg-6 col-md-12" *ngFor="let camera of cameras">
            <armon-camera-card [camera]="camera" (cameraDeleted)="onCameraDeleted($event)"
              (cameraUpdated)="onCameraUpdated($event)"></armon-camera-card>
          </div>
        </div>
      </ng-container>
      <div class="row py-5" *ngIf="cameras && cameras.length==0">
        <div class="col-12 mt-5">
          <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
            <ng-template #contentTpl>
              <span>{{'CAMERA.FILTER_NO_ITEMS'|translate}}</span>
            </ng-template>
          </nz-empty>
        </div>
      </div>
      <div class="row" *ngIf="cameras && cameras.length>0">
        <div class="col-12 my-2">
          <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)">
          </armon-pagination>
        </div>
      </div>
    </ng-template>
  </side-navigation>
</div>`;var Ve="";var Fe=`<ng-container *ngIf="visibleComponent">
  <div class="modal-header">
    <span class="text-lg">{{(isEditMode ? 'CAMERA.EDIT' : 'CAMERA.ADD' ) | translate}}</span>
  </div>
  <div class="modal-body">
    <nz-tabset [nzAnimated]="false">
      <nz-tab nzTitle="{{'CAMERA.BASIC_SETTINGS' | translate}}">
        <form class="form" [formGroup]="cameraForm">
          <div class="row mx-0">
            <div class="col-12">
              <div class="form-group">
                <label for="nameInput">{{'CAMERA.NAME' | translate}}</label>
                <input type="text" id="nameInput" formControlName="name"
                  [ngClass]="{'is-invalid': cameraForm.get('name').touched && cameraForm.get('name').invalid}"
                  class="form-control form-control-sm">
                <ng-template
                  *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: cameraForm, control:cameraForm.get('name')}">
                </ng-template>
              </div>
            </div>
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label for="usernameInput">{{'CAMERA.USERNAME' | translate}}</label>
                <input type="text" id="usernameInput" formControlName="userName" autocomplete="new-password"
                  [ngClass]="{'is-invalid': cameraForm.get('userName').touched && cameraForm.get('userName').invalid}"
                  class="form-control form-control-sm">
                <ng-template
                  *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: cameraForm, control:cameraForm.get('userName')}">
                </ng-template>
              </div>
            </div>
            <div class="col-md-6 col-12">
              <div class="form-group">
                <label for="passwordInput">{{'CAMERA.PASSWORD' | translate}}</label>
                <input type="password" id="passwordInput" formControlName="password" autocomplete="new-password"
                  placeholder="{{(isEditMode?'COMMON.PASSWORD_HIDDEN_PLACEHOLDER':undefined) | translate}}"
                  [ngClass]="{'is-invalid': cameraForm.get('password').touched && cameraForm.get('password').invalid}"
                  class="form-control form-control-sm">
                <ng-template
                  *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: cameraForm, control:cameraForm.get('password')}">
                </ng-template>
              </div>
            </div>
            <div class="col-12">
              <div class="form-group">
                <label for="snapshotUrlInput">{{'CAMERA.SNAPSHOTURL' | translate}}</label>
                <div class="input-group">
                  <input type="text" id="snapshotUrlInput" formControlName="snapshotUrl"
                    [ngClass]="{'is-invalid': cameraForm.get('snapshotUrl').touched && cameraForm.get('snapshotUrl').invalid}"
                    class="form-control form-control-sm">
                  <ng-template
                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: cameraForm, control:cameraForm.get('snapshotUrl')}">
                  </ng-template>
                </div>
              </div>
            </div>
            <div class="col-12">
              <div class="form-group">
                <label for="proxyUrlInput">{{'CAMERA.PROXY_TERMINAL' | translate}}</label>
                <armon-select-search query="terminal" [allowMulti]="false" formControlName="proxyTerminalId"
                  [invalid]="cameraForm.get('proxyTerminalId').touched && cameraForm.get('proxyTerminalId').invalid"
                  [allowClear]="true">
                </armon-select-search>
                <ng-template
                  *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: cameraForm, control:cameraForm.get('proxyTerminalId')}">
                </ng-template>
              </div>
            </div>
          </div>
        </form>
      </nz-tab>
      <nz-tab nzTitle="{{'CAMERA.ACTION_MAPPING' | translate}}">
        <div class="row mx-0">
          <div class="col-12">
            <div class="form-group">
              <label>{{'CAMERA.MAP_WITH_ACP_LABEL' | translate}}</label>
              <armon-select-search query="point" [allowMulti]="true" [(ngModel)]="viewAccessControlPointIds">
              </armon-select-search>
            </div>
          </div>
        </div>
        <div class="row mx-0 mhs-20">
          <div class="col-12">
            <button nz-dropdown [nzDropdownMenu]="menuAction" class="btn btn-primary btn-sm">
              {{'CAMERA.ADD_ACTION' | translate}}
              <cds-icon shape="angle" direction="down"></cds-icon>
            </button>
            <nz-dropdown-menu #menuAction="nzDropdownMenu">
              <ul nz-menu>
                <li nz-menu-item (click)="onAddAuth($event)">{{'CAMERA.AUTHENTICATION'|translate}}</li>
                <li nz-menu-item (click)="onAddRemoteAccess($event)">{{'CAMERA.REMOTE_ACCESS'|translate}}</li>
                <li nz-menu-divider></li>
                <li nz-menu-item (click)="onAddSensorStatus($event)">{{'CONNECTIONS.TYPE_STATUS_SENSOR'|translate}}</li>
                <li nz-menu-item (click)="onAddSensorCounter($event)">{{'CONNECTIONS.TYPE_COUNTER_SENSOR'|translate}}
                </li>
                <li nz-menu-item (click)="onAddSwitchTamper($event)">{{'CONNECTIONS.TYPE_TAMPER_SENSOR'|translate}}</li>
                <li nz-menu-item (click)="onAddExitButton($event)">{{'CONNECTIONS.TYPE_EXIT_BUTTON'|translate}}</li>
              </ul>
            </nz-dropdown-menu>

            <div class="row mt-2">
              <div *ngFor="let actionMapping of actionMappings;let i = index" class="col-12">
                <ng-container *ngIf="actionMappings[i]">
                  <armon-camera-action-item [(map)]="actionMappings[i]"
                    (mapDeleteClicked)="onMappingDeleteClicked($event)">
                  </armon-camera-action-item>
                </ng-container>
              </div>
            </div>
          </div>
        </div>
      </nz-tab>
    </nz-tabset>
  </div>
  <div class="modal-footer">
    <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
      {{'BUTTON.CANCEL' | translate}}
    </button>
    <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="cameraForm.invalid">
      {{'BUTTON.SAVE' | translate}}
    </button>
  </div>
</ng-container>


<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
      <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
      <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
        max:control.errors.maxlength.requiredLength} }}</span>
      <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
      <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
        min:control.errors.minlength.requiredLength} }}</span>
    </div>
  </ng-container>
</ng-template>`;var Ue=`.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}
`;var je=`<div class="modal-header">
  <span class="text-lg">{{'CAMERA.AUTHENTICATION' | translate}}</span>
</div>
<div class="modal-body">
  <form class="form" [formGroup]="form">
    <div class="row">
      <div class="col-12">
        <div class="form-group">
          <label>{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>
          <armon-select-search query="point" [allowMulti]="false" formControlName="accessControlPointId"
            [invalid]="form.get('accessControlPointId').touched && form.get('accessControlPointId').invalid">
          </armon-select-search>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('accessControlPointId')}">
          </ng-template>
        </div>
      </div>
      <div class="col-12">
        <div class="form-group">
          <label>{{'CAMERA.DIRECTION' | translate}}</label>
          <select id="directionInput" class="form-select form-select-sm" formControlName="direction"
            [ngClass]="{'is-invalid': form.get('direction').touched && form.get('direction').invalid}">
            <option *ngFor="let directionType of directionTypes" [ngValue]="directionType.type">
              {{directionType.description
              | translate}}</option>
          </select>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('direction')}">
          </ng-template>
        </div>
      </div>
      <div class="col-12">
        <div class="form-group">
          <label> {{'CAMERA.ACCESS_RESULT' | translate}}</label>
          <select id="resultInput" class="form-select form-select-sm" formControlName="result"
            [ngClass]="{'is-invalid': form.get('result').touched && form.get('result').invalid}">
            <option *ngFor="let accessResultType of accessResultTypes" [ngValue]="accessResultType.type">
              {{accessResultType.description
              | translate}}</option>
          </select>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('result')}">
          </ng-template>
        </div>
      </div>
    </div>
  </form>
</div>
<div class="modal-footer">
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
    {{'BUTTON.CANCEL' | translate}}
  </button>
  <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="form.invalid">
    {{(isEditMode?'BUTTON.UPDATE':'BUTTON.ADD') | translate}}
  </button>
</div>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
      <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
      <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
        max:control.errors.maxlength.requiredLength} }}</span>
      <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
      <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
        min:control.errors.minlength.requiredLength} }}</span>
    </div>
  </ng-container>
</ng-template>`;var Be=`.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}
`;var I=class extends le{type;direction;result;accessControlPointId;accessControlPointName;dryContactInputName;dryContactInputId;statusSensorEvents;counterSensorEvents;terminalId;terminalName;filterEvents;dryContactInputType;id};var gt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},k=class extends S{formBuilder;accessControlPointService;sessionService;mapping;isEditMode=!1;directionTypes=H;accessResultTypes=ue;form;constructor(e,t,o){super(),this.formBuilder=e,this.accessControlPointService=t,this.sessionService=o}onModalInitialized(){super.onModalInitialized(),this.mapping?(this.mapping=b(this.mapping),this.isEditMode=!0):(this.mapping=new I,this.mapping.id=x(),this.mapping.type=d.Auth),this.createForm()}createForm(){this.form=this.formBuilder.group({accessControlPointId:[this.mapping.accessControlPointId||null,[l.required]],direction:[this.mapping.direction||G.All,[l.required]],result:[this.mapping.result||fe.All,[l.required]]})}onSaveClicked(e){Object.assign(this.mapping,this.form.value),this.accessControlPointService.getAccessControlPointBasic(this.mapping.accessControlPointId).subscribe(t=>{this.mapping.accessControlPointName=t.name,this.closeModal(this.mapping)})}static ctorParameters=()=>[{type:h},{type:Q},{type:T}];static propDecorators={mapping:[{type:f}]}};k=gt([c({selector:"armon-camera-auth-action-modal",template:je,standalone:!0,imports:[v,C,E,g,y,u,m,p],styles:[Be]})],k);var qe=`<ng-container>
  <div class="modal-header">
    <span class="text-lg">{{'CAMERA.REMOTE_ACCESS' | translate}}</span>
  </div>
  <div class="modal-body">
    <form class="form" [formGroup]="form">
      <div class="row">
        <div class="col-12">
          <div class="form-group">
            <label>{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>
            <armon-select-search query="point" [allowMulti]="false" formControlName="accessControlPointId"
              [invalid]="form.get('accessControlPointId').touched && form.get('accessControlPointId').invalid">
            </armon-select-search>
            <ng-template
              *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('accessControlPointId')}">
            </ng-template>
          </div>
        </div>
        <div class="col-12">
          <div class="form-group">
            <label>{{'CAMERA.DIRECTION' | translate}}</label>
            <select id="directionInput" class="form-select form-select-sm" formControlName="direction"
              [ngClass]="{'is-invalid': form.get('direction').touched && form.get('direction').invalid}">
              <option *ngFor="let directionType of directionTypes" [ngValue]="directionType.type">
                {{directionType.description
                | translate}}</option>
            </select>
            <ng-template
              *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('direction')}">
            </ng-template>
          </div>
        </div>
      </div>
    </form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
      {{'BUTTON.CANCEL' | translate}}
    </button>
    <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="form.invalid">
      {{(isEditMode?'BUTTON.UPDATE':'BUTTON.ADD') | translate}}
    </button>
  </div>

  <!-- FORM FIELD VALIDATION -->
  <ng-template #controlValidationTemplate let-form let-control="control">
    <ng-container *ngIf="control.errors">
      <div class="invalid-feedback d-flex flex-column" style="display: initial;">
        <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
        <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
        <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
        <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
          max:control.errors.maxlength.requiredLength} }}</span>
        <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
        <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
          min:control.errors.minlength.requiredLength} }}</span>
      </div>
    </ng-container>
  </ng-template>`;var $e=`.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}
`;var Ct=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},P=class extends S{formBuilder;accessControlPointService;sessionService;mapping;isEditMode=!1;directionTypes=H;form;constructor(e,t,o){super(),this.formBuilder=e,this.accessControlPointService=t,this.sessionService=o}onModalInitialized(){super.onModalInitialized(),this.mapping?(this.mapping=b(this.mapping),this.isEditMode=!0):(this.mapping=new I,this.mapping.id=x(),this.mapping.type=d.RemoteAccess),this.createForm()}createForm(){this.form=this.formBuilder.group({accessControlPointId:[this.mapping.accessControlPointId||null,[l.required]],direction:[this.mapping.direction||G.All,[l.required]]})}onSaveClicked(e){Object.assign(this.mapping,this.form.value),this.accessControlPointService.getAccessControlPointBasic(this.mapping.accessControlPointId).subscribe(t=>{this.mapping.accessControlPointName=t.name,this.closeModal(this.mapping)})}static ctorParameters=()=>[{type:h},{type:Q},{type:T}];static propDecorators={mapping:[{type:f}]}};P=Ct([c({selector:"armon-camera-remote-access-modal",template:qe,standalone:!0,imports:[v,C,E,g,y,u,m,p],styles:[$e]})],P);var Ge=`<div class="modal-header">
  <span class="text-lg">{{'CONNECTIONS.TYPE_STATUS_SENSOR' | translate}}</span>
</div>
<div class="modal-body">
  <form class="form" [formGroup]="form">
    <div class="row mhs-25 align-content-start">
      <div class="col-12">
        <div class="form-group">
          <label>{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>
          <armon-select-search query="point" [allowMulti]="false" formControlName="accessControlPointId"
            [invalid]="form.get('accessControlPointId').touched && form.get('accessControlPointId').invalid">
          </armon-select-search>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('accessControlPointId')}">
          </ng-template>
        </div>
      </div>
      <div class="col-12">
        <div class="form-group">
          <label>{{'CONNECTIONS.TYPE_STATUS_SENSOR' | translate}}</label>
          <armon-select-search query="sensor" [allowMulti]="false" formControlName="dryContactInputId"
            [searchFilters]="{accessControlPointId:form.get('accessControlPointId').value, sensorType:1}"
            (onSelectedChanged)="onSensorSelected($event)"
            [invalid]="form.get('dryContactInputId').touched && form.get('dryContactInputId').invalid">
          </armon-select-search>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('dryContactInputId')}">
          </ng-template>
        </div>
      </div>
      <div class="col-12">
        <div class="form-group">
          <label>{{'SENSOR.NOTIFICATION_SENSOR_STATUS_EVENTS' | translate}}</label>
          <nz-select id="statusSensorEventsInput" class="w-100" formControlName="statusSensorEvents" nzMode="multiple"
            nzShowSearch nzMaxTagCount="100"
            [ngClass]="{'nz-invalid': form.get('statusSensorEvents').touched && form.get('statusSensorEvents').invalid}">
            <ng-container *ngFor="let statusSensorReason of statusSensorReasons">
              <nz-option [nzLabel]="statusSensorReason.description|translate" [nzValue]="statusSensorReason.type"
                *ngIf="isEventAvailable(statusSensorReason.type)">
              </nz-option>
            </ng-container>
          </nz-select>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('statusSensorEvents')}">
          </ng-template>
        </div>
      </div>
    </div>
  </form>
</div>
<div class="modal-footer">
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
    {{'BUTTON.CANCEL' | translate}}
  </button>
  <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="form.invalid">
    {{(isEditMode?'BUTTON.UPDATE':'BUTTON.ADD') | translate}}
  </button>
</div>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
      <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
      <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
        max:control.errors.maxlength.requiredLength} }}</span>
      <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
      <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
        min:control.errors.minlength.requiredLength} }}</span>
    </div>
  </ng-container>
</ng-template>`;var He=`.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}
`;var xt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},D=class extends S{formBuilder;sessionService;mapping;isEditMode=!1;statusSensorReasons=Ie;pairedRelay=!0;form;constructor(e,t){super(),this.formBuilder=e,this.sessionService=t}onModalInitialized(){super.onModalInitialized(),this.mapping?(this.mapping=b(this.mapping),this.isEditMode=!0):(this.mapping=new I,this.mapping.id=x(),this.mapping.type=d.Sensor,this.mapping.dryContactInputType=A.StatusSensor),this.createForm()}createForm(){this.form=this.formBuilder.group({accessControlPointId:[this.mapping.accessControlPointId||null,[l.required]],dryContactInputId:[this.mapping.dryContactInputId||null,[l.required]],dryContactInputName:[this.mapping.dryContactInputName||"",[l.required]],statusSensorEvents:[this.mapping.statusSensorEvents||[],[l.required]]})}onSensorSelected(e){let t=e.data;this.pairedRelay=t.deviceRelayId&&t.deviceRelayId!="",this.form.get("dryContactInputName").setValue(e.optionLabel),(!this.mapping.dryContactInputId||this.mapping.dryContactInputId!=e.optionValue)&&this.form.get("statusSensorEvents").setValue([])}isEventAvailable(e){switch(e){case N.RemoteAccessTriggeredRelayDrive:case N.WiegandReaderTriggeredRelayDrive:case N.ExitButtonTriggeredRelayDrive:case N.UnknownReasonOpenAlthoughRelayIsMapped:return this.pairedRelay;case N.LeavedOpenned:case N.ClosedAfterLeavedOpennedTimeout:case N.Closed:return!0;case N.UnknownReasonOpenRelayIsNotMapped:return!this.pairedRelay}}onSaveClicked(e){Object.assign(this.mapping,this.form.value),this.closeModal(this.mapping)}static ctorParameters=()=>[{type:h},{type:T}];static propDecorators={mapping:[{type:f}]}};D=xt([c({selector:"armon-camera-sensor-status-modal",template:Ge,standalone:!0,imports:[v,C,E,g,W,y,u,m,p],styles:[He]})],D);var We=`<div class="modal-header">
  <span class="text-lg">{{'CONNECTIONS.TYPE_COUNTER_SENSOR'|translate}}</span>
</div>
<div class="modal-body">
  <form class="form" [formGroup]="form">
    <div class="row mhs-25 align-content-start">
      <div class="col-12">
        <div class="form-group">
          <label>{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>
          <armon-select-search query="point" [allowMulti]="false" formControlName="accessControlPointId"
            [invalid]="form.get('accessControlPointId').touched && form.get('accessControlPointId').invalid">
          </armon-select-search>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('accessControlPointId')}">
          </ng-template>
        </div>
      </div>
      <div class="col-12">
        <div class="form-group">
          <label>{{'CONNECTIONS.TYPE_COUNTER_SENSOR'|translate}}</label>
          <armon-select-search query="sensor" [allowMulti]="false" formControlName="dryContactInputId"
            [searchFilters]="{accessControlPointId:form.get('accessControlPointId').value, sensorType:2}"
            (onSelectedChanged)="onSensorSelected($event)"
            [invalid]="form.get('dryContactInputId').touched && form.get('dryContactInputId').invalid">
          </armon-select-search>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('dryContactInputId')}">
          </ng-template>
        </div>
      </div>
      <div class="col-12">
        <div class="form-group">
          <label>{{'SENSOR.NOTIFICATION_SENSOR_COUNTER_EVENTS' | translate}}</label>
          <nz-select id="counterSensorEventsInput" class="w-100" formControlName="counterSensorEvents" nzMode="multiple"
            nzShowSearch nzMaxTagCount="100"
            [ngClass]="{'nz-invalid': form.get('counterSensorEvents').touched && form.get('counterSensorEvents').invalid}">
            <ng-container *ngFor="let counterSensorReason of counterSensorReasons">
              <nz-option [nzLabel]="counterSensorReason.description|translate" [nzValue]="counterSensorReason.type"
                *ngIf="isEventAvailable(counterSensorReason.type)">
              </nz-option>
            </ng-container>
          </nz-select>
          <ng-template
            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('counterSensorEvents')}">
          </ng-template>
        </div>
      </div>
    </div>
  </form>
</div>
<div class="modal-footer">
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
    {{'BUTTON.CANCEL' | translate}}
  </button>
  <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="form.invalid">
    {{(isEditMode?'BUTTON.UPDATE':'BUTTON.ADD') | translate}}
  </button>
</div>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control">
  <ng-container *ngIf="control.errors">
    <div class="invalid-feedback d-flex flex-column" style="display: initial;">
      <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
      <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
      <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
      <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
        max:control.errors.maxlength.requiredLength} }}</span>
      <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
      <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
        min:control.errors.minlength.requiredLength} }}</span>
    </div>
  </ng-container>
</ng-template>`;var Xe=`.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}
`;var At=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},L=class extends S{formBuilder;sessionService;mapping;isEditMode=!1;counterSensorReasons=be;pairedRelay=!1;form;constructor(e,t){super(),this.formBuilder=e,this.sessionService=t}onModalInitialized(){super.onModalInitialized(),this.mapping?(this.mapping=b(this.mapping),this.isEditMode=!0):(this.mapping=new I,this.mapping.id=x(),this.mapping.type=d.Sensor,this.mapping.dryContactInputType=A.Counter),this.createForm()}createForm(){this.form=this.formBuilder.group({accessControlPointId:[this.mapping.accessControlPointId||null,[l.required]],dryContactInputId:[this.mapping.dryContactInputId||null,[l.required]],dryContactInputName:[this.mapping.dryContactInputName||"",[l.required]],counterSensorEvents:[this.mapping.counterSensorEvents||[],[l.required]]})}onSensorSelected(e){let t=e.data;this.pairedRelay=t.deviceRelayId&&t.deviceRelayId!="",this.form.get("dryContactInputName").setValue(e.optionLabel),(!this.mapping.dryContactInputId||this.mapping.dryContactInputId!=e.optionValue)&&this.form.get("counterSensorEvents").setValue([])}isEventAvailable(e){switch(e){case Ce.UnknownReasonCounterRelayIsNotMapped:return!this.pairedRelay;default:return this.pairedRelay}}onSaveClicked(e){Object.assign(this.mapping,this.form.value),this.closeModal(this.mapping)}static ctorParameters=()=>[{type:h},{type:T}];static propDecorators={mapping:[{type:f}]}};L=At([c({selector:"armon-camera-sensor-counter-modal",template:We,standalone:!0,imports:[v,C,E,g,W,y,u,m,p],styles:[Xe]})],L);var Ye=`<ng-container>
  <div class="modal-header">
    <span class="text-lg">{{'CONNECTIONS.TYPE_TAMPER_SENSOR' | translate}}</span>
  </div>
  <div class="modal-body">
    <form class="form" [formGroup]="form">
      <div class="row">
        <div class="col-12">
          <div class="form-group">
            <label>{{'CAMERA.TERMINAL'| translate}}</label>
            <armon-select-search query="terminal" [allowMulti]="false" formControlName="terminalId"
              [invalid]="form.get('terminalId').touched && form.get('terminalId').invalid">
            </armon-select-search>
            <ng-template
              *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('terminalId')}">
            </ng-template>
          </div>
        </div>
        <div class="col-12">
          <div class="form-group">
            <label>{{'CONNECTIONS.TYPE_STATUS_SENSOR' | translate}}</label>
            <armon-select-search query="drycontact" [allowMulti]="false" formControlName="dryContactInputId"
              [searchFilters]="{terminalId:form.get('terminalId').value, sensorType:6}"
              (onSelectedChanged)="onSensorSelected($event)"
              [invalid]="form.get('dryContactInputId').touched && form.get('dryContactInputId').invalid">
            </armon-select-search>
            <ng-template
              *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('dryContactInputId')}">
            </ng-template>
          </div>
        </div>
      </div>
    </form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
      {{'BUTTON.CANCEL' | translate}}
    </button>
    <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="form.invalid">
      {{(isEditMode?'BUTTON.UPDATE':'BUTTON.ADD') | translate}}
    </button>
  </div>

  <!-- FORM FIELD VALIDATION -->
  <ng-template #controlValidationTemplate let-form let-control="control">
    <ng-container *ngIf="control.errors">
      <div class="invalid-feedback d-flex flex-column" style="display: initial;">
        <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
        <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
        <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
        <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
          max:control.errors.maxlength.requiredLength} }}</span>
        <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
        <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
          min:control.errors.minlength.requiredLength} }}</span>
      </div>
    </ng-container>
  </ng-template>`;var Qe=`.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}
`;var Nt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},z=class extends S{formBuilder;sessionService;mapping;isEditMode=!1;form;constructor(e,t){super(),this.formBuilder=e,this.sessionService=t}onModalInitialized(){super.onModalInitialized(),this.mapping?(this.mapping=b(this.mapping),this.isEditMode=!0):(this.mapping=new I,this.mapping.id=x(),this.mapping.type=d.Sensor,this.mapping.dryContactInputType=A.TamperSwitch),this.createForm()}createForm(){this.form=this.formBuilder.group({terminalId:[this.mapping.terminalId||null,[l.required]],dryContactInputId:[this.mapping.dryContactInputId||null,[l.required]],dryContactInputName:[this.mapping.dryContactInputName||"",[l.required]]})}onSensorSelected(e){this.form.get("dryContactInputName").setValue(e.optionLabel)}onSaveClicked(e){Object.assign(this.mapping,this.form.value),this.closeModal(this.mapping)}static ctorParameters=()=>[{type:h},{type:T}];static propDecorators={mapping:[{type:f}]}};z=Nt([c({selector:"armon-camera-switch-tamper-modal",template:Ye,standalone:!0,imports:[v,C,E,g,m,p],styles:[Qe]})],z);var Je=`<ng-container>
  <div class="modal-header">
    <span class="text-lg">{{'CONNECTIONS.TYPE_EXIT_BUTTON' | translate}}</span>
  </div>
  <div class="modal-body">
    <form class="form" [formGroup]="form">
      <div class="row">
        <div class="col-12">
          <div class="form-group">
            <label>{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>
            <armon-select-search query="point" [allowMulti]="false" formControlName="accessControlPointId"
              [invalid]="form.get('accessControlPointId').touched && form.get('accessControlPointId').invalid">
            </armon-select-search>
            <ng-template
              *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('accessControlPointId')}">
            </ng-template>
          </div>
        </div>
        <div class="col-12">
          <div class="form-group">
            <label>{{'REPORT.ACP_SUMMARY_EXIT_BUTTON' | translate}}</label>
            <armon-select-search query="exitbutton" [allowMulti]="false" formControlName="dryContactInputId"
              [searchFilters]="{accessControlPointId:form.get('accessControlPointId').value}"
              (onSelectedChanged)="onExitButtonSelected($event)"
              [invalid]="form.get('dryContactInputId').touched && form.get('dryContactInputId').invalid">
            </armon-select-search>
            <ng-template
              *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('dryContactInputId')}">
            </ng-template>
          </div>
        </div>
      </div>
    </form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">
      {{'BUTTON.CANCEL' | translate}}
    </button>
    <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="form.invalid">
      {{(isEditMode?'BUTTON.UPDATE':'BUTTON.ADD') | translate}}
    </button>
  </div>

  <!-- FORM FIELD VALIDATION -->
  <ng-template #controlValidationTemplate let-form let-control="control">
    <ng-container *ngIf="control.errors">
      <div class="invalid-feedback d-flex flex-column" style="display: initial;">
        <span *ngIf="control.errors.required">{{'VALIDATION.REQUIRED'|translate}}</span>
        <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
        <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
        <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
          max:control.errors.maxlength.requiredLength} }}</span>
        <span *ngIf="control.errors.min">{{'VALIDATION.MIN_VALUE'|translate:control.errors.min}}</span>
        <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
          min:control.errors.minlength.requiredLength} }}</span>
      </div>
    </ng-container>
  </ng-template>`;var Ke=`.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}
`;var wt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},V=class extends S{formBuilder;sessionService;mapping;isEditMode=!1;form;constructor(e,t){super(),this.formBuilder=e,this.sessionService=t}onModalInitialized(){super.onModalInitialized(),this.mapping?(this.mapping=b(this.mapping),this.isEditMode=!0):(this.mapping=new I,this.mapping.id=x(),this.mapping.type=d.Sensor,this.mapping.dryContactInputType=A.ExitButton),this.createForm()}createForm(){this.form=this.formBuilder.group({accessControlPointId:[this.mapping.accessControlPointId||null,[l.required]],dryContactInputId:[this.mapping.dryContactInputId||null,[l.required]],dryContactInputName:[this.mapping.dryContactInputName||"",[l.required]]})}onExitButtonSelected(e){this.form.get("dryContactInputName").setValue(e.optionLabel)}onSaveClicked(e){Object.assign(this.mapping,this.form.value),this.closeModal(this.mapping)}static ctorParameters=()=>[{type:h},{type:T}];static propDecorators={mapping:[{type:f}]}};V=wt([c({selector:"armon-camera-exit-button-modal",template:Je,standalone:!0,imports:[v,C,E,g,m,p],styles:[Ke]})],V);var Ze=`<ng-container *ngIf="map">
  <div class="d-flex container mb-1">
    <div class="d-flex flex-grow-1 align-items-center">
      <span *ngIf="map.type === CameraActionType.Auth" class="text-sm text-bold me-1">
        {{'CAMERA.AUTHENTICATION' | translate}}:
      </span>
      <span *ngIf="map.type === CameraActionType.Sensor" class="text-sm text-bold me-1">
        <ng-container [ngSwitch]="map.dryContactInputType">
          <ng-container *ngSwitchCase="DryContactType.StatusSensor">{{'CONNECTIONS.TYPE_STATUS_SENSOR'|translate}}:
          </ng-container>
          <ng-container *ngSwitchCase="DryContactType.Counter">{{'CONNECTIONS.TYPE_COUNTER_SENSOR'|translate}}:
          </ng-container>
          <ng-container *ngSwitchCase="DryContactType.TamperSwitch">{{'CONNECTIONS.TYPE_TAMPER_SENSOR'|translate}}:
          </ng-container>
          <ng-container *ngSwitchCase="DryContactType.ExitButton">{{'CONNECTIONS.TYPE_EXIT_BUTTON'|translate}}:
          </ng-container>
        </ng-container>
      </span>
      <span *ngIf="map.type === CameraActionType.RemoteAccess" class="text-sm text-bold me-1">
        {{'CAMERA.REMOTE_ACCESS' | translate}}:
      </span>
      <span *ngIf="map.type === CameraActionType.Auth || map.type === CameraActionType.RemoteAccess" class="text-sm">
        {{map.accessControlPointName}}
      </span>
      <span *ngIf="map.type === CameraActionType.Sensor" class="text-sm">
        {{map.dryContactInputName}}
      </span>
    </div>
    <button class="btn btn-sm btn-link" (click)="onClickEdit($event)">{{'BUTTON.EDIT' | translate}}</button>
    <button class="btn btn-sm btn-link" (click)="onClickDelete($event)">{{'BUTTON.DELETE' | translate}}</button>
  </div>
</ng-container>`;var et=`.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}:host .container{border:1px solid #cde1ec;background-color:#fafcfd;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}
`;var kt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},J=class{modalService;map;mapChange=new O;mapDeleteClicked=new O;constructor(e){this.modalService=e}ngOnInit(){}onClickEdit(e){if(this.map.type==d.Auth)this.onEditAuth();else if(this.map.type==d.Sensor)switch(this.map.dryContactInputType){case A.StatusSensor:this.onEditSensorStatus();break;case A.Counter:this.onEditSensorCounter();break;case A.TamperSwitch:this.onEditSwitchTamper();break;case A.ExitButton:this.onEditExitButton();break}else this.map.type==d.RemoteAccess&&this.onEditRemoteAccess()}onClickDelete(e){this.mapDeleteClicked.emit(this.map)}get CameraActionType(){return d}get DryContactType(){return A}onEditAuth(e=null){this.modalService.open(k,{settings:{size:"md",centered:!0},props:{mapping:this.map}}).result.then(t=>{this.map=t,this.mapChange.emit(this.map)}).catch(t=>{})}onEditRemoteAccess(e=null){this.modalService.open(P,{settings:{size:"md",centered:!0},props:{mapping:this.map}}).result.then(t=>{this.map=t,this.mapChange.emit(this.map)}).catch(t=>{})}onEditSensorStatus(e=null){this.modalService.open(D,{settings:{size:"md",centered:!0},props:{mapping:this.map}}).result.then(t=>{this.map=t,this.mapChange.emit(this.map)}).catch(t=>{})}onEditSensorCounter(e=null){this.modalService.open(L,{settings:{size:"md",centered:!0},props:{mapping:this.map}}).result.then(t=>{this.map=t,this.mapChange.emit(this.map)}).catch(t=>{})}onEditSwitchTamper(e=null){this.modalService.open(z,{settings:{size:"md",centered:!0},props:{mapping:this.map}}).result.then(t=>{this.map=t,this.mapChange.emit(this.map)}).catch(t=>{})}onEditExitButton(e=null){this.modalService.open(V,{settings:{size:"md",centered:!0},props:{mapping:this.map}}).result.then(t=>{this.map=t,this.mapChange.emit(this.map)}).catch(t=>{})}static ctorParameters=()=>[{type:R}];static propDecorators={map:[{type:f}],mapChange:[{type:w}],mapDeleteClicked:[{type:w}]}};J=kt([c({selector:"armon-camera-action-item",template:Ze,standalone:!0,imports:[m,re,ae,p],styles:[et]})],J);var Pt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},F=class extends S{formBuilder;interactionService;cameraService;sessionService;modalService;camera;resultMappings=[];viewAccessControlPointIds=[];actionMappings=[];visibleComponent=!1;visibleLogAccessControlPoint=!1;mapAccessControlPoint=!1;isEditMode=!1;cameraForm;selectionAccessControlPoints;constructor(e,t,o,r,n){super(),this.formBuilder=e,this.interactionService=t,this.cameraService=o,this.sessionService=r,this.modalService=n}onModalInitialized(){super.onModalInitialized(),this.camera&&(this.camera=b(this.camera),this.isEditMode=this.camera.id&&this.camera.id!="",this.isEditMode&&this.camera.proxyTerminalId&&this.camera.mappings.filter(t=>t.type==d.View).forEach(t=>{this.viewAccessControlPointIds.push(t.accessControlPointId)}),this.actionMappings=this.camera.mappings.filter(e=>e.type!=d.View),this.actionMappings.forEach(e=>{e.id=x()})),this.createCameraForm(),this.visibleComponent=!0}createCameraForm(){this.cameraForm=this.formBuilder.group({name:[this.camera.name||null,[l.required,l.maxLength(255)]],userName:[this.camera.userName||null,l.maxLength(255)],password:[null,l.maxLength(255)],snapshotUrl:[this.camera.snapshotUrl||null,[l.required,l.maxLength(2055)]],proxyTerminalId:[this.camera.proxyTerminalId||null]})}onMappingDeleteClicked(e){let t=this.actionMappings.findIndex(o=>o.id==e.id);t>-1&&this.actionMappings.splice(t,1)}onSaveClicked(e){Object.assign(this.camera,this.cameraForm.value),this.camera.mappings=[],this.camera.proxyTerminalId&&this.viewAccessControlPointIds&&this.viewAccessControlPointIds.length>0&&this.viewAccessControlPointIds.forEach(t=>{let o=new I;o.type=d.View,o.accessControlPointId=t,this.camera.mappings.push(o)}),this.camera.mappings.push(...this.actionMappings),this.cameraService.upsertCamera(X.getRequestModel(this.camera)).subscribe(t=>{this.interactionService.showMessage("CAMERA.SAVE_COMPLETED",null,j.Success),this.closeModal(t)})}onAddAuth(e){this.modalService.open(k,{settings:{size:"md",centered:!0},props:{mapping:null}}).result.then(t=>{this.actionMappings.push(t)}).catch(t=>{})}onAddRemoteAccess(e){this.modalService.open(P,{settings:{size:"md",centered:!0},props:{mapping:null}}).result.then(t=>{this.actionMappings.push(t)}).catch(t=>{})}onAddSensorStatus(e){this.modalService.open(D,{settings:{size:"md",centered:!0},props:{mapping:null}}).result.then(t=>{this.actionMappings.push(t)}).catch(t=>{})}onAddSensorCounter(e){this.modalService.open(L,{settings:{size:"md",centered:!0},props:{mapping:null}}).result.then(t=>{this.actionMappings.push(t)}).catch(t=>{})}onAddSwitchTamper(e){this.modalService.open(z,{settings:{size:"md",centered:!0},props:{mapping:null}}).result.then(t=>{this.actionMappings.push(t)}).catch(t=>{})}onAddExitButton(e){this.modalService.open(V,{settings:{size:"md",centered:!0},props:{mapping:null}}).result.then(t=>{this.actionMappings.push(t)}).catch(t=>{})}static ctorParameters=()=>[{type:h},{type:_},{type:M},{type:T},{type:R}];static propDecorators={camera:[{type:f}],selectionAccessControlPoints:[{type:oe,args:["searchAccessControlPoints"]}]}};F=Pt([c({selector:"armon-camera-modal",template:Fe,standalone:!0,imports:[m,Se,v,C,y,g,E,$,q,B,u,J,p],styles:[Ue]})],F);var tt=`<ng-container *ngIf="visible">
    <div class="row mb-4">
        <div class="col-12">
            <span class="text-lg">{{'CAMERA.WEBRTC_PREFERENCES'|translate}}</span>
        </div>
    </div>
    <div class="row">
        <div class="col-12">
            <div class="form-check">
                <input type="radio" id="twilio-false" name="twilio-false" class="form-check-input"
                    [(ngModel)]="webRtcPreferences.twilio.enabled" [value]="false">
                <label class="form-check-label cursor-pointer"
                    for="twilio-false">{{'CAMERA.WEBRTC_ICE_SERVERS_SETTINGS'|translate}}</label>
            </div>
        </div>
    </div>
    <form [formGroup]="serversform">
        <div class="row" [hidden]="webRtcPreferences.twilio.enabled">
            <div class="col-12 d-flex align-items-center my-3">
                <button class="btn btn-sm btn-primary" (click)="onAddServerClicked($event)">
                    <cds-icon shape="plus-circle" solid class="cds-icon-18 me-1"></cds-icon>{{'BUTTON.ADD'|translate}}
                </button>
            </div>
            <div class="col-12 mb-2">
                <div formArray="formServers" [hidden]="formServers.controls.length==0">
                    <ng-container
                        *ngFor="let formServerControl of formServers.controls; let index = index; let last = last;">
                        <div class="row mb-3" [formGroup]="formServerControl">
                            <div class="col-12 pb-1 b-b-1">
                                <span class="text-md">{{'CAMERA.WEBRTC_ICE_SERVER'|translate}}<span class="ms-1">{{index
                                        + 1}}</span></span>
                            </div>
                            <div class="col-12">
                                <label
                                    class="report-form-label">{{'CAMERA.WEBRTC_ICE_SERVER_ADDRESS'|translate}}</label>
                                <div class="input-group input-group-sm">
                                    <input [formControl]="formServerControl.get('urls')" type="text"
                                        [ngClass]="{'is-invalid': formServerControl.get('urls').invalid}"
                                        class="form-control form-control-sm">
                                    <button class="btn btn-sm btn-danger"
                                        (click)="onRemoveServerClicked($event, index)">
                                        <cds-icon shape="times-circle" class="me-1 cds-icon-18" solid></cds-icon>
                                        {{'BUTTON.DELETE'|translate}}
                                    </button>
                                </div>
                                <ng-template
                                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: formServerControl, control:formServerControl.get('urls')}">
                                </ng-template>
                            </div>
                            <div class="col-6">
                                <label class="report-form-label">{{'CAMERA.USERNAME'|translate}}</label>
                                <input [formControl]="formServerControl.get('username')" type="text"
                                    [ngClass]="{'is-invalid': formServerControl.get('username').invalid}"
                                    class="form-control form-control-sm">
                                <ng-template
                                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: formServerControl, control:formServerControl.get('username')}">
                                </ng-template>
                            </div>
                            <div class="col-6">
                                <label class="report-form-label">{{'CAMERA.PASSWORD'|translate}}</label>
                                <input [formControl]="formServerControl.get('credential')" type="text"
                                    [ngClass]="{'is-invalid': formServerControl.get('credential').invalid}"
                                    placeholder="{{((formServerControl.get('urls').pristine && formServerControl.get('urls').value)?'COMMON.PASSWORD_HIDDEN_PLACEHOLDER':undefined) | translate}}"
                                    class="form-control form-control-sm">
                                <ng-template
                                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: formServerControl, control:formServerControl.get('credential')}">
                                </ng-template>
                            </div>
                        </div>
                    </ng-container>
                </div>
            </div>
        </div>
    </form>
    <div class="row mt-3">
        <div class="col-12">
            <div class="form-check">
                <input type="radio" id="twilio-true" name="twilio-true" class="form-check-input"
                    [(ngModel)]="webRtcPreferences.twilio.enabled" [value]="true">
                <label class="form-check-label cursor-pointer"
                    for="twilio-true">{{'CAMERA.WEBRTC_TWILIO_INTEGRATION'|translate}}</label>
            </div>
        </div>
    </div>
    <form [formGroup]="twilioForm">
        <div class="row mt-3" [hidden]="!webRtcPreferences.twilio.enabled">
            <div class="col-6">
                <label class="report-form-label">{{'CAMERA.WEBRTC_TWILIO_ACCOUNT_SID'|translate}}</label>
                <input [formControl]="twilioForm.get('accountSid')" type="text"
                    [ngClass]="{'is-invalid': twilioForm.get('accountSid').invalid}"
                    class="form-control form-control-sm">
                <ng-template
                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: twilioForm, control:twilioForm.get('accountSid')}">
                </ng-template>
            </div>
            <div class="col-6">
                <label class="report-form-label">{{'CAMERA.WEBRTC_TWILIO_AUTH_TOKEN'|translate}}</label>
                <input [formControl]="twilioForm.get('authToken')" type="text"
                    [ngClass]="{'is-invalid': twilioForm.get('authToken').invalid}"
                    placeholder="{{((twilioForm.get('authToken').hasValidator(requiredValidator))?undefined:'COMMON.PASSWORD_HIDDEN_PLACEHOLDER') | translate}}"
                    class="form-control form-control-sm">
                <ng-template
                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: twilioForm, control:twilioForm.get('authToken')}">
                </ng-template>
            </div>
        </div>
    </form>
    <div class="row mt-3">
        <div class="col-12 d-flex justify-content-end">
            <button class="btn btn-sm btn-outline-primary me-2" *ngIf="drawerRef"
                (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
            <button class="btn btn-sm btn-success"
                [disabled]="webRtcPreferences.twilio.enabled?twilioForm.invalid:serversform.invalid"
                (click)="onSaveClicked($event)">{{'BUTTON.SAVE'|translate}}</button>
        </div>
    </div>
</ng-container>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control" let-isArray="isArray">
    <ng-container *ngIf="control.errors">
        <div class="invalid-feedback" style="display: initial;">
            <span
                *ngIf="control.errors.required">{{(isArray?'VALIDATION.MIN_ONE_SELECTED':'VALIDATION.REQUIRED')|translate}}</span>
            <span *ngIf="control.errors.ip">{{'VALIDATION.IP_V4_OR_V6'|translate}}</span>
            <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
            <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
            <span *ngIf="control.errors.unique">{{'VALIDATION.UNIQUE'|translate}}</span>
        </div>
    </ng-container>
</ng-template>`;var nt=`.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}
`;var ot=st(lt());var zt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},K=class{notificationJobService;interactionService;languageService;settingsService;drawerRef;formBuilder;visible=!1;serversform;twilioForm;webRtcPreferences;requiredValidator=l.required;constructor(e,t,o,r,n,a){this.notificationJobService=e,this.interactionService=t,this.languageService=o,this.settingsService=r,this.drawerRef=n,this.formBuilder=a}ngOnInit(){this.getSettings()}ngOnDestroy(){}getSettings(){this.settingsService.getOrganizationSettings().subscribe(e=>{this.webRtcPreferences=e.webRtc,this.webRtcPreferences||(this.webRtcPreferences=te.getEmptyModel()),this.createForms()})}updateSettings(){let e=xe.getEmptyModel(),t=te.getEmptyModel();Object.assign(t,this.webRtcPreferences),this.webRtcPreferences.twilio.enabled?(t.twilio.enabled=!0,Object.assign(t.twilio,this.twilioForm.value)):(t.twilio.enabled=!1,Object.assign(t,this.serversform.value)),e.webRtc=t,this.settingsService.updateOrganizationSettings(e).subscribe(o=>{this.interactionService.showMessage("NOTIFICATIONJOBS.SETTINGS_ORGANIZATION_UPDATED",null,j.Success),this.drawerRef&&this.drawerRef.close()})}createForms(){if(this.serversform=this.formBuilder.group({iceServers:this.formBuilder.array([])}),this.webRtcPreferences&&this.webRtcPreferences.iceServers&&this.webRtcPreferences.iceServers.length>0){let e=this.serversform.get("iceServers");this.webRtcPreferences.iceServers.map(t=>{e.push(this.createIceServerForm(t))})}this.twilioForm=this.formBuilder.group({accountSid:[this.webRtcPreferences.twilio.accountSid?this.webRtcPreferences.twilio.accountSid:null,[l.required]],authToken:[null,this.webRtcPreferences.twilio.authToken?[]:[l.required]]}),this.twilioForm.get("accountSid").valueChanges.subscribe(e=>{ot.default.isNil(e)||this.webRtcPreferences.twilio.accountSid&&e!=this.webRtcPreferences.twilio.accountSid?(this.twilioForm.get("authToken").setValidators([l.required]),this.twilioForm.get("authToken").updateValueAndValidity()):(this.twilioForm.get("authToken").clearValidators(),this.twilioForm.get("authToken").updateValueAndValidity())}),this.visible=!0}get formServers(){return this.serversform.get("iceServers")}createIceServerForm(e=null){return e||(e={}),this.formBuilder.group({urls:[e.urls?e.urls:null,[l.required,pe.unique()]],username:[e.username?e.username:null],credential:[null]})}onAddServerClicked(e){this.formServers.push(this.createIceServerForm()),this.serversform.updateValueAndValidity()}onRemoveServerClicked(e,t){this.formServers.removeAt(t),this.serversform.updateValueAndValidity()}onCancelClicked(e){this.drawerRef&&this.drawerRef.close()}onSaveClicked(e){this.updateSettings()}static ctorParameters=()=>[{type:ge},{type:_},{type:ce},{type:Te},{type:Ae,decorators:[{type:ne}]},{type:h}]};K=zt([c({selector:"armon-camera-webrtc-preferences",template:tt,standalone:!0,imports:[m,v,me,C,u,y,g,p],styles:[nt]})],K);var rt=`<div class="card mb-3">

  <div class="card-body">
    <div class="d-flex">
      <div class="d-flex flex-column flex-grow-1">
        <span class="text-lg mb-4">{{camera.name}}</span>
        <div class="d-flex">
          <armon-icon-label [colorCode]="8" *ngIf="camera.hasMapView">
            <ng-template icon-label-icon>
              <cds-icon shape="video-camera" solid></cds-icon>
            </ng-template>
            <ng-template icon-label-content>
              <span>{{'CAMERA.VIEW'|translate}}</span>
            </ng-template>
          </armon-icon-label>
        </div>
        <div class="d-flex flex-wrap mt-2 column-gap-1">
          <armon-icon-label [colorCode]="6" *ngIf="camera.hasMapAuth" class="mb-2">
            <ng-template icon-label-icon>
              <cds-icon shape="camera" solid></cds-icon>
            </ng-template>
            <ng-template icon-label-content>
              <span>{{'CAMERA.AUTHENTICATION'|translate}}</span>
            </ng-template>
          </armon-icon-label>
          <armon-icon-label [colorCode]="6" *ngIf="camera.hasMapSensor" class="mb-2">
            <ng-template icon-label-icon>
              <cds-icon shape="camera" solid></cds-icon>
            </ng-template>
            <ng-template icon-label-content>
              <span>{{'CAMERA.SENSOR'|translate}}</span>
            </ng-template>
          </armon-icon-label>
          <armon-icon-label [colorCode]="6" *ngIf="camera.hasMapRemoteAccess" class="mb-2">
            <ng-template icon-label-icon>
              <cds-icon shape="camera" solid></cds-icon>
            </ng-template>
            <ng-template icon-label-content>
              <span>{{'CAMERA.REMOTE_ACCESS'|translate}}</span>
            </ng-template>
          </armon-icon-label>
        </div>
      </div>
      <div class="d-flex">
        <armon-camera-preview [camera]="camera" [pauseAfter]="1" [nextPauseAfter]="5"></armon-camera-preview>
      </div>
    </div>
  </div>

  <div class="card-footer" *ngIf="visibleButtons.length > 0">
    <button class="btn btn-sm btn-link" *ngFor="let button of visibleButtons"
      (click)="onFooterButtonClicked($event, button.event)">{{button.text | translate}}</button>
    <button nz-dropdown [nzDropdownMenu]="menuSub" class="btn btn-link btn-sm me-2" *ngIf="hiddenButtons.length > 0"
      [nzClickHide]="true">
      <cds-icon shape="ellipsis-horizontal"></cds-icon>
    </button>
    <nz-dropdown-menu #menuSub="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item *ngFor="let button of hiddenButtons" (click)="onFooterButtonClicked($event, button.event)">
          {{button.text | translate}}</li>
      </ul>
    </nz-dropdown-menu>
  </div>

</div>`;var at=`.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}
`;var Ut=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},Z=class extends Le{interactionService;cameraService;modalService;authService;camera;cameraDeleted=new O;cameraUpdated=new O;constructor(e,t,o,r){super(r),this.interactionService=e,this.cameraService=t,this.modalService=o,this.authService=r}ngOnInit(){this.initializeButtons()}initializeButtons(){this.addButton("BUTTON.EDIT",this.onEditButtonClicked,U.SYSTEM.getWrite()),this.addButton("BUTTON.DELETE",this.onDeleteButtonClicked,U.SYSTEM.getWrite())}onEditButtonClicked(){this.modalService.open(F,{settings:{size:"lg",scrollable:!0},props:{camera:this.camera}}).result.then(e=>{this.cameraUpdated.emit(this.camera.id)}).catch(e=>{})}onDeleteButtonClicked(){this.interactionService.showDialog(this.camera.name,"CAMERA.APPROVE_FOR_DELETE",null,null,!0,"BUTTON.DELETE","",!0,()=>{this.cameraService.deleteCamera(this.camera.id).subscribe(()=>{this.cameraDeleted.emit(this.camera.id)})})}static ctorParameters=()=>[{type:_},{type:M},{type:R},{type:Y}];static propDecorators={camera:[{type:f}],cameraDeleted:[{type:w}],cameraUpdated:[{type:w}]}};Z=Ut([c({selector:"armon-camera-card",template:rt,standalone:!0,imports:[m,_e,Oe,we,De,u,$,q,B,p],styles:[at]})],Z);var jt=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(n=(r<3?a(n):r>3?a(e,t,n):a(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},it=class{cameraService;authService;drawerService;modalService;cameras;permissionAddCamera=!1;request;filterText;paginationResponse=new ee;paginationRequest=new de;constructor(e,t,o,r){this.cameraService=e,this.authService=t,this.drawerService=o,this.modalService=r}ngOnInit(){this.getCameras(),this.checkPermissions()}onFilterChanged(e){e!=null&&(this.filterText=e,this.getCameras())}onAddCameraButtonClicked(){this.permissionAddCamera&&this.modalService.open(F,{settings:{size:"lg",scrollable:!0},props:{camera:X.getEmptyModel()}}).result.then(e=>{this.getCameras()}).catch(e=>{})}onWebRTCPreferencesClicked(){let e=this.drawerService.create({nzContent:K,nzClosable:!1,nzWidth:se(!1),nzContentParams:{}})}onCameraDeleted(e){ie(this.cameras,"id",e)}onCameraUpdated(e){this.getCameras()}createRequestObject(){this.request||(this.request=new ve,this.resetFilter())}resetFilter(){this.request.skip=0,this.request.take=10,this.cameras=null}getCameras(){this.createRequestObject(),this.request.name=this.filterText||"",this.cameraService.listCameras(this.request).subscribe(e=>{this.cameras=e.items;let t=new ee;t.skip=e.skip,t.take=e.take,t.total=e.total,this.paginationResponse=t})}checkPermissions(){this.permissionAddCamera=this.authService.checkPermission(U.SYSTEM.getWrite())}pageChanged(e){this.request.skip=e.skip,this.request.take=e.take,this.getCameras()}static ctorParameters=()=>[{type:M},{type:Y},{type:Ee},{type:R}]};it=jt([c({selector:"armon-manage-cameras",template:ze,animations:Ne,standalone:!0,imports:[Pe,Me,Re,ke,m,u,Z,he,ye,p],styles:[Ve]})],it);export{it as ManageCamerasComponent};
