import{a as we,b as k,c as Pe}from"./chunk-V5QQQH6M.js";import{a as ve}from"./chunk-FFR3SHS6.js";import"./chunk-I2YJPM55.js";import{a as he,b as ge,c as P}from"./chunk-SDHD5Z3H.js";import"./chunk-ZDEKLPKE.js";import"./chunk-VQU52MNH.js";import{a as ue,b as xe}from"./chunk-MXSLISEG.js";import"./chunk-FH4KR5HL.js";import"./chunk-PQGNYTS4.js";import"./chunk-P3WQM3KW.js";import"./chunk-3GSDFESG.js";import"./chunk-7QEXVS2A.js";import{b as ae}from"./chunk-FSCI3FDB.js";import{a as ce,b as me,c as pe}from"./chunk-UZB7YFT6.js";import"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import"./chunk-JUDWAYYT.js";import{a as Se}from"./chunk-5OT2MLHH.js";import{a as le}from"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{a as ye}from"./chunk-4MZCYQX4.js";import{b as de,c as fe,d as be}from"./chunk-YOJ4KGSB.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import{a as re}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{B as V,H as Y,Mb as oe,Ob as ne,a as De,c as r,h as J,i as u,j as w,o as B,wb as se}from"./chunk-YSQLW2JA.js";import{Hb as te,L as K,Ob as ie,da as Z,ea as X}from"./chunk-NVJ2ZZFT.js";import{Aa as m,Ba as f,Be as I,Ce as G,Dc as n,Fb as z,Mc as M,Mg as E,Ng as Q,Pd as L,Qf as v,Rd as S,Tb as A,Te as W,Vc as N,Wb as D,af as $,bb as h,bh as ee,cd as U,dc as O,dd as y,g as Ae,ha as d,hd as p,jb as g,ma as T,te as q,ue as F,ve as b,xe as H,ya as x,ye as j,zc as _}from"./chunk-SKPDQO4E.js";var ke=`<div class="h-100">
    <side-navigation *ngIf="visibleComponent">
        <ng-template side-navigation-nav>
            <armon-pacs-filter-select [title]="'PACS.PPERMISSION_TYPE_LABEL'" [options]="typeFilterOptions"
                [selectedIndex]="selectedTypeIndex" (filterChanged)="typeFilterChanged($event)">
            </armon-pacs-filter-select>
            <armon-pacs-filter-select [title]="'PACS.PPERMISSION_STATUS'" [options]="statusFilterOptions"
                (filterChanged)="statusFilterChanged($event)"></armon-pacs-filter-select>
            <armon-pacs-filter-date-range [title]="'PACS.USER_PPERMISSION_FILTER_DATE'" [dateRange]="filterDateRange"
                (filterChanged)="dateRangeFilterChanged($event)"></armon-pacs-filter-date-range>
            <div class="col-12 mt-4 mb-2">
                <label class="report-form-label">{{'IDENTITY.TITLE' | translate :
                    languageService.userTranslate}}</label>
                <armon-select-search query="identity" [allowMulti]="true" [(ngModel)]="request.userIds"
                    (ngModelChange)="onFilterChanged($event)">
                </armon-select-search>
            </div>
            <div class="col-12 mb-2">
                <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
                <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="request.organizationUnitIds"
                    (ngModelChange)="onFilterChanged($event)">
                </armon-select-search>
                <label class="report-checkbox-label" nz-checkbox
                    *ngIf="request.organizationUnitIds && request.organizationUnitIds.length > 0"
                    [(ngModel)]="request.organizationUnitHierarchically"
                    (ngModelChange)="onFilterChanged($event)">{{'REPORT.SHOW_HIERARCHICALLY' |
                    translate}}</label>
            </div>
            <div class="col-12 mb-4">
                <label class="report-form-label">{{'REPORT.USER_GROUPS' | translate :
                    languageService.userTranslate}}</label>
                <armon-select-search query="group" [allowMulti]="true" [(ngModel)]="request.userGroupIds"
                    (ngModelChange)="onFilterChanged($event)">
                </armon-select-search>
            </div>
            <div class="d-flex justify-content-center mt-2">
                <button class="btn btn-success btn-sm me-2" (click)="onGetExcelClicked($event)">{{'BUTTON.EXCEL'
                    | translate}}</button>
                <button class="btn btn-primary btn-sm" (click)="onGetPdfClicked($event)">{{'BUTTON.PDF'
                    | translate}}</button>
            </div>
        </ng-template>
        <ng-template side-navigation-content>
            <div class="row">
                <div class="col-12" *ngIf="visibleRoleSwitch">
                    <div class="alert alert-info" role="alert">
                        {{(useAsHumanResources ? 'PACS.PPERMISSION_USE_AS_HR_INFO' :
                        'PACS.PPERMISSION_USE_AS_MANAGER_INFO' ) | translate}}
                        <a class="alert-link" (click)="switchRoleClicked($event)"
                            *ngIf="useAsHumanResources">{{'PACS.PPERMISSION_SWITCH_AS_MANAGER'|translate}}</a>
                        <a class="alert-link" (click)="switchRoleClicked($event)"
                            *ngIf="!useAsHumanResources">{{'PACS.PPERMISSION_SWITCH_AS_HR'|translate}}</a>
                    </div>
                </div>
                <div class="col-12">
                    <div class="row">
                        <div class="col-12">
                            <armon-sorting-picker [data]="sortingPickerData"
                                (selectionChanged)="onSortingSelectionChanged($event)">
                            </armon-sorting-picker>
                        </div>
                    </div>
                </div>
                <div class="col-12 my-3" *ngIf="useAsHumanResources || hasWritePermission">
                    <button class="btn btn-sm btn-primary"
                        (click)="addPPermission($event)">{{'PACS.USER_PPERMISSION_ADD'|translate}}</button>
                </div>
            </div>
            <div class="row py-2" *ngIf="limitedMode">
                <div class="col-xl-12">
                    <div class="alert alert-info" role="alert">
                        {{'PACS.DIRECTION_PPERMISSION_LIST_LIMITED'|translate}}<a class="alert-link"
                            (click)="exitLimitedMode($event)">{{'BUTTON.SHOW_ALL'|translate}}</a>
                    </div>
                </div>
            </div>
            <div class="row pb-3">
                <div class="col-xl-12">
                    <p-table [value]="ppermissions" dataKey="id" [responsive]="true" rowExpandMode="single">
                        <ng-template pTemplate="header">
                            <tr>
                                <th>{{'REPORT.PACS_COL_USER' | translate}}</th>
                                <th>{{'PACS.USER_PPERMISSION_DATES' | translate}}</th>
                                <th class="width-15p">{{'PACS.PPERMISSION_TYPE_LABEL' | translate}}</th>
                                <th>{{'PACS.PPERMISSION_STATUS' | translate}}</th>
                            </tr>
                        </ng-template>
                        <ng-template pTemplate="body" let-ppermission let-rowData let-expanded="expanded">
                            <tr [pRowToggler]="rowData" [attr.expanded]="expanded" class="data-row">
                                <td>
                                    <div class="multi-user" *ngIf="ppermission.multiUser">
                                        <div class="multi-user-icon">
                                            <cds-icon shape="users" solid size="md">
                                            </cds-icon>
                                        </div>
                                        <strong>
                                            {{'PACS.USER_PPERMISSION_MULTI_USER' | translate}}</strong>
                                    </div>
                                    <span *ngIf="!ppermission.multiUser">
                                        <armon-captionlines [showBorder]="false"
                                            [captionlines]="ppermission.userPPermissionInfo[0].userAndDeputyInfo.userCaptions">
                                        </armon-captionlines>
                                    </span>
                                </td>
                                <td>
                                    <div class="report-multi-data-cell">
                                        <div class="d-flex align-items-center">
                                            <span class="main-text">{{ppermission.dateRange.startDateText}}</span>
                                            <div class="ms-2">
                                                <armon-icon-label
                                                    [colorCode]="ppermission.ppermissionType.isDailyScheduled?1:2">
                                                    <ng-template icon-label-icon>
                                                        <cds-icon
                                                            shape="{{ppermission.ppermissionType.isDailyScheduled?'calendar':'clock'}}"
                                                            solid></cds-icon>
                                                    </ng-template>
                                                    <ng-template icon-label-content>
                                                        <armon-pacs-ppermission-duration
                                                            [isDailyScheduled]="ppermission.ppermissionType.isDailyScheduled"
                                                            [duration]="ppermission.permissionUsageCount"></armon-pacs-ppermission-duration>
                                                    </ng-template>
                                                </armon-icon-label>

                                            </div>
                                        </div>
                                        <span class="sub-text mt-2">{{ppermission.dateRange.startDateTime |
                                            date:'medium'}} ~ {{ppermission.dateRange.endDateTime |
                                            date:'medium'}}</span>
                                    </div>
                                </td>
                                <td>
                                    <span>{{ppermission.ppermissionType.name}}</span>
                                </td>
                                <td>
                                    <armon-pacs-ppermission-approve [ppermissionResponse]="ppermission"
                                        [widgetMode]="true" [userFilters]="{userIds:request.userIds}"
                                        [useAsHumanResources]="useAsHumanResources"></armon-pacs-ppermission-approve>
                                </td>
                            </tr>
                        </ng-template>
                        <ng-template pTemplate="rowexpansion" let-ppermission>
                            <tr class="expanded-row">
                                <td [attr.colspan]="4">
                                    <armon-pacs-ppermission-management-list-item [ppermissionResponse]="ppermission"
                                        [userFilters]="{userIds:request.userIds, organizationUnitIds:request.organizationUnitIds, organizationUnitHierarchically:request.organizationUnitHierarchically,userGroupIds:request.userGroupIds}"
                                        [useAsHumanResources]="useAsHumanResources"
                                        [hasWritePermission]="hasWritePermission"
                                        (ppermissionEditStarted)="editStarted($event)"
                                        (ppermissionEditCompleted)="editCompleted($event)"
                                        (ppermissionEditCancelled)="editCancelled($event)">
                                    </armon-pacs-ppermission-management-list-item>
                                </td>
                            </tr>
                        </ng-template>
                    </p-table>
                </div>
            </div>
            <div class="row pt-5" *ngIf="ppermissions && ppermissions.length==0">
                <div class="col-12">
                    <nz-empty [nzNotFoundContent]="contentTpl"
                        [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
                        <ng-template #contentTpl>
                            <span>{{'COMMON.NO_DATA'|translate}}</span>
                        </ng-template>
                    </nz-empty>
                </div>
            </div>
            <div class="row pb-3">
                <div class="col-xl-12">
                    <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)">
                    </armon-pagination>
                </div>
            </div>
        </ng-template>
    </side-navigation>
</div>`;var Re=`.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}.multi-user{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}.multi-user .multi-user-icon{width:48px;height:48px;color:#0369a1;background-color:#f5f9fb;margin:3px 6px 3px 3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;box-shadow:0 0 3px #bbb}
`;var C=Ae(De());var Ie=`<div class="ppermission-type-item">
    <div class="card-header py-1 px-2" *ngIf="ppermissionResponse.multiUser">
        <div class="main-title">{{ppermissionResponse.ppermissionType.name}}</div>
    </div>
    <div class="card-header py-1 px-2"
        *ngIf="!ppermissionResponse.multiUser && ppermissionResponse.userPPermissionInfo && ppermissionResponse.userPPermissionInfo[0]">
        <div class="title">{{ppermissionResponse.userPPermissionInfo[0].userAndDeputyInfo.user.fullname}}</div>
        <div class="sub-title">{{ppermissionResponse.ppermissionType.name}}</div>
    </div>
    <div class="card-block">
        <div class="section-tag-container">
            <div class="section-tag" type="1">
                <div class="icon-container">
                    <cds-icon shape="calendar" size="sm"></cds-icon>
                </div>
                <div class="title-container">
                    <div class="dateinfo-container">
                        <span>
                            <strong>{{'PACS.USER_PPERMISSION_DATES' | translate}}</strong>
                        </span>
                        <span>{{ppermissionResponse.dateRange.startDateTime | date:'medium'}} -
                            {{ppermissionResponse.dateRange.endDateTime
                            | date:'medium'}}</span>
                    </div>
                    <div class="button-container">
                        <button class="btn btn-outline-primary btn-sm" (click)="calendarClicked($event)">
                            <cds-icon shape="search" class="me-2"></cds-icon>{{'PACS.CALENDAR' | translate}}
                        </button>
                    </div>
                </div>

            </div>
            <div class="section-tag" type="2" *ngIf="ppermissionResponse.note && ppermissionResponse.note.length>0">
                <div class="icon-container">
                    <cds-icon shape="note" size="sm"></cds-icon>
                </div>
                <div class="title-container">
                    <span>
                        <strong>{{'PACS.USER_PPERMISSION_NOTE' | translate}}&nbsp;:&nbsp;</strong>
                    </span>
                    <span>{{ppermissionResponse.note}}</span>
                </div>
            </div>
            <div class="section-tag" type="3"
                *ngIf="ppermissionResponse.attachmentInfoList && ppermissionResponse.attachmentInfoList.length>0">
                <div class="icon-container">
                    <cds-icon shape="download-cloud" size="sm"></cds-icon>
                </div>
                <div class="title-container">
                    <armon-pacs-attachment-list [uploadEnabled]="false"
                        [(attachmentList)]="ppermissionResponse.attachmentInfoList"
                        *ngIf="ppermissionResponse.attachmentInfoList && ppermissionResponse.attachmentInfoList.length>0">
                    </armon-pacs-attachment-list>
                </div>
            </div>
            <div class="section-tag" type="1"
                *ngIf="ppermissionResponse.dynamicFormData && ppermissionResponse.ppermissionType.dynamicForm">
                <div class="icon-container">
                    <cds-icon shape="form" size="sm"></cds-icon>
                </div>
                <div class="title-container d-flex flex-column">
                    <span>
                        <strong>{{'PACS.USER_PPERMISSION_ORGANIZATION_FORM' | translate}}</strong>
                    </span>
                    <df-form-user-content [dynamicFormData]="ppermissionResponse.dynamicFormData"
                        [userDynamicContent]="ppermissionResponse.ppermissionType.dynamicForm"></df-form-user-content>
                </div>
            </div>
        </div>
        <armon-pacs-ppermission-approve [minimalView]="minimalView" [(ppermissionResponse)]="ppermissionResponse"
            [userFilters]="userFilters" [useAsHumanResources]="useAsHumanResources">
        </armon-pacs-ppermission-approve>
    </div>
    <div class="card-footer px-1 py-3">
        <ng-container *ngIf="ppermissionResponse.isEditable == true">
            <button class="btn btn-sm btn-outline-primary me-2" (click)="editClicked($event)"
                [disabled]="disabled">{{'BUTTON.EDIT'|translate}}</button>
            <button class="btn btn-sm btn-outline-primary me-2" (click)="editUsersClicked($event)"
                *ngIf="ppermissionResponse.multiUser"
                [disabled]="disabled">{{'PACS.PPERMISSION_APPROVE_BUTTON_EDIT_USERS'|translate}}</button>
            <button class="btn btn-sm btn-outline-danger" (click)="deleteClicked($event)"
                [disabled]="disabled">{{'BUTTON.DELETE'|translate}}</button>
        </ng-container>
        <ng-container *ngIf="ppermissionResponse.isEditable == false && ppermissionResponse.editableStatusText">
            <span class="text-sm text-italic text-black-50">
                <cds-icon shape="help" class="me-2"></cds-icon>{{ppermissionResponse.editableStatusText|translate}}
            </span>
        </ng-container>
    </div>
</div>`;var Ee=`.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}:host .card{border-top:2px solid rgba(10,42,90,.6)}:host .card-header{padding:12px}:host .card-header .main-title{padding:6px 0;font-size:.924rem;text-align:left}:host .card-header .title{font-size:.84rem;text-align:left}:host .card-header .sub-title{font-weight:500;font-size:.672rem;text-align:left}:host .section-tag-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}:host .section-tag-container .section-tag[type="1"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="1"] .icon-container{padding:12px;min-height:36px;background-color:#0a2a5a33;color:#0a2a5a;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="1"] .title-container{padding:6px 12px;min-height:36px;color:#0a2a5a;background-color:#0a2a5a08;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="1"] .title-container .dateinfo-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;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="1"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="1"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="1"] .title-container .button-container .btn:last-child{margin-right:0}:host .section-tag-container .section-tag[type="2"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="2"] .icon-container{padding:12px;min-height:36px;background-color:#00435833;color:#004358;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="2"] .title-container{padding:6px 12px;min-height:36px;color:#004358;background-color:#00435808;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="2"] .title-container .dateinfo-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;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="2"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="2"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="2"] .title-container .button-container .btn:last-child{margin-right:0}:host .section-tag-container .section-tag[type="3"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="3"] .icon-container{padding:12px;min-height:36px;background-color:#0369a133;color:#0369a1;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="3"] .title-container{padding:6px 12px;min-height:36px;color:#0369a1;background-color:#0369a108;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="3"] .title-container .dateinfo-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;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="3"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="3"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="3"] .title-container .button-container .btn:last-child{margin-right:0}:host .section-tag-container .section-tag[type="4"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="4"] .icon-container{padding:12px;min-height:36px;background-color:#62a32533;color:#62a325;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="4"] .title-container{padding:6px 12px;min-height:36px;color:#62a325;background-color:#62a32508;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="4"] .title-container .dateinfo-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;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="4"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="4"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="4"] .title-container .button-container .btn:last-child{margin-right:0}
`;var Ue=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var c=l.length-1;c>=0;c--)(a=l[c])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},R=class{pacsService;interactionService;identitySelectionService;routingService;modalService;minimalView=!1;userFilters;ppermissionResponse;useAsHumanResources=!1;hasWritePermission=!1;disabled=!1;ppermissionEditStarted=new d;ppermissionEditCompleted=new d;ppermissionEditCancelled=new d;routingStarted=new d;editPPermission;constructor(e,t,i,s,o){this.pacsService=e,this.interactionService=t,this.identitySelectionService=i,this.routingService=s,this.modalService=o}ngOnInit(){}ngOnDestroy(){}showEditModal(){this.ppermissionEditStarted.emit(),this.modalService.open(P,{settings:{size:"xl",scrollable:!0,centered:!1,escape:!1,click:!1},props:{ppermissionId:this.ppermissionResponse.id,editModeOnlyDateSelection:!0,useAsHumanResources:this.useAsHumanResources,hasWritePermission:this.hasWritePermission}}).result.then(e=>{this.ppermissionEditCompleted.emit()}).catch(e=>{})}editClicked(e){this.showEditModal()}editUsersClicked(e){this.showUserSelection()}deleteClicked(e){this.interactionService.showDialog(this.ppermissionResponse.ppermissionType.name,"PACS.DIALOG_DELETE_PPERMISSION",null,null,!0,"BUTTON.DELETE","",!0,()=>{this.pacsService.deletePPermission(this.ppermissionResponse.id).subscribe(()=>{this.ppermissionEditCompleted.emit()})})}editCompleted(e){this.ppermissionEditCompleted.emit()}editCancelled(e){this.ppermissionEditCancelled.emit()}calendarClicked(e){this.ppermissionResponse&&(this.routingStarted.emit(),this.routingService.goToUserCalendar(this.ppermissionResponse.userPPermissionInfo[0].userAndDeputyInfo.user.id,n.fromJSDate(this.ppermissionResponse.dateRange.startDateTime).toFormat("yyyy-MM")))}getSessionForPPermission(e){return this.identitySelectionService.getSessionForPPermission(this.ppermissionResponse.id,e)}showUserSelection(){this.modalService.open(xe,{settings:{size:"xl"},props:{editable:!0,sessionFunction:this.getSessionForPPermission.bind(this),useCustomApply:!0}}).result.then(e=>{e&&(e&&e.added>0&&this.ppermissionResponse.ppermissionType.requireApprovement?this.interactionService.showDialog("PACS.PPERMISSION_APPROVE_BUTTON_EDIT_USERS","PACS.PPERMISSION_APPROVE_CONFIRMATION",null,null,!0,"PACS.PPERMISSION_APPROVE_CONFIRMATION_IGNORE","PACS.PPERMISSION_APPROVE_CONFIRMATION_OK",!1,()=>{this.applyUserSelection(e.sessionId,!0)},()=>{this.applyUserSelection(e.sessionId,!1)}):this.applyUserSelection(e.sessionId,!1))}).catch(e=>{})}applyUserSelection(e,t){this.pacsService.applyUserSelectionSession(this.ppermissionResponse.id,e,this.useAsHumanResources,t).subscribe(()=>{this.ppermissionEditCompleted.emit()},i=>{i&&i.status&&i.status===M.Conflict&&this.modalService.open(he,{settings:{size:"lg",scrollable:!0,centered:!0},props:{conflictList:JSON.parse(i.error)}}).result.then(s=>{this.showUserSelection()}).catch(s=>{})})}static ctorParameters=()=>[{type:w},{type:v},{type:ue},{type:oe},{type:S}];static propDecorators={minimalView:[{type:m}],userFilters:[{type:m}],ppermissionResponse:[{type:m}],useAsHumanResources:[{type:m}],hasWritePermission:[{type:m}],disabled:[{type:m}],ppermissionEditStarted:[{type:f}],ppermissionEditCompleted:[{type:f}],ppermissionEditCancelled:[{type:f}],routingStarted:[{type:f}]}};R=Ue([x({selector:"armon-pacs-ppermission-management-list-item",template:Ie,standalone:!0,schemas:[T],imports:[h,ae,Pe,k,g,y],styles:[Ee]})],R);var Le=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var c=l.length-1;c>=0;c--)(a=l[c])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ce=class{route;pacsService;authService;sessionService;roleService;languageService;interactionService;modalService;translate;visibleComponent=!1;subscriptionWindowResized;newPPermission;limitedMode=!1;typeFilterOptions=[];statusFilterOptions;availableTypes=[];selectedTypeIndex=0;ppermissions;filterDateRange;request=new ie;paginationResponse=new Q;paginationRequest=new E;useAsHumanResources;hasWritePermission;visibleRoleSwitch=!1;screenWidth;hideSideNavLeft=!0;sortingPickerData;selectedSortingPickerEvent;subscriptionPPermissionUserInfoUpdated;constructor(e,t,i,s,o,a,c,Te,ze){this.route=e,this.pacsService=t,this.authService=i,this.sessionService=s,this.roleService=o,this.languageService=a,this.interactionService=c,this.modalService=Te,this.translate=ze,this.screenWidth=window.innerWidth,this.subscriptionWindowResized=this.interactionService.onWindowResized.subscribe(()=>{this.screenWidth=window.innerWidth,this.hideSideNavLeft=!0})}ngOnInit(){this.subscriptionPPermissionUserInfoUpdated=this.pacsService.onPPermissionUserInfoUpdated.subscribe(e=>{D(this.ppermissions)||A(this.ppermissions)||this.ppermissions.forEach(t=>{t.userPPermissionInfo.forEach((i,s)=>{i.userAndDeputyInfo&&i.userAndDeputyInfo.user&&i.userAndDeputyInfo.user.id==e.userId&&t.id==e.ppermissionId&&(t.userPPermissionInfo[s]=e.userInfo)})})}),this.useAsHumanResources=this.authService.checkPermission(p.PPERMISSION.getHRApprovement())||this.authService.isPermittedForAnyUnitInOrganization(p.PPERMISSION.getHRApprovement()),this.hasWritePermission=this.authService.checkPermission(p.PPERMISSION.getWrite())&&(this.sessionService.currentUserOrganization.hasOrganizationUnitRole(this.roleService.getRoleIdWithType(V.UNIT_ADMINISTRATOR))||this.authService.isPermittedForAnyUnitInOrganization(p.PPERMISSION.getHRApprovement())),this.useAsHumanResources&&this.hasWritePermission&&(this.visibleRoleSwitch=!0),this.statusFilterOptions=O(X),this.statusFilterOptions.unshift(new Z(null,"PACS.ALL")),this.setRequest(),this.filterDateRange=this.request.dateRange,this.sortingPickerData={items:[{value:1,label:"REPORT.SORTING_PPERMISSION_START",showDirection:!0,directionDefault:u.DESC},{value:2,label:"REPORT.SORTING_PPERMISSION_END",showDirection:!0,directionDefault:u.DESC},{value:3,label:"REPORT.SORTING_PPERMISSION_DURATION",showDirection:!0},{value:4,label:"REPORT.SORTING_PPERMISSION_TYPE",showDirection:!0,isAlpha:!0,directionDefault:u.ASC},{value:5,label:"REPORT.SORTING_PPERMISSION_APPROVAL",showDirection:!0},{value:6,label:"REPORT.SORTING_PPERMISSION_REQUEST_DATE",showDirection:!0,directionDefault:u.DESC}]},this.selectedSortingPickerEvent={value:this.sortingPickerData.items[0].value,direction:N.DESC},this.setSortingPickerEvent(),this.route.queryParams.subscribe(e=>{e&&(e.id&&e.id!=""&&(this.request.ppermissionIds=[e.id],this.limitedMode=!0,this.filterDateRange={startDateTime:n.local().minus({months:24}).startOf("day").toJSDate(),endDateTime:n.local().plus({months:12}).toJSDate()},this.request.dateRange.startDateTime=this.filterDateRange.startDateTime,this.request.dateRange.endDateTime=this.filterDateRange.endDateTime),e[r.PPermissionTypeId]&&e[r.PPermissionTypeId]!==""&&(this.request.ppermissionTypeId=e[r.PPermissionTypeId]),this.visibleRoleSwitch&&e[r.UseAsHumanResources]&&e[r.UseAsHumanResources]!==""&&(this.useAsHumanResources=e[r.UseAsHumanResources]=="1"),e[r.UserId]&&e[r.UserId]!==""&&(this.request.userIds=[e[r.UserId]]),e[r.StartDate]&&e[r.EndDate]&&e[r.StartDate]!==""&&e[r.EndDate]!==""&&(this.filterDateRange={startDateTime:n.fromISO(e[r.StartDate]).toJSDate(),endDateTime:n.fromISO(e[r.EndDate]).toJSDate()},this.request.dateRange.startDateTime=this.filterDateRange.startDateTime,this.request.dateRange.endDateTime=this.filterDateRange.endDateTime)),this.getPPermissionTypes()})}ngOnDestroy(){this.subscriptionWindowResized.unsubscribe(),this.subscriptionPPermissionUserInfoUpdated.unsubscribe()}setRequest(){this.request.pagination=this.paginationRequest,this.request.pagination.take=_.REQUEST_ITEM_LIMIT,this.request.dateRange=new K,this.request.dateRange.startDateTime=n.local().minus({months:3}).startOf("day").toJSDate(),this.request.dateRange.endDateTime=n.local().plus({months:1}).toJSDate()}getPPermissionTypes(){let e=new te,t=new E;t.take=0,e.pagination=t,this.pacsService.getPPermissionTypeList(e).subscribe(i=>{this.availableTypes=i.items.filter(s=>s.hrCanInit===!0||s.unitManagerCanInit===!0),this.typeFilterOptions.push({value:null,i18nName:"PACS.ALL"}),i.items.forEach(s=>{this.typeFilterOptions.push({value:s.id,i18nName:s.name})}),this.request.ppermissionTypeId&&(this.selectedTypeIndex=this.typeFilterOptions.findIndex(s=>s.value==this.request.ppermissionTypeId)),this.visibleComponent=!0,this.getPPermissions()})}_firstSearchCompleted=!1;getPPermissions(){this.setSortingPickerEvent(),this.useAsHumanResources?this.pacsService.getPPermissionHRList(this.request).subscribe(e=>{this._firstSearchCompleted=!0,this.ppermissions=e.items,this.paginationResponse=e.pagination}):this.authService.checkPermission(p.PPERMISSION.getRead())?this.pacsService.getPPermissionList(this.request).subscribe(e=>{this._firstSearchCompleted=!0,this.ppermissions=e.items,this.paginationResponse=e.pagination}):this.pacsService.getPPermissionListAll(this.request).subscribe(e=>{this._firstSearchCompleted=!0,this.ppermissions=e.items,this.paginationResponse=e.pagination})}refreshList(e=!0){this.request.ppermissionIds&&(delete this.request.ppermissionIds,this.limitedMode=!1),e&&(this.request.pagination.skip=0),this._firstSearchCompleted&&this.getPPermissions()}addPPermission(e){this.modalService.open(P,{settings:{size:"xl",scrollable:!0,centered:!1,escape:!1,click:!1},props:{useAsHumanResources:this.useAsHumanResources,hasWritePermission:this.hasWritePermission}}).result.then(t=>{this.refreshList()}).catch(t=>{})}addCompleted(e){this.refreshList()}addCancelled(e){}editStarted(e){}editCompleted(e){this.refreshList()}editCancelled(e){}exitLimitedMode(e){this.refreshList()}pageChanged(e){this.request.pagination=e,this.refreshList(!1)}typeFilterChanged(e){this.request.ppermissionTypeId=e.value,this.refreshList()}statusFilterChanged(e){this.request.status=e.value,this.refreshList()}dateRangeFilterChanged(e){this.request.dateRange.startDateTime=e.startDateTime,this.request.dateRange.endDateTime=e.endDateTime,this.refreshList()}onFilterChanged(e){this.refreshList()}showFilterClicked(){this.hideSideNavLeft=!1}hideFilterClicked(){this.hideSideNavLeft=!0}switchRoleClicked(e){this.useAsHumanResources=!this.useAsHumanResources,this.refreshList()}setSortingPickerEvent(){this.request.sortType=this.selectedSortingPickerEvent.value,this.request.sortOrder=this.selectedSortingPickerEvent.direction}onSortingSelectionChanged(e){this.selectedSortingPickerEvent=e,this.setSortingPickerEvent(),this.getPPermissions()}onGetExcelClicked(e){this.pacsService.getPPermissionHRListAsExcel(this.request).subscribe(t=>{this.translate.get(["PAGES.PACS_PPERMISSIONS_MANAGEMENT"]).subscribe(i=>{C.default.saveAs(t,i["PAGES.PACS_PPERMISSIONS_MANAGEMENT"]+" "+n.fromJSDate(this.request.dateRange.startDateTime).toLocaleString(n.DATETIME_MED)+" "+n.fromJSDate(this.request.dateRange.endDateTime).toLocaleString(n.DATETIME_MED)+".xlsx")})})}onGetPdfClicked(e){this.pacsService.getPPermissionHRListAsPdf(this.request).subscribe(t=>{this.translate.get(["PAGES.PACS_PPERMISSIONS_MANAGEMENT"]).subscribe(i=>{C.default.saveAs(t,i["PAGES.PACS_PPERMISSIONS_MANAGEMENT"]+" "+n.fromJSDate(this.request.dateRange.startDateTime).toLocaleString(n.DATETIME_MED)+" "+n.fromJSDate(this.request.dateRange.endDateTime).toLocaleString(n.DATETIME_MED)+".pdf")})})}static ctorParameters=()=>[{type:z},{type:w},{type:ne},{type:L},{type:Y},{type:$},{type:v},{type:S},{type:U}]};Ce=Le([x({selector:"armon-pacs-ppermission-management-list",template:ke,animations:[q("listAnimation",[j("* => *",[I(":enter",b({opacity:0}),{optional:!0}),I(":enter",G("100ms",[F("0.2s ease-in",H([b({opacity:0,transform:"translateY(10%)",offset:0}),b({opacity:.5,transform:"translateY(-3%)",offset:.3}),b({opacity:1,transform:"translateY(0)",offset:1})]))]),{optional:!0,delay:200})])])],standalone:!0,imports:[h,W,be,de,ve,we,fe,J,se,Se,ye,ee,B,le,pe,ce,me,ge,k,R,re,g,y],styles:[Re]})],Ce);export{Ce as PacsPPermissionManagementListComponent};
