mupdf-webviewer
Version:
The web viewer SDK using mupdf.js
1 lines • 245 kB
JavaScript
import{a as Fo}from"./chunk-KY75LVLX.js";import{f as wo,g as No,h as Ao,i as ko,j as Ro}from"./chunk-3XEYKGPG.js";import{a as Lo,e as Uo,g as Vo}from"./chunk-STBU63PA.js";import{A as he,B as mi,C as Tt,D as Oo,a as V,b as qt,c as Ie,d as ht,e as Ei,f as Ti,g as Ii,h as wi,i as fe,j as ei,k as Pe,l as di,m as ti,n as Dt,o as ki,p as _o,q as bo,r as xo,s as at,t as Ye,u as vo,v as We,w as st,x as Ne,z as Po}from"./chunk-LNE3N6E3.js";import{$c as Pn,$d as St,$e as Mr,$f as Ri,Ae as Ve,Ag as Ui,Bb as k,Bg as yn,Ca as tt,Cb as _e,Cc as xi,D as An,Db as jn,Dd as Xt,Df as Y,E as kn,Eb as it,Ed as ot,Ef as uo,Eg as wt,Fa as Ci,Fb as bi,Fd as le,Ff as fo,G as _t,Gf as Ai,H as li,Hc as He,Hf as go,Ib as g,Id as we,Ie as ee,If as re,J as Ht,Ja as _i,Jb as C,Jf as ho,K as bt,Ka as a,Kb as Te,Kd as Oi,Kf as ge,Lb as J,Lf as Co,M as z,Mb as L,Md as yt,Na as Ln,Nd as so,Nf as Et,Oa as u,Od as Zt,Oe as U,Pa as xn,Pb as $n,Pd as yi,Pe as rt,Pg as So,Qa as I,Qb as se,R as xt,Ra as F,Rb as Pt,Sb as Fe,Ta as Un,Tb as de,Th as To,Ua as D,Ub as Hn,Ue as po,V as Rn,Vb as Yn,W as qe,Wb as Wn,We as Di,Xa as Wt,Xb as Ot,Xc as vi,Ya as p,Yb as Kn,Yc as Vt,Za as Vn,Zf as yo,_ as mt,_a as G,_b as Le,_c as Qe,_d as Si,a as W,ac as B,ad as Bt,af as Jt,ag as It,b as K,ba as Fn,bc as Ut,cb as l,cc as Ue,db as c,dc as vn,dg as Fi,dh as Mo,di as Gi,e as Sr,eb as O,ec as be,ef as pi,eg as Li,ei as zi,f as m,fb as X,fc as qn,fh as Vi,ga as Yt,gb as Z,gc as Qn,gd as no,ha as et,hb as Ft,hc as Xn,hd as Gt,hf as Mt,ib as T,id as Pi,j as In,jd as q,jf as mo,ka as ut,kb as Bn,kd as ye,kf as M,kg as ui,kh as Do,lb as P,ld as ci,lf as ue,m as wn,mb as b,me as lo,nb as Gn,nd as ie,ne as co,oa as j,ob as zn,od as oo,pa as R,pc as Kt,pd as ro,qb as ze,qc as Zn,qd as Qt,qg as ii,ra as N,rb as je,rc as me,rd as Se,s as Nn,sb as $e,sc as Jn,sd as ao,se as Mi,tb as H,tc as eo,td as On,ti as Io,u as $t,ua as vt,ub as f,uc as gt,ud as Me,v as bn,va as x,vb as h,vc as S,wa as v,wb as ft,wc as to,wd as xe,wh as Bi,xb as Lt,xc as io,xd as nt,xf as Ni,xh as Eo,yd as ve,z as oe}from"./chunk-FQTIMCVV.js";var ji=(()=>{let i=class i{baseHref;httpClient;get userUrl(){return`${this.baseHref}v4/user`}gzipHeaders;constructor(e,t){this.baseHref=e,this.httpClient=t,this.gzipHeaders=new Ut({"Content-Encoding":"gzip","Accept-Language":"utf-8"})}getUserList(e){let t=`${this.userUrl}`;return this.httpClient.get(t,{headers:this.gzipHeaders,params:this.makeHttpParams(e)})}deleteUsers(e){let t=`${this.userUrl}`;return this.httpClient.request("delete",t,{body:e})}postRegisterUser(e,t,o,s){return this.httpClient.post(`${this.userUrl}`,{userId:t,password:o,name:e,type:s})}patchUser(e,t){let o=`${this.baseHref}v4/user/${e}`;return this.httpClient.patch(o,t)}makeHttpParams(e){let t=new Ue;return Object.keys(e).filter(o=>e[o]!==void 0).forEach(o=>{t=t.set(o,String(e[o]))}),t}};m(i,"\u0275fac",function(t){return new(t||i)(N(se),N(be))}),m(i,"\u0275prov",j({token:i,factory:i.\u0275fac}));let n=i;return n})();var Er=n=>["field",n],Tr=(n,i)=>["label-box",n,i],Ir=n=>["selectable-list",n],wr=n=>["ep-button",n];function Nr(n,i){if(n&1){let r=T();l(0,"button",2),P("click",function(){x(r);let t=b();return v(t.popupChange())}),l(1,"i",3),P("click",function(t){x(r);let o=b();return v(o.refresh(t))}),c(),l(2,"span"),f(3),g(4,"translate"),c()()}if(n&2){let r=b();Wt("color",r.isSelected||r.isExistFilter?"primary":"white")("size",r.btSize),a(),p("ngClass",r.iconStyle),a(2),h(C(4,4,r.isExistFilter?"FILTERED":"FILTER"))}}function Ar(n,i){if(n&1&&(l(0,"label"),f(1),c()),n&2){let r=b().$implicit;a(),h(r.label)}}function kr(n,i){if(n&1){let r=T();l(0,"sd-date-dropdown",13),P("dateChange",function(t){x(r);let o=b(3);return v(o.customDate(t))}),c()}if(n&2){let r=b().$implicit,e=b(2);G("selected",e.isActiveFilter("date",r.item[0].value)),p("ngClass",bi(8,Tr,r.type,e.formSize))("activeFilter",e.activeFilter)("datePickerDirection",e.datePickerDirection)("disableNext",!0)("dateFormat",(r.options==null?null:r.options.dateFormat)||"yyyy.MM.dd")("defaultDurationType",e.DefaultDurationType.MONTH)}}function Rr(n,i){n&1&&O(0,"div")}function Fr(n,i){if(n&1){let r=T();l(0,"pu-dropdown",14),P("ngModelChange",function(t){x(r);let o=b().$implicit,s=b(2);return v(s.selectDropdown(o,t))}),c()}if(n&2){let r=b().$implicit,e=b(2);p("size",e.formSize)("options",r.item)("ngModel",e.currentDropdown(r))("ngStyle",r.options==null?null:r.options.style)}}function Lr(n,i){if(n&1){let r=T();X(0),l(1,"pu-checkbox",17),P("ngModelChange",function(){let t=x(r).$implicit,o=b(4);return v(o.applyColumnFilter(t.value))}),c(),Z()}if(n&2){let r=i.$implicit;a(),p("label",r.label)("ngModel",r.value.isActive)}}function Ur(n,i){if(n&1&&(X(0),l(1,"div",15),D(2,Lr,2,2,"ng-container",16),c(),Z()),n&2){let r=b().$implicit;a(2),p("ngForOf",r.item)}}function Vr(n,i){if(n&1){let r=T();l(0,"button",20),P("click",function(){let t=x(r).$implicit,o=b(2).$implicit,s=b(2);return v(s.active(o.type,t.value))}),f(1),g(2,"translate"),c()}if(n&2){let r=i.$implicit,e=b(2).$implicit,t=b(2);p("ngClass",it(6,wr,r.value)),Wt("color",t.isActiveFilter(e.type,r.value)?"primary":t.btColor)("size",t.formSize),a(),h(C(2,4,r.label))}}function Br(n,i){if(n&1&&(l(0,"div",18),D(1,Vr,3,8,"button",19),c()),n&2){let r=b().$implicit;p("ngClass",it(2,Ir,r.type)),a(),p("ngForOf",r.item)}}function Gr(n,i){if(n&1&&(l(0,"div",7),D(1,Ar,2,1,"label",8)(2,kr,1,11,"sd-date-dropdown",9)(3,Rr,1,0,"div",10)(4,Fr,1,4,"pu-dropdown",11)(5,Ur,3,1,"ng-container",10)(6,Br,2,4,"div",12),c()),n&2){let r=i.$implicit,e=b(2);p("ngClass",it(7,Er,r.type))("ngSwitch",r.type),a(),p("ngIf",!e.elClassList.contains("no-label")&&!!r.label),a(),p("ngSwitchCase","custom-date"),a(),p("ngSwitchCase","vr"),a(),p("ngSwitchCase","dropdown"),a(),p("ngSwitchCase","columns")}}function zr(n,i){if(n&1){let r=T();l(0,"button",21),P("click",function(){x(r);let t=b(2);return v(t.popupChange())}),f(1),g(2,"translate"),c()}if(n&2){let r=b(2);Wt("size",r.btSize||"tiny"),a(),h(C(2,2,"CLOSE"))}}function jr(n,i){if(n&1&&(l(0,"div",4),D(1,Gr,7,9,"div",5)(2,zr,3,4,"button",6),c()),n&2){let r=b();a(),p("ngForOf",r.filterMenus),a(),p("ngIf",!r.dock)}}var Nt=class Nt{ngControl;changeDetectorRef;elRef;get DefaultDurationType(){return _o}get isExistFilter(){return Object.keys(this.activeFilter).length!==0}get iconStyle(){return{"papycon-funnel":!this.isExistFilter,"papycon-cross":this.isExistFilter}}filterMenus=[];deactive=!0;activeFilter={};datePickerDirection="left";activeFilterChange=new tt;columnFilterChange=new tt;isSelected=!1;menuSubs=[];btColor="grey";dock=!1;btSize="small";formSize="small";elClassList;visibleYearSelector=!1;constructor(i,r,e){this.ngControl=i,this.changeDetectorRef=r,this.elRef=e,this.ngControl&&(this.ngControl.valueAccessor=this)}hostMouseDown(i){i.stopImmediatePropagation(),i.stopPropagation()}ngOnInit(){let{classList:i}=this.elRef.nativeElement;this.elClassList=i,this.dock=i.contains("dock"),this.isSelected=this.dock;let r=this.filterMenus.filter(t=>t.defaultValues),e=this.filterMenus.map(t=>t.defaultValues).filter(ee.isDefined).flat();r.length>0&&e.length>0&&r.forEach(t=>{e.forEach(o=>this.active(t.type,o))}),i.contains("button-color-dflt")&&(this.btColor="white"),i.contains("small")&&(this.btSize="small"),i.contains("form-small")&&(this.formSize="small")}ngOnChanges(i){i.activeFilter?.currentValue.date?this.buildConstDateFilter(i.activeFilter.currentValue.date.value[0]):i.activeFilter?.currentValue.status&&this.emit()}refresh(i){return this.isExistFilter?(this.activeFilter={},this.emit(),i&&i.stopPropagation(),!1):!0}customDate(i){this.activeFilter.date={value:["custom"],data:{startDate:new Date(i.startDate),endDate:new Date(i.endDate)}},U.setDayEnd(this.activeFilter.date.data.endDate),this.emit()}active(i,r){this.toggleYearSelector(!0);let e=this.filterMenus.find(t=>t.type===i);e!==void 0&&(this.deactive&&this.activeFilter[i]?.value.find(t=>t===r)?this.activeFilter[i].value=this.activeFilter[i].value.filter(t=>t!==r):e.isMulti&&this.activeFilter[i]?this.activeFilter[i]={value:[...this.activeFilter[i].value,r]}:this.activeFilter[i]={value:[r]},this.isAllValue(r)||this.activeFilter[i].value.length===0?delete this.activeFilter[i]:this.buildConstDateFilter(r),this.emit())}isActiveFilter(i,r){return!!this.activeFilter[i]?.value.find(e=>e===r)||this.isAllValue(r)&&!this.activeFilter[i]}popupChange(){this.isSelected=!this.isSelected,this.isSelected?this.menuSubs.push(bt(li(window,"mousedown"),li(window,"touchstart")).pipe(qe(1)).subscribe({next:()=>{this.popupChange()}})):(this.menuSubs.forEach(i=>i.unsubscribe()),this.menuSubs=[]),this.changeDetectorRef.markForCheck()}toggleYearSelector(i=!1){this.visibleYearSelector=!i&&!this.visibleYearSelector}currentDropdown(i){let r=this.activeFilter[i.key||i.type]?.value;return r&&r[0]!==void 0&&i.item.find(e=>e.value===r[0].value)||i.item[0]}selectDropdown(i,r){let e=i.key||i.type,t=this.activeFilter[e];r.value===void 0||r.value===null?delete this.activeFilter[e]:this.activeFilter[e]={value:[r]};let o=this.activeFilter[e];t===o||t?.value[0].value===o?.value[0].value||this.emit()}applyColumnFilter(i){this.columnFilterChange.emit(i)}writeValue(i){this.changeDetectorRef.markForCheck(),this.activeFilter=i||{}}registerOnChange(i){this.avcChanger=i}registerOnTouched(){}isAllValue(i){return Nt.ALL_VALUES.has(i.toLowerCase())}buildConstDateFilter(i){U.bindConst(this.activeFilter,i)}emit(){this.activeFilterChange.emit(this.activeFilter),this.avcChanger(this.activeFilter)}avcChanger=i=>i};m(Nt,"ALL_VALUES",new Set(["all","not-selected"])),m(Nt,"\u0275fac",function(r){return new(r||Nt)(u(Pi,10),u(L),u(Ci))}),m(Nt,"\u0275cmp",I({type:Nt,selectors:[["sd-filter-pop-up"]],hostBindings:function(r,e){r&1&&P("mousedown",function(o){return e.hostMouseDown(o)})("touchstart",function(o){return e.hostMouseDown(o)})},inputs:{filterMenus:"filterMenus",deactive:"deactive",activeFilter:"activeFilter",datePickerDirection:"datePickerDirection"},outputs:{activeFilterChange:"activeFilterChange",columnFilterChange:"columnFilterChange"},standalone:!1,features:[k([S]),vt],decls:2,vars:2,consts:[["class","ep-button dock-button",3,"click",4,"ngIf"],["class","filters",4,"ngIf"],[1,"ep-button","dock-button",3,"click"],[1,"papycon",3,"click","ngClass"],[1,"filters"],[3,"ngClass","ngSwitch",4,"ngFor","ngForOf"],["class","ep-button","color","white",3,"click",4,"ngIf"],[3,"ngClass","ngSwitch"],[4,"ngIf"],[3,"ngClass","activeFilter","datePickerDirection","selected","disableNext","dateFormat","defaultDurationType","dateChange",4,"ngSwitchCase"],[4,"ngSwitchCase"],[3,"size","options","ngModel","ngStyle","ngModelChange",4,"ngSwitchCase"],[3,"ngClass",4,"ngSwitchDefault"],[3,"dateChange","ngClass","activeFilter","datePickerDirection","disableNext","dateFormat","defaultDurationType"],[3,"ngModelChange","size","options","ngModel","ngStyle"],[1,"columns-filter"],[4,"ngFor","ngForOf"],[3,"ngModelChange","label","ngModel"],[3,"ngClass"],[3,"ngClass","click",4,"ngFor","ngForOf"],[3,"click","ngClass"],["color","white",1,"ep-button",3,"click"]],template:function(r,e){r&1&&D(0,Nr,5,6,"button",0)(1,jr,3,2,"div",1),r&2&&(p("ngIf",!e.dock),a(),p("ngIf",e.isSelected))},styles:["[_nghost-%COMP%]{position:relative}[_nghost-%COMP%]:not(.dock) .filters[_ngcontent-%COMP%]{background-color:#fff;border:1px solid #DADADA;border-radius:6px;box-shadow:0 4px 32px #6c6c6c1f;padding:24px 20px;box-sizing:border-box;position:absolute;z-index:999;transform:translateY(4px);left:0}.dock[_nghost-%COMP%] .field[_ngcontent-%COMP%] .selectable-list[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(:first-child), .dock[_nghost-%COMP%] .field.custom-date[_ngcontent-%COMP%]{margin-left:20px}[_nghost-%COMP%]:not(.inline) .filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:first-child){margin-top:12px}.inline[_nghost-%COMP%] .filters[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle}.inline[_nghost-%COMP%] .filters[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:not(:first-child){margin-left:12px}.inline[_nghost-%COMP%] .vr[_ngcontent-%COMP%]{width:1px;background:#dadada;line-height:30px;height:30px}.dock-button[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:19px}.filters[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{width:100%;margin-top:20px}.filters[_ngcontent-%COMP%] .columns-filter[_ngcontent-%COMP%]{font-size:13px;line-height:22px;display:flex;flex-direction:row;flex-wrap:wrap;column-gap:14px;row-gap:12px}.filters[_ngcontent-%COMP%] .columns-filter[_ngcontent-%COMP%] pu-checkbox[_ngcontent-%COMP%]{cursor:pointer}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:13px;line-height:22px;color:#6c6c6c;font-family:NotoSans-Medium,sans-serif;display:inline-block;height:28px}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .selectable-list[_ngcontent-%COMP%]{display:flex}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .selectable-list[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(:first-child){margin-left:12px}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .selectable-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding:5px;margin-right:10px;border:1px solid #363636;border-radius:5px;cursor:pointer}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .selectable-list[_ngcontent-%COMP%] span.active[_ngcontent-%COMP%]{background-color:#f79f1a;color:#fff}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] sd-date-dropdown[_ngcontent-%COMP%]{display:flex}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] sd-date-dropdown[_ngcontent-%COMP%] .calendar-container{z-index:999;position:absolute}.right[_nghost-%COMP%] .filters[_ngcontent-%COMP%]{right:0}.inline-date[_nghost-%COMP%] .date[_ngcontent-%COMP%], .inline-date[_nghost-%COMP%] .custom-date[_ngcontent-%COMP%]{display:inline-block}.inline-date[_nghost-%COMP%]:not(.date-only) .field.custom-date[_ngcontent-%COMP%]{float:right}.inline-date.date-only[_nghost-%COMP%] .field.custom-date[_ngcontent-%COMP%]{margin-top:0}.field.dropdown[_ngcontent-%COMP%] pu-dropdown[_ngcontent-%COMP%]{display:block}button[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:6px}"],changeDetection:0}));var Be=Nt;function $r(n,i){if(n&1){let r=T();l(0,"button",3),P("click",function(){x(r);let t=b();return v(t.movePage(1))}),f(1,"\u2026"),c()}}function Hr(n,i){if(n&1){let r=T();l(0,"button",4),P("click",function(){let t=x(r).$implicit,o=b();return v(o.movePage(t))}),f(1),c()}if(n&2){let r=i.$implicit,e=b();Wt("color",e.getIndexClass(r)?"primary-70":"dark"),a(),h(r)}}function Yr(n,i){if(n&1){let r=T();l(0,"button",3),P("click",function(){x(r);let t=b();return v(t.movePage(t.last))}),f(1,"\u2026"),c()}}var Ke=(()=>{let i=class i{ngControl;cdr;get first(){return this._first}set first(e){if(this.first!==e){if(this.last<e)throw new Error(`'first' value out of range. Expect last(${this.last}) < first(${e})`);this._first=e,this.page<this.first?this.page=this.first:this.computeSideList()}}get last(){return this._last}set last(e){if(this.last!==e){if(e<this.first)throw new Error(`'last' value out of range. Expect last(${e}) < first(${this.first})`);this._last=e,this.last<this.page?this.page=this.last:this.computeSideList()}}get page(){return this._page}set page(e){if(this.page!==e){if(this.last<e)throw new Error(`page value out of range. Expect page(${e}) < last(${this.last})`);if(e<this.first)throw new Error(`page value out of range. Expect first(${this.first}) < page(${e})`);this._page=e,this.computeSideList()}}get sideButtonCount(){return this._sideButtonCount}set sideButtonCount(e){this.sideButtonCount!==e&&(this._sideButtonCount=e,this.computeSideList())}prevLabel="";nextLabel="";pageChange=new tt;indexList=[1];_first=1;_last=1;_page=1;_sideButtonCount=0;constructor(e,t){this.ngControl=e,this.cdr=t,this.ngControl&&(this.ngControl.valueAccessor=this)}ngOnChanges(){this.computeSideList()}ngOnInit(){this.computeSideList()}getIndexClass(e){return e===this.page}movePage(e){this.page!==e&&(this.writeValue(e),this.emit())}writeValue(e){this.cdr.markForCheck(),this.page=e}registerOnChange(e){this.avcChanger=e}registerOnTouched(){}emit(){this.avcChanger(this.page),this.pageChange.emit(this.page)}computeSideList(){this.indexList=Array.from({length:this.sideButtonCount*2+4}).map((e,t)=>t-this.sideButtonCount-1).map(e=>this.page-this.first-1<this.sideButtonCount?this.first+this.sideButtonCount+e+1:this.last-this.page-1<this.sideButtonCount?this.last-this.sideButtonCount+e-1:e+this.page),this.indexList[0]!==this.first&&this.indexList.splice(0,1),this.indexList[this.indexList.length-1]!==this.last&&this.indexList.splice(this.indexList.length-1,1),this.indexList=this.indexList.filter(e=>this.first<=e&&e<=this.last)}avcChanger=e=>e};m(i,"\u0275fac",function(t){return new(t||i)(u(Pi,10),u(L))}),m(i,"\u0275cmp",I({type:i,selectors:[["sd-pagination"]],inputs:{first:"first",last:"last",page:"page",sideButtonCount:"sideButtonCount",prevLabel:"prevLabel",nextLabel:"nextLabel"},outputs:{pageChange:"pageChange"},standalone:!1,features:[vt],decls:7,vars:7,consts:[["color","dark",1,"ep-text-button",3,"click","disabled"],["class","ep-text-button","color","dark",3,"click",4,"ngIf"],["class","ep-text-button",3,"click",4,"ngFor","ngForOf"],["color","dark",1,"ep-text-button",3,"click"],[1,"ep-text-button",3,"click"]],template:function(t,o){t&1&&(l(0,"button",0),P("click",function(){return o.movePage(o.page-1)}),f(1),c(),D(2,$r,2,0,"button",1)(3,Hr,2,2,"button",2)(4,Yr,2,0,"button",1),l(5,"button",0),P("click",function(){return o.movePage(o.page+1)}),f(6),c()),t&2&&(p("disabled",o.first===o.page),a(),h(o.prevLabel),a(),p("ngIf",o.first+1<o.indexList[0]),a(),p("ngForOf",o.indexList),a(),p("ngIf",o.indexList[o.indexList.length-1]<o.last-1),a(),p("disabled",o.page===o.last),a(),h(o.nextLabel))},dependencies:[Fe,de],styles:["[_nghost-%COMP%]{width:100%;text-align:center}button[_ngcontent-%COMP%]{min-width:40px;height:40px;margin:0 6px}"],changeDetection:0}));let n=i;return n})();function qr(n,i){if(n&1&&(l(0,"div"),f(1),c()),n&2){let r=i.$implicit;a(),h(r.name)}}function Qr(n,i){if(n&1&&(l(0,"div"),f(1),c()),n&2){let r=i.$implicit;a(),h(r.userId)}}function Xr(n,i){if(n&1&&(l(0,"div"),O(1,"admin-dropdown",15),c()),n&2){let r=i.$implicit,e=b();a(),p("formControlName",r.id)("options",e.accountOptions)}}function Zr(n,i){if(n&1&&(l(0,"div"),f(1),g(2,"date"),c()),n&2){let r=i.$implicit;a(),h(Te(2,1,r.createdAt,"yyyy-MM-dd"))}}function Jr(n,i){n&1&&(l(0,"div",16)(1,"div",17),O(2,"span",18),l(3,"p",19),f(4),g(5,"translate"),c(),O(6,"div",20),l(7,"p",21),f(8),g(9,"translate"),c()()()),n&2&&(a(4),h(C(5,2,"NO_ADMIN")),a(4),h(C(9,4,"PLEASE_ADD_ADMIN")))}var Bo=(()=>{let i=class i{formBuilder;changeDetectorRef;accountDataService;toastService;authService;translatePipe;adminDialogService;store$;subs;filterMenus=[];accountOptions=[];displayableColumns=[];formGroup;userInfoFormGroup;isLoading=!1;user;table=new Ne;orderedBy="createdAt";asc=!1;NUM_PER_PAGE="13";get purposeFilterValue(){let e=this.table.filterGroup.controls.filter?.value?.purpose?.value[0];return e==="ALL"?void 0:e}get currentPageIndex(){return this.table.getPageInfo().currentIndex}constructor(e,t,o,s,d,_,y,w,A){this.formBuilder=e,this.changeDetectorRef=t,this.accountDataService=o,this.toastService=s,this.authService=d,this.translatePipe=_,this.adminDialogService=y,this.store$=w,this.subs=A,this.filterMenus=[{label:this.translatePipe.transform("DATE"),type:"date",item:U.getDateFilterList(["custom"]),isMulti:!1},{label:this.translatePipe.transform("MANUAL_SELECT"),type:"custom-date",item:[{label:"",value:"custom"}],isMulti:!1},{label:this.translatePipe.transform("USER_PURPOSE_LABEL"),type:"purpose",item:[{label:"ALL",value:"ALL"},{label:"ADMIN",value:"ADMIN"},{label:"REGISTERED",value:"REGISTERED"}],isMulti:!1}],this.accountOptions=[{label:this.translatePipe.transform(re.USER),value:re.USER},{label:this.translatePipe.transform(re.ADMIN),value:re.ADMIN},{label:this.translatePipe.transform(re.DOCUMENT_ADMIN),value:re.DOCUMENT_ADMIN}],this.displayableColumns=[{key:"name",title:this.translatePipe.transform("NAME"),sortable:!0},{key:"userId",title:this.translatePipe.transform("EMAIL_ID"),sortable:!0},{key:"type",title:this.translatePipe.transform("ACCOUNT_PURPOSE"),sortable:!0},{key:"createdAt",title:this.translatePipe.transform("CREATED_AT"),sortable:!0}],this.formGroup=this.formBuilder.nonNullable.group({purpose:this.formBuilder.nonNullable.group({}),name:this.formBuilder.nonNullable.control(""),checkedUserIds:this.formBuilder.nonNullable.control([])}),this.userInfoFormGroup=this.formBuilder.nonNullable.group({name:this.formBuilder.nonNullable.control("",Gt.required),userId:this.formBuilder.nonNullable.control({value:"",disabled:!0},Gt.required),password:this.formBuilder.nonNullable.control("",[Di.passwordValidators,()=>(this.userInfoFormGroup&&this.userInfoFormGroup.controls.passwordCheck.updateValueAndValidity(),null)]),passwordCheck:this.formBuilder.nonNullable.control("",[te=>!this.userInfoFormGroup||te.value===this.userInfoFormGroup.getRawValue().password?null:{message:this.translatePipe.transform("INVALID_PASSWORD")}]),purpose:this.formBuilder.nonNullable.control(ei[0])})}ngOnInit(){this.getUsers(),this.subs.push(this.store$.pipe(Ai()).subscribe({next:e=>{this.user=e,this.table.reset(),this.getUsers(),this.changeDetectorRef.markForCheck()}}),this.table.filterChanges.subscribe({next:()=>{this.table.reset(),this.getUsers()}}),this.table.filterGroup.controls.keyword.valueChanges.pipe(z(e=>!e)).subscribe({next:()=>{this.searchKeyword()}}),this.adminDialogService.dialogEvent$.pipe(z(e=>e.action==="confirm"&&e.dialogType===V.DELETE_ITEMS)).subscribe({next:()=>{this.adminDialogService.closeCurrentActiveDialog(),this.deleteUser()}}),this.adminDialogService.dialogEvent$.pipe(z(e=>e.action==="confirm"&&e.dialogType===V.MODIFY_USER)).subscribe({next:()=>{this.adminDialogService.closeCurrentActiveDialog();let e=this.userInfoFormGroup.getRawValue().purpose.value;if(this.user&&this.userInfoFormGroup.controls.userId.value===this.user.userId&&e===re.USER&&!(this.isLastAdmin(this.user.userId)&&e===re.USER)){this.adminDialogService.toggleDialogVisibility(V.WARNING,!0,{title:this.translatePipe.transform("CHANGE_PURPOSE_WARNING_TITLE"),description:this.translatePipe.transform("CHANGE_PURPOSE_WARNING_MESSAGE"),size:{width:388,height:280},data:{from:"modify_modal",formGroup:this.userInfoFormGroup}});return}this.updateUser({purpose:this.userInfoFormGroup.controls.purpose.value.value,password:this.userInfoFormGroup.controls.password.value,name:this.userInfoFormGroup.controls.name.value,userId:this.userInfoFormGroup.controls.userId.value})}}),this.adminDialogService.dialogEvent$.pipe(z(e=>e.action==="confirm"&&e.dialogType===V.CREATE_USER)).subscribe({next:()=>{this.registerUser()}}),this.adminDialogService.dialogEvent$.pipe(z(e=>e.dialogType===V.WARNING)).subscribe({next:e=>{e.action==="confirm"&&(this.adminDialogService.closeCurrentActiveDialog(),e.data.from==="table"?this.updateUser({userId:e.data.control.userId,purpose:e.data.control.control.value}):this.updateUser({purpose:this.userInfoFormGroup.controls.purpose.value.value,password:this.userInfoFormGroup.controls.password.value,name:this.userInfoFormGroup.controls.name.value,userId:this.userInfoFormGroup.controls.userId.value}),this.authService.logout().subscribe()),e.action==="close"&&this.getUsers()}}))}ngAfterContentInit(){this.getUsers()}searchKeyword(){this.table.reset(),this.getUsers()}onCreateClick(){this.userInfoFormGroup.reset({purpose:ei[0]}),this.userInfoFormGroup.get("userId")?.enable(),this.adminDialogService.toggleDialogVisibility(V.CREATE_USER,!0,{title:this.translatePipe.transform("NEW_ADMIN"),size:{width:452,height:595},formGroup:this.userInfoFormGroup})}onDeleteClick(){let e=this.formGroup.getRawValue().checkedUserIds.map(t=>this.table.getData().find(o=>o.userId===t)).filter(ee.isDefined);if(e.some(t=>this.user&&t.userId===this.user.userId)){this.toastService.create({icon:"failed",content:this.translatePipe.transform("CANNOT_DELETE_SELF_ACCOUNT")});return}this.adminDialogService.toggleDialogVisibility(V.DELETE_ITEMS,!0,{description:"",size:{width:336,height:280},data:e,caller:qt.ACCOUNT})}onItemDblClick(e){this.userInfoFormGroup.setValue({name:e.name,userId:e.userId,password:"",passwordCheck:"",purpose:ei.find(t=>t.value===e.type)}),this.userInfoFormGroup.get("userId")?.disable(),this.adminDialogService.toggleDialogVisibility(V.MODIFY_USER,!0,{title:this.translatePipe.transform("MODIFY_USER_INFO"),size:{width:452,height:595},formGroup:this.userInfoFormGroup})}checkedStatusChange(e){this.formGroup.controls.checkedUserIds.setValue(e)}deleteUser(){this.isLoading=!0,this.subs.set("deleteUser",this.accountDataService.deleteUsers(this.formGroup.controls.checkedUserIds.value).pipe(mt(()=>{this.table.reset(),this.getUsers()})).subscribe({next:()=>{this.toastService.create({icon:"success",content:this.translatePipe.transform("DELETE_COMPLETE")})},error:e=>{e.status===wt.NotAcceptable&&this.toastService.create({icon:"failed",content:this.translatePipe.transform("REJECTED_TO_DELETE_ACCOUNT")})}}))}updateUser(e){if(this.isLastAdmin(e.userId)&&e.purpose===re.USER){this.toastService.create({icon:"failed",content:this.translatePipe.transform("CHANGE_LAST_ADMIN_USAGE_EXCEPTION")}),this.getUsers();return}this.isLoading=!0,this.subs.set("updateUser",this.accountDataService.patchUser(e.userId,{name:e.name,password:e.password?.trim()===""?void 0:e.password,type:e.purpose}).pipe(mt(()=>{this.table.reset(),this.userInfoFormGroup.reset(),this.getUsers()})).subscribe({next:()=>{this.toastService.create({icon:"success",content:this.translatePipe.transform("SUCCEED_PATCHING")})},error:()=>{this.toastService.create({icon:"failed",content:this.translatePipe.transform("FAILED")}),this.isLoading=!1}}))}registerUser(){this.subs.set("registerUser",this.accountDataService.postRegisterUser(this.userInfoFormGroup.controls.name.value,this.userInfoFormGroup.controls.userId.value,this.userInfoFormGroup.controls.password.value,this.userInfoFormGroup.controls.purpose.value.value).subscribe({next:()=>{this.table.reset(),this.userInfoFormGroup.reset(),this.getUsers(),this.toastService.create({icon:"success",content:this.translatePipe.transform("CREATE_USER")}),this.adminDialogService.closeCurrentActiveDialog()},error:e=>{e.status===wt.BadRequest&&this.toastService.create({icon:"failed",content:this.translatePipe.transform("DUPLICATED_EMAIL")})}}))}getUsers(){let e=this.table.getPeriodValue();this.isLoading=!0,this.subs.push(this.accountDataService.getUserList({pageIndex:this.table.getPageInfo().currentIndex,listingCount:parseInt(this.NUM_PER_PAGE),search:this.table.getKeyword(),from:e?U.formatDate(e.startDate):void 0,to:e?U.formatDate(e.endDate):void 0,orderBy:this.orderedBy,ascending:this.asc,type:this.purposeFilterValue}).pipe(mt(()=>this.table.isLoading=!1)).subscribe({next:t=>{this.formGroup.controls.purpose=this.formBuilder.group({}),this.table.setData(t.resources.map(s=>K(W({},s),{id:s.userId}))),this.table.setPageInfo(t.pageInfo.totalCount,this.NUM_PER_PAGE),this.table.getData().forEach(s=>{let d=this.accountOptions.find(_=>s.type===_.value);this.formGroup.controls.purpose.addControl(s.userId,new ie(d,{nonNullable:!0}))});let o=this.table.getSelectedData();if(o){let s=this.table.getData().find(d=>d.userId===o.userId);this.table.selectData(s)}this.isLoading=!1,this.subs.set("dropdownChange",bt(...this.table.getData().map(s=>this.formGroup.controls.purpose.controls[s.userId].valueChanges.pipe(oe(d=>({userId:s.userId,control:d}))))).subscribe({next:s=>{let d=s.control.value;if(this.user&&s.userId===this.user.userId&&!(this.isLastAdmin(this.user.userId)&&d===re.USER)){this.adminDialogService.toggleDialogVisibility(V.WARNING,!0,{title:this.translatePipe.transform("CHANGE_PURPOSE_WARNING_TITLE"),description:this.translatePipe.transform("CHANGE_PURPOSE_WARNING_MESSAGE"),size:{width:388,height:280},data:{from:"table",control:s}});return}this.updateUser({userId:s.userId,purpose:s.control.value})}})),this.changeDetectorRef.markForCheck()}}))}sortingChanges(e){this.orderedBy=e.value===0?void 0:e.name,this.asc=e.value===0?void 0:e.value===1,this.getUsers()}onPageChanging(e){this.table.setPageCurrentIndex(e-1),this.getUsers()}isLastAdmin(e){return this.table.getData().find(o=>o.userId===e)?.type===re.ADMIN&&this.table.getData().filter(o=>o.type===re.ADMIN).length<=1}};m(i,"\u0275fac",function(t){return new(t||i)(u(xe),u(L),u(ji),u(Y),u(ge),u(M),u(Ie),u(Ni),u(S))}),m(i,"\u0275cmp",I({type:i,selectors:[["sd-document-list"]],standalone:!1,features:[k([S,Oi])],decls:30,vars:36,consts:[["emptyEl",""],[3,"isLoading"],[1,"form-list-header",3,"formGroup"],[1,"tools"],["size","small","color","primary",1,"ep-button",3,"click"],[1,"papycon","papycon-plus3"],["size","small","color","grey",1,"ep-button",3,"click","disabled"],[1,"papycon","papycon-minus2"],[1,"right-side"],["formControlName","filter",1,"small",3,"filterMenus"],["size","small","formControlName","keyword",1,"custom",3,"keydown.enter","focusout","useClearButton","placeholder"],[3,"formGroup"],[3,"checkedStatusChange","itemDblClick","sortingChange","data","displayedColumns","formGroupName","currentPageIndex","emptyEl"],[4,"eTableCell","eTableCellFor"],[3,"pageChange","last","sideButtonCount","page","prevLabel","nextLabel"],["color","none",3,"formControlName","options"],[1,"empty"],[1,"notifier"],[1,"papycon","papycon-profile2"],[1,"title"],[1,"dashed"],[1,"message"]],template:function(t,o){if(t&1){let s=T();l(0,"h1"),f(1),g(2,"translate"),c(),l(3,"sd-card",1)(4,"header",2)(5,"div",3)(6,"button",4),P("click",function(){return x(s),v(o.onCreateClick())}),O(7,"i",5),f(8),g(9,"translate"),c(),l(10,"button",6),P("click",function(){return x(s),v(o.onDeleteClick())}),O(11,"i",7),f(12),g(13,"translate"),c()(),l(14,"div",8),O(15,"sd-filter-pop-up",9),l(16,"pu-input",10),g(17,"translate"),P("keydown.enter",function(){return x(s),v(o.searchKeyword())})("focusout",function(){return x(s),v(o.searchKeyword())}),c()()(),X(18,11),l(19,"e-table",12),P("checkedStatusChange",function(_){return x(s),v(o.checkedStatusChange(_))})("itemDblClick",function(_){return x(s),v(o.onItemDblClick(_))})("sortingChange",function(_){return x(s),v(o.sortingChanges(_))}),D(20,qr,2,1,"div",13)(21,Qr,2,1,"div",13)(22,Xr,2,2,"div",13)(23,Zr,3,4,"div",13),c(),Z(),l(24,"footer")(25,"sd-pagination",14),g(26,"translate"),g(27,"translate"),P("pageChange",function(_){return x(s),v(o.onPageChanging(_))}),c()()(),D(28,Jr,10,6,"ng-template",null,0,J)}if(t&2){let s=H(29);a(),h(C(2,24,"ADMIN_ACCOUNT_MANAGEMENT")),a(2),p("isLoading",o.isLoading),a(),p("formGroup",o.table.filterGroup),a(4),h(C(9,26,"ADD_USER")),a(2),p("disabled",!(o.formGroup.controls.checkedUserIds.value!=null&&o.formGroup.controls.checkedUserIds.value.length)),a(2),h(C(13,28,"DELETE")),a(3),p("filterMenus",o.filterMenus),a(),p("useClearButton",!0)("placeholder",C(17,30,"ADMIN_ACCOUNT_SEARCH_PLACEHOLDER")),a(2),p("formGroup",o.formGroup),a(),p("data",o.table.getData())("displayedColumns",o.displayableColumns)("formGroupName","purpose")("currentPageIndex",o.currentPageIndex)("emptyEl",s),a(),p("eTableCellFor","name"),a(),p("eTableCellFor","userId"),a(),p("eTableCellFor","type"),a(),p("eTableCellFor","createdAt"),a(2),p("last",o.table.getPageInfo().allPageCount)("sideButtonCount",1)("page",o.table.getPageInfo().currentIndex+1)("prevLabel",C(26,32,"PREVIOUS"))("nextLabel",C(27,34,"NEXT"))}},dependencies:[Pe,Ii,Be,q,ye,le,Se,Me,ao,Ke,Ye,We,Le,M],styles:[".split[_ngcontent-%COMP%]{width:1px;height:20px;background:#c8c8c8}sd-card-loader[_ngcontent-%COMP%]{position:unset;top:0;left:0}header.dialog[_ngcontent-%COMP%]{margin:40px 0 0;font-size:16px;line-height:26px;font-family:NotoSans-Medium,sans-serif;color:#1e1e1e}header.dialog[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%]{font-family:NotoSans-Medium,sans-serif;font-weight:400;margin:0}h1[_ngcontent-%COMP%]{font-size:20px;line-height:28px}h2[_ngcontent-%COMP%]{font-size:16px;line-height:26px}h3[_ngcontent-%COMP%]{font-size:14px;line-height:24px}h4[_ngcontent-%COMP%]{font-size:13px;line-height:22px}h5[_ngcontent-%COMP%]{font-size:12px;line-height:20px}pu-icon[_ngcontent-%COMP%], .papycon[_ngcontent-%COMP%]{text-align:center}pu-icon.bt[_ngcontent-%COMP%], .papycon.bt[_ngcontent-%COMP%]{cursor:pointer}.dialog__header[_ngcontent-%COMP%] pu-icon[_ngcontent-%COMP%], .dialog__header[_ngcontent-%COMP%] .papycon[_ngcontent-%COMP%]{align-self:flex-start}textarea[_ngcontent-%COMP%]{font-size:13px;line-height:22px;font-family:NotoSans-Regular,sans-serif;border:1px solid #DADADA;border-radius:2px;height:62px;resize:none;box-sizing:border-box;padding:3px}textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:#f79f1a}textarea[_ngcontent-%COMP%]::placeholder{color:#6c6c6c;opacity:.7}textarea.fit[_ngcontent-%COMP%]{width:100%}pu-checkbox.custom[_ngcontent-%COMP%]{line-height:1!important;padding:3px 10px}pu-checkbox.box[_ngcontent-%COMP%]{font-size:20px;border:solid 1px #DADADA;background-color:#fff;border-radius:2px}pu-checkbox[_ngcontent-%COMP%] .papycon[_ngcontent-%COMP%]{vertical-align:initial}pu-toggle-button[_ngcontent-%COMP%] input[type]{border:unset}.empty[_ngcontent-%COMP%]{flex:1;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.empty[_ngcontent-%COMP%] .notifier[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;width:170px;height:160px}.empty[_ngcontent-%COMP%] .papycon[_ngcontent-%COMP%]{color:#6c6c6c;font-size:22px;margin:0 auto 12px}.empty[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:16px;font-family:NotoSans-Regular}.empty[_ngcontent-%COMP%] .message[_ngcontent-%COMP%]{font-size:14px;font-weight:400;text-align:center;font-family:NotoSans-Regular;padding-top:12px}.empty[_ngcontent-%COMP%] .dashed[_ngcontent-%COMP%]{width:170px;height:2px;border-bottom:2px dashed #979797}.notifier[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:6px 0}[_nghost-%COMP%]:not(.loading){position:relative;width:100%;min-width:1120px;display:flex;flex-flow:column}[_nghost-%COMP%]:not(.loading) > header[_ngcontent-%COMP%]{background:#f2f2f2}[_nghost-%COMP%]:not(.loading) > header[_ngcontent-%COMP%] .light[_ngcontent-%COMP%]{color:#6c6c6c}[_nghost-%COMP%]:not(.loading) > header[_ngcontent-%COMP%] .tool[_ngcontent-%COMP%]{margin-top:14px;display:flex}[_nghost-%COMP%]:not(.loading) > header[_ngcontent-%COMP%] .tool[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(:first-child){margin-left:12px}[_nghost-%COMP%]:not(.loading) > header[_ngcontent-%COMP%] .tool[_ngcontent-%COMP%] .push[_ngcontent-%COMP%]{margin-left:auto}sd-card[_ngcontent-%COMP%]{padding:30px 24px 37px}.form-list-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-list-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:6px;font-size:18px}.form-list-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] + button[_ngcontent-%COMP%]{margin-left:12px}.form-list-header[_ngcontent-%COMP%] .right-side[_ngcontent-%COMP%]{display:flex}.form-list-header[_ngcontent-%COMP%] .right-side[_ngcontent-%COMP%] pu-input[_ngcontent-%COMP%]{width:307px}.form-list-header[_ngcontent-%COMP%] .right-side[_ngcontent-%COMP%] pu-input.custom[_ngcontent-%COMP%]{margin-left:12px}.form-list-header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:12px;line-height:20px;font-family:NotoSans-Medium,sans-serif;color:#6c6c6c;border-radius:12px;border:solid 1.2px #C8C8C8;padding:3px 12px;margin-left:8px}e-table[_ngcontent-%COMP%]{margin-top:20px;flex:1;box-sizing:border-box;display:flex;width:100%;overflow:visible}e-table[_ngcontent-%COMP%] td.name, e-table[_ngcontent-%COMP%] th.name{flex:0 1 245px;font-size:14px}e-table[_ngcontent-%COMP%] .userId{flex:1;font-size:14px}e-table[_ngcontent-%COMP%] .createdAt{flex:0 1 152px;font-size:14px}e-table[_ngcontent-%COMP%] .type{flex:0 1 250px;font-size:14px;display:flex}e-table[_ngcontent-%COMP%] .type:hover pu-dropdown[size] div.select-box{background-color:#fff;border-radius:2px;border:1px solid #DADADA}e-table[_ngcontent-%COMP%] .type pu-dropdown[size] div.select-box{width:100px;display:flex;flex-direction:row-reverse;height:33px;border:none;background-color:transparent}e-table[_ngcontent-%COMP%] .type pu-dropdown[size] div.select-box div.expand-button{background-color:transparent;border-left:none}footer[_ngcontent-%COMP%]{height:95px;display:flex;justify-content:center}footer[_ngcontent-%COMP%] sd-pagination[_ngcontent-%COMP%]{margin-top:38px}span.primary[_ngcontent-%COMP%]{color:#ff6100;text-decoration:underline}"]}));let n=i;return n})();var pt=(()=>{let i=class i{};m(i,"\u0275fac",function(t){return new(t||i)}),m(i,"\u0275mod",F({type:i})),m(i,"\u0275inj",R({imports:[B,xo,nt,ue,ot,Zt,ve]}));let n=i;return n})();_e(Be,[Pt,Fe,de,Ot,Hn,Yn,Wn,bo,q,oo,Xt,so],[M]);var dt=(()=>{let i=class i{};m(i,"\u0275fac",function(t){return new(t||i)}),m(i,"\u0275mod",F({type:i})),m(i,"\u0275inj",R({imports:[B]}));let n=i;return n})();var Go=(()=>{let i=class i{};m(i,"\u0275fac",function(t){return new(t||i)}),m(i,"\u0275mod",F({type:i})),m(i,"\u0275inj",R({providers:[ji],imports:[at,B,wi,pt,nt,ue,Tt,ot,yt,Zt,we,ve,dt,st]}));let n=i;return n})();var ea=["*"],zo=(()=>{let i=class i{};m(i,"\u0275fac",function(t){return new(t||i)}),m(i,"\u0275cmp",I({type:i,selectors:[["sd-main-contents"]],standalone:!1,ngContentSelectors:ea,decls:1,vars:0,template:function(t,o){t&1&&(Gn(),zn(0))},styles:["[_nghost-%COMP%]{background-color:#f2f2f2;width:100%;height:calc(100% - 70px);display:flex}[_nghost-%COMP%] .admin-content-container>:last-child:not(e-login){display:block;padding:40px 30px 50px;box-sizing:border-box}[_nghost-%COMP%] .admin-content-container>:last-child:not(e-login)>h1{margin-bottom:30px;font-size:28px;font-family:NotoSans-Medium,sans-serif}"]}));let n=i;return n})();var jo=(()=>{let i=class i{changeDetectorRef;authService;subs;translatePipe;adminDialogService;toastService;formBuilder;store$;productService;i18nService;modalService;preferenceService;menus=[];logoToggle=new tt;packageVersion="";user;passwordFormGroup;userFormGroup;languageFormGroup;get logoUrl(){return this.productService.adminLogo}get rightMenuStyle(){return{width:this.i18nService.language==="en"?"115px":"95px",height:"98px"}}constructor(e,t,o,s,d,_,y,w,A,te,Ee,Je){this.changeDetectorRef=e,this.authService=t,this.subs=o,this.translatePipe=s,this.adminDialogService=d,this.toastService=_,this.formBuilder=y,this.store$=w,this.productService=A,this.i18nService=te,this.modalService=Ee,this.preferenceService=Je,this.passwordFormGroup=this.formBuilder.group({password:this.formBuilder.nonNullable.control("")}),this.userFormGroup=this.formBuilder.group({name:this.formBuilder.nonNullable.control(""),email:this.formBuilder.nonNullable.control({value:"",disabled:!0},Gt.required),password:this.formBuilder.nonNullable.control("",[Di.passwordValidators,()=>(this.userFormGroup&&this.userFormGroup.controls.passwordCheck.updateValueAndValidity(),null)]),passwordCheck:this.formBuilder.nonNullable.control("",[_n=>!this.userFormGroup||_n.value===this.userFormGroup.getRawValue().password?null:{message:this.translatePipe.transform("INVALID_PASSWORD")}]),purpose:this.formBuilder.nonNullable.control(ei[0])}),this.languageFormGroup=this.formBuilder.group({language:this.formBuilder.nonNullable.control(this.i18nService.language)})}ngOnInit(){this.subs.push(this.productService.getPackageVersion().subscribe({next:e=>this.packageVersion=`v${e}`}),this.store$.pipe(Ai(),z(ee.isDefined)).subscribe({next:e=>{this.user=e,this.userFormGroup.reset({name:this.user.name,email:this.user.userId}),this.changeDetectorRef.markForCheck()}}),this.adminDialogService.dialogEvent$.pipe(z(e=>e.action==="confirm"&&e.dialogType===V.MODIFY_MY_INFO),et(()=>this.store$.pipe(go(),z(ee.isDefined)))).subscribe({next:()=>{this.subs.set("patchMyInfo",this.authService.patchMyInfo(this.userFormGroup.getRawValue()).pipe(et(()=>this.authService.sharedGetSession)).subscribe({next:e=>{this.store$.dispatch(fo.setUser({payload:e})),this.adminDialogService.closeCurrentActiveDialog(),this.toastService.create({icon:"success",content:this.translatePipe.transform("CHANGES_SAVED")}),this.changeDetectorRef.markForCheck()},error:()=>{this.passwordFormGroup.reset(),this.userFormGroup.reset(),this.toastService.create({icon:"failed",content:this.translatePipe.transform("FAILED")})}}))}}),this.adminDialogService.dialogEvent$.pipe(z(e=>e.dialogType===V.LANGUAGE_SETTING&&e.action==="select"),oe(e=>e.data)).subscribe({next:e=>this.changeLanguage(e)})),this.buildMenu()}logout(){this.authService.logout().subscribe()}changeLanguage(e){this.preferenceService.updatePreferences(["language"],e),setTimeout(()=>{this.modalService.createCommonModal({type:Ri.BASIC,width:350,icon:"papycon papycon-questionmark",title:this.translatePipe.transformByLanguage(e,"NOTIFICATION"),content:this.translatePipe.transformByLanguage(e,"NEED_TO_REFRESH"),confirmButton:!0,confirmLabel:this.translatePipe.transformByLanguage(e,"OK")})})}showLanguageSettingDialog(){this.adminDialogService.toggleDialogVisibility(V.LANGUAGE_SETTING,!0,{title:this.translatePipe.transform("LANGUAGE_SETTING"),size:{width:269,height:216},formGroup:this.languageFormGroup})}showModifyUserInfoDialog(){this.passwordFormGroup.reset(),this.adminDialogService.toggleDialogVisibility(V.CHECK_USER,!0,{title:this.translatePipe.transform("MODIFY_USER_INFO"),size:{width:452,height:282},formGroup:this.passwordFormGroup}),this.subs.set("checkUser",this.adminDialogService.dialogEvent$.pipe(z(e=>e.action==="confirm"&&e.dialogType===V.CHECK_USER),qe(1),ut(()=>this.adminDialogService.closeCurrentActiveDialog()),et(()=>this.authService.postCheckPassword(this.passwordFormGroup.controls.password.value))).subscribe({next:()=>{this.userFormGroup.reset({name:this.user.name,email:this.user.userId}),this.adminDialogService.toggleDialogVisibility(V.MODIFY_MY_INFO,!0,{title:this.translatePipe.transform("MODIFY_USER_INFO"),size:{width:452,height:484},formGroup:this.userFormGroup})},error:()=>{this.passwordFormGroup.reset(),this.userFormGroup.reset({name:this.user.name,email:this.user.userId}),this.toastService.create({icon:"failed",content:this.translatePipe.transform("INVALID_PASSWORD")})}}))}getUser(){this.authService.sharedGetSession.pipe(qe(1)).subscribe({next:e=>{this.user=e,this.userFormGroup.reset({name:this.user.name,email:this.user.userId}),this.changeDetectorRef.markForCheck()}})}buildMenu(){this.menus=[{items:[{label:this.translatePipe.transform("USER_INFO"),command:()=>this.showModifyUserInfoDialog()},{label:this.translatePipe.transform("LANGUAGE_SETTING"),command:()=>this.showLanguageSettingDialog()},{label:this.translatePipe.transform("LOGOUT"),command:()=>this.logout()}]}],this.getUser(),this.changeDetectorRef.markForCheck()}};m(i,"\u0275fac",function(t){return new(t||i)(u(L),u(ge),u(S),u(M),u(Ie),u(Y),u(xe),u(Ni),u(Et),u(mo),u(It),u(yo))}),m(i,"\u0275cmp",I({type:i,selectors:[["sd-main-toolbar"]],outputs:{logoToggle:"logoToggle"},standalone:!1,features:[k([S])],decls:13,vars:5,consts:[["menuRef",""],[1,"toolbar-container"],[1,"left-container"],[1,"papycon","papycon-more-symbol5",3,"click"],[3,"src"],[1,"package-version"],[1,"right-container"],[3,"click"],[1,"papycon","papycon-chevron3-down","arrow"],[3,"menus","ngStyle"]],template:function(t,o){if(t&1){let s=T();l(0,"div",1)(1,"div",2)(2,"i",3),P("click",function(){return x(s),v(o.logoToggle.emit())}),c(),O(3,"img",4),l(4,"span",5),f(5),c()(),l(6,"div",6)(7,"div",7),P("click",function(){x(s);let _=H(12);return v(_.toggleMenu())}),l(8,"span"),f(9),c(),O(10,"i",8)(11,"pu-menu",9,0),c()()()}t&2&&(a(3),p("src",o.logoUrl,_i),a(2),h(o.packageVersion),a(4),h(o.user==null?null:o.user.name),a(2),p("menus",o.menus)("ngStyle",o.rightMenuStyle))},dependencies:[Ot,Si],styles:[".toolbar-container[_ngcontent-%COMP%]{background-color:#363636;width:100%;height:70px;display:flex;justify-content:space-between}.toolbar-container[_ngcontent-%COMP%] .left-container[_ngcontent-%COMP%]{height:100%;display:flex;justify-content:center;align-items:center}.toolbar-container[_ngcontent-%COMP%] .left-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-left:34px;font-size:28px;color:#fff}.toolbar-container[_ngcontent-%COMP%] .left-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:hover{cursor:pointer}.toolbar-container[_ngcontent-%COMP%] .left-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-left:37px;height:18px}.toolbar-container[_ngcontent-%COMP%] .left-container[_ngcontent-%COMP%] .package-version[_ngcontent-%COMP%]{font-family:NotoSans-Bold,sans-serif;font-size:14px;line-height:24px;color:#fff;margin-left:8px}.toolbar-container[_ngcontent-%COMP%] .right-container[_ngcontent-%COMP%]{width:100px;height:100%;display:flex;justify-content:center;align-items:center;color:#fff;margin-right:15px}.toolbar-container[_ngcontent-%COMP%] .right-container[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;line-height:24px;font-family:NotoSans-Regular,sans-serif;margin-right:6px}.toolbar-container[_ngcontent-%COMP%] .right-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:12px}.toolbar-container[_ngcontent-%COMP%] .right-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{position:relative;display:flex;justify-content:center;align-items:center;cursor:pointer}.toolbar-container[_ngcontent-%COMP%] .right-container[_ngcontent-%COMP%] pu-menu[_ngcontent-%COMP%] {top:30px;right:0;z-index:9999}.toolbar-container[_ngcontent-%COMP%] .right-container[_ngcontent-%COMP%] pu-menu[_ngcontent-%COMP%] .menu-item__text{font-size:13px;line-height:22px}"]}));let n=i;return n})();var $o={root:{label:"",route:"",data:"",expanded:!0,parent:null,children:[{label:"DASHBOARD",route:"dashboard",data:"thumbnail",expanded:!1,parent:null,children:[]},{label:"DOCUMENT_LIST",route:"document-list",data:"list2",expanded:!1,parent:null,children:[{label:"DOCUMENT_LIST",route:"document-list",data:null,expanded:!1,parent:null,children:[]},{label:"REMOVED_DOCUMENT_LIST",route:"removed-document-list",data:null,expanded:!1,parent:null,children:[]}]},{label:"STATISTIC",route:"statistic-period",data:"analytics",expanded:!1,parent:null,children:[{label:"STATISTIC_BY_PERIOD",route:"statistic-period",data:null,expanded:!1,parent:null,children:[]},{label:"STATISTIC_BY_DOCUMENT",route:"statistic-document",data:null,expanded:!1,parent:null,children:[]},{label:"STATISTIC_BY_VIEWER",route:"statistic-viewer",data:null,expanded:!1,parent:null,children:[]}]},{label:"SERVER_MANAGEMENT",route:"server-monitoring",data:"switch",expanded:!1,parent:null,children:[{label:"SERVER_MONITORING",route:"server-monitoring",data:null,expanded:!1,parent:null,children:[]},{label:"LOG_MANAGEMENT",route:"server-log",data:null,expanded:!1,parent:null,children:[]},{label:"DOCUMENT_HISTORY",route:"document-log",data:null,expanded:!1,parent:null,children:[]},{label:"DELETE_TEMP_FILE",route:"system-management",data:null,expanded:!1,parent:null,children:[]}]},{label:"VIEW_SETTINGS",route:"configs/view",data:"settings",expanded:!1,parent:null,children:[{label:"VIEW_SETTINGS_UI",route:"configs/view",data:null,expanded:!1,parent:null,children:[]},{label:"WATERMARK",route:"configs/watermark",data:null,expanded:!1,parent:null,children:[]}]},{label:"ACCOUNT_MANAGEMENT",route:"account",data:"profile2",expanded:!1,parent:null,children:[]},{label:"LICENSE_MANAGEMENT",route:"license",data:"security",expanded:!1,parent:null,children:[]}]}},Ho={root:{label:"",route:"",data:"",expanded:!0,parent:null,children:[{label:"DASHBOARD",route:"dashboard",data:"thumbnail",expanded:!1,parent:null,children:[]},{label:"DOCUMENT_LIST",route:"document-list",data:"list2",expanded:!1,parent:null,children:[{label:"DOCUMENT_LIST",route:"document-list",data:null,expanded:!1,parent:null,children:[]},{label:"REMOVED_DOCUMENT_LIST",route:"removed-document-list",data:null,expanded:!1,parent:null,children:[]}]},{label:"STATISTIC",route:"statistic-period",data:"analytics",expanded:!1,parent:null,children:[{label:"STATISTIC_BY_PERIOD",route:"statistic-period",data:null,expanded:!1,parent:null,children:[]},{label:"STATISTIC_BY_DOCUMENT",route:"statistic-document",data:null,expanded:!1,parent:null,children:[]}]},{label:"SERVER_MANAGEMENT",route:"server-monitoring",data:"switch",expanded:!1,parent:null,children:[{label:"SERVER_MONITORING",route:"server-monitoring",data:null,expanded:!1,parent:null,children:[]},{label:"DOCUMENT_HISTORY",route:"document-log",data:null,expanded:!1,parent:null,children:[]}]}]}},Yo={root:{label:"",route:"",data:"",expanded:!0,parent:null,children:[{label:"DASHBOARD",route:"dashboard",data:"thumbnail",expanded:!1,parent:null,children:[]},{label:"DOCUMENT_LIST",route:"document-list",data:"list2",expanded:!1,parent:null,children:[]},{label:"STATISTIC",route:"statistic-period",data:"analytics",expanded:!1,parent:null,children:[{label:"STATISTIC_BY_PERIOD",route:"statistic-period",data:null,expanded:!1,parent:null,children:[]},{label:"STATISTIC_BY_DOCUMENT",route:"statistic-document",data:null,expanded:!1,parent:null,children:[]}]}]}};function na(n,i){if(n&1&&O(0,"i",9),n&2){let r=b(3).$implicit;p("@chevron",r.expanded)}}function oa(n,i){if(n&1&&(X(0),l(1,"span",7),f(2),g(3,"translate"),c(),D(4,na,1,1,"i",8),Z()),n&2){let r=b(2).$implicit,e=b();a(),p("@label",e.setDuration(r)),a(),h(C(3,3,r.label)),a(2),p("ngIf",r.children)}}function ra(n,i){if(n&1){let r=T();X(0),l(1,"div",3),P("click",function(){x(r);let t=b().$implicit,o=b();return v(o.onNestedMenuClick(t))}),l(2,"div",4),O(3,"i",5),c(),D(4,oa,5,5,"ng-container",6),c(),Z()}if(n&2){let r=b(