1import{a as Ja,b as Ai,c as Di,d as Ge,e as Zt,f as vn,g as Za}from"./chunk-5UOLHEPE.js";import{a as Ii,b as de,d as Xa}from"./chunk-ZEV3HIZJ.js";import{$ as Re,$a as it,$b as Fe,$f as Hr,$g as en,$k as Ta,$o as ja,Aa as a,Aj as ha,Ak as _a,Ba as s,Bf as Pr,Bh as na,Bk as At,Bo as Ha,C as ge,Ca as N,Cf as wr,Cg as g,Ck as Ui,Co as Ti,D as ye,Da as Ue,De as Rr,Dg as Xr,Dh as oa,Dk as nr,Do as w,Ea as Ke,Ec as ti,Ef as Ye,Ek as Yt,Eo as Ei,F as pr,Fe as q,Ff as Lr,Fg as W,Fh as nn,Fk as ii,Ga as b,Gk as cn,Go as gn,Ha as h,He as Ir,Hk as Ki,Ho as Qe,Ia as c,Ib as xt,Ik as dn,J as ne,Jb as fe,Jk as mn,Jo as Va,Kb as _r,Kk as pn,L as qo,Lh as zt,Lk as ji,M as Le,Mh as at,Mj as _i,Mk as qi,N as O,Nc as rt,Nh as Tt,Nk as un,Oa as ri,Of as Br,Oh as Y,Oj as rn,Ok as or,Oo as yi,P as J,Ph as ra,Pj as Xt,Pk as ni,Po as Sn,Qe as qe,Qf as ie,Qg as Jr,Qh as aa,Qj as an,Qk as Yi,Qo as Tn,Ra as G,Re as Wo,Rf as Fr,Rg as Xo,Rh as sa,Rj as Jt,Rk as hn,Sa as re,Sf as $e,Sg as D,Sh as la,Sj as sn,So as vi,T as Xi,Ta as Ne,Te as Ar,Tf as kr,Th as Ft,To as Ua,Ub as ci,Uf as pi,Ug as Zr,Uh as kt,Uj as Ie,Uk as Ca,Uo as En,Va as ai,Vb as Cr,Vf as $r,Vg as ea,Vh as se,W as pe,Wa as si,Wb as Oe,Wh as Et,Wj as ir,X as S,Xa as li,Xb as U,Xh as st,Xk as ga,Y as T,Yc as Qo,Zb as H,Zf as Gr,Zh as ca,Zn as fn,Zo as he,_ as ue,_d as Kt,_e as Je,_f as et,_k as Sa,_n as rr,_o as Ka,aa as Ve,ab as E,af as Dr,ag as le,ah as tn,ap as qa,bb as dt,bc as di,bf as zo,bl as Ea,cc as Q,ch as ta,cl as ya,cp as nt,d as P,da as Nt,df as Ee,do as gi,ec as K,f as I,fa as l,fb as p,ff as Ze,fi as Be,fj as Jo,fo as Pa,ga as k,gb as f,gd as Zi,gj as on,gl as va,go as wa,hb as je,hc as ke,hd as Er,he as vr,hf as Or,hg as Vr,hk as $,hl as ba,id as yr,ie as Pt,ig as Ur,il as Gt,io as _n,ip as bi,jb as Rt,je as br,jg as Kr,jh as ia,jl as Ci,jp as Ya,ka as u,kb as ei,ke as L,kg as jr,kk as $t,kl as Ra,kp as Qa,lc as gr,le as A,lf as wt,lg as ui,ll as Ia,lo as La,m as Wt,ma as R,mc as Sr,mf as Lt,mg as qr,ml as Aa,mo as Ba,na as Ji,ne as M,nf as Bt,ni as da,nl as Da,no as Fa,np as Wa,o as me,ob as j,oe as z,of as We,oi as ma,oj as Zo,ol as Oa,oo as ut,pa as V,pg as Yr,pi as pa,pj as ua,pl as Na,po as Si,pp as yn,q as He,qa as Z,qe as _e,qf as Nr,qg as Me,qj as er,qk as fa,ql as Qi,rb as x,rf as Mr,rg as Qr,rj as fi,rk as yt,rl as Ma,ro as ve,rp as Ri,sa as _,sb as hr,sf as xr,sk as Gi,sl as xa,so as ka,sp as za,ta as St,tb as Mt,th as _t,tk as lt,to as $a,ua as C,ug as hi,uh as y,uk as ct,v as we,va as pt,vb as fr,ve as jt,vh as mt,vk as It,vo as be,w as mr,wa as ur,wc as Yo,wf as X,wg as Wr,wk as Hi,wo as Ga,x as zi,xa as Se,xc as Tr,xe as mi,xg as xe,xk as ln,ya as Te,yg as zr,yk as qt,yo as Cn,za as d,zf as $i,zj as tr,zk as Vi,zo as ce}from"./chunk-QWVXRTQO.js";import"./chunk-FGYGDAFZ.js";import{a as te,b as Ut,i as gt}from"./chunk-26DOOVEQ.js";var Vs=t=>({label:t}),Us=t=>({"-clickable":t}),Ks=(t,o)=>o.cardAction;function js(t,o){if(t&1&&(a(0,"p",7),G(1),p(2,"translate"),s()),t&2){let n=c().$implicit;l(),Ne(" ",je(2,1,n.subtitle.label,n.subtitle.param)," ")}}function qs(t,o){if(t&1){let n=b();a(0,"div",2)(1,"div",3)(2,"div",4),h("click",function(){let i=S(n).$implicit,r=c(2);return T(r.onCardClicked(i.cardAction))}),a(3,"div",5)(4,"div")(5,"p",6),G(6),p(7,"translate"),s(),_(8,js,3,4,"p",7),s(),N(9,"span",8),s()()()()}if(t&2){let n=o.$implicit;l(2),d("ngClass",E(6,Us,n.cardAction)),l(4),Ne(" ",je(7,3,n.title.label,n.title.param)," "),l(2),C(n.subtitle?8:-1)}}function Ys(t,o){t&1&&(a(0,"div",1),Se(1,qs,10,8,"div",2,Ks),s()),t&2&&(l(),Te(o))}var bn=(()=>{let o=class o{constructor(e,i){this.navigationService=e,this.authenticationService=i,this.translationKey="ADMINISTRATION.HOME.",this.breadcrumb$=new I({show:!1,items:[]}),this.canManageRoles$=this.authenticationService.canAccess([{action:se.ManageRoles}]),this.canManageDocumentRequests$=this.authenticationService.canAccess([{action:se.ManageRequirementSubjects}]),this.cardItems$=this.fetchCardItems()}ngOnInit(){this.initBreadcrumb()}fetchCardItems(){let e=[];return zi(this.canManageRoles$,this.canManageDocumentRequests$).pipe(me(([i,r])=>(e.push({title:{label:`${this.translationKey}MANAGE_SURVEYS_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_SURVEYS_CONTENT`},cardAction:lt.MANAGE_SURVEYS},{title:{label:`${this.translationKey}MANAGE_TAGS_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_TAGS_CONTENT`},cardAction:lt.MANAGE_TAGS}),r&&e.push({title:{label:`${this.translationKey}REQUIREMENT_SUBJECTS_TITLE`},subtitle:{label:`${this.translationKey}REQUIREMENT_SUBJECTS_CONTENT`},cardAction:lt.DOCUMENT_REQUESTS}),e.push({title:{label:`${this.translationKey}MANAGE_CATEGORIES_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_CATEGORIES_CONTENT`},cardAction:lt.CATEGORIES}),Ti.isMonitoredProductsFeatureEnabled()&&e.push({title:{label:`${this.translationKey}MANAGE_MONITORING_TOPICS_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_MONITORING_TOPICS_CONTENT`},cardAction:lt.MONITORING_TOPICS}),e.push({title:{label:`${this.translationKey}MANAGE_REGULATORY_CHECK_CONFIGURATIONS_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_REGULATORY_CHECK_CONFIGURATIONS_CONTENT`},cardAction:lt.REGULATORY_CHECK_CONFIGURATIONS}),i&&e.push({title:{label:`${this.translationKey}MANAGE_ROLES_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_ROLES_CONTENT`},cardAction:lt.MANAGE_ROLES}),e.push({title:{label:`${this.translationKey}MANAGE_SERVICES_TITLE`},subtitle:{label:`${this.translationKey}MANAGE_SERVICES_CONTENT`},cardAction:lt.MANAGE_SERVICES}),e)))}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"}}];this.breadcrumb$.next({show:!0,items:e})}onCardClicked(e){switch(e.toString()){case lt.MANAGE_SURVEYS:this.navigationService.goToManageSurveys();break;case lt.MANAGE_TAGS:this.navigationService.goToAllTags();break;case lt.DOCUMENT_REQUESTS:this.navigationService.goToAllDocumentRequests();break;case lt.CATEGORIES:this.navigationService.goToManageCategories();break;case lt.MONITORING_TOPICS:this.navigationService.goToMonitoringTopicsAdministration();break;case lt.REGULATORY_CHECK_CONFIGURATIONS:this.navigationService.goToRegulatoryCheckConfigurations();break;case lt.MANAGE_ROLES:this.navigationService.goToRoles();break;case lt.MANAGE_SERVICES:this.navigationService.goToServices();break}}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Si))},o.\u0275cmp=R({type:o,selectors:[["biorius-administration-home"]],standalone:!1,decls:4,vars:9,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin","pt-s","pb-l"],[1,"row","mx-l","mt-m"],[1,"col-12","col-lg-8"],[1,"card","p-m",3,"click","ngClass"],[1,"flex","flex-middle","flex-between"],[1,"c-grey10","f-s"],[1,"c-grey06","f-xs"],[1,"icon","c-primary01","f-xl","icon-chevron-right-alt"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),_(2,Ys,3,0,"div",1),p(3,"async")),i&2){let m;d("title",E(7,Vs,r.translationKey+"TITLE"))("breadcrumb",f(1,3,r.breadcrumb$)),l(2),C((m=f(3,5,r.cardItems$))?2:-1,m)}},dependencies:[j,$,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var Qs=t=>({label:t});function Ws(t,o){if(t&1&&(a(0,"p",7),G(1),p(2,"translate"),s()),t&2){let n=c().$implicit;l(),Ne(" ",je(2,1,n.subtitle.label,n.subtitle.param)," ")}}function zs(t,o){if(t&1){let n=b();a(0,"ds-button",9),h("clicked",function(){S(n);let i=c().$implicit,r=c();
1return T(r.onActionClicked(i.actionButton.id))}),s()}if(t&2){let n=c().$implicit;d("label",n.actionButton.label)("type",n.actionButton.type)("icon",n.actionButton.icon)("iconPlacement",n.actionButton.iconPlacement)}}function Xs(t,o){if(t&1&&(a(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div")(5,"p",6),G(6),p(7,"translate"),s(),_(8,Ws,3,4,"p",7),s(),_(9,zs,1,4,"ds-button",8),s()()()()),t&2){let n=o.$implicit;l(6),Ne(" ",je(7,3,n.title.label,n.title.param)," "),l(2),C(n.subtitle?8:-1),l(),C(n.actionButton?9:-1)}}var Rn=(()=>{let o=class o{constructor(e){this.navigationService=e,this.translationKey="ADMINISTRATION.EXPLANATION_HELP.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.breadcrumb$=new I({show:!1,items:[]}),this.cardItems=this.fetchCardItems()}ngOnInit(){this.initBreadcrumb()}fetchCardItems(){return[{title:{label:this.translationKey+"DOCUMENTS_EXPLANATION_TITLE"},subtitle:{label:this.translationKey+"DOCUMENTS_EXPLANATION_CONTENT"},actionButton:{id:Gi.DOWNLOAD_DOCUMENTS_EXPLANATION,label:{label:this.translationKey+"DOCUMENTS_EXPLANATION_ACTION"},type:M.TERNARY,icon:A.arrowDown,iconPlacement:L.before}},{title:{label:this.translationKey+"WATCH_TUTORIALS_TITLE"},subtitle:{label:this.translationKey+"WATCH_TUTORIALS_CONTENT"},actionButton:{id:Gi.WATCH_TUTORIALS,label:{label:this.translationKey+"WATCH_TUTORIALS_ACTION"},type:M.TERNARY,icon:A.out,iconPlacement:L.before}}]}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.EXPLANATION_HELP"}}];this.breadcrumb$.next({show:!0,items:e})}goBack(){this.navigationService.goBack()}onActionClicked(e){switch(e){case Gi.DOWNLOAD_DOCUMENTS_EXPLANATION:this.downloadExplanationDocumentsPdf();break;case Gi.WATCH_TUTORIALS:this.watchTutorials();break}}downloadExplanationDocumentsPdf(){window.open("http://myapps.biorius.com/Document+Explanation.pdf","_blank")}watchTutorials(){window.open("https://biorius.com/biorius-app-tutorials","_blank")}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-explanation-help"]],standalone:!1,decls:5,vars:6,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin","pt-m","pb-l"],[1,"row","mx-l","mt-m"],[1,"col-12","col-lg-8","col-xl-6"],[1,"card","p-m"],[1,"flex","flex-middle","flex-between"],[1,"c-grey10","f-s"],[1,"c-grey06","f-xs"],[3,"label","type","icon","iconPlacement"],[3,"clicked","label","type","icon","iconPlacement"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),Se(3,Xs,10,6,"div",2,pt),s()),i&2&&(d("title",E(4,Qs,r.translationKey+"TITLE"))("breadcrumb",f(1,2,r.breadcrumb$)),l(3),Te(r.cardItems))},dependencies:[$,q,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var ts=t=>({label:t}),Js=t=>({id:t}),Zs=t=>({date:t});function el(t,o){if(t&1&&(a(0,"h1"),G(1),p(2,"translate"),s(),a(3,"p",6),G(4),p(5,"date"),p(6,"translate"),s(),N(7,"biorius-survey",7)),t&2){let n=c().dsLoading,e=c();l(),re(je(2,4,e.translationKey+"SURVEY_SUBTITLE",E(13,Js,n.id))),l(3),re(je(6,10,e.translationKey+"CREATED_DATE",E(15,Zs,je(5,7,n.creationDate,"mediumDate")))),l(3),d("survey",n)("isScoreClickable",!1)}}function tl(t,o){if(t&1){let n=b();a(0,"div",5)(1,"div",8)(2,"div",9)(3,"div",10)(4,"p"),G(5),p(6,"translate"),s()()()(),a(7,"div",11)(8,"div",9)(9,"div",10)(10,"ds-button",12),h("clicked",function(){S(n);let i=c(2);return T(i.onCreateSurveyClicked())}),s()()()()()}if(t&2){let n=c(2);l(5),re(f(6,2,n.translationKey+"NO_ACTIVE_SURVEY")),l(5),d("label",E(4,ts,n.translationKey+"CREATE_SURVEY_BTN"))}}function il(t,o){if(t&1&&(Ue(0),_(1,el,8,17)(2,tl,11,6,"div",5),Ke()),t&2){let n=o.dsLoading;l(),C(n.isTrueSurvey?1:2)}}var In=(()=>{let o=class o{constructor(e,i,r){this.navigationService=e,this.surveysService=i,this.modalService=r,this.translationKey="ADMINISTRATION.MANAGE_SURVEYS.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerRightActions$=new I([]),this.surveyRefresher$=new P,this.destroyer$=new P}ngOnInit(){this.initBreadcrumb(),this.activeSurvey$=we(this.fetchActiveSurvey(),this.surveyRefresher$.pipe(He(()=>this.fetchActiveSurvey()))).pipe(ne({bufferSize:1,refCount:!0}))}ngOnDestroy(){this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.MANAGE_SURVEYS"}}];this.breadcrumb$.next({show:!0,items:e})}fetchActiveSurvey(){return this.surveysService.getActiveSurvey().pipe(J(e=>{this.cachedSurvey=e,this.headerRightActions$.next(this.fetchHeaderRightActions(e))}))}fetchHeaderRightActions(e,i=!1){return e&&e.isTrueSurvey?[{label:{label:`${this.translationKey}DELETE_SURVEY_BTN`},type:M.DANGER,eventType:_e.DELETE,loading:i},{label:{label:`${this.translationKey}CREATE_NEW_SURVEY_BTN`},type:M.PRIMARY,eventType:_e.CREATE,disabled:i}]:[]}onCreateSurveyClicked(){this.navigationService.goToSurveyCreation()}onHeaderRightActionClicked(e){switch(e){case _e.CREATE:this.navigationService.goToSurveyCreation();break;case _e.DELETE:this.openConfirmDeleteSurveyModal();break}}openConfirmDeleteSurveyModal(){this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}CONFIRM_DELETE_SURVEY_TITLE`},contentLine1:{label:`${this.translationKey}CONFIRM_DELETE_SURVEY_LINE1`},confirmButtonText:`${this.translationKey}CONFIRM_DELETE_SURVEY_YES_BTN`}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(e=>{this.closeModal(),e.confirm&&this.deleteSurvey()})}deleteSurvey(){this.headerRightActions$.next(this.fetchHeaderRightActions(this.cachedSurvey,!0)),this.surveysService.deactivateSurvey().pipe(O(this.destroyer$)).subscribe({next:()=>{this.surveyRefresher$.next()},error:()=>{this.headerRightActions$.next(this.fetchHeaderRightActions(this.cachedSurvey))}})}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ei),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-manage-surveys"]],standalone:!1,decls:7,vars:10,consts:[[3,"onRightButtonClicked","clickOnReturn","title","breadcrumb","rightButtons"],["id","content",1,"-admin","pt-s","pb-l"],[1,"row","mx-l","mt-m"],[1,"col-12","col-lg-9"],[4,"dsLoading"],[1,"card","-no-shadow","p-m"],[1,"c-grey06","mb-s"],[3,"survey","isScoreClickable"],[1,"row"],[1,"col-12"],[1,"flex","flex-center"],[1,"row","pt-s"],[3,"clicked","label"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),p(2,"async"),h("onRightButtonClicked",function(v){return r.onHeaderRightActionClicked(v)})("clickOnReturn",function(){return r.goBack()}),s(),a(3,"div",1)(4,"div",2)(5,"div",3),Z(6,il,3,1,"ng-container",4),s()()()),i&2&&(d("title",E(8,ts,r.translationKey+"TITLE"))("breadcrumb",f(1,4,r.breadcrumb$))("rightButtons",f(2,6,r.headerRightActions$)),l(6),d("dsLoading",r.activeSurvey$))},dependencies:[$,qa,ie,q,x,Mt,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var uo=gt(Pt());var An=(()=>{let o=class o extends Yr{constructor(){super(),this.destroyer$=new P}get control(){return this.formControl}ngOnInit(){this.showError$=this.formControl.statusChanges.pipe(O(this.destroyer$),qo(this.showError),me(()=>this.showError)),this.readOnly$=this.formControl.statusChanges.pipe(O(this.destroyer$),qo(!!this.props.disabled),me(()=>!!this.props.disabled))}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}mfaChanged(e){this.control.setValue(e)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-formly-mfa"]],standalone:!1,features:[V],decls:2,vars:3,consts:[[3,"mfaChange","readOnly"]],template:function(i,r){i&1&&(a(0,"biorius-mfa-selection",0),p(1,"async"),h("mfaChange",function(v){return r.mfaChanged(v)}),s()),i&2&&d("readOnly",!!f(1,1,r.readOnly$))},dependencies:[$a,x],encapsulation:2});let t=o;return t})();var nl=t=>({label:t}),ol=()=>["-small"];function rl(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function al(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,rl,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(8,nl,n.translationKey+"LABEL_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("classList",it(10,ol))("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.ProfilesFilterKeys.NAME)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var Dn=(()=>{let o=class o{constructor(){this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_PROFILES.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.ProfilesFilterKeys=Hi,this.form=new H({[Hi.NAME]:new Fe("",[Cr.minLength(3)])}),this.destroyer$=new P}ngOnInit(){this.searchConfig=this.fetchAdvancedSearchConfig(),this.prefillQuery?.query&&(this.form.get(ct.NAME)?.setValue(this.prefillQuery.query
1),this.profileNameSearchValue=this.prefillQuery.query),this.initialSearch=this.prefillQuery?.advancedSearch?this.prefillQuery.advancedSearch:{filters:[{column:Xo.IS_ENABLED,filterId:Xo.IS_ENABLED,type:le.CHOICE,data:[st.activeStatusItem]}]},this.advancedSearchValue=this.initialSearch,this.form.get(ct.NAME)?.valueChanges.pipe(ye(1)).subscribe(()=>this.form.markAllAsTouched()),this.form.get(ct.NAME)?.valueChanges.pipe(ge(Be.searchInputDebounce),mr(e=>!e||e.length===0||e.length>=3),O(this.destroyer$)).subscribe(e=>{this.profileNameSearchValue=e,this.emitQuery()})}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:Hi.IS_ENABLED,column:Hi.IS_ENABLED,label:`${this.translationKey}IS_ENABLED`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.activeStatusSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.emitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(ct.NAME)?.setValue("")}emitQuery(){let e=_n.fromFilters(this.profileNameSearchValue,this.advancedSearchValue);this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-profiles-search"]],inputs:{prefillQuery:"prefillQuery"},outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","classList","iconPlacement","formControlName","clearable"],[1,"col-8"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,al,6,11,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var ll=()=>["-overflow-visible","-large"],cl=t=>({label:t});function dl(t,o){t&1&&(a(0,"div",4),N(1,"span",10),s())}function ml(t,o){if(t&1&&(a(0,"div",6),G(1),p(2,"translate"),s()),t&2){let n=c();l(),Ne(" ",f(2,1,n.translationKey+"LINE2_STEP1")," ")}}function pl(t,o){if(t&1){let n=b();a(0,"ds-button",13),h("clicked",function(){S(n);let i=c(2);return T(i.onSeePasswordBtnClicked())}),s()}if(t&2){let n=c(2);d("label",E(4,cl,n.translationKey+"LINK_TO_SEE_PWD"))("type",n.DS_ButtonTypeEnum.TRANSPARENT)("isFullWidth",!0)("smallLabel",!0)}}function ul(t,o){t&1&&(a(0,"span",14),G(1),s()),t&2&&(l(),re(o))}function hl(t,o){if(t&1&&(a(0,"div",12)(1,"span"),G(2),p(3,"translate"),s(),_(4,ul,2,1,"span",14),p(5,"async"),s()),t&2){let n,e=c(2);l(2),re(f(3,2,e.translationKey+"NEW_PWD_IS")),l(2),C((n=f(5,4,e.newPassword$))?4:-1,n)}}function fl(t,o){if(t&1&&(a(0,"div",7),_(1,pl,1,6,"ds-button",11)(2,hl,6,6,"div",12),s()),t&2){let n=c();l(),C(n.passwordIsVisible?2:1)}}function _l(t,o){if(t&1&&(a(0,"div",8),G(1),p(2,"translate"),s()),t&2){let n=c();l(),Ne(" ",f(2,1,n.translationKey+"CONFIRMATION_PWD_CHANGED_WARNING")," ")}}var xn=(()=>{let o=class o{constructor(e){this.profilesService=e,this.closeEmitter=new k,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.translationKey="ADMINISTRATION.PROFILE_DEFINITION.RESET_PWD_MODAL.",this.rightButtons$=new I([]),this.title={label:`${this.translationKey}TITLE`},this.currentStep=1,this.newPassword$=new I(""),this.passwordIsVisible=!1,this.destroyer$=new P}ngOnInit(){this.computeRightButtons()}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}computeRightButtons(e=!1){var i=[];this.currentStep===1?i.push({label:{label:"COMMON.CANCEL"},type:M.SECONDARY,isFullWidth:!1,eventType:_e.CANCEL,disabled:e},{label:{label:"COMMON.CONFIRM"},type:M.PRIMARY,isFullWidth:!1,eventType:_e.CONFIRM,loading:e}):i.push({label:{label:"COMMON.CLOSE"},type:M.PRIMARY,isFullWidth:!1,eventType:_e.CANCEL}),this.rightButtons$.next(i)}closeModal(){this.closeEmitter.emit(),this.closeEmitter.complete()}onBottomActionClicked(e){switch(e.eventType){case _e.CANCEL:this.closeModal();break;case _e.CONFIRM:this.confirmResetPassword();break}}confirmResetPassword(){this.computeRightButtons(!0),this.profilesService.resetTempPassword(this.profileId).pipe(O(this.destroyer$)).subscribe({next:e=>{this.currentStep=2,this.newPassword$.next(e),this.computeRightButtons()},error:()=>{this.computeRightButtons()}})}onSeePasswordBtnClicked(){this.passwordIsVisible=!0}};o.\u0275fac=function(i){return new(i||o)(u(Di))},o.\u0275cmp=R({type:o,selectors:[["biorius-reset-temp-password-modal"]],inputs:{profileId:"profileId"},outputs:{closeEmitter:"closeEmitter"},standalone:!1,decls:12,vars:12,consts:[[1,"col-12","col-md-10","offset-md-1","col-lg-8","offset-lg-2","p-none","modal
1-wrapper"],[3,"onCancel","title"],[3,"customClasses"],[1,"modal-body__text","px-m"],[1,"flex","flex-middle","flex-center"],[1,"text-center","f-s","pt-m","c-grey08",3,"innerHTML"],[1,"text-center","pb-m","px-xl","f-s","mt-m","c-grey08"],[1,"pwd","text-center","px-m","f-s","mt-xl","c-grey08"],[1,"text-center","pb-m","px-xl","f-xxs","mt-xl","c-grey06"],[3,"buttonClick","rightButtons"],[1,"icon","icon-check","-bg","-md","bg-valid02","c-valid01"],[3,"label","type","isFullWidth","smallLabel"],[1,"pt-pwd"],[3,"clicked","label","type","isFullWidth","smallLabel"],[1,"f-bold"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"ds-modal-header",1),h("onCancel",function(){return r.closeModal()}),s(),a(2,"ds-modal-body",2)(3,"div",3),_(4,dl,2,0,"div",4),N(5,"div",5),p(6,"translate"),_(7,ml,3,3,"div",6)(8,fl,3,1,"div",7),_(9,_l,3,3,"div",8),s()(),a(10,"ds-modal-footer",9),p(11,"async"),h("buttonClick",function(v){return r.onBottomActionClicked(v)}),s()()),i&2&&(l(),d("title",r.title),l(),d("customClasses",it(11,ll)),l(2),C(r.currentStep===2?4:-1),l(),d("innerHTML",f(6,7,r.translationKey+"LINE1_"+(r.currentStep===1?"STEP1":"STEP2")),Nt),l(2),C(r.currentStep===1?7:8),l(2),C(r.currentStep===2?9:-1),l(),d("rightButtons",f(11,9,r.rightButtons$)))},dependencies:[q,Bt,wt,Lt,x,fe],styles:[".pwd[_ngcontent-%COMP%]{min-height:40px}.pt-pwd[_ngcontent-%COMP%]{padding-top:6px}"],changeDetection:0});let t=o;return t})();var Cl=t=>({label:t});function gl(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function Sl(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,gl,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,Cl,n.translationKey+"LABEL_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.TagsFilterKeys.NAME)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var Pn=(()=>{let o=class o{constructor(e){this.translateService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_TAGS.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.TagsFilterKeys=ct,this.form=new H({[ct.NAME]:new Fe("")}),this.initialSearch={filters:[{column:ct.IS_ENABLED,filterId:ct.IS_ENABLED,type:le.CHOICE,data:[st.activeStatusItem]}]},this.destroyer$=new P}ngOnInit(){this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(ct.NAME)?.valueChanges.pipe(ge(Be.searchInputDebounce),O(this.destroyer$)).subscribe(e=>{this.tagNameSearchValue=e,this.emitQuery()})}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:ct.TYPE,column:ct.TYPE,label:`${this.translationKey}TYPE`,placeholder:`${this.translationKey}TYPE_PLACEHOLDER`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:tn(this.translateService),multiple:!0}},{id:ct.IS_ENABLED,column:ct.IS_ENABLED,label:`${this.translationKey}IS_ENABLED`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.activeStatusSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.emitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(ct.NAME)?.setValue("")}emitQuery(){let e=hn.fromFilters(this.tagNameSearchValue,this.advancedSearchValue);this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(xt))},o.\u0275cmp=R({type:o,selectors:[["biorius-tags-search"]],outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-8"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,Sl,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();function El(t,o){if(t&1&&(a(0,"form",6),N(1,"formly-form",7),s()),t&2){let n=c();d("formGroup",n.formGroup),l(),d("form",n.formGroup)("fields",n.fields)("model",n.model)}}var Oi=(()=>{let o=class o{constructor(){this.translationKey="ADMINISTRATION.TAG_FORM.",this.DS_IconsEnum=A,this.DS_ColorStateEnum=z}};o.\u0275fac=function(i){return new(i||o)}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-tag-form"]],inputs:{formGroup:"formGroup",fields:"fields",model:"model"},standalone:!1,decls:9,vars:4,consts:[[1,"card"],[1,"py-l","pl-l","pr-m","w-100"],[1,"flex"],[1,"icon","icon-list","-bg","-primary","mr-m","f-xl"],[1,"mt-xs","mb-l"],[1,"formly-col"],[3,"formGroup"],[3,"form","fields","model"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),N(3,"span",3),a(4,"h3",4),G(5),p(6,"translate"),s()(),a(7,"div",5),_(8,El,2,4,"form",6),s()()()),i&2&&(l(5),re(f(6,2,r.translationKey+"IDENTIFICATION")),l(3),C(r.formGroup&&r.fields?8:-1))},dependencies:[Q,U,K,Me,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var yl=t=>({label:t});function vl(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function bl(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,vl,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,yl,n.translationKey+"NAME_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.DocumentRequestsFilterKeys.NAME)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var wn=(()=>{let o=class o{constructor(e){this.translateService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_DOCUMENT_REQUESTS.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.DocumentRequestsFilterKeys=_t,this.form=new H({[_t.NAME]:new Fe("")}),this.initialSearch={filters:[{column:_t.IS_ENABLED,filterId:_t.IS_ENABLED,type:le.CHOICE,data:[st.activeStatusItem]}]},this.destroyer$=new P}ngOnInit(){this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(_t.NAME)?.valueChanges.pipe(ge(Be.searchInputDebounce),O(this.destroyer$)).subscribe(e=>{this.nameSearchValue=e,this.emitQuery()}),this.onSearchChange(this.initialSearch)}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:_t.TAG_TYPES,column:_t.TAG_TYPES,label:`${this.translationKey}TAG_TYPES`,placeholder:`${this.translationKey}TAG_TYPES_PLACEHOLDER`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:tn(this.translateService).filter(e=>ta.includes(e.value)),multiple:!0}},{id:_t.DOCUMENT_TYPES,column:_t.DOCUMENT_TYPES,label:`${this.translationKey}DOCUMENT_TYPE`,placeholder:`${this.translationKey}DOCUMENT_TYPE_PLACEHOLDER`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:this.documentTypesItems,multiple:!0}},{id:_t.IS_ENABLED,column:_t.IS_ENABLED,label:`${this.translationKey}IS_ENABLED`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.activeStatusSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.emitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(_t.NAME)?.setValue("")}emitQuery(){let e=on.fromFilters(this.nameSearchValue,this.advancedSearchValue);this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(xt))},o.\u0275cmp=R({type:o,selectors:[["biorius-document-requests-search"]],inputs:{documentTypesItems:"documentTypesItems"},outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-8"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,bl,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var Il=t=>({"ml-s":t}),Al=(t,o)=>o.eventType;function Dl(t,o){if(t&1){let n=b();a(0,"ds-button",5),h("clicked",function(){let i=S(n).$implicit,r=c();return T(r.onActionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,Il,e!==0))}}function Ol(t,o){if(t&1&&N(0,"biorius-document-request-configurations-form",4),t&2){let n=c();d("documentRequest",n.documentRequest)("documentTypes",n.documentTypes)("pageType",n.pageType())("formModel",n.formModel)("formGroup",n.formGroup)("openServicesSelectionModalGetter",n.openServicesSelectionModalGetter)("openComponentsSelectionModalGetter",n.openComponentsSelectionModalGetter)("openCategoriesSelectionModalGetter",n.openCategoriesSelectionModalGetter)("technicalTags",o)}}var Ln=(()=>{let o=class o{constructor(e){this.tagStore=e,this.changePendingEmitter=new k,this.onExportComponentsClickedEmitter=new k,this.translationKey="ADMINISTRATION.DOCUMENT_REQUEST_CONFIGURATIONS_TAB.",this.actions=Re([]),this.pageType=Re(y.READONLY),this.modelBeforeEdition={},this.formModel={},this.formGroup=new H({}),this.destroyer$=new P,this.technicalTags$=this.tagStore.tagsByTypeWithoutDisabled$.pipe(me(i=>i.Technical))}ngOnInit(){this.computeActions()}
1ngOnChanges(e){(e.documentRequest.isFirstChange()&&e.documentTypes||!e.documentRequest.isFirstChange())&&(this.formModel=this.documentRequest.toEditionForm())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}computeActions(e=!1){let i=[];this.pageType()===y.EDITION?i.push({label:{label:"COMMON.CANCEL"},type:M.SECONDARY,eventType:qt.CANCEL_EDITION,disabled:e},{label:{label:"COMMON.SAVE"},type:M.PRIMARY,eventType:qt.CONFIRM_EDITION,loading:e}):(this.documentRequest.tagType!==ti.ProductDocumentRequestReason&&i.push({label:{label:`${this.translationKey}EXPORT_COMPONENTS`},type:M.SECONDARY,icon:A.file,iconPlacement:L.before,eventType:qt.EXPORT_COMPONENTS}),i.push({label:{label:"COMMON.EDIT"},type:M.PRIMARY,eventType:qt.START_EDITION})),this.actions.set(i)}onActionClicked(e){switch(e.toString()){case qt.START_EDITION:this.modelBeforeEdition=te({},this.formModel),this.changeReadOnlyMode(!1);break;case qt.CONFIRM_EDITION:this.updateDocumentRequest();break;case qt.CANCEL_EDITION:this.formModel=te({},this.modelBeforeEdition),this.formModel.configurations=this.formModel.configurations?[...this.formModel.configurations.filter(i=>!!i.context?.id)]:[],this.changeReadOnlyMode(!0);break;case qt.EXPORT_COMPONENTS:this.onExportComponentsClickedEmitter.emit();break}}changeReadOnlyMode(e){this.changePendingEmitter.emit(!e),this.pageType.set(e?y.READONLY:y.EDITION),this.computeActions()}updateDocumentRequest(){if(vr(this.formGroup),this.formGroup.valid&&this.formModel){this.computeActions(!0);let e=this.documentRequest.tagType===ti.ProductDocumentRequestReason?Jo.fromProductEditionForm(this.formModel):Jo.fromRawMaterialEditionForm(this.formModel);this.updateDocumentRequestGetter(e,this.documentRequest.id).pipe(O(this.destroyer$)).subscribe({next:()=>{this.changeReadOnlyMode(!0)},error:()=>{this.computeActions()}})}else br()}};o.\u0275fac=function(i){return new(i||o)(u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-document-request-configurations-tab"]],inputs:{documentRequest:"documentRequest",documentTypes:"documentTypes",updateDocumentRequestGetter:"updateDocumentRequestGetter",openServicesSelectionModalGetter:"openServicesSelectionModalGetter",openComponentsSelectionModalGetter:"openComponentsSelectionModalGetter",openCategoriesSelectionModalGetter:"openCategoriesSelectionModalGetter"},outputs:{changePendingEmitter:"changePendingEmitter",onExportComponentsClickedEmitter:"onExportComponentsClickedEmitter"},standalone:!1,features:[Ve],decls:7,vars:3,consts:[[1,"row"],[1,"col-12","pb-s"],[1,"flex","flex-middle","flex-end"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"documentRequest","documentTypes","pageType","formModel","formGroup","openServicesSelectionModalGetter","openComponentsSelectionModalGetter","openCategoriesSelectionModalGetter","technicalTags"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"]],template:function(i,r){if(i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),Se(3,Dl,1,9,"ds-button",3,Al),s()()(),_(5,Ol,1,9,"biorius-document-request-configurations-form",4),p(6,"async")),i&2){let m;l(3),Te(r.actions()),l(2),C((m=f(6,1,r.technicalTags$))?5:-1,m)}},dependencies:[j,Qa,U,K,q,x],encapsulation:2,changeDetection:0});let t=o;return t})();var ns=gt(Pt());var Ml=t=>({"ml-s":t}),xl=t=>({"-readmode":t}),Pl=(t,o)=>o.eventType;function wl(t,o){if(t&1){let n=b();a(0,"ds-button",6),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,Ml,e!==0))}}function Ll(t,o){if(t&1&&(a(0,"div",1)(1,"div",2)(2,"div",4),Se(3,wl,1,9,"ds-button",5,Pl),s()()()),t&2){let n=c();l(3),Te(n)}}function Bl(t,o){t&1&&_(0,Ll,5,0,"div",1),t&2&&C(o.length?0:-1)}function Fl(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",7),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(5,xl,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)}}var Ni=(()=>{let o=class o{constructor(e){this.navigationService=e,this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.MONITORING_TOPIC.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={generalInformation:{}},this.pageType=y.READONLY,this.actions$=new I([]),this.destroyer$=new P}ngOnInit(){this.monitoringTopic?this.model=this.monitoringTopic.toEditionForm():(this.pageType=y.CREATION,this.changePendingEmitter.emit(!0)),this.fields=this.fetchFields(),this.initListeners(),this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))}ngOnChanges(e){e.monitoringTopic?.currentValue&&!e.monitoringTopic.firstChange&&(this.model=this.monitoringTopic.toEditionForm(),this.fields=this.fetchFields())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}initListeners(){this.form.valueChanges.pipe(ge(150),O(this.destroyer$)).subscribe(e=>{this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))})}fetchFields(){return Ra.generalFormFields(this.translationKey,this.pageType===y.READONLY)}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.modelBeforeEdition=(0,ns.cloneDeep)(this.model),this.changePendingEmitter.emit(!0),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updateMonitoringTopic();break;case Y.CANCEL_CREATION:this.changePendingEmitter.emit(!1),this.navigationService.goBack();break;case Y.CONFIRM_CREATION:this.createMonitoringTopic();break;default:throw new Error(`Could not handle the click on item ${e}`)}}switchType(e){this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),e!==y.SAVING_IN_PROGRESS&&(this.fields=this.fetchFields())}cancelEditModeWithoutSaving(){this.modelBeforeEdition&&(this.model=te({},this.modelBeforeEdition)),this.changePendingEmitter.emit(!1),this.switchType(y.READONLY)}updateMonitoringTopic(){this.form.valid&&this.monitoringTopic&&this.updateMonitoringTopicGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.updateMonitoringTopicGetter(this.monitoringTopic.id,tr.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:()=>{this.changePendingEmitter.emit(!1),this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}createMonitoringTopic(){this.form.valid&&this.createMonitoringTopicGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.createMonitoringTopicGetter(tr.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:e=>{this.changePendingEmitter.emit(!1),this.navigationService.goToMonitoringTopicDetail(e,!0)},error:()=>{this.switchType(y.CREATION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-monitoring-topic-general-info-form"]],inputs:{monitoringTopic:"monitoringTopic",updateMonitoringTopicGetter:"updateMonitoringTopicGetter",createMonitoringTopicGetter:"createMonitoringTopicGetter"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pb-xxl"],[1,"row"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,Bl,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,Fl,2,7,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:[".-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{dis
1play:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var kl=t=>({"-loading":t}),$l=(t,o)=>({"-dragOver":t,"-error":o}),Gl=t=>[t],Hl=t=>({date:t}),Vl=t=>({label:t});function Ul(t,o){if(t&1&&(a(0,"div",4)(1,"div",13)(2,"p",14),G(3),p(4,"date"),p(5,"translate"),s()()()),t&2){let n=c();l(3),Ne(" ",je(5,4,n.translationKey+"LAST_EXPORT_DATE",E(7,Hl,je(4,1,n.lastImportDate,"long")))," ")}}function Kl(t,o){t&1&&N(0,"div",10)}function jl(t,o){t&1&&N(0,"div",11)}function ql(t,o){if(t&1&&(a(0,"p",15),G(1),p(2,"translate"),s(),a(3,"p",16),G(4),s(),a(5,"p",16),G(6),p(7,"translate"),s(),a(8,"div",17),N(9,"ds-button",18),s()),t&2){let n=c();l(),re(f(2,4,n.translationKey+"ERROR_FILE.TITLE")),l(3),re(o),l(2),re(f(7,6,n.translationKey+"ERROR_FILE.REUPLOAD_MSG")),l(3),d("label",E(8,Vl,n.translationKey+"ERROR_FILE.TRY_AGAIN"))}}function Yl(t,o){if(t&1&&(a(0,"p"),G(1),p(2,"translate"),s(),N(3,"p",19),p(4,"translate")),t&2){let n=c();l(),re(f(2,2,n.translationKey+"DROP_TEMPLATE")),l(2),d("innerHtml",f(4,4,n.translationKey+"OR_SELECT"),Nt)}}var Bn=(()=>{let o=class o{constructor(){this.onImportImpactedProductsFileEmitter=new k,this.allowedContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",this.translationKey="ADMINISTRATION.MONITORING_TOPIC.IMPACTED_PRODUCTS.",this.dragOver=!1,this.errorUpload$=new I(null),this.importLoading$=new I(!1),this.DS_ButtonTypeEnum=M,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.destroyer$=new P}ngOnInit(){}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}uploadFiles(e){if(e.target?.files?.length){let i=e.target.files;this.onImportImpactedProductsFileEmitter.emit(i[0])}}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-monitoring-topics-impacted-products"]],inputs:{lastImportDate:"lastImportDate"},outputs:{onImportImpactedProductsFileEmitter:"onImportImpactedProductsFileEmitter"},standalone:!1,decls:21,vars:26,consts:[["fileInput",""],[1,"container"],[1,"mt-l"],[1,"card","-no-shadow","mt-xs",3,"ngClass"],[1,"row","mt-l","mb-m","separator-bottom-large"],[1,"row","pt-s","pb-xs"],[1,"col-12","col-md-6","offset-md-3"],[1,"mt-m"],["ds-DragAndDropFile","",1,"file-upload","-big","my-l",3,"fileOver","fileDropped","click","ngClass"],[1,"flex","flex-center","mb-m","mt-s"],[1,"icon","icon-arrow-up","c-primary01","f-xl"],[1,"icon","icon-cross","c-error01","f-xl"],["clickStopPropagation","","type","file",2,"display","none",3,"ngModelChange","change","accept","multiple","ngModel"],[1,"pb-l","col-12"],[1,"text-center","c-grey05"],[1,"c-grey09","f-medium"],[1,"c-grey05","f-s"],[1,"flex","flex-center","mt-m","pb-s"],[3,"label"],[3,"innerHtml"]],template:function(i,r){if(i&1){let m=b();a(0,"div",1)(1,"h3",2),G(2),p(3,"translate"),s(),a(4,"div",3),p(5,"async"),_(6,Ul,6,9,"div",4),a(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8),p(11,"async"),h("fileOver",function(F){return S(m),T(r.dragOver=F)})("fileDropped",function(F){return S(m),T(r.onImportImpactedProductsFileEmitter.emit(F))})("click",function(){S(m);let F=ri(20);return T(F.click())}),a(12,"div",9),_(13,Kl,1,0,"div",10),p(14,"async"),St(15,jl,1,0,"div",11),s(),_(16,ql,10,10),p(17,"async"),St(18,Yl,5,6),a(19,"input",12,0),li("ngModelChange",function(F){return S(m),si(r.importedTemplateFile,F)||(r.importedTemplateFile=F),T(F)}),h("change",function(F){return S(m),T(r.uploadFiles(F))}),s()()()()()()()}if(i&2){let m;l(2),re(f(3,9,r.translationKey+"TITLE")),l(2),d("ngClass",E(19,kl,f(5,11,r.importLoading$))),l(2),C(r.lastImportDate?6:-1),l(4),d("ngClass",dt(21,$l,r.dragOver,f(11,13,r.errorUpload$))),l(3),C(f(14,15,r.errorUpload$)?15:13),l(3),C((m=f(17,17,r.errorUpload$))?16:18,m),l(3),d("accept",E(24,Gl,r.allowedContentType))("multiple",!1),ai("ngModel",r.importedTemplateFile)}},dependencies:[j,Ri,ci,Oe,di,q,pi,x,Mt,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var ss=[Ni,Bn];var Wl=t=>({label:t});function zl(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function Xl(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,zl,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,Wl,n.translationKey+"NAME_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.RuleSetsFilterKeys.NAME_OR_DESCRIPTION)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var Fn=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_RULE_SETS.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.RuleSetsFilterKeys=zt,this.form=new H({[zt.NAME_OR_DESCRIPTION]:new Fe("")}
1),this.initialSearch={filters:[]},this.destroyRef=pe(ue)}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(zt.NAME_OR_DESCRIPTION)?.valueChanges.pipe(ge(Be.searchInputDebounce),X(this.destroyRef)).subscribe(e=>{this.nameOrDescriptionSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}initSavedFilters(){let e=this.filtersService.getActiveRuleSetsFilters(!0);e?.nameDescriptionFilter?.length&&(this.form.patchValue({[zt.NAME_OR_DESCRIPTION]:e.nameDescriptionFilter},{emitEvent:!1}),this.nameOrDescriptionSearchValue=e.nameDescriptionFilter),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:zt.IS_ENABLED,column:zt.IS_ENABLED,label:`${this.translationKey}IS_ENABLED`,placeholder:`${this.translationKey}IS_ENABLED_PLACEHOLDER`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.activeStatusSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(zt.NAME_OR_DESCRIPTION)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=Jt.fromFilters(this.nameOrDescriptionSearchValue,this.advancedSearchValue);this.filtersService.setActiveRuleSetsFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-sets-search"]],outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-12"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,Xl,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var kn=gt(Pt());var Zl=t=>({"ml-s":t}),ec=t=>({"-readmode":t}),tc=(t,o)=>o.eventType;function ic(t,o){if(t&1){let n=b();a(0,"ds-button",6),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,Zl,e!==0))}}function nc(t,o){if(t&1&&(a(0,"div",1)(1,"div",2)(2,"div",4),Se(3,ic,1,9,"ds-button",5,tc),s()()()),t&2){let n=c();l(3),Te(n)}}function oc(t,o){t&1&&_(0,nc,5,0,"div",1),t&2&&C(o.length?0:-1)}function rc(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",7),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(6,ec,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var Mi=(()=>{let o=class o{constructor(e){this.navigationService=e,this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.RULE_SET.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={identificationGroup:{},positiveListsGroup:{},staticRulesGroup:{}},this.formlyOptions={formState:{readonly:!0}},this.searchPositiveListsHandler$=new I(""),this.pageType=y.READONLY,this.actions$=new I([]),this.destroyer$=new P}ngOnInit(){this.ruleSet?(this.switchType(y.READONLY),this.model=this.ruleSet.toEditionForm()):this.switchType(y.CREATION),this.initDropdownObservablesAndHandler(),this.fields=this.fetchFields(),this.initListeners()}ngOnChanges(e){e.ruleSet?.currentValue&&!e.ruleSet.firstChange&&(this.model=this.ruleSet.toEditionForm(),this.fields=this.fetchFields())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}initListeners(){this.form.valueChanges.pipe(ge(150),O(this.destroyer$)).subscribe(e=>{this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))})}initDropdownObservablesAndHandler(){this.positiveListItems$=this.searchPositiveListsHandler$.pipe(O(this.destroyer$),Le(e=>this.searchPositiveListsGetter(e)),me(e=>{let i=e.items;return this.ruleSet?.positiveLists?.length&&(i.push(...this.ruleSet.positiveLists),i=(0,kn.uniqBy)(i,"id"),i=(0,kn.sortBy)(i,"name")),i}),ne({bufferSize:1,refCount:!0}))}fetchFields(){return Ia.generalFormFields(this.translationKey,this.positiveListItems$,this.searchPositiveListsHandler$)}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.formlyOptions.updateInitialValue?.(),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updateRuleSet();break;case Y.CANCEL_CREATION:this.changePendingEmitter.emit(!1),this.navigationService.goBack();break;case Y.CONFIRM_CREATION:this.createRuleSet();break;default:throw new Error(`Could not handle the click on item ${e}`)}}switchType(e){if(this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.pageType===y.SAVING_IN_PROGRESS)return;let i=this.pageType===y.EDITION||this.pageType===y.CREATION;this.changePendingEmitter.emit(i),this.formlyOptions.formState.readonly=!i}cancelEditModeWithoutSaving(){this.formlyOptions.resetModel?.(),this.switchType(y.READONLY)}updateRuleSet(){this.form.valid&&this.ruleSet&&this.updateRuleSetGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.updateRuleSetGetter(this.ruleSet.id,Ca.fromForm(this.model,this.ruleSet.id)).pipe(O(this.destroyer$)).subscribe({next:()=>{this.changePendingEmitter.emit(!1),this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}createRuleSet(){this.form.valid&&this.createRuleSetGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.createRuleSetGetter(ga.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:e=>{this.changePendingEmitter.emit(!1),this.navigationService.goToRuleSetDetail(e,!0)},error:()=>{this.switchType(y.CREATION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-set-general-info-form"]],inputs:{ruleSet:"ruleSet",updateRuleSetGetter:"updateRuleSetGetter",createRuleSetGetter:"createRuleSetGetter",searchPositiveListsGetter:"searchPositiveListsGetter"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pb-xxl"],[1,"row"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model","options"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,oc,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,rc,2,8,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:[".-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{dis
1play:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var cs=gt(Va());var ds=t=>({label:t}),ac=()=>[],sc=t=>({"-loading":t}),lc=(t,o)=>({"-dragOver":t,"-error":o}),cc=()=>({label:"COMMON.DELETE"});function dc(t,o){t&1&&N(0,"div",14)}function mc(t,o){t&1&&N(0,"div",15)}function pc(t,o){if(t&1&&(a(0,"p"),G(1),p(2,"translate"),s(),N(3,"p",17),p(4,"translate")),t&2){let n=c(2);l(),re(f(2,2,n.translationKey+"DROP_TEMPLATE")),l(2),d("innerHtml",f(4,4,n.translationKey+"OR_SELECT"),Nt)}}function uc(t,o){t&1&&(a(0,"p",18),G(1),p(2,"translate"),s()),t&2&&(l(),re(f(2,1,o)))}function hc(t,o){t&1&&(a(0,"p",19),G(1),p(2,"translate"),s()),t&2&&(l(),re(f(2,1,o)))}function fc(t,o){t&1&&(a(0,"p",19),G(1),p(2,"translate"),s()),t&2&&(l(),re(f(2,1,o)))}function _c(t,o){if(t&1&&(_(0,uc,3,3,"p",18),_(1,hc,3,3,"p",19),_(2,fc,3,3,"p",19),a(3,"div",20),N(4,"ds-button",21),s()),t&2){let n,e,i,r=c(2);C((n=r.errorTitle(r.errorImportCode))?0:-1,n),l(),C((e=r.errorSubTitle(r.errorImportCode))?1:-1,e),l(),C((i=r.errorReUploadMsg(r.errorImportCode))?2:-1,i),l(2),d("label",E(4,ds,r.translationKey+"TRY_AGAIN"))}}function Cc(t,o){if(t&1){let n=b();a(0,"div",7),p(1,"async"),a(2,"div",9)(3,"div",10)(4,"div",11)(5,"div",12),h("fileOver",function(i){S(n);let r=c();return T(r.dragOver=i)})("fileDropped",function(i){S(n);let r=c();return T(r.onUploadFile(i))})("click",function(){S(n);let i=ri(12);return T(i.click())}),a(6,"div",13),_(7,dc,1,0,"div",14)(8,mc,1,0,"div",15),s(),_(9,pc,5,6)(10,_c,5,6),a(11,"input",16,0),li("ngModelChange",function(i){S(n);let r=c();return si(r.uploadedFileInput,i)||(r.uploadedFileInput=i),T(i)}),h("change",function(i){S(n);let r=c();return T(r.uploadFiles(i))}),s()()()()()()}if(t&2){let n=c();d("ngClass",E(9,sc,f(1,7,n.importLoading$))),l(5),d("ngClass",dt(11,lc,n.dragOver,n.errorImportCode)),l(2),C(n.errorImportCode?8:7),l(2),C(n.errorImportCode?10:9),l(2),d("accept",n.allowedContentTypes)("multiple",!1),ai("ngModel",n.uploadedFileInput)}}function gc(t,o){if(t&1){let n=b();a(0,"div",22)(1,"p",23),G(2),s(),a(3,"ds-button",24),h("clicked",function(){S(n);let i=c();return T(i.cancelTemplateImport())}),s()(),a(4,"div",25),N(5,"span",26),s(),a(6,"div",27),G(7),p(8,"translate"),s()}if(t&2){let n=c();l(2),re(n.uploadedFile.name),l(),d("label",it(7,cc))("type",n.DS_ButtonTypeEnum.DANGER)("disabled",n.confirmationIsLoading),l(4),Ne(" ",f(8,5,n.translationKey+"NO_ERROR_DETECTED")," ")}}var $n=(()=>{let o=class o{constructor(e,i){this.regulatoryCheckService=e,this.datePipe=i,this.closeEmitter=new k,this.translationKey="ADMINISTRATION.RULE_SET_DETAIL.IMPORT_FILE_MODAL.",this.allowedContentTypes=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel.sheet.macroEnabled.12"],this.DS_ButtonTypeEnum=M,this.DS_ColorStateEnum=z,this.confirmationIsLoading=!1,this.dragOver=!1,this.importLoading$=new I(!1),this.footerButtons$=new I([]),this.destroyer$=new P}ngOnInit(){this.updateFooterButtons()}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}uploadFiles(e){if(e.target?.files?.length){let i=e.target.files;this.onUploadFile(i[0])}}updateFooterButtons(e=!0,i=!1){this.confirmationIsLoading=i;let r=[{label:{label:"COMMON.CANCEL"},type:M.SECONDARY,isFullWidth:!1,isLarge:!0,eventType:_e.CANCEL,disabled:i},{label:{label:`${this.translationKey}CONFIRM_IMPORT_BTN`},type:M.PRIMARY,isFullWidth:!1,isLarge:!0,eventType:_e.CONFIRM,disabled:e,loading:i}];this.footerButtons$.next(r)}onUploadFile(e){this.importLoading$.next(!0),this.updateFooterButtons(),this.regulatoryCheckService.importRuleSetRegulatoryRules(this.ruleSet.id,e,!0).pipe(ye(1)).subscribe({next:()=>{this.importLoading$.next(!1),this.errorImportCode=void 0,this.uploadedFile=e,this.updateFooterButtons(!1)},error:i=>{this.manageErrorImport(i)}})}cancelTemplateImport(){this.uploadedFile=void 0,this.uploadedFileInput=void 0,this.errorImportCode=void 0,this.updateFooterButtons()}buttonClickHandler(e){switch(e.eventType){case _e.CANCEL:this.closeModal();break;case _e.CONFIRM:this.confirmImportFile();break}}confirmImportFile(){this.uploadedFile&&!this.errorImportCode&&(this.updateFooterButtons(!0,!0),this.regulatoryCheckService.importRuleSetRegulatoryRules(this.ruleSet.id,this.uploadedFile,!1).pipe(ye(1)).subscribe({next:()=>{this.closeModal(!0)},error:e=>{this.manageErrorImport(e)}}))}manageErrorImport(e){e.status===422&&(0,cs.saveAs)(e.error,`RuleSetImportErrors-${this.datePipe.transform(new Date,"yyyy-MM-dd hh:mm:ss")}.xlsx`),this.importLoading$.next(!1),this.errorImportCode=e.status,this.uploadedFile=void 0,this.uploadedFileInput=void 0,this.updateFooterButtons()}errorTitle(e){return e===422?`${this.translationKey}422_ERROR.TITLE`:`${this.translationKey}OTHER_ERROR.TITLE`}errorSubTitle(e){if(e===422)return`${this.translationKey}422_ERROR.SUBTITLE`}errorReUploadMsg(e){return e===422?`${this.translationKey}422_ERROR.REUPLOAD_MSG`:`${this.translationKey}OTHER_ERROR.REUPLOAD_MSG`}closeModal(e=!1){this.closeEmitter.emit(e),this.closeEmitter.complete()}};o.\u0275fac=function(i){return new(i||o)(u(Ge),u(Mt))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-rule-set-import-file-modal"]],inputs:{ruleSet:"ruleSet"},outputs:{closeEmitter:"closeEmitter"},standalone:!1,decls:12,vars:13,consts:[["fileInput",""],[3,"onCancel","title","showCancelButton"],[3,"preventHeightResize"],[1,"container-fluid","pt-xxl","px-xxl"],[1,"text-center","pb-xs"],[1,"flex","flex-center","w-100"],[1,"w-66"],[1,"card","-no-shadow","px-xl","w-100",3,"ngClass"],[3,"buttonClick","rightButtons"],[1,"row","pt-s","pb-xs"],[1,"col-12"],[1,"mt-m"],["ds-DragAndDropFile","",1,"file-upload","-big","my-l",3,"fileOver","fileDropped","click","ngClass"],[1,"flex","flex-center","mb-m","mt-s"],[1,"icon","icon-arrow-up","c-primary01","f-xl"],[1,"icon","icon-cross","c-error01","f-xl"],["clickStopPropagation","","type","file",2,"display","none",3,"ngModelChange","change","accept","multiple","ngModel"],[3,"innerHtml"],[1,"c-grey09","f-medium"],[1,"c-grey05","f-s"],[1,"flex","flex-center","mt-m","pb-s"],[3,"label"],[1,"card","p-m","flex","flex-between","flex-middle","my-xs"],[1,"f-s"],[3,"clicked","label","type","disabled"],[1,"flex","flex-middle","flex-center"],[1,"icon","icon-check","-bg","-md","bg-valid02","c-valid01","mt-xl"],[1,"text-center","f-s","pt-m","c-grey08"]],template:function(i,r){i&1&&(a(0,"ds-modal-header",1),h("onCancel",function(){return r.closeModal()}),s(),a(1,"ds-modal-body",2)(2,"div",3)(3,"h4",4),G(4),p(5,"translate"),s(),a(6,"div",5)(7,"div",6),_(8,Cc,13,14,"div",7)(9,gc,9,8),s()()()(),a(10,"ds-modal-footer",8),p(11,"async"),h("buttonClick",function(v){return r.buttonClickHandler(v)}),s()),i&2&&(d("title",E(10,ds,r.translationKey+"TITLE"))("showCancelButton",!r.confirmationIsLoading),l(),d("preventHeightResize",!0),l(3),re(f(5,6,r.translationKey+"SUBTITLE")),l(4),C(r.uploadedFile?9:8),l(2),d("rightButtons",f(11,8,r.footerButtons$)??it(12,ac)))},dependencies:[j,Ri,ci,Oe,di,q,Bt,wt,Lt,pi,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var Sc=t=>({label:t});function Tc(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function Ec(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,Tc,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,Sc,n.translationKey+"BUSINESS_ID_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.RuleSetRulesFilterKeys.BUSINESS_ID)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var Gn=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_RULE_SET_RULES.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.RuleSetRulesFilterKeys=at,this.form=new H({[at.BUSINESS_ID]:new Fe("")}),this.initialSearch={filters:[]},this.destroyer$=new P}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(at.BUSINESS_ID)?.valueChanges.pipe(ge(Be.searchInputDebounce),O(this.destroyer$)).subscribe(e=>{this.businessIdSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}initSavedFilters(){let e=this.filtersService.getActiveRegulatoryRulesFilters();e?.businessId?.length&&(this.form.patchValue({[at.BUSINESS_ID]:e.businessId},{emitEvent:!1}),this.businessIdSearchValue=e.businessId),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:at.ANNEX,column:at.ANNEX,label:`${this.translationKey}ANNEX`,placeholder:`${this.translationKey}ANNEX_PLACEHOLDER`,type:le.TEXT,canAddMultipleTimes:!1},{id:at.REFERENCE,column:at.REFERENCE,label:`${this.translationKey}REFERENCE`,placeholder:`${this.translationKey}REFERENCE_PLACEHOLDER`,type:le.TEXT,canAddMultipleTimes:!1},{id:at.NUMBER,column:at.NUMBER,label:`${this.translationKey}NUMBER`,placeholder:`${this.translationKey}NUMBER_PLACEHOLDER`,type:le.TEXT,canAddMultipleTimes:!1},{id:at.INFORMATION_DATE,column:at.INFORMATION_DATE,label:`${this.translationKey}
1INFORMATION_DATE`,type:le.DATE,canAddMultipleTimes:!1},{id:at.INTERNAL_APPLICATION_DATE,column:at.INTERNAL_APPLICATION_DATE,label:`${this.translationKey}INTERNAL_APPLICATION_DATE`,type:le.DATE,canAddMultipleTimes:!1},{id:at.END_DATE,column:at.END_DATE,label:`${this.translationKey}END_DATE`,type:le.DATE,canAddMultipleTimes:!1}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(at.BUSINESS_ID)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=an.fromFilters(this.businessIdSearchValue,this.advancedSearchValue);this.filtersService.setActiveRegulatoryRulesFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-set-rules-search"]],outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-8"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,Ec,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var vc=t=>({label:t});function bc(t,o){if(t&1){let n=b();a(0,"div",9)(1,"ds-simple-table",10),h("rowClicked",function(i){S(n);let r=c(2);return T(r.onRuleClicked(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function Rc(t,o){if(t&1&&(a(0,"div",8),_(1,bc,2,5,"div",9),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Vn=(()=>{let o=class o extends nt{constructor(e,i){super(),this.modalService=e,this.errorHandlerService=i,this.onRuleClickedEmitter=new k,this.onImportNewFileEmitter=new k,this.translationKey="ADMINISTRATION.RULE_SET_RULES.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.headers$.next(this.buildHeaders())}ngOnDestroy(){this.closeModal()}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new an(e?te({},e):{});return r.page=i,this.currentQuery=r,this.searchRulesGetter(r)}}buildHeaders(){return[{label:this.tableBaseTranslationKey("BUSINESS_ID"),value:e=>e.businessId,isStrong:!0},{label:this.tableBaseTranslationKey("ANNEX"),value:e=>e.annex},{label:this.tableBaseTranslationKey("REFERENCE"),value:e=>e.reference},{label:this.tableBaseTranslationKey("NUMBER"),value:e=>e.number},{label:this.tableBaseTranslationKey("INFORMATION_DATE"),value:e=>jt.fromDateToDisplayedString(e.informationDate,!1)},{label:this.tableBaseTranslationKey("INTERNAL_APPLICATION_DATE"),value:e=>jt.fromDateToDisplayedString(e.internalApplicationDate,!1)},{label:this.tableBaseTranslationKey("END_DATE"),value:e=>jt.fromDateToDisplayedString(e.endDate,!1)}]}onImportNewFileClicked(){this.modalRef=this.modalService.show($n,{initialState:{ruleSet:this.ruleSet}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(e=>{this.closeModal(),e&&(this.onQuery(this.currentQuery),this.errorHandlerService.displaySuccess(`${this.translationKey}IMPORT_SUCCESS_MESSAGE`))})}onRuleClicked(e){this.onRuleClickedEmitter.emit(e.id)}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(xe),u($t))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-set-rules"]],inputs:{ruleSet:"ruleSet",searchRulesGetter:"searchRulesGetter"},outputs:{onRuleClickedEmitter:"onRuleClickedEmitter",onImportNewFileEmitter:"onImportNewFileEmitter"},standalone:!1,features:[V],decls:8,vars:9,consts:[["id","content","infiniteScroll","",1,"search-results","-content-detail-with-tabs",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"query"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){i&1&&(a(0,"div",0),h("scrolled",function(v){return r.onScrollDown(v)}),a(1,"div",1)(2,"div",2)(3,"div",3)(4,"biorius-rule-set-rules-search",4),h("query",function(v){return r.onQuery(v)}),s()(),a(5,"div",5)(6,"ds-button",6),h("clicked",function(){return r.onImportNewFileClicked()}),s()()(),Z(7,Rc,3,3,"div",7),s()()),i&2&&(d("scrollWindow",!1),l(6),d("label",E(7,vc,r.translationKey+"IMPORT_NEW_FILE"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.arrowUp)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0))},dependencies:[j,Ye,$e,ie,q,Gn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Ac=t=>({"-readmode":t});function Dc(t,o){if(t&1&&(a(0,"form",2),N(1,"formly-form",3),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(5,Ac,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)}}var Un=(()=>{let o=class o{constructor(){this.translationKey="ADMINISTRATION.RULE_DETAIL.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={generalInformation:{},verbatim:{}},this.pageType=y.READONLY,this.destroyer$=new P}ngOnInit(){this.fields=this.fetchFields()}ngOnChanges(e){e.rule?.currentValue&&(this.model=this.rule.toEditionForm())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}fetchFields(){return Aa.generalFormFields(this.translationKey,this.pageType===y.READONLY)}};o.\u0275fac=function(i){return new(i||o)}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-regulatory-rule-general-info-form"]],inputs:{rule:"rule"},standalone:!1,features:[Ve],decls:3,vars:1,consts:[[1,"row","mt-m"],[1,"col-12"],[3,"formGroup","ngClass"],[3,"form","fields","model"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1),_(2,Dc,2,7,"form",2),s()()),i&2&&(l(2),C(r.fields.length&&r.form&&r.model?2:-1))},dependencies:[j,Q,U,K,Me],styles:[".-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{display:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:30%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:70%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();function Nc(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h6",4),G(5),p(6,"translate"),s(),a(7,"div",5),N(8,"ds-dropdown",6),s()()()()()),t&2){let n=c();d("formGroup",n.form),l(5),re(f(6,6,"SHARED.COMPONENTS_SEARCH.SHOW_OTHER_INCINAME")),l(3),d("label",void 0)("formControlName",n.RegulatoryRuleComponentsFilterKeys.OTHER_INCI_NAME)("options",n.otherInciNameOptions)("bindValue","value")}}var Kn=(()=>{let o=class o{constructor(){this.otherInciRegionCodeChanged=new k,this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.RegulatoryRuleComponentsFilterKeys=Ki,this.form=new H({[Ki.OTHER_INCI_NAME]:new Fe(void 0)}),this.destroyRef=pe(ue)}ngOnInit(){this.initInciNameOptions(),this.initListeners(),this.form.patchValue({[Ki.OTHER_INCI_NAME]:this.tagRegions.find(e=>e.code==ir.US_CODE)?.id})}initInciNameOptions(){this.otherInciNameOptions=this.tagRegions.filter(e=>e.code!=ir.EUROPEAN_CODE).map(e=>({label:e.name,value:e.id}))}initListeners(){this.form.get(Ki.OTHER_INCI_NAME)?.valueChanges.pipe(X(this.destroyRef)).subscribe(e=>{this.otherInciRegionCodeChanged.emit(this.tagRegions.find(i=>i.id===e))})}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-regulatory-rule-components-search"]],inputs:{tagRegions:"tagRegions"},outputs:{otherInciRegionCodeChanged:"otherInciRegionCodeChanged"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col","flex","flex-end"],[1,"flex","flex-middle"],[1,"f-xxs","mr-xs"],[1,"filters__drop"],[3,"label","formControlName","options","bindValue"]],template:function(i,r){i&1&&_(0,Nc,9,8,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,Pr,fe],styles:[".filters__drop[_ngcontent-%COMP%]{width:150px}"],changeDetection:0});let t=o;return t})();function xc(t,o){if(t&1&&N(0,"ds-simple-table",6),t&2){let n=c(2);d("headers",o)("data",n.regulatedComponents)("tableStyle",n.tableStyle)("clickable",!1)}}function Pc(t,o){if(t&1&&(_(0,xc,1,4,"ds-simple-table",6),p(1,"async")),t&2){let n,e=c();C((n=f(1,1,e.headers$))?0:-1,n)}}var jn=(()=>{let o=class o{constructor(){this.onInciNameFilterChanged=new k,this.translationKey="ADMINISTRATION.RULE_DETAIL.REGULATED_COMPONENTS.",this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.tableBaseTranslationKey=e=>`SHARED.TABLE.${e}`,this.otherInciNameRegion="",this.headers$=new I([]),this.isExpanded=!0,this.tableStyle={bgGrey:!0,smallHeight:!0}}ngOnInit(){this.headers$.next(this.buildHeaders())}buildHeaders(){return[{label:this.tableBaseTranslationKey("INCI_NAME_EU"),value:e=>e.inciNameEU,secondLineValues:e=>[{value:`${this.translationKey}INCI_NAME ${this.otherInciNameRegion} : ${e.otherInciName??"-"}`}],linkUrl:e=>`/${Jr.BASE}/${e.componentId}`,isStrong:!0,icons:e=>e.isHeterogeneous?[{iconRef:ca.getHeterogeneousIcon()}]:void 0,iconsPosition:L.after},{label:this.tableBaseTranslationKey("CAS_NR"),value:e=>e.casNumbers},{label:this.tableBaseTranslationKey("COMPONENT_FAMILY_TAG"),tags:e=>this.getComponentFamilyTags(e)}]}getComponentFamilyTags(e){return e.componentFamilyTags?.map(i=>({label:{label:i},isSmall:!0,oneLine:!0}))}onOtherInciRegionCodeChanged(e){this.otherInciNameRegion=e.code,this.onInciNameFilterChanged.emit(e)}onExpandClicked(){this.isExpanded=!this.isExpanded}};o.\u0275fac=function(i){return new(i||o)}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-regulatory-rule-regulated-components"]],inputs:{tagRegions:"tagRegions",regulatedComponents:"regulatedComponents"},outputs:{onInciNameFilterChanged:"onInciNameFilterChanged"},standalone:!1,decls:10,vars:6,consts:[[1,"card","p-m"],[1,"flex","flex-top","flex-between"],[1,"flex","flex-middle"],[1,"icon","c-primary01","f-xl","pr-xs","c-pointer","expand-icon",3,"click","ngClass"],[1,"c-pointer",3,"click"],[3,"otherInciRegionCodeChanged","tagRegions"],[3,"headers","data","tableStyle","clickable"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),h("click",function(){return r.onExpandClicked()}),s(),a(4,"div",4),h("click",function(){return r.onExpandClicked()}),a(5,"h3"),G(6),p(7,"translate"),s()()(),a(8,"biorius-regulatory-rule-components-search",5),h("otherInciRegionCodeChanged",function(v){return r.onOtherInciRegionCodeChanged(v)}),s()(),_(9,Pc,2,3),s()),i&2&&(l(3),d("ngClass",r.isExpanded?r.DS_IconsEnum.chevronUpAlt:r.DS_IconsEnum.chevronDownAlt),l(3),re(f(7,4,r.translationKey+"TITLE")),l(2),d("tagRegions",r.tagRegions),l(),C(r.isExpanded?9:-1))},dependencies:[j,$e,Kn,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var Lc=t=>({label:t});function Bc(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function Fc(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,Bc,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,Lc,n.translationKey+"NAME_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.RulePacksFilterKeys.NAME_OR_DESCRIPTION)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var qn=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_RULE_PACKS.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.RulePacksFilterKeys=Tt,this.form=new H({[Tt.NAME_OR_DESCRIPTION]:new Fe("")}),this.initialSearch={filters:[]},this.destroyRef=pe(ue)}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(Tt.NAME_OR_DESCRIPTION)?.valueChanges.pipe(ge(Be.searchInputDebounce),X(this.destroyRef)).subscribe(e=>{this.nameOrDescriptionSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}initSavedFilters(){let e=this.filtersService.getActiveRulePacksFilters(!0);e?.nameDescriptionFilter?.length&&(this.form.patchValue({[Tt.NAME_OR_DESCRIPTION]:e.nameDescriptionFilter},{emitEvent:!1}),this.nameOrDescriptionSearchValue=e.nameDescriptionFilter),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:Tt.BRANDS,column:Tt.BRANDS,label:`${this.translationKey}BRANDS`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}BRANDS_PLACEHOLDER`,data:{items:this.allBrandsGetter,multiple:!0}},{id:Tt.SERVICES,column:Tt.SERVICES,label:`${this.translationKey}SERVICES`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}SERVICES_PLACEHOLDER`,data:{items:this.allServicesGetter,multiple:!0}},{id:Tt.IS_ENABLED,column:Tt.IS_ENABLED,label:`${this.translationKey}IS_ENABLED`,placeholder:`${this.translationKey}IS_ENABLED_PLACEHOLDER`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.activeStatusSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(Tt.NAME_OR_DESCRIPTION)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=rn.fromFilters(this.nameOrDescriptionSearchValue,this.advancedSearchValue);this.filtersService.setActiveRulePacksFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-rule-packs-search"]],inputs:{allBrandsGetter:"allBrandsGetter",allServicesGetter:"allServicesGetter"},outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-12"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,Fc,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var xi=gt(Pt());var $c=t=>({"ml-s":t}),Gc=t=>({"-readmode":t}),Hc=(t,o)=>o.eventType;function Vc(t,o){if(t&1){let n=b();a(0,"ds-button",7),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,$c,e!==0))}}function Uc(t,o){if(t&1&&(a(0,"div",4)(1,"div",2)(2,"div",5),Se(3,Vc,1,9,"ds-button",6,Hc),s()()()),t&2){let n=c();l(3),Te(n)}}function Kc(t,o){t&1&&_(0,Uc,5,0,"div",4),t&2&&C(o.length?0:-1)}function jc(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",8),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(6,Gc,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var Pi=(()=>{let o=class o{constructor(e){this.navigationService=e,this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.RULE_PACK.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={identificationGroup:{},brandsGroup:{},servicesGroup:{},ruleSetsGroup:{}},this.formlyOptions={formState:{readonly:!0}},this.searchBrandsHandler$=new I(""),this.searchRuleSetsHandler$=new I(""),this.pageType=y.READONLY,this.actions$=new I([]),this.destroyer$=new P}ngOnInit(){this.rulePack?(this.switchType(y.READONLY),this.model=this.rulePack.toEditionForm()):this.switchType(y.CREATION),this.initDropdownObservablesAndHandler(),this.fields=this.fetchFields(),this.initListeners()}ngOnChanges(e){e.rulePack?.currentValue&&!e.rulePack.firstChange&&(this.model=this.rulePack.toEditionForm(),this.fields=this.fetchFields())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}initListeners(){this.form.valueChanges.pipe(ge(150),O(this.destroyer$)).subscribe(e=>{this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))})}initDropdownObservablesAndHandler(){this.brandItems$=this.searchBrandsHandler$.pipe(O(this.destroyer$),Le(e=>this.searchBrandsGetter(e)),me(e=>{let i=e.items;return this.rulePack?.brands?.length&&(i.push(...this.rulePack.brands),i=(0,xi.uniqBy)(i,"id"),i=(0,xi.sortBy)(i,"name")),i}),ne({bufferSize:1,refCount:!0})),this.ruleSetItems$=this.searchRuleSetsHandler$.pipe(O(this.destroyer$),Le(e=>this.searchRuleSetsGetter(e)),me(e=>{let i=e.items;return this.rulePack?.ruleSets?.length&&(i.push(...this.rulePack.ruleSets),i=(0,xi.uniqBy)(i,"id"),i=(0,xi.sortBy)(i,"name")),i}),ne({bufferSize:1,refCount:!0}))}fetchFields(){return Da.generalFormFields(this.translationKey,this.openServicesSelectionModalGetter,this.brandItems$,this.searchBrandsHandler$,this.ruleSetItems$,this.searchRuleSetsHandler$)}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.formlyOptions.updateInitialValue?.(),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updateRulePack();break;case Y.CANCEL_CREATION:this.changePendingEmitter.emit(!1),this.navigationService.goBack();break;case Y.CONFIRM_CREATION:this.createRulePack();break;default:throw new Error(`Could not handle the click on item ${e}`)}}switchType(e){if(this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.pageType===y.SAVING_IN_PROGRESS)return;let i=this.pageType===y.EDITION||this.pageType===y.CREATION;this.changePendingEmitter.emit(i),this.formlyOptions.formState.readonly=!i}cancelEditModeWithoutSaving(){this.formlyOptions.resetModel?.(),this.switchType(y.READONLY)}updateRulePack(){this.form.valid&&this.rulePack&&this.updateRulePackGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.updateRulePackGetter(this.rulePack.id,Ta.fromForm(this.model,this.rulePack.id)).pipe(O(this.destroyer$)).subscribe({next:()=>{this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}createRulePack(){this.form.valid&&this.createRulePackGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.createRulePackGetter(Sa.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:e=>{this.changePendingEmitter.emit(!1),this.navigationService.goToRulePackDetail(e,!0)},error:()=>{this.switchType(y.CREATION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-pack-general-info-form"]],inputs:{rulePack:"rulePack",updateRulePackGetter:"updateRulePackGetter",createRulePackGetter:"createRulePackGetter",searchBrandsGetter:"searchBrandsGetter",searchRuleSetsGetter:"searchRuleSetsGetter",openServicesSelectionModalGetter:"openServicesSelectionModalGetter"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pb-xxl"],[1,"row","pb-xxl"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"row"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model","options"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,Kc,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,jc,2,8,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:[".-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{dis
1play:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var qc=t=>({label:t});function Yc(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function Qc(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,Yc,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,qc,n.translationKey+"NAME_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.PositiveListsFilterKeys.NAME)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var Yn=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_POSITIVE_LISTS.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.PositiveListsFilterKeys=Ft,this.form=new H({[Ft.NAME]:new Fe("")}),this.initialSearch={filters:[]},this.destroyer$=new P}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(Ft.NAME)?.valueChanges.pipe(ge(Be.searchInputDebounce),O(this.destroyer$)).subscribe(e=>{this.nameSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}initSavedFilters(){let e=this.filtersService.getActivePositiveListsFilters();e?.nameFilter?.length&&(this.form.patchValue({[Ft.NAME]:e.nameFilter},{emitEvent:!1}),this.nameSearchValue=e.nameFilter),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:Ft.TYPES,column:Ft.TYPES,label:`${this.translationKey}TYPES.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}TYPES.PLACEHOLDER`,data:{items:la,multiple:!0}},{id:Ft.ANNEXES,column:Ft.ANNEXES,label:`${this.translationKey}ANNEXES.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}ANNEXES.PLACEHOLDER`,data:{items:this.allAnnexes,multiple:!0}}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(Ft.NAME)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=Xt.fromFilters(this.nameSearchValue,this.advancedSearchValue);this.filtersService.setActivePositiveListsFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))},o.\u0275cmp=R({type:o,selectors:[["biorius-positive-lists-search"]],inputs:{allAnnexes:"allAnnexes"},outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-12"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,Qc,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var zc=t=>({"ml-s":t}),Xc=t=>({"-readmode":t}),Jc=(t,o)=>o.eventType;function Zc(t,o){if(t&1){let n=b();a(0,"ds-button",7),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,zc,e!==0))}}function ed(t,o){if(t&1&&(a(0,"div",4)(1,"div",2)(2,"div",5),Se(3,Zc,1,9,"ds-button",6,Jc),s()()()),t&2){let n=c();l(3),Te(n)}}function td(t,o){t&1&&_(0,ed,5,0,"div",4),t&2&&C(o.length?0:-1)}function id(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",8),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(6,Xc,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var wi=(()=>{let o=class o{constructor(e){this.navigationService=e,this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.POSITIVE_LIST.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={identificationGroup:{}},this.formlyOptions={formState:{readonly:!0}},this.pageType=y.READONLY,this.actions$=new I([]),this.destroyer$=new P}ngOnInit(){this.positiveList?(this.switchType(y.READONLY),this.model=this.positiveList.toEditionForm()):this.switchType(y.CREATION),this.fields=this.fetchFields(),this.initListeners()}ngOnChanges(e){e.positiveList?.currentValue&&!e.positiveList.firstChange&&(this.model=this.positiveList.toEditionForm(),this.fields=this.fetchFields())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}initListeners(){this.form.valueChanges.pipe(ge(150),O(this.destroyer$)).subscribe(e=>{this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))})}fetchFields(){return Oa.generalFormFields(this.translationKey,this.allRuleAnnexes,this.functionTags,!this.positiveList)}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.formlyOptions.updateInitialValue?.(),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updatePositiveList();break;case Y.CANCEL_CREATION:this.changePendingEmitter.emit(!1),this.navigationService.goBack();break;case Y.CONFIRM_CREATION:this.createPositiveList();break;default:throw new Error(`Could not handle the click on item ${e}`)}}switchType(e){if(this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.pageType===y.SAVING_IN_PROGRESS)return;let i=this.pageType===y.EDITION||this.pageType===y.CREATION;this.changePendingEmitter.emit(i),this.formlyOptions.formState.readonly=!i}cancelEditModeWithoutSaving(){this.formlyOptions.resetModel?.(),this.switchType(y.READONLY)}updatePositiveList(){this.form.valid&&this.positiveList&&this.updatePositiveListGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.updatePositiveListGetter(this.positiveList.id,ya.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:()=>{this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}createPositiveList(){this.form.valid&&this.createPositiveListGetter?(this.switchType(y.SAVING_IN_PROGRESS),this.createPositiveListGetter(Ea.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:e=>{this.changePendingEmitter.emit(!1),this.navigationService.goToPositiveListDetail(e,!0)},error:()=>{this.switchType(y.CREATION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-positive-list-general-info-form"]],inputs:{positiveList:"positiveList",allRuleAnnexes:"allRuleAnnexes",functionTags:"functionTags",updatePositiveListGetter:"updatePositiveListGetter",createPositiveListGetter:"createPositiveListGetter"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pb-xxl"],[1,"row","pb-xxl"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"row"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model","options"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,td,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,id,2,8,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:[".-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{dis
1play:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var nd=t=>({label:t});function od(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function rd(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,od,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,nd,n.translationKey+"SEARCH_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.SentencesFilterKeys.SEARCH)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var Qn=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_SENTENCES.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.SentencesFilterKeys=kt,this.form=new H({[kt.SEARCH]:new Fe("")}),this.initialSearch={filters:[]},this.destroyRef$=pe(ue)}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(kt.SEARCH)?.valueChanges.pipe(ge(Be.searchInputDebounce),X(this.destroyRef$)).subscribe(e=>{this.sentenceSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}initSavedFilters(){let e=this.filtersService.getActiveSentencesFilters();e?.search?.length&&(this.form.patchValue({[kt.SEARCH]:e.search},{emitEvent:!1}),this.sentenceSearchValue=e.search),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:kt.THEMES,column:kt.THEMES,label:`${this.translationKey}THEMES.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}THEMES.PLACEHOLDER`,data:{items:aa,multiple:!0}},{id:kt.TAGS,column:kt.TAGS,label:`${this.translationKey}TAGS.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}TAGS.PLACEHOLDER`,data:{items:this.tags?.map(e=>({value:e,label:e.name,id:e.id})),multiple:!0}}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(kt.SEARCH)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=sn.fromFilters(this.sentenceSearchValue,this.advancedSearchValue);this.filtersService.setActiveSentencesFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))},o.\u0275cmp=R({type:o,selectors:[["biorius-sentences-search"]],inputs:{tags:"tags"},outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-12"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,rd,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var sd=t=>({"ml-s":t}),ld=t=>({"-readmode":t});function cd(t,o){if(t&1){let n=b();a(0,"ds-button",7),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,sd,e!==0))}}function dd(t,o){if(t&1&&(a(0,"div",4)(1,"div",2)(2,"div",5),Se(3,cd,1,9,"ds-button",6,pt),s()()()),t&2){let n=c();l(3),Te(n)}}function md(t,o){if(t&1&&_(0,dd,5,0,"div",4),t&2){let n=o;C(n!=null&&n.length?0:-1)}}function pd(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",8),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(6,ld,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var Li=(()=>{let o=class o{constructor(e){this.navigationService=e,this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.SENTENCE.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={identificationGroup:{}},this.formlyOptions={formState:{readonly:!0}},this.pageType=y.READONLY,this.actions$=new I([]),this.destroyRef=pe(ue)}ngOnInit(){this.sentence?(this.switchType(y.READONLY),this.model=this.sentence.toEditionForm()):this.switchType(y.CREATION),this.fields=this.fetchFields()}ngOnChanges(e){e.sentence?.currentValue&&!e.sentence.firstChange&&(this.model=this.sentence.toEditionForm(),this.fields=this.fetchFields())}ngAfterViewInit(){this.initListeners()}initListeners(){this.form.valueChanges.pipe(ge(150),X(this.destroyRef)).subscribe(e=>{this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))}),this.form.get(Qi.IDENTIFICATION_GROUP)?.get(Qi.TAG_TYPE)?.valueChanges.pipe(X(this.destroyRef)).subscribe(e=>{this.form.get(Qi.IDENTIFICATION_GROUP)?.get(Qi.TAG_VALUE)?.setValue(void 0)})}fetchFields(){return Ma.generalFormFields(this.translationKey,this.tagsByTypes,!this.sentence)}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.formlyOptions.updateInitialValue?.(),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updateSentence();break;case Y.CANCEL_CREATION:this.changePendingEmitter.emit(!1),this.navigationService.goBack();break;case Y.CONFIRM_CREATION:this.createSentence();break;default:throw new Error(`Could not handle the click on item ${e}`)}}switchType(e){if(this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.pageType===y.SAVING_IN_PROGRESS)return;let i=this.pageType===y.EDITION||this.pageType===y.CREATION;this.changePendingEmitter.emit(i),this.formlyOptions.formState.readonly=!i}cancelEditModeWithoutSaving(){this.formlyOptions.resetModel?.(),this.switchType(y.READONLY)}updateSentence(){this.form.valid&&this.sentence&&this.updateSentenceTrigger?(this.switchType(y.SAVING_IN_PROGRESS),this.updateSentenceTrigger(this.sentence.id,rr.fromForm(this.model,this.tagsByTypes)).pipe(X(this.destroyRef)).subscribe({next:()=>{this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}createSentence(){this.form.valid&&this.createSentenceTrigger?(this.switchType(y.SAVING_IN_PROGRESS),this.createSentenceTrigger(rr.fromForm(this.model,this.tagsByTypes)).pipe(X(this.destroyRef)).subscribe({next:e=>{this.changePendingEmitter.emit(!1),this.navigationService.goToSentenceDetail(e,!0)},error:()=>{this.switchType(y.CREATION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-sentence-general-info-form"]],inputs:{sentence:"sentence",tagsByTypes:"tagsByTypes",updateSentenceTrigger:"updateSentenceTrigger",createSentenceTrigger:"createSentenceTrigger"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pb-xxl"],[1,"row","pb-xxl"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"row"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model","options"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,md,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,pd,2,8,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:[".-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{dis
1play:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();function ud(t,o){if(t&1&&N(0,"ds-simple-table",5),t&2){let n=c(2);d("headers",o)("data",n.encodedComponents)("tableStyle",n.tableStyle)("clickable",!1)}}function hd(t,o){if(t&1&&(_(0,ud,1,4,"ds-simple-table",5),p(1,"async")),t&2){let n,e=c();C((n=f(1,1,e.headers$))?0:-1,n)}}var Wn=(()=>{let o=class o{constructor(){this.translationKey="ADMINISTRATION.RULE_DETAIL.ENCODED_COMPONENTS.",this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.tableBaseTranslationKey=e=>`SHARED.TABLE.${e}`,this.headers$=new I([]),this.isExpanded=!0,this.tableStyle={bgGrey:!0,smallHeight:!0}}ngOnInit(){this.headers$.next(this.buildHeaders())}buildHeaders(){return[{label:this.tableBaseTranslationKey("INCI_NAME"),value:e=>e.inciName,isStrong:!0},{label:this.tableBaseTranslationKey("CAS_NR"),value:e=>e.casNumbers},{label:this.tableBaseTranslationKey("COMPONENT_FAMILY_TAG"),tags:e=>this.getComponentFamilyTags(e)}]}getComponentFamilyTags(e){return e.componentFamilyTag?[{label:{label:e.componentFamilyTag},isSmall:!0,oneLine:!0}]:void 0}onExpandClicked(){this.isExpanded=!this.isExpanded}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-regulatory-rule-encoded-components"]],inputs:{encodedComponents:"encodedComponents"},standalone:!1,decls:9,vars:5,consts:[[1,"card","p-m"],[1,"flex","flex-top","flex-between"],[1,"flex","flex-middle"],[1,"icon","c-primary01","f-xl","pr-xs","c-pointer","expand-icon",3,"click","ngClass"],[1,"c-pointer",3,"click"],[3,"headers","data","tableStyle","clickable"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),h("click",function(){return r.onExpandClicked()}),s(),a(4,"div",4),h("click",function(){return r.onExpandClicked()}),a(5,"h3"),G(6),p(7,"translate"),s()()()(),_(8,hd,2,3),s()),i&2&&(l(3),d("ngClass",r.isExpanded?r.DS_IconsEnum.chevronUpAlt:r.DS_IconsEnum.chevronDownAlt),l(3),re(f(7,3,r.translationKey+"TITLE")),l(2),C(r.isExpanded?8:-1))},dependencies:[j,$e,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var hs=[wi,Yn,Wn,Kn,Un,jn,Pi,qn,Mi,$n,Vn,Gn,Fn,Li,Qn];var ar=gt(Pt());var _d=t=>({"ml-s":t}),Cd=t=>({"-readmode":t});function gd(t,o){if(t&1){let n=b();a(0,"ds-button",7),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,_d,e!==0))}}function Sd(t,o){if(t&1&&(a(0,"div",4)(1,"div",2)(2,"div",5),Se(3,gd,1,9,"ds-button",6,pt),s()()()),t&2){let n=c();l(3),Te(n)}}function Td(t,o){if(t&1&&_(0,Sd,5,0,"div",4),t&2){let n=o;C(n!=null&&n.length?0:-1)}}function Ed(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",8),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(6,Cd,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var Bi=(()=>{let o=class o{constructor(e){this.navigationService=e,this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.ROLE.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={identificationGroup:{}},this.formlyOptions={formState:{readonly:!0}},this.pageType=y.READONLY,this.actions$=new I([]),this.destroyRef=pe(ue)}ngOnInit(){this.role?(this.switchType(y.READONLY),this.model=this.role.toEditionForm()):this.switchType(y.CREATION),this.fields=this.fetchFields(),this.actions$.next(Ie.computeEditOrCreateActions(this.pageType))}ngOnChanges(e){e.role?.currentValue&&!e.role.firstChange&&(this.model=this.role.toEditionForm(),this.fields=this.fetchFields())}fetchFields(){return xa.generalFormFields(this.translationKey,this.permissionMetadata,this.getEntitiesSubTypesTrigger,this.getEntitiesIdsTrigger,this.role?.permissions??[])}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.formlyOptions.formState.originalModel=(0,ar.cloneDeep)(this.model),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updateRole();break;case Y.CANCEL_CREATION:this.changePendingEmitter.emit(!1),this.navigationService.goBack();break;case Y.CONFIRM_CREATION:this.createRole();break;default:throw new Error(`Could not handle the click on item ${e}`)}}switchType(e){if(this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.pageType===y.SAVING_IN_PROGRESS)return;let i=this.pageType===y.EDITION||this.pageType===y.CREATION;this.changePendingEmitter.emit(i),this.formlyOptions.formState.readonly=!i}cancelEditModeWithoutSaving(){this.model=(0,ar.cloneDeep)(this.formlyOptions.formState.originalModel),this.switchType(y.READONLY)}updateRole(){this.form.valid&&this.role&&this.updateRoleTrigger?(this.switchType(y.SAVING_IN_PROGRESS),this.updateRoleTrigger(this.role.i
1d,wa.fromForm(this.model)).pipe(X(this.destroyRef)).subscribe({next:()=>{this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}createRole(){this.form.valid&&this.createRoleTrigger?(this.switchType(y.SAVING_IN_PROGRESS),this.createRoleTrigger(Pa.fromForm(this.model)).pipe(X(this.destroyRef)).subscribe({next:e=>{this.changePendingEmitter.emit(!1),this.navigationService.goToRoleDetail(e,!0)},error:()=>{this.switchType(y.CREATION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-role-general-info-form"]],inputs:{role:"role",permissionMetadata:"permissionMetadata",updateRoleTrigger:"updateRoleTrigger",createRoleTrigger:"createRoleTrigger",getEntitiesSubTypesTrigger:"getEntitiesSubTypesTrigger",getEntitiesIdsTrigger:"getEntitiesIdsTrigger"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pt-xxs","pb-xxl"],[1,"row","pb-xxl"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"row"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model","options"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,Td,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,Ed,2,8,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:["formly-form[_ngcontent-%COMP%] .formly-col:not(.-full) .row-form>div>formly-group{width:calc(100% + 24px)}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .-form-repeater>.simple-field__label{display:none!important}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .-form-repeater>.simple-field__field{width:100%!important}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{display:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var yd=t=>({label:t});function vd(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function bd(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,vd,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,yd,n.translationKey+"SEARCH_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.ProfileRolesFilterKeys.NAME)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var zn=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_ROLES.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.ProfileRolesFilterKeys=Et,this.form=new H({[Et.NAME]:new Fe("")}),this.initialSearch={filters:[]},this.destroyRef$=pe(ue)}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(Et.NAME)?.valueChanges.pipe(ge(Be.searchInputDebounce),X(this.destroyRef$)).subscribe(e=>{this.nameSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}initSavedFilters(){let e=this.filtersService.getActiveRolesFilters();e?.name?.length&&(this.form.patchValue({[Et.NAME]:e.name},{emitEvent:!1}),this.nameSearchValue=e.name),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:Et.ROLE_TYPE,column:Et.ROLE_TYPE,label:`${this.translationKey}ROLE_TYPE.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}ROLE_TYPE.PLACEHOLDER`,data:{items:ea,multiple:!0}},{id:Et.IS_AUTO_ASSIGNED,column:Et.IS_AUTO_ASSIGNED,label:`${this.translationKey}IS_AUTO_ASSIGNED.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.yesNoSearchItems,multiple:!1}},{id:Et.IS_DELETABLE,column:Et.IS_DELETABLE,label:`${this.translationKey}IS_DELETABLE.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}IS_DELETABLE.PLACEHOLDER`,data:{items:st.yesNoSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(Et.NAME)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=gi.fromFilters(this.nameSearchValue,this.advancedSearchValue);this.filtersService.setActiveRolesFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-roles-search"]],outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-12"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,bd,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var _s=[Bi,zn];var Xn=gt(Pt());var Id=t=>({"ml-s":t}),Ad=t=>({"-readmode":t});function Dd(t,o){if(t&1){let n=b();a(0,"ds-button",7),h("clicked",function(){let i=S(n).$implicit,r=c(3);return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,Id,e!==0))}}function Od(t,o){if(t&1&&(a(0,"div",4)(1,"div",2)(2,"div",5),Se(3,Dd,1,9,"ds-button",6,pt),s()()()),t&2){let n=c();l(3),Te(n)}}function Nd(t,o){if(t&1&&_(0,Od,5,0,"div",4),t&2){let n=o;C(n!=null&&n.length?0:-1)}}function Md(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",8),s()),t&2){let n=c();d("formGroup",n.form)("ngClass",E(6,Ad,n.pageType===n.PageType.READONLY)),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var Jn=(()=>{let o=class o{constructor(){this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.PROFILE_DEFINITION.ROLES_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={rolesGroup:{}},this.formlyOptions={formState:{readonly:!0}},this.searchRolesHandler$=new I(""),this.pageType=y.READONLY,this.actions$=new I([]),this.destroyRef=pe(ue)}ngOnInit(){this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.initDropdownObservablesAndHandler(),this.model=this.profile.toRolesEditionForm(),this.fields=this.fetchFields()}ngOnChanges(e){e.profile?.currentValue&&!e.profile.firstChange&&(this.model=this.profile.toRolesEditionForm(),this.fields=this.fetchFields())}initDropdownObservablesAndHandler(){let e=this.connectedUser.profile?.permissions?.find(m=>m.action===se.GrantRevoke&&(!m.entityType||m.entityType===Zi.Role)),i=!1;e&&(e.entitySubTypes?.length?i=e.entitySubTypes.some(m=>m===this.profile.type):i=!e.entityIds||e.entityIds.length===0);let r=e?.entityIds;this.rolesItems$=this.searchRolesHandler$.pipe(X(this.destroyRef),Le(m=>this.searchProfileRolesTrigger(m)),me(m=>{let v=m.items;return this.profile?.roles?.length&&(v.push(...this.profile?.roles),v=(0,Xn.uniqBy)(v,"id"),v=(0,Xn.sortBy)(v,"name")),v.map(F=>{let ae=i||r?.some(Ce=>Ce===F.id);return{value:F.id,label:F.name,id:F.id,disabled:!ae,notRemovable:!ae}})}),ne({bufferSize:1,refCount:!0}))}fetchFields(){return Gt.rolesFormFields(this.translationKey,this.rolesItems$,this.searchRolesHandler$)}actionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.formlyOptions.updateInitialValue?.(),this.switchType(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.cancelEditModeWithoutSaving();break;case Y.SAVE_CHANGES:this.updateProfileRoles();break}}switchType(e){if(this.pageType=e,this.actions$.next(Ie.computeEditOrCreateActions(this.pageType)),this.pageType===y.SAVING_IN_PROGRESS)return;let i=this.pageType===y.EDITION;this.changePendingEmitter.emit(i),this.formlyOptions.formState.readonly=!i}cancelEditModeWithoutSaving(){this.switchType(y.READONLY),this.formlyOptions.resetModel?.(),this.fields=this.fetchFields()}updateProfileRoles(){this.form.valid?(this.switchType(y.SAVING_IN_PROGRESS),this.updateProfileRolesTrigger(this.profile.id,this.model.rolesGroup.roles??[]).pipe(X(this.destroyRef)).subscribe({next:()=>{this.switchType(y.READONLY)},error:()=>{this.switchType(y.EDITION)}})):this.form.markAllAsTouched()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-profile-detail-roles-form"]],inputs:{profile:"profile",connectedUser:"connectedUser",updateProfileRolesTrigger:"updateProfileRolesTrigger",searchProfileRolesTrigger:"searchProfileRolesTrigger"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,features:[Ve],decls:6,vars:4,consts:[[1,"container","pt-xxs","pb-xxl"],[1,"row","pb-xxl"],[1,"col-12"],[3,"formGroup","ngClass"],[1,"row"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"form","fields","model","options"]],template:function(i,r){if(i&1&&(a(0,"div",0),_(1,Nd,1,1),p(2,"async"),a(3,"div",1)(4,"div",2),_(5,Md,2,8,"form",3),s()()()),i&2){let m;l(),C((m=f(2,2,r.actions$))?1:-1,m),l(4),C(r.fields.length&&r.form&&r.model?5:-1)}},dependencies:[j,Q,U,K,Me,q,x],styles:["formly-form[_ngcontent-%COMP%] .formly-col:not(.-full) .row-form>div>formly-group{width:calc(100% + 24px)}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .-form-repeater>.simple-field__label{display:none!important}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .-form-repeater>.simple-field__field{width:100%!important}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .col-6{flex:1;max-width:none}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .col-6 .simple-field__field{margin-left:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{dis
1play:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var Pd=t=>({count:t}),wd=()=>({label:"COMMON.CLEAR_ALL"});function Ld(t,o){if(t&1){let n=b();a(0,"ds-button",4),h("clicked",function(){S(n);let i=c();return T(i.onClearAllClicked())}),s()}if(t&2){let n=c();d("type",n.DS_ButtonTypeEnum.DANGERLIGHT)("label",it(2,wd))}}function Bd(t,o){if(t&1&&(a(0,"form",6),N(1,"formly-form",8),s()),t&2){let n=c(2);d("formGroup",n.formGroup),l(),d("form",n.formGroup)("fields",n.formlyFields)("model",n.formModel)}}function Fd(t,o){if(t&1&&(a(0,"p",7),G(1),p(2,"translate"),s()),t&2){let n=c(2);l(),re(f(2,1,n.translationKey+"NO_TASK_SELECTED"))}}function kd(t,o){if(t&1&&(a(0,"div",3)(1,"div",5),_(2,Bd,2,4,"form",6)(3,Fd,3,3,"p",7),s()()),t&2){let n=c();l(2),C(n.selectedReviewTasks.length?2:3)}}var Zn=(()=>{let o=class o{constructor(){this.selectedReviewTasksChangedEmitter=new k,this.formModel={},this.formGroup=new H({}),this.formlyOptions={formState:{}},this.DS_ButtonTypeEnum=M,this.translationKey="ADMINISTRATION.SERVICE.TASKS.ASK_REVIEW_TASK_MODAL.",this.destroyRef=pe(ue),this.initForm()}ngOnInit(){this.formModel={selectedTasks:[...this.selectedReviewTasks]}}ngOnChanges(e){e.selectedReviewTasks?.currentValue&&(this.formModel={selectedTasks:[...this.selectedReviewTasks]})}initForm(){this.formlyFields=[{wrappers:["group-wrapper"],props:{noCard:!0,groupClasses:["-no-shadow"]},fieldGroup:[Ie.repeatForm([{key:"taskCode",type:hi.TEXT,props:{readonly:!0,label:"",required:!0},className:"col-5"},Ut(te({},Ie.integerInput("reviewCountTrigger",`${this.translationKey}REVIEW_COUNT_`,!0,!0,!1,[],void 0,void 0,void 0,!1,!1)),{className:"col-4"})],"selectedTasks",{canDelete:!0,canAdd:!1})]}],this.listenToFormChanges()}onClearAllClicked(){this.selectedReviewTasksChangedEmitter.emit({tasks:[],isFormValid:this.formGroup.valid})}listenToFormChanges(){this.formGroup.valueChanges.pipe(me(e=>e.selectedTasks),X(this.destroyRef)).subscribe(e=>{this.selectedReviewTasksChangedEmitter.emit({tasks:e,isFormValid:this.formGroup.valid})})}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-service-review-tasks-modal-selection-resume"]],inputs:{selectedReviewTasks:"selectedReviewTasks"},outputs:{selectedReviewTasksChangedEmitter:"selectedReviewTasksChangedEmitter"},standalone:!1,features:[Ve],decls:7,vars:8,consts:[[1,"flex","flex-middle","flex-between","mb-xs"],[1,"f-s","f-medium","c-grey05","py-xs"],[3,"type","label"],[1,"row"],[3,"clicked","type","label"],[1,"col-12","py-s"],[3,"formGroup"],[1,"c-grey05"],[1,"-big-repeater",3,"form","fields","model"]],template:function(i,r){i&1&&(a(0,"div")(1,"div",0)(2,"div",1),G(3),p(4,"translate"),s(),_(5,Ld,1,3,"ds-button",2),s(),_(6,kd,4,1,"div",3),s()),i&2&&(l(3),Ne(" ",je(4,3,r.translationKey+"TITLE",E(6,Pd,r.selectedReviewTasks.length))," "),l(2),C(r.selectedReviewTasks.length?5:-1),l(),C(r.formGroup?6:-1))},dependencies:[Q,U,K,Me,q,fe],styles:["formly-form[_ngcontent-%COMP%] .formly-col{padding:0}formly-form[_ngcontent-%COMP%] .formly-col .row-form>div>formly-group{width:calc(100% + 24px)}formly-form[_ngcontent-%COMP%] .formly-col .-repeated{background:var(--grey01);padding:4px 12px 8px;border-radius:8px;position:relative}formly-form[_ngcontent-%COMP%] .formly-col .-repeated formly-group{display:flex;margin:0 -12px}formly-form[_ngcontent-%COMP%] .formly-col .-repeated formly-group .col-5{display:flex;align-items:center;padding-top:6px}formly-form[_ngcontent-%COMP%] .formly-col .-repeated formly-group .simple-field{margin-top:0}"],changeDetection:0});let t=o;return t})();var Hd=t=>({kind:t}),Ss=(t,o)=>({label:t,param:o}),Cs=t=>({count:t}),Ts=t=>({label:t}),Vd=()=>({label:"COMMON.THREE_CHAR_REQUIRED"}),Ud=()=>({label:"COMMON.CLEAR_ALL"}),Es=(t,o)=>o.id;function Kd(t,o){if(t&1&&(a(0,"form",12)(1,"div",6)(2,"div",7),N(3,"ds-textfield",23),s()()()),t&2){let n=c(2);d("formGroup",n.form),l(3),d("placeholder",E(7,Ts,n.translationKey+"SEARCH_CODE"))("icon",n.DS_IconsEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("errorMessage",it(9,Vd))("formControlName",n.DocumentSelectionFilterKeys.NAME)("clearable",!0)}}
1function jd(t,o){if(t&1){let n=b();a(0,"ds-selection-item",25),h("selectionChange",function(i){let r=S(n).$implicit,m=c(3);return T(m.onSelectDocument(r,i))}),s()}if(t&2){let n=o.$implicit,e=c(3);d("label",E(2,Ts,n.code))("isSelected",e.isSelected(n))}}function qd(t,o){if(t&1&&(Se(0,jd,1,4,"ds-selection-item",24,Es),p(2,"sort")),t&2){let n=c();Te(je(2,0,n,"code"))}}function Yd(t,o){if(t&1&&(a(0,"p",16),G(1),p(2,"translate"),s()),t&2){let n=c(2);l(),Ne(" ",f(2,1,n.translationKey+"NO_RESULT_FOUND")," ")}}function Qd(t,o){if(t&1){let n=b();a(0,"ds-button",26),h("clicked",function(){S(n);let i=c(2);return T(i.onClearAllSelection())}),s()}if(t&2){let n=c(2);d("type",n.DS_ButtonTypeEnum.DANGERLIGHT)("label",it(2,Ud))}}function Wd(t,o){if(t&1){let n=b();a(0,"div",22)(1,"div",27)(2,"div")(3,"div",28),G(4),s()(),a(5,"ds-button",29),h("clicked",function(){let i=S(n).$implicit,r=c(2);return T(r.onSelectDocument(i,!1))}),s()()()}if(t&2){let n=o.$implicit,e=c(2);l(4),Ne(" ",n.code," "),l(),d("type",e.DS_ButtonTypeEnum.ICONDANGER)("icon",e.DS_IconsEnum.cross)}}function zd(t,o){if(t&1){let n=b();a(0,"div",2)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"h2",8),G(6),p(7,"translate"),s()(),a(8,"div",9)(9,"div",10)(10,"div",11),_(11,Kd,4,10,"form",12),s(),a(12,"ds-button",13),h("clicked",function(){S(n);let i=c();return T(i.onSelectAllDocumentsClicked())}),s()(),a(13,"div",14)(14,"ul",15),_(15,qd,3,3)(16,Yd,3,3,"p",16),s()()()()(),a(17,"div",17)(18,"div",18)(19,"div",19)(20,"div",20),G(21),p(22,"translate"),_(23,Qd,1,3,"ds-button",21),s(),Se(24,Wd,6,3,"div",22,Es),s()()()()()}if(t&2){let n=o,e=c();l(6),re(f(7,9,e.translationKey+"SUBTITLE")),l(5),C(e.form?11:-1),l(),d("label",dt(16,Ss,e.translationKey+(n.length>1?"SELECT_DOCUMENTS_BTN_PL":"SELECT_DOCUMENTS_BTN"),E(14,Cs,n.length.toString())))("type",e.DS_ButtonTypeEnum.SECONDARY)("disabled",n.length===0)("isLarge",!0),l(3),C(n.length?15:16),l(6),Ne("",je(22,11,e.translationKey+"SELECTED_DOCUMENTS_TITLE",E(19,Cs,e.selectedDocuments().length))," "),l(2),C(e.selectedDocuments().length?23:-1),l(),Te(e.selectedDocuments())}}var eo=(function(t){return t.NAME="name",t})(eo||{}),to=(()=>{let o=class o{constructor(){this.closeEmitter=new k,this.translationKey="ADMINISTRATION.SERVICE.DOCUMENTS.SELECT_DOCUMENTS.",this.DS_ButtonTypeEnum=M,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DocumentSelectionFilterKeys=eo,this.destroyRef=pe(ue),this.bottomButtons=[{label:{label:"COMMON.CANCEL"},type:M.SECONDARY,isFullWidth:!1,eventType:_e.CANCEL},{label:{label:"COMMON.CONFIRM"},type:M.PRIMARY,isFullWidth:!1,eventType:_e.CONFIRM}],this.form=new H({[eo.NAME]:new Fe("")}),this.filteredDocuments=Re([]),this.selectedDocuments=Re([])}ngOnInit(){this.selectedDocuments.set(this.alreadySelectedDocumentTypes),this.filteredDocuments.set(this.documentTypesAvailable),this.form.get(eo.NAME)?.valueChanges.pipe(ge(Be.searchInputDebounce),X(this.destroyRef)).subscribe(e=>{e?.length?this.filteredDocuments.set(this.documentTypesAvailable.filter(i=>mi.containsSubString(i.code,e))):this.filteredDocuments.set(this.documentTypesAvailable)})}onSelectAllDocumentsClicked(){this.selectedDocuments.update(e=>{let i=this.filteredDocuments().filter(r=>!e.some(m=>m.id===r.id));return[...e,...i]})}onClearAllSelection(){this.selectedDocuments.set([])}onSelectDocument(e,i){i?this.selectedDocuments.update(r=>[...r,e]):this.selectedDocuments.update(r=>r.filter(m=>m.id!==e.id))}isSelected(e){return!!this.selectedDocuments().find(i=>i.id===e.id)}onBottomButtonClicked(e){switch(e.eventType){case _e.CANCEL:this.closeModal();break;case _e.CONFIRM:this.closeModal(!0);break}}closeModal(e=!1){this.closeEmitter.emit(e?this.selectedDocuments():void 0),this.closeEmitter.complete()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-documents-selection-modal"]],inputs:{documentKind:"documentKind",alreadySelectedDocumentTypes:"alreadySelectedDocumentTypes",documentTypesAvailable:"documentTypesAvailable"},outputs:{closeEmitter:"closeEmitter"},standalone:!1,decls:5,vars:12,consts:[[3,"onCancel","title","showCancelButton"],[1,"relative",3,"preventHeightResize"],[1,"container-fluid"],[3,"buttonClick","rightButtons"],[1,"row","pb-l"],[1,"col-8","container"],[1,"row"],[1,"col-12"],[1,"pt-m"],[1,"col-12","pt-xs"],[1,"flex","flex-top","flex-between","pb-xs"],[1,"mt-xs","col-5"],[3,"formGroup"],[1,"pt-xs",3,"clicked","label","type","disabled","isLarge"],[1,"card"],[1,"card__list"],[1,"mx-m","py-l"],[1,"col-4","bg-grey00","modal-body__aside"],[1,"py-l"],[1,"mb-xs"],[1,"f-s","f-medium","c-grey05","py-xs"],[3,"type","label"],[1,"bg-grey01","br-m","px-s","py-xs","mb-xs"],[3,"placeholder","icon","iconPlacement","errorMessage","formControlName","clearable"],[3,"label","isSelected"],[3,"selectionChange","label","isSelected"],[3,"clicked","type","label"],[1,"flex","flex-middle","flex-between"],[1,"f-s","f-medium"],[3,"clicked","type","icon"]],template:function(i,r){if(i&1&&(a(0,"ds-modal-header",0),p(1,"titlecase"),h("onCancel",function(){return r.closeModal()}),s(),a(2,"ds-modal-body",1),_(3,zd,26,21,"div",2),s(),a(4,"ds-modal-footer",3),h("buttonClick",function(v){return r.onBottomButtonClicked(v)}),s()),i&2){let m;d("title",dt(9,Ss,r.translationKey+"TITLE",E(7,Hd,f(1,5,r.documentKind))))("showCancelButton",!0),l(2),d("preventHeightResize",!0),l(),C((m=r.filteredDocuments())?3:-1,m),l(
1),d("rightButtons",r.bottomButtons)}},dependencies:[Q,Oe,U,K,ke,qe,q,Bt,wt,Lt,ui,hr,yn,fe],encapsulation:2,changeDetection:0});let t=o;return t})();function Xd(t,o){if(t&1&&(a(0,"form",3),N(1,"formly-form",4),s()),t&2){let n=c();d("formGroup",n.form),l(),d("form",n.form)("fields",n.fields)("model",n.model)("options",n.formlyOptions)}}var io=(()=>{let o=class o{constructor(){this.changePendingEmitter=new k,this.translationKey="ADMINISTRATION.SERVICE.GENERAL_INFORMATION_FORM.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.PageType=y,this.form=new H({}),this.fields=[],this.model={},this.formlyOptions={formState:{readonly:!0}}}ngOnInit(){this.formlyOptions.formState.readonly=!0,this.model=this.service.toEditionForm(),this.fields=this.fetchFields()}fetchFields(){return fn.generalFormFields(this.translationKey,this.regions)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-service-general-info-form"]],inputs:{service:"service",regions:"regions",createServiceTrigger:"createServiceTrigger"},outputs:{changePendingEmitter:"changePendingEmitter"},standalone:!1,decls:4,vars:1,consts:[[1,"container","pt-xxs","pb-xxl"],[1,"row","pb-xxl"],[1,"col-12"],[1,"-readmode",3,"formGroup"],[3,"form","fields","model","options"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),_(3,Xd,2,5,"form",3),s()()()),i&2&&(l(3),C(r.fields.length&&r.form&&r.model?3:-1))},dependencies:[Q,U,K,Me],styles:["formly-form[_ngcontent-%COMP%] .formly-col:not(.-full) .row-form>div>formly-group{width:calc(100% + 24px)}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .-form-repeater>.simple-field__label{display:none!important}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .-form-repeater>.simple-field__field{width:100%!important}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .formly-col{padding-bottom:16px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field{display:flex;padding-top:8px}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__label{width:25%;padding-right:12px;line-height:1;display:flex;align-items:start}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field{width:75%}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field label{padding:0;margin:2px 0 0;min-height:0;border:0;line-height:1;word-break:break-word}.-readmode[_ngcontent-%COMP%] formly-form[_ngcontent-%COMP%] .simple-field .simple-field__field .flex-middle{padding:0}"],changeDetection:0});let t=o;return t})();var Zd=t=>({"ml-s":t});function em(t,o){if(t&1){let n=b();a(0,"ds-button",6),h("clicked",function(){let i=S(n).$implicit,r=c();return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,Zd,e!==0))}}function tm(t,o){if(t&1&&(a(0,"form",5),N(1,"formly-form",7),s()),t&2){let n=c();d("formGroup",n.formGroup),l(),d("options",n.formlyOptions)("form",n.formGroup)("fields",n.formlyFields)("model",n.formModel)}}var no=(()=>{let o=class o{constructor(e){this.modalService=e,this.pageTypeChanged=new k,this.actionButtons=Rt(()=>Ie.computeEditOrCreateActions(this.currentPageType(),this.canEdit)),this.currentPageType=Re(y.READONLY),this.PageType=y,this.formModel={documents:[]},this.formGroup=new H({}),this.formlyOptions={formState:{}},this.translationKey="ADMINISTRATION.SERVICE.DOCUMENTS.",this.openDocumentTypesSelectionModal=i=>this.allDocumentTypesGetter.pipe(ye(1),Le(r=>(this.modalRef=this.modalService.show(to,{initialState:{alreadySelectedDocumentTypes:i,documentTypesAvailable:r,documentKind:this.documentKindToHandle},ignoreBackdropClick:!0,class:"-full-screen"}),this.currentPageType.set(y.EDITION),this.modalRef.content.closeEmitter)),J(r=>{r?this.formModel=Ut(te({},this.formModel),{documents:r.sort((m,v)=>m.code.localeCompare(v.code))}):(this.currentPageType.set(y.READONLY),this.setValueFromDocumentTypes()),this.modalRef?.hide()})),ei(()=>{this.pageTypeChanged.emit(this.currentPageType()),this.formlyOptions.formState.readonly=this.currentPageType()!==y.EDITION})}ngOnInit(){this.initForm(),this.setValueFromDocumentTypes()}ngOnChanges(e){e.documentTypes&&!e.documentTypes.isFirstChange()&&this.setValueFromDocumentTypes()}actionClicked(e){switch(e){case Y.START_EDIT_MODE:this.currentPageType.set(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.currentPageType.set(y.READONLY),this.setValueFromDocumentTypes();break;case Y.SAVE_CHANGES:this.serviceDocumentUpdater(this.formModel.documents,this.documentKindToHandle).subscribe({next:()=>{this.currentPageType.set(y.READONLY)}});break;default:throw new Error(`Could not handle the click on item ${e}`)}}initForm(){this.formlyFields=[{wrappers:["group-wrapper"],props:{groupClasses:["card -no-shadow p-m mt-m"]},fieldGroup:[{key:"documents",type:hi.ITEMS_SELECTION_WITH_MODAL,props:{required:!1,readonly:!0,itemsSelectionConfig:{label:{label:`${this.translationKey}TITLE`},editButtonLabel:{label:`${this.translationKey}SELECT_DOCUMENTS.EDIT_LABEL`},addButtonLabel:{label:`${this.translationKey}SELECT_DOCUMENTS.ADD_LABEL`},noItemsLabel:{label:`${this.translationKey}SELECT_DOCUMENTS.NO_ITEMS_SELECTED`},openSelectionModalGetter:this.openDocumentTypesSelectionModal,headers:[{label:`${this.translationKey}SELECT_DOCUMENTS.DESCRIPTION`,value:e=>e.code,isStrong:!0}],smallTitle:!1,isCollapsable:!1,withCardBorder:!1}},expressions:{"props.readonly":e=>!!e.options?.formState.readonly}}]}]}setValueFromDocumentTypes(){this.formModel=Ut(te({},this.formModel),{documents:this.documentTypes})}};o.\u0275fac=function(i){return new(i||o)(u(xe))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-service-handle-documents"]],inputs:{documentKindToHandle:"documentKindToHandle",documentTypes:"documentTypes",allDocumentTypesGetter:"allDocumentTypesGetter",canEdit:"canEdit",serviceDocumentUpdater:"serviceDocumentUpdater"},outputs:{pageTypeChanged:"pageTypeChanged"},standalone:!1,features:[Ve],decls:7,vars:1,consts:[[1,"container","pt-xxs","pb-xxl"],[1,"row"],[1,"col-12"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[1,"form","-spaced",3,"formGroup"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"options","form","fields","model"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),Se(4,em,1,9,"ds-button",4,pt),s()()(),_(6,tm,2,5,"form",5),s()),i&2&&(l(4),Te(r.actionButtons()),l(2),C(r.formlyFields?6:-1))},dependencies:[j,Q,U,K,Me,q],encapsulation:2,changeDetection:0});let t=o;return t})();var nm=t=>({label:t});function om(t,o){if(t&1){let n=b();a(0,"af-search",6),h("searchChange",function(i){S(n);let r=c(2);return T(r.onSearchChange(i))})("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c(2);return T(r.onClearAllFiltersClicked(i))}),s()}if(t&2){let n=c(2);d("config",n.searchConfig)("search",n.initialSearch)}}function rm(t,o){if(t&1&&(a(0,"form",0)(1,"div",1)(2,"div",2),N(3,"ds-textfield",3),s(),a(4,"div",4),_(5,om,1,2,"af-search",5),s()()()),t&2){let n=c();d("formGroup",n.form),l(3),d("placeholder",E(7,nm,n.translationKey+"SEARCH_PLACEHOLDER"))("icon",n.DS_IconEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("formControlName",n.ServicesFilterKeys.NAME_CODE)("clearable",!0),l(2),C(n.searchConfig?5:-1)}}var oo=(()=>{let o=class o{constructor(e){this.filtersService=e,this.query=new k,this.translationKey="ADMINISTRATION.SEARCH_SERVICES.",this.DS_IconEnum=A,this.DS_IconPlacementEnum=L,this.ProfileRolesFilterKeys=mt,this.form=new H({[mt.NAME_CODE]:new Fe("")}),this.initialSearch={filters:[]},this.destroyRef=pe(ue),this.ServicesFilterKeys=mt}ngOnInit(){this.initSavedFilters(),this.searchConfig=this.fetchAdvancedSearchConfig(),this.form.get(mt.NAME_CODE)?.valueChanges.pipe(ge(Be.searchInputDebounce),X(this.destroyRef)).subscribe(e=>{this.nameSearchValue=e,this.saveActiveFiltersAndEmitQuery()}),this.onSearchChange(this.initialSearch)}initSavedFilters(){let e=this.filtersService.getActiveServicesFilters();e?.query?.length&&(this.form.patchValue({[mt.NAME_CODE]:e.query},{emitEvent:!1}),this.nameSearchValue=e.query),e?.advancedSearch?.filters?.length&&(this.initialSearch=e.advancedSearch,this.advancedSearchValue=e.advancedSearch)}fetchAdvancedSearchConfig(){return{allowedFilters:[{id:mt.PIF_TYPE,column:mt.PIF_TYPE,label:`${this.translationKey}PIF_TYPE.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}PIF_TYPE.PLACEHOLDER`,data:{items:ia,multiple:!0}},{id:mt.REGIONS,column:mt.REGIONS,label:`${this.translationKey}REGIONS.LABEL`,placeholder:`${this.translationKey}REGIONS.PLACEHOLDER`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:this.allRegionsItems?.map(e=>({label:e.label,value:e.value}))??[],multiple:!0}},{id:mt.COMPOSITION_TYPE,column:mt.COMPOSITION_TYPE,label:`${this.translationKey}COMPOSITION_TYPE.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,placeholder:`${this.translationKey}COMPOSITION_TYPE.PLACEHOLDER`,data:{items:oa,multiple:!0}},{id:mt.IS_PURCHASABLE,column:mt.IS_PURCHASABLE,label:`${this.translationKey}IS_PURCHASABLE.LABEL`,type:le.CHOICE,canAddMultipleTimes:!1,data:{items:st.yesNoSearchItems,multiple:!1}}]}}onSearchChange(e){this.advancedSearchValue=e,this.saveActiveFiltersAndEmitQuery()}onClearAllFiltersClicked(e){this.advancedSearchValue=e||{filters:[]},this.form.get(mt.NAME_CODE)?.setValue("")}saveActiveFiltersAndEmitQuery(){let e=fi.fromFilters(this.nameSearchValue,this.advancedSearchValue);this.filtersService.setActiveServicesFilters(e),this.query.emit(e)}};o.\u0275fac=function(i){return new(i||o)(u(ut))},o.\u0275cmp=R({type:o,selectors:[["biorius-services-search"]],inputs:{allRegionsItems:"allRegionsItems"},outputs:{query:"query"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"row"],[1,"col-4"],[3,"placeholder","icon","iconPlacement","formControlName","clearable"],[1,"col-12"],[3,"config","search"],[3,"searchChange","onClearAllEnabledFiltersClicked","config","search"]],template:function(i,r){i&1&&_(0,rm,6,9,"form",0),i&2&&C(r.form?0:-1)},dependencies:[Q,Oe,U,K,ke,qe,et],encapsulation:2,changeDetection:0});let t=o;return t})();var sr=t=>({label:t}),sm=()=>({label:"COMMON.THREE_CHAR_REQUIRED"}),lm=t=>({count:t}),cm=(t,o)=>({label:t,param:o});
1function dm(t,o){if(t&1){let n=b();a(0,"form",9)(1,"div",3)(2,"div",17),N(3,"ds-textfield",18),s(),a(4,"div",19)(5,"ds-button",20),h("clicked",function(){S(n);let i=c();return T(i.onSelectAllFilteredTasksClicked())}),s()()()()}if(t&2){let n=c();d("formGroup",n.formGroupFilter),l(3),d("placeholder",E(11,sr,n.translationKey+"SEARCH"))("icon",n.DS_IconsEnum.search)("iconPlacement",n.DS_IconPlacementEnum.after)("errorMessage",it(13,sm))("formControlName","taskCode")("clearable",!0),l(2),d("label",dt(16,cm,n.translationKey+(n.filteredReviewTasksCode().length>1?"SELECT_REVIEW_TASK_BTN_PL":"SELECT_REVIEW_TASK_BTN"),E(14,lm,n.filteredReviewTasksCode().length.toString())))("type",n.DS_ButtonTypeEnum.SECONDARY)("disabled",n.filteredReviewTasksCode().length===0)("isLarge",!0)}}function mm(t,o){if(t&1){let n=b();a(0,"ds-selection-item",22),h("selectionChange",function(i){let r=S(n).$implicit,m=c(2);return T(m.onSelectionItemChange(r,i))}),s()}if(t&2){let n=o.$implicit,e=c(2);d("label",E(2,sr,n))("isSelected",e.isSelected(n))}}
1function pm(t,o){if(t&1&&(Se(0,mm,1,4,"ds-selection-item",21,ur),p(2,"sort")),t&2){let n=c();Te(f(2,0,n.filteredReviewTasksCode()))}}function um(t,o){if(t&1&&(a(0,"p",12),G(1),p(2,"translate"),s()),t&2){let n=c();l(),Ne(" ",f(2,1,n.translationKey+"NO_RESULT_FOUND")," ")}}var ro=(()=>{let o=class o{constructor(){this.closeEmitter=new k,this.translationKey="ADMINISTRATION.SERVICE.TASKS.ASK_REVIEW_TASK_MODAL.",this.DS_ButtonTypeEnum=M,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.selectedReviewTasks=Re([]),this.filteredReviewTasksCode=Re([]),this.formGroupFilter=new H({taskCode:new Fe("")}),this.destroyRef=pe(ue),this.formGroupReviewModel={},this.formGroupReviewCount=new H({}),this.bottomButtons=Re(this.generateBottomButtons(!0))}ngOnInit(){this.selectedReviewTasks.set(this.preSelectedReviewTasks),this.filteredReviewTasksCode.set(this.availableReviewTasksCode),this.formGroupFilter.valueChanges.pipe(ge(Be.searchInputDebounce),me(e=>e.taskCode),X(this.destroyRef)).subscribe(e=>{this.onSearchChanged(e)}),this.formGroupReviewCount.valueChanges.pipe(ge(Be.searchInputDebounce),me(e=>e.reviewLegacyTasks),X(this.destroyRef)).subscribe(e=>{this.selectedReviewTasks.set(e)})}onAddTaskFromSelection(e){this.selectedReviewTasks.update(i=>[...i,this.mapTaskCodeToServiceReviewLegacyTask(e)])}onRemoveTaskFromSelection(e){this.selectedReviewTasks.update(i=>i.filter(r=>r.taskCode!==e)),this.formGroupReviewModel=te(te({},this.formGroupReviewModel),this.mapTaskCodeToServiceReviewLegacyTask(e))}onSearchChanged(e){this.filteredReviewTasksCode.set(this.availableReviewTasksCode.filter(i=>mi.containsSubString(i,e)))}onSelectAllFilteredTasksClicked(){let e=this.selectedReviewTasks(),i=this.filteredReviewTasksCode().filter(r=>!e.some(m=>m.taskCode===r)).map(r=>this.mapTaskCodeToServiceReviewLegacyTask(r));this.selectedReviewTasks.update(r=>[...r,...i])}isSelected(e){return this.selectedReviewTasks()?.some(i=>e===i.taskCode)}onSelectionItemChange(e,i){i?this.onAddTaskFromSelection(e):this.onRemoveTaskFromSelection(e)}onBottomButtonClicked(e){switch(e.eventType){case _e.CANCEL:this.closeModal();break;case _e.CONFIRM:this.closeModal(!0);break}}onSelectedReviewTasksChanged(e){this.bottomButtons.set(this.generateBottomButtons(e.isFormValid)),this.selectedReviewTasks.set(e.tasks)}closeModal(e=!1){this.closeEmitter.emit(e?this.selectedReviewTasks():void 0),this.closeEmitter.complete()}mapTaskCodeToServiceReviewLegacyTask(e){return new Ba({taskCode:e,reviewCountTrigger:null})}generateBottomButtons(e){return[{label:{label:"COMMON.CANCEL"},type:M.SECONDARY,isFullWidth:!1,disabled:!1,eventType:_e.CANCEL},{label:{label:"COMMON.CONFIRM"},type:M.PRIMARY,isFullWidth:!1,disabled:!e,eventType:_e.CONFIRM}]}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-service-review-tasks-modal"]],inputs:{availableReviewTasksCode:"availableReviewTasksCode",preSelectedReviewTasks:"preSelectedReviewTasks"},outputs:{closeEmitter:"closeEmitter"},standalone:!1,decls:23,vars:13,consts:[[3,"onCancel","title","showCancelButton"],[1,"relative",3,"preventHeightResize"],[1,"container-fluid"],[1,"row"],["
1infiniteScroll","",1,"px-l","py-xl","col-8","modal-body__main",3,"scrollWindow"],[1,"container"],[1,"col-12"],[1,"flex","flex-top","flex-between","pt-m","pb-xs"],[1,"w-100"],[3,"formGroup"],[1,"card"],[1,"card__list"],[1,"mx-m","py-l"],[1,"col-4","bg-grey00","modal-body__aside"],[1,"py-l"],[3,"selectedReviewTasksChangedEmitter","selectedReviewTasks"],[3,"buttonClick","rightButtons"],[1,"col-5"],[3,"placeholder","icon","iconPlacement","errorMessage","formControlName","clearable"],[1,"offset-4","col-3"],[3,"clicked","label","type","disabled","isLarge"],[3,"label","isSelected"],[3,"selectionChange","label","isSelected"]],template:function(i,r){i&1&&(a(0,"ds-modal-header",0),h("onCancel",function(){return r.closeModal()}),s(),a(1,"ds-modal-body",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",3)(7,"div",6)(8,"h2"),G(9),p(10,"translate"),s()(),a(11,"div",6)(12,"div",7)(13,"div",8),_(14,dm,6,19,"form",9),s()(),a(15,"div",10)(16,"ul",11),_(17,pm,3,2)(18,um,3,3,"p",12),s()()()()()(),a(19,"div",13)(20,"div",14)(21,"biorius-service-review-tasks-modal-selection-resume",15),h("selectedReviewTasksChangedEmitter",function(v){return r.onSelectedReviewTasksChanged(v)}),s()()()()()(),a(22,"ds-modal-footer",16),h("buttonClick",function(v){return r.onBottomButtonClicked(v)}),s()),i&2&&(d("title",E(11,sr,r.translationKey+"TITLE"))("showCancelButton",!0),l(),d("preventHeightResize",!0),l(3),d("scrollWindow",!1),l(5),re(f(10,9,r.translationKey+"SUBTITLE")),l(5),C(r.formGroupFilter?14:-1),l(3),C(r.filteredReviewTasksCode().length?17:18),l(4),d("selectedReviewTasks",r.selectedReviewTasks()),l(),d("rightButtons",r.bottomButtons()))},dependencies:[Q,Oe,U,K,ke,Ye,qe,q,Bt,wt,Lt,ui,Zn,yn,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var hm=t=>({"ml-s":t});function fm(t,o){if(t&1){let n=b();a(0,"ds-button",6),h("clicked",function(){let i=S(n).$implicit,r=c();return T(r.actionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,hm,e!==0))}}function _m(t,o){if(t&1&&(a(0,"form",5),N(1,"formly-form",7),s()),t&2){let n=c();d("formGroup",n.formGroup),l(),d("options",n.formlyOptions)("form",n.formGroup)("fields",n.formlyFields)("model",n.formModel)}}var lr=(function(t){return t.LegacyTaskCode="linkingLegacyTaskCode",t.ReviewLegacyTasks="reviewLegacyTasks",t})(lr||{}),ao=(()=>{let o=class o{constructor(e){this.modalService=e,this.pageTypeChanged=new k,this.formModel={reviewLegacyTasks:[],linkingLegacyTaskCode:null},this.formGroup=new H({}),this.formlyOptions={formState:{}},this.actionButtons=Rt(()=>Ie.computeEditOrCreateActions(this.currentPageType(),this.canEdit)),this.currentPageType=Re(y.READONLY),this.translationKey="ADMINISTRATION.SERVICE.TASKS.",this.openSelectReviewTaskModal=i=>(this.modalRef=this.modalService.show(ro,{initialState:{availableReviewTasksCode:this.calmosTaskTypes,preSelectedReviewTasks:i??[]},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(J(r=>{if(r){let m=r.map(v=>({reviewCountTrigger:v.reviewCountTrigger,taskCode:v.taskCode}));this.formModel=Ut(te({},this.formModel),{reviewLegacyTasks:m.sort((v,F)=>v.reviewCountTrigger-F.reviewCountTrigger)})}this.modalRef?.hide()}))),ei(()=>{this.pageTypeChanged.emit(this.currentPageType()),this.formlyOptions.formState.readonly=this.currentPageType()!==y.EDITION})}ngOnChanges(e){e.serviceLegacyTasks&&!e.serviceLegacyTasks.isFirstChange()&&this.setFormValueFromServiceTasks()}ngOnInit(){this.initForm(),this.formModel=this.serviceLegacyTasks.toForm()}actionClicked(e){switch(e){case Y.START_EDIT_MODE:this.currentPageType.set(y.EDITION);break;case Y.CANCEL_EDIT_MODE:this.currentPageType.set(y.READONLY),this.setFormValueFromServiceTasks();break;case Y.SAVE_CHANGES:let i=Fa.fromForm(this.formModel);this.serviceLegacyTasksUpdater(i).subscribe({next:()=>{this.currentPageType.set(y.READONLY)}});break;default:throw new Error(`Could not handle the click on item ${e}`)}}initForm(){let e=this.calmosTaskTypes.map(i=>({label:i,value:i}));this.formlyFields=[{wrappers:["group-wrapper"],props:{groupClasses:["card -no-shadow p-m mt-m"],groupTitle:`${this.translationKey}LEGACY_CODE.TITLE`},fieldGroup:[Ie.searchDropdown(lr.LegacyTaskCode,`${this.translationKey}LEGACY_CODE.`,Wt(e),new I(""),"label","value",!1,!1,"",!1,!1,!1,!1,void 0,!1,!1)]},{wrappers:["group-wrapper"],props:{groupClasses:["card -no-shadow p-m mt-m"]},fieldGroup:[{key:lr.ReviewLegacyTasks,type:hi.ITEMS_SELECTION_WITH_MODAL,props:{required:!1,readonly:!0,itemsSelectionConfig:{label:{label:`${this.translationKey}ASK_REVIEW_TASKS`},editButtonLabel:{label:`${this.translationKey}ASK_REVIEW_TASK_MODAL.EDIT_LABEL`},addButtonLabel:{label:`${this.translationKey}ASK_REVIEW_TASK_MODAL.ADD_LABEL`},noItemsLabel:{label:`${this.translationKey}ASK_REVIEW_TASK_MODAL.NO_ITEMS_SELECTED`},openSelectionModalGetter:this.openSelectReviewTaskModal,headers:[{label:`${this.translationKey}ASK_REVIEW_TASK_MODAL.CODE`,value:i=>i.taskCode,isStrong:!0},{label:`${this.translationKey}ASK_REVIEW_TASK_MODAL.REVIEW_COUNT`,value:i=>i.reviewCountTrigger.toString(),isMini:!1}],smallTitle:!1,isCollapsable:!1,withCardBorder:!1}},expressions:{"props.readonly":i=>!!i.options?.formState.readonly}}]}]}setFormValueFromServiceTasks(){this.formGroup.setValue(this.serviceLegacyTasks.toForm())}};o.\u0275fac=function(i){return new(i||o)(u(xe))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-service-tasks"]],inputs:{serviceLegacyTasks:"serviceLegacyTasks",calmosTaskTypes:"calmosTaskTypes",canEdit:"canEdit",serviceLegacyTasksUpdater:"serviceLegacyTasksUpdater"},outputs:{pageTypeChanged:"pageTypeChanged"},standalone:!1,features:[Ve],decls:7,vars:1,consts:[[1,"container","pt-xxs","pb-xxl"],[1,"row"],[1,"col-12"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[1,"form","-spaced",3,"formGroup"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"options","form","fields","model"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),Se(4,fm,1,9,"ds-button",4,pt),s()()(),_(6,_m,2,5,"form",5),s()),i&2&&(l(4),Te(r.actionButtons()),l(2),C(r.formlyFields?6:-1))},dependencies:[j,Q,U,K,Me,q],styles:["formly-form[_ngcontent-%COMP%] .formly-col formly-group{width:calc(100% + 24px)!important}formly-form[_ngcontent-%COMP%] table.table .table__row-body{background-color:var(--grey01)}"],changeDetection:0});let t=o;return t})();function gm(t,o){if(t&1&&(a(0,"form",9),N(1,"formly-form",10),s()),t&2){let n=c();d("formGroup",n.form),l(),d("form",n.form)("fields",n.fields)("model",n.model)}}var so=(()=>{let o=class o{constructor(){this.formChangedEmitter=new k,this.translationKey="ADMINISTRATION.SERVICE.CREATE_SERVICE.SERVICE_CONFIGURATION.",this.form=new H({}),this.fields=[],this.model={},this.destroy=pe(ue)}ngOnInit(){this.fields=this.fetchFields(),this.model=this.processType.toServiceCreationForm(),this.form.valueChanges.pipe(X(this.destroy)).subscribe(e=>{this.formChangedEmitter.emit({isFormValid:this.form.valid,formValue:e})})}fetchFields(){return fn.generalFormFields("ADMINISTRATION.SERVICE.GENERAL_INFORMATION_FORM.",this.regions)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-create-service-configuration-step"]],inputs:{processType:"processType",regions:"regions"},outputs:{formChangedEmitter:"formChangedEmitter"},standalone:!1,decls:11,vars:4,consts:[[1,"row","modal-body__main"],[1,"py-l","col-12"],[1,"container"],[1,"flex","flex-top","f-s","bs-solid","bw-xxs","bc-warning01","bg-warning02","br-l","p-s","mt-m"],[1,"icon","icon-attention","f-l","c-warning01","pr-xs"],[1,"c-grey08",3,"innerHtml"],[1,"row"],[1,"col-12"],[1,"card"],[3,"formGroup"],[3,"form","fields","model"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),N(4,"span",4)(5,"div",5),p(6,"translate"),s(),a(7,"div",6)(8,"div",7)(9,"div",8),_(10,gm,2,4,"form",9),s()()()()()()),i&2&&(l(5),d("innerHtml",f(6,2,r.translationKey+"WARNING"),Nt),l(5),C(r.fields.length&&r.form&&r.model?10:-1))},dependencies:[Q,U,K,Me,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var Fi=class{constructor(o){o&&Object.assign(this,o)}toDto(){return{page:this.page.toDto(),query:this.query,regionCodes:this.regionCodes,shouldReturnAvailableProcessTypesOnly:this.shouldReturnAvailableProcessTypesOnly}}};var lo=t=>({label:t}),Tm=t=>[t],Em=(t,o)=>o.id;function ym(t,o){if(t&1){let n=b();a(0,"af-search",13),h("onClearAllEnabledFiltersClicked",function(i){S(n);let r=c();return T(r.onClearAllFiltersClicked(i))})("searchChange",function(i){S(n);let r=c();return T(r.onSearchChange(i))}),s()}t&2&&d("config",o)}function vm(t,o){if(t&1){let n=b();a(0,"ds-selection-item",17),h("selectionChange",function(i){let r=S(n).$implicit,m=c(3);return T(m.onSelectionItemChange(r,i))}),s()}if(t&2){let n=o.$implicit,e=c(3);d("label",E(4,lo,n.description))("subLabel",E(6,lo,n.processTypeCode))("rightInformation",E(12,Tm,E(10,lo,E(8,lo,n.regionCode))))("isSelected",e.isSelected(n))}}function bm(t,o){if(t&1&&Se(0,vm,1,14,"ds-selection-item",16,Em),t&2){let n=c().dsLoading;Te(n)}}function Rm(t,o){if(t&1&&(a(0,"p",15),G(1),p(2,"translate"),s()),t&2){let n=c(2);l(),Ne(" ",f(2,1,n.translationKey+"NO_RESULT_FOUND")," ")}}function Im(t,o){if(t&1&&(a(0,"ul",14),_(1,bm,2,0)(2,Rm,3,3,"p",15),s()),t&2){let n=o.dsLoading;l(),C(n.length?1:2)}}var co=(function(t){return t.REGION="region",t})(co||{}),mo=(()=>{let o=class o extends nt{constructor(){super(),this.onSelectedProcessType=new k,this.translationKey="ADMINISTRATION.SERVICE.CREATE_SERVICE.SELECT_PROCESS_TYPE.",this.selectedProcessType=Re(void 0),this.filterRegions=Re([]),this.filterQuery=Re(void 0),this.searchConfig=Re({allowedFilters:[{id:co.REGION,column:co.REGION,label:`${this.translationKey}FILTERS.REGION.LABEL`,type:le.TEXT,placeholder:`${this.translationKey}FILTERS.REGION.PLACEHOLDER`,canAddMultipleTimes:!0}],filtersToDisplay:[]}),this.initSearchGetter(),ei(()=>{this.onSelectedProcessType.emit(this.selectedProcessType())}),ei(()=>{this.onQuery(new Fi({regionCodes:this.filterRegions(),query:this.filterQuery()??""}))})}ngOnInit(){super.ngOnInit(),this.selectedProcessType.set(this.alreadySelectedProcessType)}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new Fi(e?te({},e):{});return r.page=i,r.shouldReturnAvailableProcessTypesOnly=!0,this.searchProcessTypesGetter(r)}}onSelectionItemChange(e,i){i?this.selectedProcessType.set(e):this.selectedProcessType.set(void 0)}isSelected(e){return!!this.selectedProcessType()&&this.selectedProcessType().id===e.id}onSearchTermChange(e){this.filterQuery.set(e),this.onQuery(new Fi({}))}onSearchChange(e){this.filterRegions.set(e.filters.filter(i=>i.filterId==co.REGION)?.map(i=>i.data.value)??[])}onClearAllFiltersClicked(e){this.filterRegions.set([])}};o.\u0275fac=function(i){return new(i||o)}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-create-service-select-process-type-step"]],inputs:{searchProcessTypesGetter:"searchProcessTypesGetter",alreadySelectedProcessType:"alreadySelectedProcessType"},outputs:{onSelectedProcessType:"onSelectedProcessType"},standalone:!1,features:[V],decls:16,vars:8,consts:[["infiniteScroll","",1,"row","modal-body__main",3,"scrolled","scrollWindow"],[1,"py-l","col-12"],[1,"container"],[1,"row"],[1,"col-12"],[1,"pb-s"],[1,"card"],[1,"flex","flex-middle","flex-between","py-xs"],[1,"w-50","px-m","pt-s","py-xs"],[3,"query","searchPlaceholder"],[1,"w-50","pl-xxs"],[3,"config"],["class","card__list",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[3,"onClearAllEnabledFiltersClicked","searchChange","config"],[1,"card__list"],[1,"mx-m","py-l"],[3,"label","subLabel","rightInformation","isSelected"],[3,"selectionChange","label","subLabel","rightInformation","isSelected"]],template:function(i,r){if(i&1&&(a(0,"div",0),h("scrolled",function(v){return r.onScrollDown(v)}),a(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"h3",5),G(6),p(7,"translate"),s()(),a(8,"div",4)(9,"div",6)(10,"div",7)(11,"div",8)(12,"biorius-simple-search",9),h("query",function(v){return r.onSearchTermChange(v)}),s()(),a(13,"div",10),_(14,ym,1,1,"af-search",11),s()(),Z(15,Im,3,1,"ul",12),s()()()()()()),i&2){let m;d("scrollWindow",!1),l(6),re(f(7,6,r.translationKey+"TITLE")),l(6),d("searchPlaceholder",r.translationKey+"SEARCH_PLACEHOLDER"),l(2),C((m=r.searchConfig())?14:-1,m),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0)}},dependencies:[Ka,Ye,ie,ui,et,fe],encapsulation:2,changeDetection:0});let t=o;return t})();function Dm(t,o){if(t&1){let n=b();a(0,"biorius-create-service-select-process-type-step",5),h("onSelectedProcessType",function(i){S(n);let r=c();return T(r.onSelectedProcessType(i))}),s()}if(t&2){let n=c();d("searchProcessTypesGetter",n.searchProcessTypesGetter)("alreadySelectedProcessType",n.selectedProcessType())}}function Om(t,o){if(t&1){let n=b();a(0,"biorius-create-service-configuration-step",6),h("formChangedEmitter",function(i){S(n);let r=c();return T(r.onFormChanged(i))}),s()}if(t&2){let n=c();d("processType",n.selectedProcessType())("regions",n.regionTags)}}var bt=(function(t){return t[t.SelectProcessType=0]="SelectProcessType",t[t.ServiceConfiguration=1]="ServiceConfiguration",t})(bt||{}),po=(()=>{let o=class o{constructor(){this.closeEmitter=new k,this.translationKey="ADMINISTRATION.SERVICE.CREATE_SERVICE.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.CreateServiceModalStep=bt,this.currentStep=Re(bt.SelectProcessType),this.serviceCreationModel=Re(void 0),this.headerTitle=Rt(()=>this.currentStep()===bt.SelectProcessType?{label:`${this.translationKey}SELECT_PROCESS_TYPE.TITLE`}:{label:`${this.translationKey}SERVICE_CONFIGURATION.TITLE`}),this.headerSubTitle=Rt(()=>this.currentStep()===bt.SelectProcessType?[]:[{label:`${this.selectedProcessType().processTypeCode} - ${this.selectedProcessType().description}`}]),this.hasPreviousStep=Rt(()=>this.currentStep()!==bt.SelectProcessType),this.footerButtons=Rt(()=>{switch(this.currentStep()){case bt.SelectProcessType:return[{label:{label:"COMMON.CANCEL"},type:M.SECONDARY,isFullWidth:!1,isLarge:!0,eventType:_e.CANCEL,disabled:!1},{label:{label:"COMMON.NEXT"},type:M.PRIMARY,isFullWidth:!1,isLarge:!0,eventType:_e.NEXT,disabled:!this.isStepValid()}];case bt.ServiceConfiguration:return[{label:{label:"COMMON.PREV"},type:M.SECONDARY,isFullWidth:!1,isLarge:!0,eventType:_e.PREVIOUS},{label:{label:"COMMON.CONFIRM"},type:M.PRIMARY,isFullWidth:!1,isLarge:!0,eventType:_e.CONFIRM,disabled:!this.isStepValid(),disabledTooltip:{label:`${this.translationKey}FORM_NOT_VALID`}}];default:return[]}}),this.selectedProcessType=Re(void 0),this.isStepValid=Re(!1)}ngOnInit(){}ngOnDestroy(){this.closeEmitter.complete()}closeModal(e=void 0){this.closeEmitter.emit(e)}buttonClickHandler(e){switch(e.eventType){case _e.CANCEL:this.closeModal();break;case _e.PREVIOUS:this.goToPreviousStep();break;case _e.NEXT:this.goToNextStep();break;case _e.CONFIRM:this.save();break}}onSelectedProcessType(e){e?this.isStepValid.set(!0):this.isStepValid.set(!1),this.selectedProcessType.set(e)}onFormChanged(e){this.isStepValid.set(e.isFormValid),this.serviceCreationModel.set(e.isFormValid?La.fromServiceE
1dition(e.formValue,this.selectedProcessType()):void 0)}goToNextStep(){this.currentStep()===bt.SelectProcessType&&this.goToStep(bt.ServiceConfiguration)}goToPreviousStep(){this.currentStep()===bt.ServiceConfiguration&&this.goToStep(bt.SelectProcessType)}goToStep(e){this.currentStep.set(e)}save(){this.closeModal(this.serviceCreationModel())}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=R({type:o,selectors:[["biorius-create-service-modal"]],inputs:{regionTags:"regionTags",searchProcessTypesGetter:"searchProcessTypesGetter"},outputs:{closeEmitter:"closeEmitter"},standalone:!1,decls:5,vars:7,consts:[[3,"onBack","onCancel","title","subLabels","showCancelButton","showBackButton"],[1,"relative",3,"preventHeightResize"],[3,"searchProcessTypesGetter","alreadySelectedProcessType"],[3,"processType","regions"],[3,"buttonClick","rightButtons"],[3,"onSelectedProcessType","searchProcessTypesGetter","alreadySelectedProcessType"],[3,"formChangedEmitter","processType","regions"]],template:function(i,r){if(i&1&&(a(0,"ds-modal-header",0),h("onBack",function(){return r.goToPreviousStep()})("onCancel",function(){return r.closeModal()}),s(),a(1,"ds-modal-body",1),_(2,Dm,1,2,"biorius-create-service-select-process-type-step",2)(3,Om,1,2,"biorius-create-service-configuration-step",3),s(),a(4,"ds-modal-footer",4),h("buttonClick",function(v){return r.buttonClickHandler(v)}),s()),i&2){let m;d("title",r.headerTitle())("subLabels",r.headerSubTitle())("showCancelButton",!0)("showBackButton",r.hasPreviousStep()),l(),d("preventHeightResize",!0),l(),C((m=r.currentStep())===r.CreateServiceModalStep.SelectProcessType?2:m===r.CreateServiceModalStep.ServiceConfiguration?3:-1),l(2),d("rightButtons",r.footerButtons())}},dependencies:[Bt,wt,Lt,mo,so],encapsulation:2,changeDetection:0});let t=o;return t})();var ys=[po,mo,so];var vs=[oo,io,no,to,ao,ro,Zn,...ys];var OE=[Ln,wn,An,Dn,Jn,xn,Oi,Pn,...ss,...hs,..._s,...vs];var Nm=t=>({"ml-s":t});function Mm(t,o){if(t&1){let n=b();a(0,"ds-button",11),h("clicked",function(){let i=S(n).$implicit,r=c(5);return T(r.generalInformationActionClicked(i.eventType))}),s()}if(t&2){let n=o.$implicit,e=o.$index;d("icon",n.icon)("iconPlacement",n.iconPlacement)("type",n.type)("label",n.label)("disabled",n.disabled??!1)("loading",n.loading??!1)("ngClass",E(7,Nm,e!==0))}}function xm(t,o){if(t&1&&(a(0,"div",8)(1,"div",6)(2,"div",9),Se(3,Mm,1,9,"ds-button",10,pt),s()()()),t&2){let n=c();l(3),Te(n)}}function Pm(t,o){if(t&1&&_(0,xm,5,0,"div",8),t&2){let n=o;C(n!=null&&n.length?0:-1)}}function wm(t,o){if(t&1&&(a(0,"form",18),N(1,"formly-form",19),s()),t&2){let n=c(5);d("formGroup",n.formGroupInfo),l(),d("form",n.formGroupInfo)("fields",n.fieldsInformation)("model",n.model)}}function Lm(t,o){if(t&1&&(a(0,"div",13),N(1,"span",15),a(2,"div")(3,"h3",16),G(4),p(5,"translate"),s(),a(6,"div",17),_(7,wm,2,4,"form",18),s()()()),t&2){let n=c(4);l(4),Ne("",f(5,2,n.translationKey+"PERSONAL_INFORMATION")," "),l(3),C(n.formGroupInfo?7:-1)}}function Bm(t,o){if(t&1&&(a(0,"form",18),N(1,"formly-form",19),s()),t&2){let n=c(5);d("formGroup",n.formGroupMgmt),l(),d("form",n.formGroupMgmt)("fields",n.fieldsManagement)("model",n.model)}}
1function Fm(t,o){if(t&1&&(a(0,"div",14)(1,"div",13),N(2,"span",20),a(3,"div",21)(4,"div",22)(5,"h3",16),G(6),p(7,"translate"),s()(),a(8,"div",23),_(9,Bm,2,4,"form",18),s()()()()),t&2){let n=c(4);l(6),re(f(7,2,n.translationKey+"ACCESS_MGMT")),l(3),C(n.formGroupMgmt?9:-1)}}function km(t,o){if(t&1&&(a(0,"form",18),N(1,"formly-form",19),s()),t&2){let n=c(5);d("formGroup",n.formGroupNotifications),l(),d("form",n.formGroupNotifications)("fields",n.fieldsNotifications)("model",n.model)}}function $m(t,o){if(t&1&&(a(0,"div",14)(1,"div",13),N(2,"span",24),a(3,"div",21)(4,"div",22)(5,"h3",16),G(6),p(7,"translate"),s()(),a(8,"div",17),_(9,km,2,4,"form",18),s()()()()),t&2){let n=c(4);l(6),re(f(7,2,n.translationKey+"NOTIFICATIONS")),l(3),C(n.formGroupNotifications?9:-1)}}function Gm(t,o){if(t&1&&(a(0,"div",12),_(1,Lm,8,4,"div",13),_(2,Fm,10,4,"div",14),_(3,$m,10,4,"div",14),s()),t&2){let n=c(3);l(),C(n.fieldsInformation?1:-1),l(),C(n.fieldsManagement?2:-1),l(),C(n.fieldsNotifications?3:-1)}}function Hm(t,o){if(t&1&&(a(0,"div",3),_(1,Pm,1,1),p(2,"async"),a(3,"div",5)(4,"div",6),Z(5,Gm,4,3,"div",7),s()()()),t&2){let n,e=c(2);l(),C((n=f(2,2,e.generalInformationActions$))?1:-1,n),l(4),d("dsLoading",e.formInit$)}}function Vm(t,o){if(t&1){let n=b();a(0,"biorius-profile-detail-roles-form",25),p(1,"async"),h("changePendingEmitter",function(i){S(n);let r=c(2);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c().dsLoading,e=c();d("connectedUser",f(1,4,e.userInfos$))("profile",n)("searchProfileRolesTrigger",e.searchProfileRolesTrigger)("updateProfileRolesTrigger",e.updateProfileRolesTrigger)}}function Um(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),p(7,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("onRightMenuActionClicked",function(i){S(n);let r=c();return T(r.onHeaderRightMenuActionClicked(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(8,"div",2),_(9,Hm,6,4,"div",3),p(10,"async"),St(11,Vm,2,6,"biorius-profile-detail-roles-form",4),s(),Ke()}if(t&2){let n,e=c();l(),d("title",e.headerTitle)("rightButtons",f(2,8,e.headerRightButtons$))("rightMenuActions",f(3,10,e.headerRightMenuActions$))("breadcrumb",f(4,12,e.breadcrumb$))("tags",f(5,14,e.tags$))("tabs",f(6,16,e.headerTabs$)??void 0)("defaultTab",f(7,18,e.selectedHeaderTabs$)),l(8),C((n=f(10,20,e.selectedHeaderTabs$))===e.ProfileDetailHeaderTab.GENERAL_INFORMATION?9:n===e.ProfileDetailHeaderTab.ROLES?11:-1)}}var Wi=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae,Ce,ot,Ct,oi,Gs,Hs){super(W.FORM,v,void 0,"ADMINISTRATION.PROFILE_DEFINITION.EXIT_MODAL_TITLE"),this.router=e,this.modalService=i,this.profilesService=r,this.companiesService=m,this.userProfileService=v,this.activatedRoute=F,this.translate=ae,this.navigationService=Ce,this.errorHandlerService=ot,this.authenticationService=Ct,this.surveysService=oi,this.pendingChangesGuard=Gs,this.rolesAndPermissionsService=Hs,this.translationKey="ADMINISTRATION.PROFILE_DEFINITION.",this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.ProfileDetailHeaderTab=ni,this.PendingChangeType=W,this.profileRefresher$=new P,this.isExpert=!1,this.isCurrentUser=!1,this.headerTitle={label:""},this.headerRightButtons$=new I([]),this.headerRightMenuActions$=new I([]),this.breadcrumb$=new I({show:!1,items:[]}),this.tags$=new I([]),this.selectedHeaderTabs$=new I(ni.GENERAL_INFORMATION),this.generalInformationActions$=new I([]),this.formInit$=new I(!1),this.fromDashboard=!1,this.fromMyProfile=!1,this.modelBeforeEdition={},this.searchCompanyHandler$=new I(""),this.companies$=new I(void 0),this.destroyer$=new P,this.unlockUserGetter=()=>this.profilesService.unlockProfile(this.profileId),this.disableMfaGetter=()=>this.profilesService.resetMfa(this.profileId),this.updateUserStatusGetter=ki=>this.profilesService.updateProfileActivation(this.profileId,ki),this.updateProfileRolesTrigger=(ki,jo)=>this.profilesService.updateProfileRoles(ki,jo).pipe(J(Ku=>this.profileRefresher$.next())),this.searchProfileRolesTrigger=ki=>{let jo=new gi({name:ki,roleType:[this.pageType.profile]});return this.rolesAndPermissionsService.searchRoles(jo)},this.defaultCompany=this.router.getCurrentNavigation()?.extras.state?.company,this.fromDashboard=this.router.getCurrentNavigation()?.extras.state?.fromDashboard,this.jobFunctionItems=fa(this.translate),this.mfaTypeItems=_a(this.translate),this.languageItems=[{value:Er.En,label:this.translate.instant("COMMON.EN")}],this.hasGrantRevokeRolesPermission$=this.authenticationService.canAccess([{action:se.GrantRevoke,entityType:Zi.Role}])}ngOnInit(){this.userInfos$=this.userProfileService.userProfile$.pipe(pr((e,i)=>(0,uo.isEqual)(e,i)),O(this.destroyer$),ne({bufferSize:1,refCount:!0})),this.formGroupInfo=new H({}),this.formGroupMgmt=new H({}),this.formGroupNotifications=new H({}),this.profileId=+this.activatedRoute.snapshot.params.id,this.pageType=this.fetchPageType(this.profileId),this.generalInformationActions$.next(Ie.computeEditOrCreateActions(this.pageType.type)),Xr[g.MY_PROFILE].test(this.router.url)&&(this.userInfos$.pipe(O(this.destroyer$)).subscribe(e=>{e.profile?.profileId!==this.profileId&&this.navigationService.goToHome()}),this.fromMyProfile=!0),this.pageType.type===y.CREATION&&this.changePending(!0),this.profile$=we(this.fetchProfile(this.profileId),this.profileRefresher$.pipe(He(()=>this.fetchProfile(this.profileId)))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}ngOnDestroy(){this.clearPending(),this.destroyer$.next(),this.destroyer$.complete()}fetchProfile(e){return this.userInfos$.pipe(O(this.destroyer$),He(i=>{this.headerTabs$=this.fetchHeaderTabs();let r=this.pageType.profile===rt.Extern&&i.profile?.profileId!==this.profileId;return e?this.profilesService.getProfile(this.profileId,r).pipe(J(m=>{this.profileCached=m,this.tags$.next(this.fetchHeaderTags(m)),this.computeHeaderRightMenuActions(),this.initUserInfo(m)})):(this.tags$.next([]),this.initUserInfo(void 0),Wt({}))}))}initUserInfo(e){this.userInfos$.pipe(O(this.destroyer$)).subscribe(i=>{this.isExpert=i.profile?.profileType===rt.Intern,this.isCurrentUser=i.profile?.profileId===this.profileId,this.expertGuard();let r=this.isExpert?e?.company?.id:i.profile.companyId;this.pageType.type===y.CREATION&&this.defaultCompany?.id&&(r=this.defaultCompany.id),this.initHeader(i,e?.fullName),this.model=Gt.defaultModel(r,e,this.translate.instant(`${this.translationKey}LOGIN_METHOD.CREATE_USER_PLACEHOLDER`)),r?this.companiesService.getCompany(r).pipe(O(this.destroyer$)).subscribe(m=>this.initForm(m)):this.initForm()})}fetchPageType(e){return{profile:this.activatedRoute.snapshot.params.profileType,type:e?y.READONLY:y.CREATION}}switchType(e){this.pageType=Ut(te({},this.pageType),{type:e}),this.generalInformationActions$.next(Ie.computeEditOrCreateActions(this.pageType.type)),this.initForm(void 0,!0)}expertGuard(){!this.isExpert&&this.activatedRoute.snapshot.params.profileType===rt.Intern&&this.navigationService.goToProfiles()}closeModal(){this.modalRef?.hide()}goBack(){this.fromDashboard||this.fromMyProfile?this.navigationService.goToDashboard():this.navigationService.goToProfiles()}fetchHeaderTabs(){let e=[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:ni.GENERAL_INFORMATION}];return this.pageType.type!==y.CREATION?this.hasGrantRevokeRolesPermission$.pipe(me(i=>(i&&e.push({label:{label:`${this.translationKey}HEADER.TABS.ROLES`},value:ni.ROLES}),e))):Wt(e)}fetchHeaderTags(e){let i=[];return e&&this.pageType.type===y.READONLY&&(i.push({label:{label:this.translationKey+(e.isActivated?"USER_ACTIVE":"USER_INACTIVE")},colorState:e.isActivated?z.VALID_LIGHT:z.ERROR_LIGHT}),e.profileAdmin?.isLocked&&i.push({label:{label:"COMMON.LOCKED"},colorState:z.WARN_LIGHT,icon:A.lock}),e.profileAdmin?.hasNeverLogged&&i.push({label:{label:"COMMON.NEVER_CONNECTED"},colorState:z.GREY})),i}refreshBreadcrumb(e,i){let r=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:this.fetchHeaderTitle(e,i)}];i||r.splice(1,0,{label:{label:"SHARED.BREADCRUMB.ADMIN.PROFILES"},url:`/${g.BASE}
1/${g.PROFILES}`}),this.breadcrumb$.next({show:!0,items:r})}initHeader(e,i){let r=e.profile?.profileId===this.profileId;this.headerTitle=this.fetchHeaderTitle(i,r),this.refreshBreadcrumb(i,r),we(this.formGroupInfo.valueChanges,this.formGroupMgmt.valueChanges,this.formGroupNotifications.valueChanges).pipe(ge(150),O(this.destroyer$)).subscribe(m=>{this.computeHeaderRightMenuActions()})}fetchHeaderTitle(e,i){return i?{label:this.translationKey+"TITLE_SELF"}:e?{label:e}:{label:this.translationKey+"CREATE_"+this.pageType.profile?.toUpperCase()}}computeHeaderRightMenuActions(){let e=`${this.translationKey}HEADER.ACTIONS.`,i=[];this.profileId&&this.pageType.profile===rt.Extern&&this.pageType.type===y.READONLY&&this.userInfos$.pipe(ye(1)).subscribe(r=>{r.profile?.profileId&&this.profileId!==r.profile?.profileId&&(this.profileCached?.profileAdmin&&(this.profileCached.profileAdmin.hasNeverLogged&&i.push({label:{label:`${e}RESET_TEMP_PWD`},id:At.RESET_TEMP_PWD}),this.profileCached.profileAdmin.isLocked&&i.push({label:{label:`${e}UNLOCK_USER`},id:At.UNLOCK_USER}),this.profileCached.profileAdmin.mfa!==yr.Disabled&&i.push({label:{label:`${e}DISABLE_MFA`},id:At.DISABLE_MFA})),i.push(this.profileCached?.isActivated?{label:{label:`${e}DEACTIVATE_USER`},color:z.ERROR,typeIfOneButton:M.DANGER,id:At.DEACTIVATE_USER}:{label:{label:`${e}ACTIVATE_USER`},id:At.ACTIVATE_USER}))}),this.headerRightMenuActions$.next(i)}onHeaderRightMenuActionClicked(e){switch(e.id){case At.ACTIVATE_USER:this.openUserActiveStatusEditionModal(!0);break;case At.DEACTIVATE_USER:this.openUserActiveStatusEditionModal(!1);break;case At.RESET_TEMP_PWD:this.resetTempPassword();break;case At.UNLOCK_USER:this.openUnlockUserConfirmationModal();break;case At.DISABLE_MFA:this.openDisableMfaConfirmationModal();break}}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{if(i){switch(this.selectedHeaderTabs$.getValue()){case ni.GENERAL_INFORMATION:this.cancelGeneralInformationEditMode();break;case ni.ROLES:this.clearPending();break}this.confirmTabChanged(e)}}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}openUserActiveStatusEditionModal(e){this.modalRef=this.modalService.show(We,{initialState:{title:{label:this.translationKey+"CONFIRM_"+(e?"ACTIVATE":"DEACTIVATE"),param:{userName:this.profileCached?.fullName??"-"}},contentLine1:{label:this.translationKey+"CONFIRM_LINE_"+(e?"ACTIVATE":"DEACTIVATE")},contentLine2:{label:"COMMON.CONTINUE_CONFIRMATION"},confirmationGetter:this.updateUserStatusGetter,confirmationGetterArgs:[e]}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{i.confirm&&this.profileRefresher$.next(),this.closeModal()})}resetTempPassword(){this.modalRef=this.modalService.show(xn,{initialState:{profileId:this.profileId}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(()=>this.closeModal())}openUnlockUserConfirmationModal(){let e="CONFIRM_UNLOCK_USER_MODAL.";this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}${e}TITLE`},contentLine1:{label:`${this.translationKey}${e}CONTENT`},contentLine2:{label:`${this.translationKey}${e}CONTENT2`},confirmationGetter:this.unlockUserGetter}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{i.confirm&&this.profileRefresher$.next(),this.closeModal()})}openDisableMfaConfirmationModal(){let e="CONFIRM_DISABLE_MFA_MODAL.";this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}${e}TITLE`},contentLine1:{label:`${this.translationKey}${e}CONTENT`},contentLine2:{label:"COMMON.CONTINUE_CONFIRMATION"},confirmationGetter:this.disableMfaGetter}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{i.confirm&&this.profileRefresher$.next(),this.closeModal()})}generalInformationActionClicked(e){switch(e.toString()){case Y.START_EDIT_MODE:this.startGeneralInformationEditMode();break;case Y.CANCEL_EDIT_MODE:this.cancelGeneralInformationEditMode();break;case Y.CANCEL_CREATION:this.clearPending(),this.goBack();break;case Y.SAVE_CHANGES:this.updateUser();break;case Y.CONFIRM_CREATION:this.createUser();break}}startGeneralInformationEditMode(){this.changePending(!0),this.modelBeforeEdition=te(te({},this.model),this.formValue),this.switchType(y.EDITION),this.tags$.next(this.fetchHeaderTags(this.profileCached))}cancelGeneralInformationEditMode(){this.clearPending(),this.model=this.modelBeforeEdition,this.switchType(y.READONLY),this.tags$.next(this.fetchHeaderTags(this.profileCached))}get formValue(){return te(te(te({},this.formGroupInfo.value),this.formGroupMgmt.value),this.formGroupNotifications.value)}initForm(e,i=!1){let r=this.pageType.profile===rt.Intern,m=this.pageType.type===y.READONLY;i||(this.companiesService.searchCompanies(new Zo({query:""})).pipe(O(this.destroyer$)).subscribe(v=>{this.companies$.next(v.items)}),this.companyItems$=this.searchCompanyHandler$.pipe(O(this.destroyer$),Le(v=>v&&this.isExpert?this.companiesService.searchCompanies(new Zo({query:v})).pipe(me(F=>F.items)):e&&this.isExpert?this.companies$.pipe(me(F=>(F?.push(e),F))):e&&!this.isExpert?this.companies$.pipe(me(F=>
1(F&&(F=[e]),F))):this.companies$),me(v=>(0,uo.orderBy)(v,[F=>F.name.toLowerCase()])),ne({bufferSize:1,refCount:!0}))),this.updateField(r,m,e?.id??this.formGroupMgmt.value[ba.COMPANY_ID])}updateField(e,i,r){this.fieldsInformation=Gt.getInformationForm(this.translationKey,this.jobFunctionItems,this.languageItems,e,i,this.pageType.type===y.CREATION),e||(this.fieldsManagement=Gt.getUserMgmtForm(this.translationKey,this.companyItems$,this.searchCompanyHandler$,r,this.mfaTypeItems,i,this.isExpert,this.isCurrentUser,this.pageType.type===y.CREATION),this.fieldsNotifications=Gt.getUserNotificationsForm(this.translationKey,i)),this.computeHeaderRightMenuActions(),this.formInit$.next(!0)}createUser(){if(this.formGroupMgmt.valid&&this.formGroupInfo.valid&&this.formGroupNotifications.valid)if(this.pageType.profile===rt.Intern)this.userInfos$.pipe(Le(e=>{let i=Gt.formToDto(this.formValue,this.pageType.profile,e.profile?.companyId);return this.switchType(y.SAVING_IN_PROGRESS),this.profilesService.createProfile(i)}),O(this.destroyer$)).subscribe({next:e=>{this.creationSuccess(e)},error:e=>{this.switchType(y.CREATION),this.handleDuplicateUsernameError(e)}});else{let e=Gt.formToDto(this.formValue,this.pageType.profile);this.switchType(y.SAVING_IN_PROGRESS),this.profilesService.createProfile(e).pipe(O(this.destroyer$)).subscribe({next:i=>{this.creationSuccess(i)},error:i=>{this.switchType(y.CREATION),this.handleDuplicateUsernameError(i)}})}}creationSuccess(e){this.errorHandlerService.displaySuccess(this.translationKey+"USER_CREATED"),this.clearPending(),this.surveysService.showSurveyAndPostResponse(),this.fromDashboard?this.navigationService.goToDashboard():this.redirectToDetail(e)}handleDuplicateUsernameError(e){e.status===409&&this.formGroupInfo.get(va.LOGIN)?.setErrors({duplicateLogin:!0})}redirectToDetail(e){let i=g.PROFILE_DEFINITION.replace(":profileType",this.pageType.profile).replace(":id",e.id?.toString());this.router.navigateByUrl("/",{skipLocationChange:!0}).then(()=>this.router.navigateByUrl(`${g.BASE}/${i}`))}updateUser(){let e=this.formValue.mfa;e&&e.mfaType!==e.previousMfaType&&e.mfaType==="app"&&!e.code?this.errorHandlerService.displayError(`${this.translationKey}MFA_APP_CODE_REQUIRED`):this.formGroupInfo.valid&&this.formGroupMgmt.valid&&this.formGroupNotifications.valid&&(this.switchType(y.SAVING_IN_PROGRESS),this.userInfos$.pipe(ye(1),Le(i=>{let r=this.pageType.profile===rt.Intern?i.profile.companyId:void 0,m=Gt.formToDtoEdition(this.formValue,this.pageType.profile,r);return this.profilesService.updateProfile(this.profileId,m)}),Le(()=>e&&(e.mfaType!==e.previousMfaType||e.code)?this.authenticationService.validateCode(e.mfaType,e.code):Wt(null)),O(this.destroyer$)).subscribe({next:()=>{this.switchType(y.READONLY),this.profileRefresher$.next(),this.clearPending()},error:i=>{i?.code==="EnableSoftwareTokenMFAException"&&this.errorHandlerService.displayError(`${this.translationKey}MFA_APP_CODE_ERROR`),this.switchType(y.EDITION)}}))}};o.\u0275fac=function(i){return new(i||o)(u(Dr),u(xe),u(Di),u(Ha),u(ce),u(Je),u(xt),u(w),u($t),u(Si),u(Ei),u(de),u(Zt))},o.\u0275cmp=R({type:o,selectors:[["biorius-profile-definition"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","onRightMenuActionClicked","clickOnReturn","title","rightButtons","rightMenuActions","breadcrumb","tags","tabs","defaultTab"],["id","content",1,"-content-detail-with-tabs"],[1,"container","pt-xxs","pb-xxl"],[3,"connectedUser","profile","searchProfileRolesTrigger","updateProfileRolesTrigger"],[1,"row","pt-m"],[1,"col-12"],["class","card p-m",4,"dsLoading"],[1,"row"],[1,"flex","flex-middle","flex-end","mt-m"],[3,"icon","iconPlacement","type","label","disabled","loading","ngClass"],[3,"clicked","icon","iconPlacement","type","label","disabled","loading","ngClass"],[1,"card","p-m"],[1,"flex","flex-top"],[1,"mt-xl"],[1,"icon","icon-user","-bg","-primary","mr-m","f-xl"],[1,"mt-xs","mb-m"],[1,"formly-col","formly-2-col"],[3,"formGroup"],[3,"form","fields","model"],[1,"icon","icon-list","-bg","-primary","mr-m","f-xl"],[1,"w-100"],[1,"flex"],[1,"formly-col"],[1,"icon","icon-notification","-bg","-primary","mr-m","f-xl"],[3,"changePendingEmitter","connectedUser","profile","searchProfileRolesTrigger","updateProfileRolesTrigger"]],template:function(i,r){i&1&&Z(0,Um,12,22,"ng-container",0),i&2&&d("dsLoading",r.profile$)},dependencies:[j,$,Q,U,K,Me,ie,q,Jn,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var cr=t=>({label:t});function Km(t,o){if(t&1){let n=b();a(0,"div",4)(1,"ds-tab",12),h("selectionChanged",function(i){S(n);let r=c(2);return T(r.tabChanged(i))}),s()()}if(t&2){let n=c(),e=c();l(),d("tabs",e.tabs)("defaultValue",n)}}function jm(t,o){if(t&1){let n=b();a(0,"ds-button",13),p(1,"async"),h("clicked",function(){S(n);let i=c(2);return T(i.createUser(i.ProfileTabListType.EXTERNAL_USERS))}),s()}if(t&2){let n=c(2);d("icon",n.DS_IconsEnum.plus)("label",E(4,cr,n.translationKey+"CREATE_EXTERNAL_USER"+(f(1,2,n.isIntern$)?"_AS_BIORIUS":"")))}}function qm(t,o){if(t&1){let n=b();a(0,"ds-button",13),h("clicked",function(){S(n);let i=c(2);return T(i.createUser(i.ProfileTabListType.BIORIUS_USERS))}),s()}if(t&2){let n=c(2);d("icon",n.DS_IconsEnum.plus)("label",E(2,cr,n.translationKey+"CREATE_BIORIUS_USER"))}}function Ym(t,o){if(t&1){let n=b();a(0,"div",3)(1,"div",14)(2,"div")(3,"ds-simple-table",15),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToUser(i))}),s()()()()}if(t&2){let n=o.dsLoading,e=c(2);l(3),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("isLoadingAfterScroll",e.isLoadingAfterScroll)("headers",e.headers)("data",n)("clickable",!0)}}
1function Qm(t,o){if(t&1){let n=b();a(0,"div",2)(1,"div",3),_(2,Km,2,2,"div",4),p(3,"async"),s(),a(4,"div",5)(5,"div",6)(6,"biorius-profiles-search",7),p(7,"async"),h("query",function(i){S(n);let r=c();return T(r.onQuery(i))}),s()(),a(8,"div",8)(9,"div",9),_(10,jm,2,6,"ds-button",10)(11,qm,1,4,"ds-button",10),s()()(),Z(12,Ym,4,5,"div",11),s()}if(t&2){let n,e,i=o,r=c();l(2),C((n=f(3,4,r.isIntern$))?2:-1,n),l(4),d("prefillQuery",(e=f(7,6,r.filterProfileService.filterProfilesUpdate$))==null?null:e.query),l(4),C(i===r.ProfileTabListType.EXTERNAL_USERS?10:i===r.ProfileTabListType.BIORIUS_USERS?11:-1),l(2),d("dsLoading",r.profiles$)}}var ho=(()=>{let o=class o{constructor(e,i,r,m){this.profilesService=e,this.userProfileService=i,this.navigationService=r,this.filterProfileService=m,this.translationKey="ADMINISTRATION.PROFILES.",this.profilesBucket=[],this.isLoadingAfterSearch=!1,this.isLoadingAfterScroll=!1,this.tableBaseTranslationKey=v=>`SHARED.TABLE.${v}`,this.tabTranslationKey=v=>`${this.translationKey}TABS.${v}`,this.breadcrumb$=new I({show:!1,items:[]}),this.ProfileTabListType=yt,this.DS_IconsEnum=A,this.destroyer$=new P}ngOnInit(){this.initBreadcrumb(),this.isIntern$=this.userProfileService.isIntern$.pipe(O(this.destroyer$),J(i=>{this.buildTabFromProfileType(i?rt.Intern:rt.Extern),this.filterProfileService.init(i)}),ne({bufferSize:1,refCount:!0}));let e=this.filterProfileService.filterProfilesUpdate$.getValue();e.scrollEvent=!1,this.filterProfileService.filterProfilesUpdate$.next(e),this.profiles$=this.fetchProfiles()}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete(),this.filterProfileService.clearScrollEvent()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.PROFILES"}}];this.breadcrumb$.next({show:!0,items:e})}fetchProfiles(){let e=()=>this.filterProfileService.scrollPagination$.getValue(),i=r=>r===yt.BIORIUS_USERS?rt.Intern:rt.Extern;return this.filterProfileService.filterProfilesUpdate$.pipe(O(this.destroyer$),Le(r=>{this.isLoadingAfterSearch=!r.scrollEvent,this.isLoadingAfterScroll=r.scrollEvent;let m=r.scrollEvent?e().page+1:0,v=r.query;return v||(v=new _n({})),v.type=i(r.selectedTab),v.page=new da({page:m,size:Be.searchPageSize}),this.profilesService.searchProfiles(v)}),me(r=>{let m=i(this.filterProfileService.selectedTab);this.buildHeadersFromUserType(m),this.filterProfileService.scrollPagination$.next(r.pagination);let v=r.profiles;return this.isLoadingAfterSearch=!1,this.isLoadingAfterScroll=!1,r.pagination?.page!==0?(this.profilesBucket=this.profilesBucket.length?[...this.profilesBucket,...v]:v,this.profilesBucket):v?.length?(this.profilesBucket=[...v],this.filterProfileService.lastSearchPosition=0,v):[]}),ne({bufferSize:1,refCount:!0}))}buildTabFromProfileType(e){e===rt.Intern?this.tabs=[{label:{label:this.tabTranslationKey(yt.EXTERNAL_USERS)},value:yt.EXTERNAL_USERS},{label:{label:this.tabTranslationKey(yt.BIORIUS_USERS)},value:yt.BIORIUS_USERS}]:this.tabs=[{label:{label:this.tabTranslationKey(yt.COMPANY_USERS)},value:yt.EXTERNAL_USERS}]}buildHeadersFromUserType(e){let i=[{label:this.tableBaseTranslationKey("FULL_NAME"),value:r=>r.fullName,isStrong:!0},{label:this.tableBaseTranslationKey("LOGIN"),value:r=>r.login},{label:this.tableBaseTranslationKey("EMAIL"),value:r=>r.email}];e===rt.Extern&&i.push({label:this.tableBaseTranslationKey("COMPANY"),value:r=>r.companyName}),i.push({label:this.tableBaseTranslationKey("STATUS"),value:r=>r.isDisabledString,hasIsInactiveBadge:r=>!r.isActivated,hasIsActiveBadge:r=>!!r.isActivated}),this.headers=i}goBack(){this.navigationService.goBack()}createUser(e){switch(e.toString()){case yt.EXTERNAL_USERS:this.navigationService.goToProfileDefinition(rt.Extern,"0");break;case yt.BIORIUS_USERS:this.navigationService.goToProfileDefinition(rt.Intern,"0");break;default:break}}onQuery(e){this.filterProfileService.onQuery(e)}tabChanged(e){this.filterProfileService.tabChanged(e)}onScrollDown(e){this.filterProfileService.onScrollDown(e)}goToUser(e){let i=this.filterProfileService.selectedTab===yt.BIORIUS_USERS?rt.Intern:rt.Extern;this.navigationService.goToProfileDefinition(i,e.id.toString())}};o.\u0275fac=function(i){return new(i||o)(u(Di),u(ce),u(w),u(Ja))},o.\u0275cmp=R({type:o,selectors:[["biorius-profiles"]],standalone:!1,decls:5,vars:10,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"-admin","pb-l",3,"scrolled","scrollWindow"],[1,"container-fluid","mt-xxs","px-m","vh-100"],[1,"row"],[1,"col-12","flex"],[1,"row","py-m"],[1,"col-10"],[3,"query","prefillQuery"],[1,"col-2"],[1,"flex","flex-end","mt-xxs"],[3,"icon","label"],["class","row",4,"dsLoading"],[3,"selectionChanged","tabs","defaultValue"],[3,"clicked","icon","label"],[1,"col-12"],[3,"rowClicked","ngClass","isLoadingAfterScroll","headers","data","clickable"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),_(3,Qm,13,8,"div",2),p(4,"async"),s()),i&2){let m;d("title",E(8,cr,r.translationKey+"TITLE"))("breadcrumb",f(1,4,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(),C((m=f(4,6,r.filterProfileService.selectedTab$))?3:-1,m)}},dependencies:[j,$,Ye,$e,ie,Nr,q,Dn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Wm=t=>({label:t}),fo=(()=>{let o=class o extends he{constructor(e,i,r,m){super(W.FORM,m,void 0,"ADMINISTRATION.SURVEY_CREATION.EXIT_MODAL_TITLE"),this.navigationService=e,this.surveysService=i,this.modalService=r,this.userProfileService=m,this.translationKey="ADMINISTRATION.SURVEY_CREATION.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerRightActions$=new I([]),this.isFormDisabled$=new I(!1),this.destroyer$=new P}ngOnInit(){this.initBreadcrumb(),this.updateRigthActions(!0)}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.MANAGE_SURVEYS"},url:`/${g.BASE}/${g.MANAGE_SURVEYS}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.SURVEY_CREATION"}}];this.breadcrumb$.next({show:!0,items:e})}updateRigthActions(e=!1,i=!1){this.headerRightActions$.next(this.fetchHeaderRightActions(e,i))}fetchHeaderRightActions(e=!0,i=!1){return[{label:{label:`${this.translationKey}PUBLISH_BTN`},type:M.PRIMARY,eventType:_e.CONFIRM,loading:i,disabled:e}]}onHeaderRightActionClicked(e){e===_e.CONFIRM&&this.openConfirmModal(te({},this.newSurvey))}onUpdateSurvey(e){this.newSurvey=te({},e),this.changePending(!!e.imageBase64?.length||!!e.question?.length),this.updateRigthActions(!e.question?.length)}openConfirmModal(e){this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}CONFIRM_TITLE`},contentLine1:{label:`${this.translationKey}CONFIRM_LINE1`},contentLine2:{label:`${this.translationKey}CONFIRM_LINE2`},confirmButtonText:`${this.translationKey}CONFIRM_YES_BTN`}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{this.closeModal(),i.confirm&&this.sendNewSurvey(e)})}sendNewSurvey(e){this.updateRigthActions(!1,!0),this.isFormDisabled$.next(!0),this.surveysService.createSurvey(ma.fromForm(e)).pipe(O(this.destroyer$)).subscribe({next:()=>{this.clearPending(),this.navigationService.goToManageSurveys(!0)},error:()=>{this.updateRigthActions(),this.isFormDisabled$.next(!1)}})}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ei),u(xe),u(ce))},o.\u0275cmp=R({type:o,selectors:[["biorius-survey-creation"]],standalone:!1,features:[V],decls:11,vars:15,consts:[[3,"onRightButtonClicked","clickOnReturn","title","breadcrumb","rightButtons"],["id","content",1,"pt-xl","pb-l"],[1,"row","mx-l","mt-m"],[1,"col-12","col-lg-9"],[3,"onUpdateSurveyForm","isFormDisabled"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),p(2,"async"),h("onRightButtonClicked",function(v){return r.onHeaderRightActionClicked(v)})("clickOnReturn",function(){return r.goBack()}),s(),a(3,"div",1)(4,"div",2)(5,"div",3)(6,"h2"),G(7),p(8,"translate"),s(),a(9,"biorius-survey-form",4),p(10,"async"),h("onUpdateSurveyForm",function(v){return r.onUpdateSurvey(v)}),s()()()()),i&2&&(d("title",E(13,Wm,r.translationKey+"TITLE"))("breadcrumb",f(1,5,r.breadcrumb$))("rightButtons",f(2,7,r.headerRightActions$)),l(7),re(f(8,9,r.translationKey+"PREVIEW_TITLE")),l(2),d("isFormDisabled",!!f(10,11,r.isFormDisabled$)))},dependencies:[$,ja,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var _o=gt(Pt());var bs=t=>({label:t});function zm(t,o){if(t&1){let n=b();a(0,"div",10)(1,"ds-simple-table",11),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i.id))}),s()()}if(t&2){let n=c().dsLoading;l(),d("headers",o)("data",n)("clickable",!0)}}function Xm(t,o){if(t&1&&(a(0,"div",9),_(1,zm,2,3,"div",10),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Co=(()=>{let o=class o{constructor(e,i){this.navigationService=e,this.tagsStore=i,this.translationKey="ADMINISTRATION.ALL_TAGS.",this.breadcrumb$=new I({show:!1,items:[]}),this.update$=new I(new hn({isDisabled:!1})),this.tableBaseTranslationKey=r=>"SHARED.TABLE."+r,this.headers$=new I([]),this.DS_IconsEnum=A,this.destroyer$=new P}ngOnInit(){this.initBreadcrumb(),this.allTags$=this.fetchAllTags(),this.headers$.next(this.buildHeaders())}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete()}fetchAllTags(){return this.update$.pipe(O(this.destroyer$),Le(e=>this.tagsStore.tagsByType$.pipe(me(i=>{let r=[];for(let m in i)r.push(...i[m]);return(0,_o.orderBy)(this.filteredTags(r,e),[m=>m.name.toLowerCase()])}))),ne({bufferSize:1,refCount:!0}))}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_TAGS"}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("LABEL"),value:e=>e.name,isStrong:!0},{label:this.tableBaseTranslationKey("TAG_TYPE"),value:e=>e.getTypeString},{label:this.tableBaseTranslationKey("STATUS"),value:e=>e.isDisabledString,hasIsInactiveBadge:e=>e.isDisabled,hasIsActiveBadge:e=>!e.isDisabled}]}onCreateTagClicked(){this.navigationService.goToTagCreation()}onSearchQueryChange(e){this.update$.next(e)}goBack(){this.navigationService.goBack()}goToDetails(e){this.navigationService.goToTagDetail(e)}filteredTags(e,i){return e.filter(r=>{let m=!0,v=!0,F=!0;return i.name?.length&&(m=mi.containsSubString(r.name,i.name)),(0,_o.isNil)(i.isDisabled)||(v=r.isDisabled===i.isDisabled),i.types?.length&&(F=i.types.some(ae=>r.type===ae)),m&&v&&F})}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Qe))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-all-tags"]],standalone:!1,decls:10,vars:11,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"search-results","-admin"],[1,"container","pb-xl","pt-m"],[1,"row","pb-m"],[1,"col-10"],[3,"query"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","icon"],["class","row",4,"dsLoading"],[1,"row"],[1,"col-12"],[3,"rowClicked","headers","data","clickable"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"biorius-tags-search",5),h("query",function(v){return r.onSearchQueryChange(v)}),s()(),a(7,"div",6)(8,"ds-button",7),h("clicked",function(){return r.onCreateTagClicked()}),s()()(),Z(9,Xm,3,3,"div",8),s()()),i&2&&(d("title",E(7,bs,r.translationKey+"TITLE"))("breadcrumb",f(1,5,r.breadcrumb$)),l(8),d("label",E(9,bs,r.translationKey+"CREATE_TAG"))("icon",r.DS_IconsEnum.plus),l(),d("dsLoading",r.allTags$))},dependencies:[$,$e,ie,q,Pn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Jm=t=>({label:t});
1function Zm(t,o){if(t&1&&N(0,"biorius-tag-form",4),t&2){let n=c(2);d("formGroup",n.formGroup)("fields",n.fields)("model",n.model)}}function ep(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),h("onRightButtonClicked",function(i){S(n);let r=c();return T(r.actionClicked(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(5,"div",2)(6,"div",3),_(7,Zm,1,3,"biorius-tag-form",4),s()(),Ke()}if(t&2){let n=o.dsLoading,e=c();l(),d("title",E(11,Jm,n.name))("rightButtons",f(2,5,e.headerActions$))("breadcrumb",f(3,7,e.breadcrumb$))("tags",f(4,9,e.headerTags$)),l(6),C(e.formGroup&&e.fields?7:-1)}}var go=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae){super(W.FORM,e,void 0,"ADMINISTRATION.TAG_DETAIL.EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.tagsStore=m,this.tagsService=v,this.translateService=F,this.modalService=ae,this.translationKey="ADMINISTRATION.TAG_DETAIL.",this.pageType=y.READONLY,this.refreshTag$=new P,this.headerActions$=new I([]),this.breadcrumb$=new I({show:!1,items:[]}),this.headerTags$=new I([]),this.formGroup=new H({}),this.model={},this.modelBeforeEdition={},this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.destroyer$=new P,this.unableToDeactivateTagTypes=[ti.Region,ti.DocumentRequestReason,ti.CompliantReason],this.updateTagStatusTagGetter=()=>{let Ce=new er({name:this.cachedTag.name,isDisabled:!this.cachedTag.isDisabled});return this.tagsService.updateTag(this.tagId,Ce).pipe(J(ot=>this.tagsStore.init()))}}ngOnInit(){this.tagId=+this.activatedRoute.snapshot.params.id,this.initTagFetch(),this.initListeners()}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initTagFetch(){this.tag$=we(this.fetchTag(this.tagId),this.refreshTag$.pipe(He(()=>this.fetchTag(this.tagId)))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}fetchTag(e){return this.tagsService.getTag(e).pipe(J(i=>{this.cachedTag=i,this.refreshBreadcrumb(this.cachedTag),this.headerTags$.next(this.fetchHeaderTags(this.cachedTag)),this.headerActions$.next(this.fetchHeaderActions(this.cachedTag)),this.initFormModel(this.cachedTag),this.fields=this.fetchFields()}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_TAGS"},url:`/${g.BASE}/${g.ALL_TAGS}`},{label:{label:e.name}}];this.breadcrumb$.next({show:!0,items:i})}fetchHeaderTags(e){return this.pageType===y.READONLY?[{label:{label:e.isDisabled?"COMMON.DEACTIVATED":"COMMON.ACTIVE"},colorState:e.isDisabled?z.ERROR_LIGHT:z.VALID_LIGHT,isLight:!0}]:[]}fetchHeaderActions(e,i=!1){let r=[];switch(this.pageType.toString()){case y.EDITION:r.push({label:{label:`${this.translationKey}HEADER_ACTIONS.CANCEL_UPDATE`},type:M.SECONDARY,eventType:It.CANCEL_UPDATE,disabled:i},{label:{label:`${this.translationKey}HEADER_ACTIONS.CONFIRM_UPDATE`},type:M.PRIMARY,eventType:It.CONFIRM_UPDATE,disabled:!this.formGroup.valid,loading:i});break;case y.READONLY:this.unableToDeactivateTagTypes.some(m=>m===e.type)||r.push({label:{label:`COMMON.${e.isDisabled?"REACTIVATE":"DEACTIVATE"}`},type:e.isDisabled?M.VALID:M.DANGER,eventType:e.isDisabled?It.REACTIVATE_TAG:It.DEACTIVATE_TAG}),r.push({label:{label:`${this.translationKey}HEADER_ACTIONS.START_UPDATE_TAG`},type:M.PRIMARY,eventType:It.START_UPDATE_TAG});break}return r}initListeners(){this.formGroup.valueChanges.pipe(O(this.destroyer$)).subscribe(e=>{this.headerActions$.next(this.fetchHeaderActions(this.cachedTag))})}initFormModel(e){this.model=e.toEditFormModel(),this.modelBeforeEdition=te({},this.model)}fetchFields(){return[Ci.tagName(this.pageType===y.READONLY),Ci.tagType(this.translateService,!0)]}switchType(e){this.pageType=e,this.headerActions$.next(this.fetchHeaderActions(this.cachedTag)),this.fields=this.fetchFields()}actionClicked(e){switch(e.toString()){case It.START_UPDATE_TAG:this.changePending(!0),this.modelBeforeEdition=te({},this.model),this.switchType(y.EDITION);break;case It.CONFIRM_UPDATE:this.updateTag();break;case It.CANCEL_UPDATE:this.clearPending(),this.model=te({},this.modelBeforeEdition),this.switchType(y.READONLY);break;case It.REACTIVATE_TAG:case It.DEACTIVATE_TAG:this.changeDisabledStatus();break}}updateTag(){this.headerActions$.next(this.fetchHeaderActions(this.cachedTag,!0)),this.tagsService.updateTag(this.tagId,er.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:e=>
1{this.tagsStore.init(),this.refreshTag$.next(),this.clearPending(),this.switchType(y.READONLY)},error:e=>{this.headerActions$.next(this.fetchHeaderActions(this.cachedTag,!1))}})}changeDisabledStatus(){let e=`CONFIRM_CHANGE_STATUS_MODAL.${this.cachedTag.isDisabled?"REACTIVATE.":"DEACTIVATE."}`;this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}${e}TITLE`,param:{tagName:this.cachedTag.name}},contentLine1:{label:`${this.translationKey}${e}CONTENT`},contentLine2:{label:`${this.translationKey}${e}CONTENT2`},confirmationGetter:this.updateTagStatusTagGetter}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{i.confirm&&this.refreshTag$.next(),this.closeModal()})}closeModal(){this.modalRef?.hide()}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Qe),u(gn),u(xt),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-tag-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onRightButtonClicked","clickOnReturn","title","rightButtons","breadcrumb","tags"],["id","content",1,"-admin","pt-l","pb-l"],[1,"container"],[3,"formGroup","fields","model"]],template:function(i,r){i&1&&Z(0,ep,8,13,"ng-container",0),i&2&&d("dsLoading",r.tag$)},dependencies:[$,U,K,ie,Oi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var tp=t=>({label:t});function ip(t,o){if(t&1&&N(0,"biorius-tag-form",3),t&2){let n=c();d("formGroup",n.formGroup)("fields",n.fields)("model",n.model)}}var So=(()=>{let o=class o extends he{constructor(e,i,r,m,v){super(W.FORM,e,void 0,"ADMINISTRATION.TAG_CREATION.EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.tagsStore=r,this.tagsService=m,this.translateService=v,this.translationKey="ADMINISTRATION.TAG_CREATION.",this.headerActions$=new I([]),this.breadcrumb$=new I({show:!1,items:[]}),this.formGroup=new H({}),this.model={},this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.destroyer$=new P}ngOnInit(){this.changePending(!0),this.refreshBreadcrumb(),this.fields=this.fetchFields(),this.headerActions$.next(this.fetchHeaderActions(!0)),this.initListeners()}ngOnDestroy(){this.clearPending(),this.destroyer$.next(),this.destroyer$.complete()}refreshBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_TAGS"},url:`/${g.BASE}/${g.ALL_TAGS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}fetchHeaderActions(e=!1,i=!1){return[{label:{label:`${this.translationKey}HEADER_ACTIONS.CANCEL_CREATION`},type:M.SECONDARY,eventType:Y.CANCEL_CREATION,disabled:i},{label:{label:`${this.translationKey}HEADER_ACTIONS.CONFIRM_CREATION`},type:M.PRIMARY,eventType:Y.CONFIRM_CREATION,disabled:e,loading:i}]}initListeners(){this.formGroup.valueChanges.pipe(O(this.destroyer$)).subscribe(e=>{this.headerActions$.next(this.fetchHeaderActions(!this.formGroup.valid))})}fetchFields(){return[Ci.tagName(),Ci.tagType(this.translateService)]}actionClicked(e){switch(e.toString()){case Y.CONFIRM_CREATION:this.createTag();break;case Y.CANCEL_CREATION:this.clearPending(),this.goBack();break}}createTag(){this.headerActions$.next(this.fetchHeaderActions(!1,!0)),this.tagsService.createTag(ua.fromForm(this.model)).pipe(O(this.destroyer$)).subscribe({next:e=>{this.tagsStore.init(),this.clearPending(),this.navigationService.goToTagDetail(e.id,!0)},error:e=>{this.headerActions$.next(this.fetchHeaderActions())}})}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Qe),u(gn),u(xt))},o.\u0275cmp=R({type:o,selectors:[["biorius-tag-creation"]],standalone:!1,features:[V],decls:6,vars:10,consts:[[3,"onRightButtonClicked","clickOnReturn","title","rightButtons","breadcrumb"],["id","content",1,"-admin","pt-l","pb-l"],[1,"container"],[3,"formGroup","fields","model"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),p(2,"async"),h("onRightButtonClicked",function(v){return r.actionClicked(v)})("clickOnReturn",function(){return r.goBack()}),s(),a(3,"div",1)(4,"div",2),_(5,ip,1,3,"biorius-tag-form",3),s()()),i&2&&(d("title",E(8,tp,r.translationKey+"TITLE"))("rightButtons",f(1,4,r.headerActions$))("breadcrumb",f(2,6,r.breadcrumb$)),l(5),C(r.formGroup&&r.fields?5:-1))},dependencies:[$,U,K,Oi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Rs=gt(Pt());var np=t=>({label:t});function op(t,o){if(t&1){let n=b();a(0,"biorius-document-requests-search",7),h("query",function(i){S(n);let r=c();return T(r.onQuery(i))}),s()}t&2&&d("documentTypesItems",o)}function rp(t,o){if(t&1){let n=b();a(0,"div",4)(1,"ds-simple-table",9),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function ap(t,o){if(t&1&&(a(0,"div",8),_(1,rp,2,5,"div",4),p(2,"async"),s()),t&2){let n,e=c();
1l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var To=(()=>{let o=class o extends nt{constructor(e,i,r){super(),this.navigationService=e,this.documentRequestsService=i,this.documentTypesService=r,this.translationKey="ADMINISTRATION.ALL_DOCUMENT_REQUESTS.",this.DS_IconsEnum=A,this.breadcrumb=Re({show:!1,items:[]}),this.initSearchGetter(),this.initBreadcrumb()}ngOnInit(){super.ngOnInit(),this.headers$.next(this.buildHeaders()),this.allDocumentTypesItems$=this.fetchDocumentTypesItems()}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new on(e?te({},e):{});return r.page=i,this.documentRequestsService.searchDocumentRequests(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_DOCUMENT_REQUESTS"}}];this.breadcrumb.set({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("NAME"),value:e=>e.tagName,isStrong:!0},{label:this.tableBaseTranslationKey("TAG_TYPE"),value:e=>en(e.tagType)},{label:this.tableBaseTranslationKey("DOCUMENT_TYPE"),value:e=>e.documentType?.code},{label:this.tableBaseTranslationKey("ACTIVATION_STATUS"),value:e=>e.isActiveString,isMini:!0,hasIsInactiveBadge:e=>!e.isActive,hasIsActiveBadge:e=>e.isActive}]}fetchDocumentTypesItems(){return this.documentTypesService.getAllDocumentTypes([Kt.InputRawMaterial,Kt.InputFinishedProduct]).pipe(me(e=>(0,Rs.orderBy)([...e.inputRawMaterial??[],...e.inputFinishedProduct??[]],i=>i.code?.toLowerCase()).map(i=>({value:i,label:i.code}))))}goToDetails(e){this.navigationService.goToDocumentRequestDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Sn),u(yi))},o.\u0275cmp=R({type:o,selectors:[["biorius-all-document-requests"]],standalone:!1,features:[V],decls:8,vars:10,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-12"],[3,"documentTypesItems"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[3,"query","documentTypesItems"],[1,"row"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),h("clickOnReturn",function(){return r.goBack()}),s(),a(1,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(2,"div",2)(3,"div",3)(4,"div",4),_(5,op,1,1,"biorius-document-requests-search",5),p(6,"async"),s()(),Z(7,ap,3,3,"div",6),s()()),i&2){let m;d("title",E(8,np,r.translationKey+"TITLE"))("breadcrumb",r.breadcrumb()),l(),d("scrollWindow",!1),l(4),C((m=f(6,6,r.allDocumentTypesItems$))?5:-1,m),l(2),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0)}},dependencies:[j,$,Ye,$e,ie,wn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var sp=t=>({label:t});function lp(t,o){if(t&1){let n=b();a(0,"div",3)(1,"biorius-document-request-configurations-tab",4),h("changePendingEmitter",function(i){S(n);let r=c(3);return T(r.onChangeEditionMode(i))})("onExportComponentsClickedEmitter",function(){S(n);let i=c(3);return T(i.exportComponents())}),s()()}if(t&2){let n=c(2).dsLoading,e=c();l(),d("documentRequest",n)("updateDocumentRequestGetter",e.updateDocumentRequestGetter)("openServicesSelectionModalGetter",e.openServicesSelectionModalGetter)("openComponentsSelectionModalGetter",e.openComponentsSelectionModalGetter)("openCategoriesSelectionModalGetter",e.openCategoriesSelectionModalGetter)("documentTypes",o)}}function cp(t,o){if(t&1&&(_(0,lp,2,6,"div",3),p(1,"async")),t&2){let n,e=c(2);C((n=f(1,1,e.documentTypes$))?0:-1,n)}}function dp(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("onRightButtonClicked",function(i){S(n);let r=c();return T(r.actionHeaderClicked(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(7,"div",2),_(8,cp,2,3),p(9,"async"),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(19,sp,e.tagName))("breadcrumb",f(2,7,i.breadcrumb$))("tags",f(3,9,i.headerTags$))("tabs",f(4,11,i.headerTabs$)??void 0)("defaultTab",f(5,13,i.selectedHeaderTabs$))("rightButtons",f(6,15,i.headerActions$)),l(7),C((n=f(9,17,i.selectedHeaderTabs$))===i.DocumentRequestDetailHeaderTab.CONFIGURATIONS?8:-1)}}var Eo=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae,Ce,ot){super(W.FORM,e),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.documentRequestsService=m,this.categoriesService=v,this.pendingChangesGuard=F,this.documentTypesService=ae,this.errorHandlerService=Ce,this.modalService=ot,this.translationKey="ADMINISTRATION.DOCUMENT_REQUEST_DETAIL.",this.pageType=y.READONLY,this.documentRequestRefresher$=new P,this.breadcrumb$=new I({show:!1,items:[]}),this.headerTags$=new I([]),this.headerTabs$=new I(void 0),this.headerActions$=new I([]),this.selectedHeaderTabs$=new I(ln.CONFIGURATIONS),this.DocumentRequestDetailHeaderTab=ln,this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.destroyer$=new P,this.updateDocumentRequestStatusGetter=()=>this.documentRequestsService.updateDocumentRequestStatus(this.documentRequestId,!this.cachedDocumentRequest?.isActive),this.updateDocumentRequestGetter=(Ct,oi)=>this.documentRequestsService.updateDocumentRequest(oi,Ct).pipe(J(()=>{this.documentRequestRefresher$.next()})),this.openServicesSelectionModalGetter=Ct=>(this.modalRef=this.modalService.show(bi,{initialState:{selectedServices:Ct},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$),J(()=>{this.closeModal()}))),this.openComponentsSelectionModalGetter=Ct=>(this.modalRef=this.modalService.show(Ya,{initialState:{selectedComponents:Ct,isIntern:!0},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$),J(()=>{this.closeModal()}))),this.openCategoriesSelectionModalGetter=Ct=>this.categoriesService.getCategories(!1).pipe(ye(1),Le(oi=>(this.modalRef=this.modalService.show(Wa,{initialState:{selectedCategories:Ct,allCategories:oi},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$),J(()=>{this.closeModal()}))))),this.documentTypes$=this.fetchAllRawMaterialDocumentTypes()}ngOnInit(){this.documentRequestId=+this.activatedRoute.snapshot.params.id,this.initDocumentRequestFetch(),this.headerTabs$.next(this.fetchHeaderTabs())}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initDocumentRequestFetch(){this.documentRequest$=we(this.fetchDocumentRequest(this.documentRequestId),this.documentRequestRefresher$.pipe(He(()=>this.fetchDocumentRequest(this.documentRequestId)))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}fetchHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.CONFIGURATIONS`},value:ln.CONFIGURATIONS}]}fetchDocumentRequest(e){return this.documentRequestsService.getDocumentRequest(e).pipe(J(i=>{this.cachedDocumentRequest=i,this.refreshBreadcrumb(this.cachedDocumentRequest),this.headerTags$.
1next(this.fetchHeaderTags(this.cachedDocumentRequest)),this.headerActions$.next(this.fetchHeaderActions(this.cachedDocumentRequest))}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_DOCUMENT_REQUESTS"},url:`/${g.BASE}/${g.ALL_DOCUMENT_REQUESTS}`},{label:{label:e.tagName}}];this.breadcrumb$.next({show:!0,items:i})}fetchHeaderTags(e){return[{label:{label:e.isActive?"COMMON.ACTIVE":"COMMON.DEACTIVATED"},colorState:e.isActive?z.VALID_LIGHT:z.ERROR_LIGHT,isLight:!0}]}fetchHeaderActions(e){let i=[];return this.pageType===y.READONLY&&i.push({label:{label:`COMMON.${e.isActive?"DEACTIVATE":"REACTIVATE"}`},type:e.isActive?M.DANGER:M.VALID,eventType:e.isActive?Vi.DEACTIVATE_DOCUMENT_REQUEST:Vi.REACTIVATE_DOCUMENT_REQUEST}),i}fetchAllRawMaterialDocumentTypes(){return this.documentTypesService.getAllDocumentTypes([Kt.InputRawMaterial,Kt.InputFinishedProduct])}actionHeaderClicked(e){switch(e.toString()){case Vi.REACTIVATE_DOCUMENT_REQUEST:case Vi.DEACTIVATE_DOCUMENT_REQUEST:this.changeDisabledStatus();break}}changeDisabledStatus(){let e=`CONFIRM_CHANGE_STATUS_MODAL.${this.cachedDocumentRequest.isActive?"DEACTIVATE.":"REACTIVATE."}`;this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}${e}TITLE`,param:{tagName:this.cachedDocumentRequest.tagName}},contentLine1:{label:`${this.translationKey}${e}CONTENT`},contentLine2:{label:`${this.translationKey}${e}CONTENT2`},confirmationGetter:this.updateDocumentRequestStatusGetter}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{i.confirm&&this.documentRequestRefresher$.next(),this.closeModal()})}exportComponents(){let e=new P,i=()=>{e.next(),e.complete()},r=`${this.cachedDocumentRequest.tagName} - Components`;this.errorHandlerService.displayInfiniteProgress(e,`${r}.xlsx`,"COMMON.GENERATE_FILE"),this.documentRequestsService.exportDocumentRequestConfiguration(this.documentRequestId,r).pipe(O(this.destroyer$)).subscribe({next:()=>{i()},error:()=>{i()}})}onChangeEditionMode(e){this.pageType=e?y.EDITION:y.READONLY,this.changePending(e),this.headerActions$.next(this.fetchHeaderActions(this.cachedDocumentRequest))}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}closeModal(){this.modalRef?.hide()}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Sn),u(En),u(de),u(yi),u($t),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-document-request-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","onRightButtonClicked","clickOnReturn","title","breadcrumb","tags","tabs","defaultTab","rightButtons"],["id","content",1,"-content-detail-with-tabs"],[1,"container","pb-xl","pt-l"],[3,"changePendingEmitter","onExportComponentsClickedEmitter","documentRequest","updateDocumentRequestGetter","openServicesSelectionModalGetter","openComponentsSelectionModalGetter","openCategoriesSelectionModalGetter","documentTypes"]],template:function(i,r){i&1&&Z(0,dp,10,21,"ng-container",0),i&2&&d("dsLoading",r.documentRequest$)},dependencies:[$,ie,Ln,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Is=gt(Va());var dr=t=>({label:t}),mp=t=>({"-loading":t}),pp=(t,o)=>({"-dragOver":t,"-error":o}),up=t=>[t],hp=t=>({date:t});function fp(t,o){if(t&1){let n=b();a(0,"div",4)(1,"div",13)(2,"p",14),G(3),p(4,"date"),p(5,"translate"),s(),a(6,"div",15)(7,"ds-button",16),h("clicked",function(){S(n);let i=c(2);return T(i.exportCurrentCategoriesConfiguration())}),s()()()()}if(t&2){let n=c(),e=c();l(3),Ne(" ",je(5,8,e.translationKey+"LAST_EXPORT_DATE",E(11,hp,je(4,5,n.importedDate,"long")))," "),l(4),d("label",E(13,dr,e.translationKey+"EXPORT_FILE"))("icon",e.DS_IconsEnum.arrowDown)("iconPlacement",e.DS_IconPlacementEnum.before)("type",e.DS_ButtonTypeEnum.SECONDARY)}}function _p(t,o){t&1&&N(0,"div",10)}function Cp(t,o){t&1&&N(0,"div",11)}function gp(t,o){if(t&1&&(a(0,"p",17),G(1),p(2,"translate"),s(),a(3,"p",18),G(4),s(),a(5,"p",18),G(6),p(7,"translate"),s(),a(8,"div",19),N(9,"ds-button",20),s()),t&2){let n=c(2);l(),re(f(2,4,n.translationKey+"ERROR_FILE.TITLE")),l(3),re(o),l(2),re(f(7,6,n.translationKey+"ERROR_FILE.REUPLOAD_MSG")),l(3),d("label",E(8,dr,n.translationKey+"ERROR_FILE.TRY_AGAIN"))}}function Sp(t,o){if(t&1&&(a(0,"p"),G(1),p(2,"translate"),s(),N(3,"p",21),p(4,"translate")),t&2){let n=c(2);l(),re(f(2,2,n.translationKey+"DROP_TEMPLATE")),l(2),d("innerHtml",f(4,4,n.translationKey+"OR_SELECT"),Nt)}}function Tp(t,o){if(t&1){let n=b();a(0,"div",3),p(1,"async"),_(2,fp,8,15,"div",4),a(3,"div",5)(4,"div",6)(5,"div",7)(6,"div",8),p(7,"async"),h("fileOver",function(i){S(n);let r=c();return T(r.dragOver=i)})("fileDropped",function(i){S(n);let r=c();return T(r.openConfirmUploadFileModal(i))})("click",function(){S(n);let i=ri(16);return T(i.click())}
1),a(8,"div",9),_(9,_p,1,0,"div",10),p(10,"async"),St(11,Cp,1,0,"div",11),s(),_(12,gp,10,10),p(13,"async"),St(14,Sp,5,6),a(15,"input",12,0),li("ngModelChange",function(i){S(n);let r=c();return si(r.importedTemplateFile,i)||(r.importedTemplateFile=i),T(i)}),h("change",function(i){S(n);let r=c();return T(r.uploadFiles(i))}),s()()()()()()}if(t&2){let n,e=c();d("ngClass",E(16,mp,f(1,8,e.importLoading$))),l(2),C(o.importedDate?2:-1),l(4),d("ngClass",dt(18,pp,e.dragOver,f(7,10,e.errorUpload$))),l(3),C(f(10,12,e.errorUpload$)?11:9),l(3),C((n=f(13,14,e.errorUpload$))?12:14,n),l(3),d("accept",E(21,up,e.allowedContentType))("multiple",!1),ai("ngModel",e.importedTemplateFile)}}var yo=(()=>{let o=class o extends he{constructor(e,i,r,m,v){super(W.UPLOAD,e),this.userProfileService=e,this.navigationService=i,this.productCategoriesService=r,this.errorService=m,this.modalService=v,this.allowedContentType="application/json",this.translationKey="ADMINISTRATION.MANAGE_CATEGORIES.",this.dragOver=!1,this.errorUpload$=new I(null),this.lastImportInformation$=new I(null),this.importLoading$=new I(!1),this.breadcrumb$=new I({show:!1,items:[]}),this.DS_ButtonTypeEnum=M,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.destroyer$=new P,this.importLoading(!1),this.initBreadcrumb()}ngOnInit(){this.fetchLastImportData()}ngOnDestroy(){this.destroyer$.next(),this.destroyer$.complete(),this.closeModal()}fetchLastImportData(){this.productCategoriesService.getLastImportedCategoriesFileInformation().pipe(ye(1)).subscribe(e=>{this.lastImportInformation$.next(e)}),this.errorUpload$.next(null)}uploadFiles(e){if(e.target?.files?.length){let i=e.target.files;this.openConfirmUploadFileModal(i[0])}}exportCurrentCategoriesConfiguration(){this.productCategoriesService.exportCategoriesFile().subscribe(e=>{(0,Is.saveAs)(e,"currentCategories.json")})}goBack(){this.navigationService.goBack()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.MANAGE_CATEGORIES"}}];this.breadcrumb$.next({show:!0,items:e})}importCategoriesFile(e){if(e.type!==this.allowedContentType){this.errorUpload$.next("WRONG_FORMAT");return}else this.errorUpload$.next(null);this.importLoading(!0),this.productCategoriesService.importCategoriesFile(e).pipe(O(this.destroyer$)).subscribe({next:()=>{this.importLoading(!1),this.errorService.displaySuccess(`${this.translationKey}IMPORT_SUCCESS_MESSAGE`),this.fetchLastImportData()},error:i=>{this.importLoading(!1),this.manageImportError(i)}})}importLoading(e){this.importLoading$.next(e),this.changePending(e)}manageImportError(e){let i;if(e.error.errorType!==Yo.Technical&&(e.error=JSON.parse(e.error??"")),e.status===422){let r=e.error?pa.fromDto(e.error):void 0;r?.errorType===Yo.Business&&r?.businessError?.code===Tr.Generic&&this.errorUpload$.next(r.businessError.genericError)}else i=e;i&&this.errorService.displayServiceError(i)}openConfirmUploadFileModal(e){this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}CONFIRM_UPLOAD`},contentLine1:{label:`${this.translationKey}CONFIRMATION_LINE1`},contentLine2:{label:`${this.translationKey}CONFIRMATION_LINE2`},confirmButtonText:`${this.translationKey}CONFIRM_BUTTON`}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(i=>{this.closeModal(),i.confirm&&this.importCategoriesFile(e)})}closeModal(){this.modalRef?.hide(),this.importedTemplateFile=void 0}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(En),u($t),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-manage-categories"]],standalone:!1,features:[V],decls:5,vars:9,consts:[["fileInput",""],[3,"clickOnReturn","title","breadcrumb"],[1,"pb-xxl","mt-xxl","pt-xl"],[1,"card","-no-shadow","p-m","m-m",3,"ngClass"],[1,"row","mt-l","separator-bottom-large"],[1,"row","pt-l","pb-xs"],[1,"col-12","col-md-6","offset-md-3"],[1,"mt-m"],["ds-DragAndDropFile","",1,"file-upload","-big","my-l",3,"fileOver","fileDropped","click","ngClass"],[1,"flex","flex-center","mb-m","mt-s"],[1,"icon","icon-arrow-up","c-primary01","f-xl"],[1,"icon","icon-cross","c-error01","f-xl"],["clickStopPropagation","","type","file",2,"display","none",3,"ngModelChange","change","accept","multiple","ngModel"],[1,"pb-xl","col-12"],[1,"text-center","c-grey05","mb
1-xxs"],[1,"flex","flex-center"],[3,"clicked","label","icon","iconPlacement","type"],[1,"c-grey09","f-medium"],[1,"c-grey05","f-s"],[1,"flex","flex-center","mt-m","pb-s"],[3,"label"],[3,"innerHtml"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",1),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",2),_(3,Tp,17,23,"div",3),p(4,"async"),s()),i&2){let m;d("title",E(7,dr,r.translationKey+"TITLE"))("breadcrumb",f(1,3,r.breadcrumb$)),l(3),C((m=f(4,5,r.lastImportInformation$))?3:-1,m)}},dependencies:[j,$,Ri,ci,Oe,di,q,pi,x,Mt,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var As=t=>({label:t});function Ep(t,o){if(t&1){let n=b();a(0,"div",8)(1,"ds-simple-table",9),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function yp(t,o){if(t&1&&(a(0,"div",7),_(1,Ep,2,5,"div",8),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var vo=(()=>{let o=class o extends nt{constructor(e,i){super(),this.navigationService=e,this.monitoringTopicsService=i,this.translationKey="ADMINISTRATION.ALL_MONITORING_TOPICS.",this.DS_IconsEnum=A,this.DS_ButtonTypeEnum=M,this.DS_IconPlacementEnum=L,this.breadcrumb$=new I({show:!1,items:[]}),this.allowSearchOnEmptyQuery=!0,this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders())}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new ha(e?te({},e):{});return r.page=i,this.monitoringTopicsService.searchMonitoringTopics(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_MONITORING_TOPICS"}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("TITLE"),value:e=>e.title,isStrong:!0,isLarge:!0},{label:this.tableBaseTranslationKey("STATUS"),value:e=>nn(e.status)},{label:this.tableBaseTranslationKey("DEADLINE"),value:e=>jt.fromDateToDisplayedString(e.deadline,!1)},{label:this.tableBaseTranslationKey("LAST_FOLLOW_UP"),value:e=>jt.fromDateToDisplayedString(e.lastFollowUpDate,!1)},{label:this.tableBaseTranslationKey("NEXT_FOLLOW_UP"),value:e=>jt.fromDateToDisplayedString(e.nextFollowUpDate,!1)},{label:this.tableBaseTranslationKey("LAST_PRODUCTS_IMPORT"),value:e=>jt.fromDateToDisplayedString(e.lastProductsImportDate,!1)}]}onCreateMonitoringTopicClicked(){this.navigationService.goToMonitoringTopicCreation()}goToDetails(e){this.navigationService.goToMonitoringTopicDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ai))},o.\u0275cmp=R({type:o,selectors:[["biorius-all-monitoring-topics"]],standalone:!1,features:[V],decls:8,vars:15,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-s"],[1,"col-12","flex","flex-end"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(3,"div",2)(4,"div",3)(5,"div",4)(6,"ds-button",5),h("clicked",function(){return r.onCreateMonitoringTopicClicked()}),s()()(),Z(7,yp,3,3,"div",6),s()()),i&2&&(d("title",E(11,As,r.translationKey+"TITLE"))("breadcrumb",f(1,9,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(4),d("label",E(13,As,r.translationKey+"CREATE_BTN"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.plus)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0))},dependencies:[j,$,Ye,$e,ie,q,x],encapsulation:2,changeDetection:0});let t=o;return t})();var vp=t=>({label:t});function bp(t,o){if(t&1){let n=b();a(0,"biorius-monitoring-topic-general-info-form",5),h("changePendingEmitter",function(i){S(n);let r=c(2);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c().dsLoading,e=c();d("monitoringTopic",n)("updateMonitoringTopicGetter",e.updateMonitoringTopicGetter)}}function Rp(t,o){if(t&1){let n=b();a(0,"biorius-monitoring-topics-impacted-products",6),h("onImportImpactedProductsFileEmitter",function(i){S(n);let r=c(2);return T(r.onImportImpactedProductsFile(i))}),s()}if(t&2){let n=c().dsLoading;d("lastImportDate",n.lastProductsImportDate)}}function Ip(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())})("onRightButtonClicked",function(i){S(n);let r=c();return T(r.actionHeaderClicked(i))}),s(),a(7,"div",2),_(8,bp,1,2,"biorius-monitoring-topic-general-info-form",3),p(9,"async"),St
1(10,Rp,1,1,"biorius-monitoring-topics-impacted-products",4),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(19,vp,e.title))("breadcrumb",f(2,7,i.breadcrumb$))("tags",f(3,9,i.headerTags$))("tabs",f(4,11,i.headerTabs$)??void 0)("defaultTab",f(5,13,i.selectedHeaderTabs$))("rightButtons",f(6,15,i.headerActions$)),l(7),C((n=f(9,17,i.selectedHeaderTabs$))===i.MonitoringTopicDetailTab.GENERAL_INFORMATION?8:n===i.MonitoringTopicDetailTab.IMPACTED_PRODUCTS?10:-1)}}var bo=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae){super(W.FORM,e,void 0,"ADMINISTRATION.MONITORING_TOPIC.EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.monitoringTopicsService=m,this.pendingChangesGuard=v,this.modalService=F,this.errorHandlerService=ae,this.translationKey="ADMINISTRATION.MONITORING_TOPIC.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTags$=new I([]),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(Ui.GENERAL_INFORMATION),this.headerActions$=new I([]),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.MonitoringTopicDetailTab=Ui,this.refreshMonitoringTopic$=new P,this.destroyer$=new P,this.updateMonitoringTopicGetter=(Ce,ot)=>this.monitoringTopicsService.updateMonitoringTopic(Ce,ot).pipe(O(this.destroyer$),J(()=>this.refreshMonitoringTopic$.next())),this.cancelMonitoringTopicGetter=()=>this.monitoringTopicsService.cancelMonitoringTopic(this.monitoringTopicId).pipe(O(this.destroyer$),J(()=>this.refreshMonitoringTopic$.next())),this.importImpactedProductsGetter=Ce=>this.monitoringTopicsService.importImpactedProducts(this.monitoringTopicId,Ce).pipe(O(this.destroyer$),J(()=>{this.refreshMonitoringTopic$.next(),this.errorHandlerService.displaySuccess(`${this.translationKey}UPLOAD_PRODUCTS_SUCCESS`)}))}ngOnInit(){this.monitoringTopicId=+this.activatedRoute.snapshot.params.id,this.headerTabs$.next(this.fetchHeaderTabs()),this.initMonitoringTopicFetch()}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initMonitoringTopicFetch(){this.monitoringTopic$=we(this.fetchMonitoringTopic(this.monitoringTopicId),this.refreshMonitoringTopic$.pipe(He(()=>this.fetchMonitoringTopic(this.monitoringTopicId)))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}fetchMonitoringTopic(e){return this.monitoringTopicsService.getMonitoringTopic(e).pipe(J(i=>{this.refreshBreadcrumb(i),this.headerTags$.next(this.fetchHeaderTags(i)),this.headerActions$.next(this.fetchHeaderActions(i))}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_MONITORING_TOPICS"},url:`/${g.BASE}/${g.ALL_MONITORING_TOPICS}`},{label:{label:e.title}}];this.breadcrumb$.next({show:!0,items:i})}fetchHeaderTags(e){return[{label:{label:nn(e.status)},colorState:e.statusColor,isLight:!0}]}fetchHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:Ui.GENERAL_INFORMATION},{label:{label:`${this.translationKey}HEADER.TABS.IMPACTED_PRODUCTS`},value:Ui.IMPACTED_PRODUCTS}]}fetchHeaderActions(e){let i=[];return(e.status===Qo.Ongoing||e.status===Qo.Created)&&i.push({label:{label:`${this.translationKey}CANCEL_TOPIC`},type:M.DANGER,eventType:nr.CANCEL_MONITORING_TOPIC}),i}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}actionHeaderClicked(e){e.toString()===nr.CANCEL_MONITORING_TOPIC&&this.openCancelMonitoringTopicConfirmationModal()}openCancelMonitoringTopicConfirmationModal(){this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}CANCEL_MODAL.TITLE`},contentLine1:{label:`${this.translationKey}CANCEL_MODAL.CONTENT`},contentLine2:{label:`${this.translationKey}CANCEL_MODAL.CONTENT2`},confirmationGetter:this.cancelMonitoringTopicGetter}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(()=>{this.closeModal()})}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}onImportImpactedProductsFile(e){this.changePendingAndType(!0,W.UPLOAD),this.modalRef=this.modalService.show(We,{initialState:{t
1itle:{label:`${this.translationKey}IMPACTED_PRODUCTS.CONFIRM_UPLOAD`},contentLine1:{label:`${this.translationKey}IMPACTED_PRODUCTS.CONFIRMATION_LINE1`},contentLine2:{label:`${this.translationKey}IMPACTED_PRODUCTS.CONFIRMATION_LINE2`},confirmButtonText:`${this.translationKey}IMPACTED_PRODUCTS.CONFIRM_BUTTON`,confirmationGetter:this.importImpactedProductsGetter,confirmationGetterArgs:[e]}}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$)).subscribe(()=>{this.changePending(!1),this.closeModal()})}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Ai),u(de),u(xe),u($t))},o.\u0275cmp=R({type:o,selectors:[["biorius-monitoring-topic-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","clickOnReturn","onRightButtonClicked","title","breadcrumb","tags","tabs","defaultTab","rightButtons"],["id","content",1,"-content-detail-with-tabs"],[3,"monitoringTopic","updateMonitoringTopicGetter"],[3,"lastImportDate"],[3,"changePendingEmitter","monitoringTopic","updateMonitoringTopicGetter"],[3,"onImportImpactedProductsFileEmitter","lastImportDate"]],template:function(i,r){i&1&&Z(0,Ip,11,21,"ng-container",0),i&2&&d("dsLoading",r.monitoringTopic$)},dependencies:[$,ie,Ni,Bn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Ap=t=>({label:t}),Ro=(()=>{let o=class o extends he{constructor(e,i,r){super(W.FORM,e,void 0,"ADMINISTRATION.MONITORING_TOPIC_CREATION.EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.monitoringTopicsService=r,this.translationKey="ADMINISTRATION.MONITORING_TOPIC_CREATION.",this.breadcrumb$=new I({show:!1,items:[]}),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.destroyer$=new P,this.createMonitoringTopicGetter=m=>this.monitoringTopicsService.createMonitoringTopic(m)}ngOnInit(){this.initBreadcrumb()}ngOnDestroy(){this.clearPending(),this.destroyer$.next(),this.destroyer$.complete()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_MONITORING_TOPICS"},url:`/${g.BASE}/${g.ALL_MONITORING_TOPICS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Ai))},o.\u0275cmp=R({type:o,selectors:[["biorius-monitoring-topic-creation"]],standalone:!1,features:[V],decls:4,vars:7,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin"],[3,"changePendingEmitter","createMonitoringTopicGetter"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1)(3,"biorius-monitoring-topic-general-info-form",2),h("changePendingEmitter",function(v){return r.changePendingAndType(v,r.PendingChangeType.FORM)}),s()()),i&2&&(d("title",E(5,Ap,r.translationKey+"TITLE"))("breadcrumb",f(1,3,r.breadcrumb$)),l(3),d("createMonitoringTopicGetter",r.createMonitoringTopicGetter))},dependencies:[$,Ni,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Dp=t=>({label:t}),Op=t=>({"-clickable":t}),Np=(t,o)=>o.cardAction;function Mp(t,o){if(t&1&&(a(0,"p",7),G(1),p(2,"translate"),s()),t&2){let n=c().$implicit;l(),Ne(" ",je(2,1,n.subtitle.label,n.subtitle.param)," ")}}function xp(t,o){if(t&1){let n=b();a(0,"div",2)(1,"div",3)(2,"div",4),h("click",function(){let i=S(n).$implicit,r=c();return T(r.onCardClicked(i.cardAction))}),a(3,"div",5)(4,"div")(5,"p",6),G(6),p(7,"translate"),s(),_(8,Mp,3,4,"p",7),s(),N(9,"span",8),s()()()()}if(t&2){let n=o.$implicit;l(2),d("ngClass",E(6,Op,n.cardAction)),l(4),Ne(" ",je(7,3,n.title.label,n.title.param)," "),l(2),C(n.subtitle?8:-1)}}var Io=(()=>{let o=class o{constructor(e){this.navigationService=e,this.translationKey="ADMINISTRATION.REGULATORY_CHECK_CONFIGURATIONS.",this.breadcrumb$=new I({show:!1,items:[]}),this.cardItems=this.fetchCardItems()}ngOnInit(){this.initBreadcrumb()}fetchCardItems(){let e=[];return e.push({title:{label:`${this.translationKey}RULE_PACKS_TITLE`},cardAction:Yt.RULE_PACKS},{title:{label:`${this.translationKey}RULE_SETS_TITLE`},cardAction:Yt.RULE_SETS},{title:{label:`${this.translationKey}SENTENCES_TITLE`},cardAction:Yt.SENTENCES},{title:{label:`${this.translationKey}POSITIVE_LISTS_TITLE`},cardAction:Yt.POSITIVE_LISTS}),e}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:this.navigationService.homeUrl},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"}}];this.breadcrumb$.next({show:!0,items:e})}onCardClicked(e){switch(e.toString()){case Yt.RULE_PACKS:this.navigationService.goToRulePacks();break;case Yt.RULE_SETS:this.navigationService.goToRuleSets();break;case Yt.POSITIVE_LISTS:this.navigationService.goToPositiveLists();break;case Yt.SENTENCES:this.navigationService.goToSentences();break}}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w))},o.\u0275cmp=R({type:o,selectors:[["biorius-regulatory-check-configurations"]],standalone:!1,decls:5,vars:6,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin","pt-m","pb-l"],[1,"row","mx-l","mt-m"],[1,"col-12","col-lg-8"],[1,"card","p-m",3,"click","ngClass"],[1,"flex","flex-middle","flex-between"],[1,"c-grey10","f-s"],[1,"c-grey06","f-xs"],[1,"icon","c-primary01","f-xl","icon-chevron-right-alt"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),Se(3,xp,10,8,"div",2,Np),s()),i&2&&(d("title",E(4,Dp,r.translationKey+"TITLE"))("breadcrumb",f(1,2,r.breadcrumb$)),l(3),Te(r.cardItems))},dependencies:[j,$,x,fe],encapsulation:2,changeDetection:0});let t=o;return t})();var Ds=t=>({label:t});function Pp(t,o){if(t&1){let n=b();a(0,"div",10)(1,"ds-simple-table",11),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function wp(t,o){if(t&1&&(a(0,"div",9),_(1,Pp,2,5,"div",10),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Ao=(()=>{let o=class o extends nt{constructor(e,i){super(),this.navigationService=e,this.regulatoryCheckService=i,this.translationKey="ADMINISTRATION.RULE_SETS.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.breadcrumb$=new I({show:!1,items:[]}),this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders())}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new Jt(e?te({},e):{});return r.page=i,this.regulatoryCheckService.searchRuleSets(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("NAME"),value:e=>e.name,isStrong:!0,hasLabelTooltip:!0},{label:this.tableBaseTranslationKey("DESCRIPTION"),value:e=>e.description,hasLabelTooltip:!0},{label:this.tableBaseTranslationKey("ACTIVATION_STATUS"),value:e=>e.isEnabledString,hasIsInactiveBadge:e=>!e.isEnabled,hasIsActiveBadge:e=>e.isEnabled,customWidth:12}]}onCreateRuleSetClicked(){this.navigationService.goToRuleSetCreation()}goToDetails(e){this.navigationService.goToRuleSetDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ge))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-sets"]],standalone:!1,features:[V],decls:10,vars:15,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"query"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(3,"div",2)(4,"div",3)(5,"div",4)(6,"biorius-rule-sets-search",5),h("query",function(v){return r.onQuery(v)}),s()(),a(7,"div",6)(8,"ds-button",7),h("clicked",function(){return r.onCreateRuleSetClicked()}),s()()(),Z(9,wp,3,3,"div",8),s()()),i&2&&(d("title",E(11,Ds,r.translationKey+"TITLE"))("breadcrumb",f(1,9,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(6),d("label",E(13,Ds,r.translationKey+"CREATE_BTN"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.plus)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0))},dependencies:[j,$,Ye,$e,ie,q,Fn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Lp=t=>({label:t});function Bp(t,o){if(t&1){let n=b();a(0,"biorius-rule-set-general-info-form",5),h("changePendingEmitter",function(i){S(n);let r=c(2);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c().dsLoading,e=c();d("ruleSet",n)("updateRuleSetGetter",e.updateRuleSetGetter)("searchPositiveListsGetter",e.searchPositiveListsGetter)}}function Fp(t,o){if(t&1){let n=b();a(0,"biorius-rule-set-rules",6),h("onRuleClickedEmitter",function(i){S(n);let r=c(2);return T(r.onRuleClicked(i))}),s()}if(t&2){let n=c().dsLoading,e=c();d("ruleSet",n)("searchRulesGetter",e.searchRulesGetter)}}function kp(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("onRightButtonClicked",function(i){S(n);let r=c();return T(r.onHeaderActionClicked(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(7,"div",2),_(8,Bp,1,3,"biorius-rule-set-general-info-form",3),p(9,"async"),St
1(10,Fp,1,2,"biorius-rule-set-rules",4),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(19,Lp,e.name))("breadcrumb",f(2,7,i.breadcrumb$))("tabs",f(3,9,i.headerTabs$)??void 0)("defaultTab",f(4,11,i.selectedHeaderTabs$))("rightButtons",f(5,13,i.headerRightActions$))("tags",f(6,15,i.tags$)??void 0),l(7),C((n=f(9,17,i.selectedHeaderTabs$))===i.RuleSetDetailTab.GENERAL_INFORMATION?8:n===i.RuleSetDetailTab.RULES?10:-1)}}var Do=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F){super(W.FORM,e,void 0,"ADMINISTRATION.RULE_SET_DETAIL.EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.regulatoryCheckService=m,this.pendingChangesGuard=v,this.modalService=F,this.translationKey="ADMINISTRATION.RULE_SET_DETAIL.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(ii.GENERAL_INFORMATION),this.headerRightActions$=new I([]),this.tags$=new I(void 0),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.RuleSetDetailTab=ii,this.refreshRuleSet$=new P,this.destroyRef=pe(ue),this.updateRuleSetStatusGetter=ae=>this.regulatoryCheckService.updateRuleSetStatus(this.ruleSetId,ae).pipe(J(Ce=>this.refreshRuleSet$.next())),this.updateRuleSetGetter=(ae,Ce)=>this.regulatoryCheckService.updateRuleSet(ae,Ce).pipe(X(this.destroyRef),J(()=>this.refreshRuleSet$.next())),this.searchPositiveListsGetter=ae=>this.regulatoryCheckService.searchPositiveLists(new Xt({nameFilter:ae})),this.searchRulesGetter=ae=>this.regulatoryCheckService.searchRegulatoryRules(this.ruleSetId,ae)}ngOnInit(){this.ruleSetId=+this.activatedRoute.snapshot.params.id,this.tabToOpenInit=this.activatedRoute.snapshot.queryParams.tabToOpen,this.headerTabs$.next(this.getHeaderTabs()),this.initRuleSetFetch(),this.tabToOpenInit&&this.confirmTabChanged(this.tabToOpenInit)}ngOnDestroy(){this.clearPending(),this.closeModal()}initRuleSetFetch(){this.ruleSet$=we(this.fetchRuleSet(this.ruleSetId),this.refreshRuleSet$.pipe(He(()=>this.fetchRuleSet(this.ruleSetId)))).pipe(X(this.destroyRef),ne({bufferSize:1,refCount:!0}))}fetchRuleSet(e){return this.regulatoryCheckService.getRuleSet(e).pipe(J(i=>{this.refreshBreadcrumb(i),this.headerRightActions$.next(this.getHeaderRightActions(i)),this.tags$.next(this.getHeaderTags(i))}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.RULE_SETS.TITLE"},url:`/${g.BASE}/${g.RULE_SETS}`},{label:{label:e.name}}];this.breadcrumb$.next({show:!0,items:i})}getHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:ii.GENERAL_INFORMATION},{label:{label:`${this.translationKey}HEADER.TABS.RULES`},value:ii.RULES}]}getHeaderRightActions(e){return[{label:{label:`${this.translationKey}HEADER.ACTIONS.${e.isEnabled?"DEACTIVATE":"ACTIVATE"}`},type:e.isEnabled?M.DANGER:M.VALID,eventType:e.isEnabled?ji.DEACTIVATE:ji.ACTIVATE}]}getHeaderTags(e){if(!e.isEnabled)return[{label:{label:"COMMON.DEACTIVATED"},colorState:z.ERROR_LIGHT}]}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e),this.navigationService.updateURLWithNewParamsWithoutReloading({tabToOpen:e})}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}onHeaderActionClicked(e){switch(e){case ji.DEACTIVATE:this.updateRuleSetStatus(!1);break;case ji.ACTIVATE:this.updateRuleSetStatus(!0);break}}updateRuleSetStatus(e){let i=`CONFIRM_CHANGE_STATUS_MODAL.${e?"ACTIVATE.":"DEACTIVATE."}`;this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}${i}TITLE`},contentLine1:{label:`${this.translationKey}${i}CONTENT`},contentLine2:{label:`${this.translationKey}CONFIRM_CHANGE_STATUS_MODAL.CONTENT2`},confirmationGetter:this.updateRuleSetStatusGetter,confirmationGetterArgs:[e]}}),this.modalRef.content.closeEmitter.pipe(X(this.destroyRef)).subscribe(()=>{this.closeModal()})}onRuleClicked(e){this.navigationService.goToRegulatoryRuleDetail(this.ruleSetId,e)}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Ge),u(de),u(xe))}
1,o.\u0275cmp=R({type:o,selectors:[["biorius-rule-set-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","onRightButtonClicked","clickOnReturn","title","breadcrumb","tabs","defaultTab","rightButtons","tags"],["id","content",1,"-content-detail-with-tabs"],[3,"ruleSet","updateRuleSetGetter","searchPositiveListsGetter"],[3,"ruleSet","searchRulesGetter"],[3,"changePendingEmitter","ruleSet","updateRuleSetGetter","searchPositiveListsGetter"],[3,"onRuleClickedEmitter","ruleSet","searchRulesGetter"]],template:function(i,r){i&1&&Z(0,kp,11,21,"ng-container",0),i&2&&d("dsLoading",r.ruleSet$)},dependencies:[$,ie,Mi,Vn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var $p=t=>({label:t}),Oo=(()=>{let o=class o extends he{constructor(e,i,r){super(W.FORM,e,void 0,"ADMINISTRATION.RULE_SET_CREATION.EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.regulatoryCheckService=r,this.translationKey="ADMINISTRATION.RULE_SET_CREATION.",this.breadcrumb$=new I({show:!1,items:[]}),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.destroyer$=new P,this.createRuleSetGetter=m=>this.regulatoryCheckService.createRuleSet(m),this.searchPositiveListsGetter=m=>this.regulatoryCheckService.searchPositiveLists(new Xt({nameFilter:m}))}ngOnInit(){this.initBreadcrumb()}ngOnDestroy(){this.clearPending(),this.destroyer$.next(),this.destroyer$.complete()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.RULE_SETS.TITLE"},url:`/${g.BASE}/${g.RULE_SETS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Ge))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-set-creation"]],standalone:!1,features:[V],decls:4,vars:8,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin"],[3,"changePendingEmitter","createRuleSetGetter","searchPositiveListsGetter"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1)(3,"biorius-rule-set-general-info-form",2),h("changePendingEmitter",function(v){return r.changePendingAndType(v,r.PendingChangeType.FORM)}),s()()),i&2&&(d("title",E(6,$p,r.translationKey+"TITLE"))("breadcrumb",f(1,4,r.breadcrumb$)),l(3),d("createRuleSetGetter",r.createRuleSetGetter)("searchPositiveListsGetter",r.searchPositiveListsGetter))},dependencies:[$,Mi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Gp=t=>({businessId:t}),Hp=(t,o)=>({label:t,param:o});function Vp(t,o){if(t&1){let n=b();a(0,"biorius-regulatory-rule-regulated-components",8),h("onInciNameFilterChanged",function(i){S(n);let r=c(4);return T(r.refreshRegulatedComponents(i))}),s()}if(t&2){let n=c().dsLoading;d("tagRegions",o)("regulatedComponents",n)}}function Up(t,o){if(t&1&&(a(0,"div",6),_(1,Vp,1,2,"biorius-regulatory-rule-regulated-components",7),p(2,"async"),s()),t&2){let n,e=c(3);l(),C((n=f(2,1,e.tagRegions$))?1:-1,n)}}function Kp(t,o){if(t&1&&(a(0,"div",6),N(1,"biorius-regulatory-rule-encoded-components",9),s()),t&2){let n=o.dsLoading;l(),d("encodedComponents",n)}}function jp(t,o){if(t&1&&(a(0,"div",3),N(1,"biorius-regulatory-rule-general-info-form",4),Z(2,Up,3,3,"div",5)(3,Kp,2,1,"div",5),s()),t&2){let n=c().dsLoading,e=c();l(),d("rule",n),l(),d("dsLoading",e.regulatedComponents$),l(),d("dsLoading",e.encodedComponents$)}}function qp(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(5,"div",2),_(6,jp,4,3,"div",3),p(7,"async"),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",dt(15,Hp,i.translationKey+"TITLE",E(13,Gp,e.businessId)))("breadcrumb",f(2,5,i.breadcrumb$))("tabs",f(3,7,i.headerTabs$)??void 0)("defaultTab",f(4,9,i.selectedHeaderTabs$)),l(5),C((n=f(7,11,i.selectedHeaderTabs$))===i.RuleDetailTab.GENERAL_INFORMATION?6:-1)}}var No=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F){super(W.FORM,e,void 0,"ADMINISTRATION.RULE_DETAIL.EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.regulatoryCheckService=m,this.pendingChangesGuard=v,this.tagsStore=F,this.translationKey="ADMINISTRATION.RULE_DETAIL.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(cn.GENERAL_INFORMATION),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.RuleDetailTab=cn,this.refreshRule$=new P,this.refreshRegulatedComponents$=ne
1w P,this.destroyer$=new P}ngOnInit(){this.ruleId=+this.activatedRoute.snapshot.params.id,this.ruleSetId=this.activatedRoute.snapshot.params.ruleSetId,this.tagRegions$=this.tagsStore.tagRegions$,this.headerTabs$.next(this.fetchHeaderTabs()),this.initRuleFetch(),this.initRuleSetFetch(),this.initEncodedComponentsFetch(),this.regulatedComponents$=this.tagsStore.europeanRegionId$.pipe(ye(1),J(e=>{this.regulatedComponentsSelectedRegionId=e}),Le(e=>this.initRegulatedComponentsFetch())),zi(this.rule$,this.ruleSet$).pipe(ye(1)).subscribe(([e,i])=>{this.initBreadcrumb(e,i)})}ngOnDestroy(){this.clearPending(),this.destroyer$.next(),this.destroyer$.complete()}initRuleFetch(){this.rule$=we(this.fetchRule(),this.refreshRule$.pipe(He(()=>this.fetchRule()))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}initRegulatedComponentsFetch(){return we(this.fetchRegulatedComponents(),this.refreshRegulatedComponents$.pipe(He(()=>this.fetchRegulatedComponents()))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}initRuleSetFetch(){this.ruleSet$=this.regulatoryCheckService.getRuleSet(this.ruleSetId).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}initEncodedComponentsFetch(){this.encodedComponents$=this.regulatoryCheckService.searchRuleEncodedComponents(this.ruleSetId,this.ruleId).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}fetchRule(){return this.regulatoryCheckService.getRegulatoryRuleDetails(this.ruleSetId,this.ruleId)}fetchRegulatedComponents(){return this.regulatoryCheckService.searchRuleRegulatedComponents(this.ruleSetId,this.ruleId,this.regulatedComponentsSelectedRegionId)}initBreadcrumb(e,i){let r=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.RULE_SETS.TITLE"},url:`/${g.BASE}/${g.RULE_SETS}`},{label:{label:i.name},url:`/${g.BASE}/${g.RULE_SET_DETAIL.replace(":id",i.id.toString())}`,queryParams:{tabToOpen:ii.RULES}},{label:{label:`${this.translationKey}TITLE`,param:{businessId:e.businessId}}}];this.breadcrumb$.next({show:!0,items:r})}fetchHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:cn.GENERAL_INFORMATION}]}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}goBack(){this.navigationService.goBack()}refreshRegulatedComponents(e){this.regulatedComponentsSelectedRegionId=e.id,this.refreshRegulatedComponents$.next()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Ge),u(de),u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-regulatory-rule-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","clickOnReturn","title","breadcrumb","tabs","defaultTab"],["id","content",1,"-content-detail-with-tabs"],[1,"container","pb-xl"],[3,"rule"],["class","mt-s",4,"dsLoading"],[1,"mt-s"],[3,"tagRegions","regulatedComponents"],[3,"onInciNameFilterChanged","tagRegions","regulatedComponents"],[3,"encodedComponents"]],template:function(i,r){i&1&&Z(0,qp,8,18,"ng-container",0),i&2&&d("dsLoading",r.rule$)},dependencies:[$,ie,Wn,Un,jn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Os=t=>({label:t});function Yp(t,o){if(t&1){let n=b();a(0,"div",10)(1,"ds-simple-table",11),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function Qp(t,o){if(t&1&&(a(0,"div",9),_(1,Yp,2,5,"div",10),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Mo=(()=>{let o=class o extends nt{constructor(e,i,r,m){super(),this.navigationService=e,this.regulatoryCheckService=i,this.brandsService=r,this.servicesService=m,this.translationKey="ADMINISTRATION.RULE_PACKS.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.breadcrumb$=new I({show:!1,items:[]}),this.allBrandsGetter=v=>this.brandsService.searchBrands(new _i({brandName:v})).pipe(me(F=>F.brands.map(ae=>({value:ae,label:ae.name})))),this.allServicesGetter=v=>this.servicesService.searchServices(new fi({query:v})).pipe(me(F=>F.services.map(ae=>({value:ae,label:ae.nameReadable}
1)))),this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders())}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new rn(e?te({},e):{});return r.page=i,this.regulatoryCheckService.searchRulePacks(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("NAME"),value:e=>e.name,isStrong:!0,hasLabelTooltip:!0},{label:this.tableBaseTranslationKey("DESCRIPTION"),value:e=>e.description,hasLabelTooltip:!0},{label:this.tableBaseTranslationKey("BRANDS"),value:e=>e.brandsNames?.join(", "),hasLabelTooltip:!0},{label:this.tableBaseTranslationKey("ACTIVATION_STATUS"),value:e=>e.isEnabledString,hasIsInactiveBadge:e=>!e.isEnabled,hasIsActiveBadge:e=>e.isEnabled,customWidth:12}]}onCreateRulePackClicked(){this.navigationService.goToRulePackCreation()}goToDetails(e){this.navigationService.goToRulePackDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ua),u(vi),u(Tn))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-packs"]],standalone:!1,features:[V],decls:10,vars:17,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"query","allBrandsGetter","allServicesGetter"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(3,"div",2)(4,"div",3)(5,"div",4)(6,"biorius-rule-packs-search",5),h("query",function(v){return r.onQuery(v)}),s()(),a(7,"div",6)(8,"ds-button",7),h("clicked",function(){return r.onCreateRulePackClicked()}),s()()(),Z(9,Qp,3,3,"div",8),s()()),i&2&&(d("title",E(13,Os,r.translationKey+"TITLE"))("breadcrumb",f(1,11,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(4),d("allBrandsGetter",r.allBrandsGetter)("allServicesGetter",r.allServicesGetter),l(2),d("label",E(15,Os,r.translationKey+"CREATE_BTN"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.plus)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0))},dependencies:[j,$,Ye,$e,ie,q,qn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Wp=t=>({label:t});function zp(t,o){if(t&1){let n=b();a(0,"biorius-rule-pack-general-info-form",4),h("changePendingEmitter",function(i){S(n);let r=c(2);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c().dsLoading,e=c();d("rulePack",n)("openServicesSelectionModalGetter",e.openServicesSelectionModalGetter)("updateRulePackGetter",e.updateRulePackGetter)("searchBrandsGetter",e.searchBrandsGetter)("searchRuleSetsGetter",e.searchRuleSetsGetter)}}function Xp(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("onRightButtonClicked",function(i){S(n);let r=c();return T(r.onHeaderActionClicked(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(7,"div",2),_(8,zp,1,5,"biorius-rule-pack-general-info-form",3),p(9,"async"),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(19,Wp,e.name))("breadcrumb",f(2,7,i.breadcrumb$))("tabs",f(3,9,i.headerTabs$)??void 0)("defaultTab",f(4,11,i.selectedHeaderTabs$))("rightButtons",f(5,13,i.headerRightActions$))("tags",f(6,15,i.tags$)??void 0),l(7),C((n=f(9,17,i.selectedHeaderTabs$))===i.RulePackDetailTab.GENERAL_INFORMATION?8:-1)}}var xo=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae){super(W.FORM,e,void 0,"ADMINISTRATION.RULE_PACK.E
1DITION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.regulatoryCheckService=m,this.brandsService=v,this.pendingChangesGuard=F,this.modalService=ae,this.translationKey="ADMINISTRATION.RULE_PACK.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(dn.GENERAL_INFORMATION),this.headerRightActions$=new I([]),this.tags$=new I(void 0),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.RulePackDetailTab=dn,this.refreshRulePack$=new P,this.destroyRef=pe(ue),this.updateRulePackStatusGetter=Ce=>this.regulatoryCheckService.updateRulePackStatus(this.rulePackId,Ce).pipe(J(ot=>this.refreshRulePack$.next())),this.updateRulePackGetter=(Ce,ot)=>this.regulatoryCheckService.updateRulePack(Ce,ot).pipe(X(this.destroyRef),J(()=>this.refreshRulePack$.next())),this.searchBrandsGetter=Ce=>{let ot=new _i({brandName:Ce});return this.brandsService.searchBrands(ot)},this.searchRuleSetsGetter=Ce=>{let ot=new Jt({nameDescriptionFilter:Ce,isEnabled:!0});return this.regulatoryCheckService.searchRuleSets(ot)},this.openServicesSelectionModalGetter=Ce=>(this.modalRef=this.modalService.show(bi,{initialState:{selectedServices:Ce},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(X(this.destroyRef),J(()=>this.closeModal())))}ngOnInit(){this.rulePackId=+this.activatedRoute.snapshot.params.id,this.headerTabs$.next(this.getHeaderTabs()),this.initRulePackFetch()}ngOnDestroy(){this.clearPending(),this.closeModal()}initRulePackFetch(){this.rulePack$=we(this.fetchRulePack(this.rulePackId),this.refreshRulePack$.pipe(He(()=>this.fetchRulePack(this.rulePackId)))).pipe(X(this.destroyRef),ne({bufferSize:1,refCount:!0}))}fetchRulePack(e){return this.regulatoryCheckService.getRulePack(e).pipe(J(i=>{this.refreshBreadcrumb(i),this.headerRightActions$.next(this.getHeaderRightActions(i)),this.tags$.next(this.getHeaderTags(i))}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.RULE_PACKS.TITLE"},url:`/${g.BASE}/${g.RULE_PACKS}`},{label:{label:e.name}}];this.breadcrumb$.next({show:!0,items:i})}getHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:dn.GENERAL_INFORMATION}]}getHeaderRightActions(e){return[{label:{label:`${this.translationKey}HEADER.ACTIONS.${e.isEnabled?"DEACTIVATE":"ACTIVATE"}`},type:e.isEnabled?M.DANGER:M.VALID,eventType:e.isEnabled?qi.DEACTIVATE:qi.ACTIVATE}]}getHeaderTags(e){if(!e.isEnabled)return[{label:{label:"COMMON.DEACTIVATED"},colorState:z.ERROR_LIGHT}]}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}onHeaderActionClicked(e){switch(e){case qi.DEACTIVATE:this.updateRulePackStatus(!1);break;case qi.ACTIVATE:this.updateRulePackStatus(!0);break}}updateRulePackStatus(e){let i=`CONFIRM_CHANGE_STATUS_MODAL.${e?"ACTIVATE.":"DEACTIVATE."}`;this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}${i}TITLE`},contentLine1:{label:`${this.translationKey}${i}CONTENT`},contentLine2:{label:`${this.translationKey}CONFIRM_CHANGE_STATUS_MODAL.CONTENT2`},confirmationGetter:this.updateRulePackStatusGetter,confirmationGetterArgs:[e]}}),this.modalRef.content.closeEmitter.pipe(X(this.destroyRef)).subscribe(()=>{this.closeModal()})}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Ge),u(vi),u(de),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-pack-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","onRightButtonClicked","clickOnReturn","title","breadcrumb","tabs","defaultTab","rightButtons","tags"],["id","content",1,"-content-detail-with-tabs"],[3,"rulePack","openServicesSelectionModalGetter","updateRulePackGetter","searchBrandsGetter","searchRuleSetsGetter"],[3,"changePendingEmitter","rulePack","openServicesSelectionModalGetter","updateRulePackGetter","searchBrandsGetter","searchRuleSetsGetter"]],template:function(i,r){i&1&&Z(0,Xp,10,21,"ng-container",0),i&2&&d("dsLoading",r.rulePack$)},dependencies:[$,ie,Pi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Jp=t=>({label:t}),Po=(()=>{let o=class o extends he{constructor(e,i,r,m,v){super(W.FORM,e,void 0,"ADMINISTRATION.RULE_PACK.CREATION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.regulatoryCheckService=r,this.brandsService=m,this.modalService=v,this.translationKey="ADMINISTRATION.RULE_PACK.",this.breadcrumb$=new I({show:!1,items:[]}),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.destroyer$=new P,this.createRulePackGetter=F=>this.regulatoryCheckService.createRulePack(F),this.searchBrandsGetter=F=>{let ae=new _i({brandName:F});return this.brandsService.searchBrands(ae)},this.searchRuleSetsGetter=F=>{let ae=new Jt({nameDescriptionFilter:F,isEnabled:!0});return this.regulatoryCheckService.searchRuleSets(ae)},this.openServicesSelectionModalGetter=F=>(this.modalRef=this.modalService.show(bi,{initialState:{selectedServices:F},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(O(this.destroyer$),J(()=>this.closeModal())))}ngOnInit(){this.initBreadcrumb()}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.RULE_PACKS.TITLE"},url:`/${g.BASE}/${g.RULE_PACKS}`},{label:{label:`${this.translationKey}CREATION_TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Ge),u(vi),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-rule-pack-creation"]],standalone:!1,features:[V],decls:4,vars:10,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin"],[3,"changePendingEmitter","createRulePackGetter","searchBrandsGetter","searchRuleSetsGetter","openServicesSelectionModalGetter"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1)(3,"biorius-rule-pack-general-info-form",2),h("changePendingEmitter",function(v){return r.changePendingAndType(v,r.PendingChangeType.FORM)}),s()()),i&2&&(d("title",E(8,Jp,r.translationKey+"CREATION_TITLE"))("breadcrumb",f(1,6,r.breadcrumb$)),l(3),d("createRulePackGetter",r.createRulePackGetter)("searchBrandsGetter",r.searchBrandsGetter)("searchRuleSetsGetter",r.searchRuleSetsGetter)("openServicesSelectionModalGetter",r.openServicesSelectionModalGetter))},dependencies:[$,Pi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Ns=t=>({label:t});function Zp(t,o){if(t&1){let n=b();a(0,"biorius-positive-lists-search",9),h("query",function(i){S(n);let r=c();return T(r.onQuery(i))}),s()}t&2&&d("allAnnexes",o)}function eu(t,o){if(t&1){let n=b();a(0,"div",11)(1,"ds-simple-table",12),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function tu(t,o){if(t&1&&(a(0,"div",10),_(1,eu,2,5,"div",11),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var wo=(()=>{let o=class o extends nt{constructor(e,i){super(),this.navigationService=e,this.regulatoryCheckService=i,this.translationKey="ADMINISTRATION.POSITIVE_LISTS.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.breadcrumb$=new I({show:!1,items:[]}),this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders()),this.ruleAnnexesSearchItems$=this.fetchRuleAnnexes()}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new Xt(e?te({},e):{});return r.page=i,this.regulatoryCheckService.searchPositiveLists(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("NAME"),value:e=>e.name,isStrong:!0},{label:this.tableBaseTranslationKey("TYPE"),value:e=>e.type?sa(e.type):void 0},{label:this.tableBaseTranslationKey("ANNEX"),value:e=>e.annex}]}fetchRuleAnnexes(){return this.regulatoryCheckService.getAllAnnexes().pipe(O(this.destroyer$),me(e=>e.map(i=>({label:i,value:i}))),ne({bufferSize:1,refCount:!0}))}onCreatePositiveListClicked(){this.navigationService.goToPositiveListCreation()}goToDetails(e){this.navigationService.goToPositiveListDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ge))},o.\u0275cmp=R({type:o,selectors:[["biorius-positives-lists"]],standalone:!1,features:[V],decls:11,vars:18,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"allAnnexes"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[3,"query","allAnnexes"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}
1),a(3,"div",2)(4,"div",3)(5,"div",4),_(6,Zp,1,1,"biorius-positive-lists-search",5),p(7,"async"),s(),a(8,"div",6)(9,"ds-button",7),h("clicked",function(){return r.onCreatePositiveListClicked()}),s()()(),Z(10,tu,3,3,"div",8),s()()),i&2){let m;d("title",E(14,Ns,r.translationKey+"TITLE"))("breadcrumb",f(1,10,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(4),C((m=f(7,12,r.ruleAnnexesSearchItems$))?6:-1,m),l(3),d("label",E(16,Ns,r.translationKey+"CREATE_BTN"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.plus)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0)}},dependencies:[j,$,Ye,$e,ie,q,Yn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var iu=t=>({label:t}),nu=()=>[];function ou(t,o){if(t&1){let n=b();a(0,"biorius-positive-list-general-info-form",4),p(1,"async"),h("changePendingEmitter",function(i){S(n);let r=c(3);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n,e=c(2).dsLoading,i=c();d("positiveList",e)("allRuleAnnexes",o)("functionTags",((n=f(1,4,i.tagsByType$))==null?null:n.ComponentFunction)??it(6,nu))("updatePositiveListGetter",i.updatePositiveListGetter)}}function ru(t,o){if(t&1&&(_(0,ou,2,7,"biorius-positive-list-general-info-form",3),p(1,"async")),t&2){let n,e=c(2);C((n=f(1,1,e.allRuleAnnexes$))?0:-1,n)}}function au(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(5,"div",2),_(6,ru,2,3),p(7,"async"),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(13,iu,e.name))("breadcrumb",f(2,5,i.breadcrumb$))("tabs",f(3,7,i.headerTabs$)??void 0)("defaultTab",f(4,9,i.selectedHeaderTabs$)),l(5),C((n=f(7,11,i.selectedHeaderTabs$))===i.PositiveListDetailTab.GENERAL_INFORMATION?6:-1)}}var Lo=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F){super(W.FORM,e,void 0,"ADMINISTRATION.POSITIVE_LIST.EDITION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.regulatoryCheckService=m,this.pendingChangesGuard=v,this.tagsStore=F,this.translationKey="ADMINISTRATION.POSITIVE_LIST.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(mn.GENERAL_INFORMATION),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.PositiveListDetailTab=mn,this.refreshPositiveList$=new P,this.destroyer$=new P,this.updatePositiveListGetter=(ae,Ce)=>this.regulatoryCheckService.updatePositiveList(ae,Ce).pipe(O(this.destroyer$),J(()=>this.refreshPositiveList$.next()))}ngOnInit(){this.positiveListId=+this.activatedRoute.snapshot.params.id,this.tagsByType$=this.tagsStore.tagsByType$,this.headerTabs$.next(this.fetchHeaderTabs()),this.initPositiveListFetch(),this.allRuleAnnexes$=this.fetchAllRuleAnnexes()}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initPositiveListFetch(){this.positiveList$=we(this.fetchPositiveList(this.positiveListId),this.refreshPositiveList$.pipe(He(()=>this.fetchPositiveList(this.positiveListId)))).pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}fetchPositiveList(e){return this.regulatoryCheckService.getPositiveList(e).pi
1pe(J(i=>{this.refreshBreadcrumb(i)}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.POSITIVE_LISTS.TITLE"},url:`/${g.BASE}/${g.POSITIVE_LISTS}`},{label:{label:e.name}}];this.breadcrumb$.next({show:!0,items:i})}fetchHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:mn.GENERAL_INFORMATION}]}fetchAllRuleAnnexes(){return this.regulatoryCheckService.getAllAnnexes().pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Ge),u(de),u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-positive-list-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","clickOnReturn","title","breadcrumb","tabs","defaultTab"],["id","content",1,"-content-detail-with-tabs"],[3,"positiveList","allRuleAnnexes","functionTags","updatePositiveListGetter"],[3,"changePendingEmitter","positiveList","allRuleAnnexes","functionTags","updatePositiveListGetter"]],template:function(i,r){i&1&&Z(0,au,8,15,"ng-container",0),i&2&&d("dsLoading",r.positiveList$)},dependencies:[$,ie,wi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var su=t=>({label:t}),lu=()=>[];function cu(t,o){if(t&1){let n=b();a(0,"biorius-positive-list-general-info-form",3),p(1,"async"),h("changePendingEmitter",function(i){S(n);let r=c();return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n,e=c();d("allRuleAnnexes",o)("functionTags",((n=f(1,3,e.tagsByType$))==null?null:n.ComponentFunction)??it(5,lu))("createPositiveListGetter",e.createPositiveListGetter)}}var Bo=(()=>{let o=class o extends he{constructor(e,i,r,m){super(W.FORM,e,void 0,"ADMINISTRATION.POSITIVE_LIST.CREATION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.regulatoryCheckService=r,this.tagsStore=m,this.translationKey="ADMINISTRATION.POSITIVE_LIST.",this.breadcrumb$=new I({show:!1,items:[]}),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.destroyer$=new P,this.createPositiveListGetter=v=>this.regulatoryCheckService.createPositiveList(v)}ngOnInit(){this.initBreadcrumb(),this.tagsByType$=this.tagsStore.tagsByType$,this.allRuleAnnexes$=this.fetchAllRuleAnnexes()}ngOnDestroy(){this.clearPending(),this.closeModal(),this.destroyer$.next(),this.destroyer$.complete()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.POSITIVE_LISTS.TITLE"},url:`/${g.BASE}/${g.POSITIVE_LISTS}`},{label:{label:`${this.translationKey}CREATION_TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}fetchAllRuleAnnexes(){return this.regulatoryCheckService.getAllAnnexes().pipe(O(this.destroyer$),ne({bufferSize:1,refCount:!0}))}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Ge),u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-positive-list-creation"]],standalone:!1,features:[V],decls:5,vars:9,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin"],[3,"allRuleAnnexes","functionTags","createPositiveListGetter"],[3,"changePendingEmitter","allRuleAnnexes","functionTags","createPositiveListGetter"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),_(3,cu,2,6,"biorius-positive-list-general-info-form",2),p(4,"async"),s()),i&2){let m;d("title",E(7,su,r.translationKey+"CREATION_TITLE"))("breadcrumb",f(1,3,r.breadcrumb$)),l(3),C((m=f(4,5,r.allRuleAnnexes$))?3:-1,m)}},dependencies:[$,wi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var xs=gt(Pt());var Ms=t=>({label:t});
1function du(t,o){if(t&1){let n=b();a(0,"biorius-sentences-search",9),h("query",function(i){S(n);let r=c();return T(r.onQuery(i))}),s()}t&2&&d("tags",o)}function mu(t,o){if(t&1){let n=b();a(0,"div",11)(1,"ds-simple-table",12),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function pu(t,o){if(t&1&&(a(0,"div",10),_(1,mu,2,5,"div",11),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Fo=(()=>{let o=class o extends nt{constructor(e,i,r){super(),this.navigationService=e,this.regulatoryCheckService=i,this.tagsStore=r,this.translationKey="ADMINISTRATION.SENTENCES.",this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.DS_ButtonTypeEnum=M,this.breadcrumb$=new I({show:!1,items:[]}),this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders()),this.authorizedTags$=this.tagsStore.tagsByType$.pipe(me(e=>{let r=(e?Object.values(e).flat():[]).filter(m=>Na.sentenceAuthorizedTagTypes.some(v=>m.type===v));return(0,xs.sortBy)(r,m=>m.name.toUpperCase().trim())}))}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new sn(e?te({},e):{});return r.page=i,this.regulatoryCheckService.searchSentences(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:`${this.translationKey}TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("SENTENCE"),value:e=>e.sentence,isStrong:!0,hasLabelTooltip:!0},{label:this.tableBaseTranslationKey("THEME"),value:e=>ra(e.theme)},{label:this.tableBaseTranslationKey("TAG_TYPE"),value:e=>e.tagType?en(e.tagType):void 0},{label:this.tableBaseTranslationKey("TAG_VALUE"),value:e=>e.tagValue}]}onCreateSentenceClicked(){this.navigationService.goToSentenceCreation()}goToDetails(e){this.navigationService.goToSentenceDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Ge),u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-sentences"]],standalone:!1,features:[V],decls:11,vars:18,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"tags"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[3,"query","tags"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(3,"div",2)(4,"div",3)(5,"div",4),_(6,du,1,1,"biorius-sentences-search",5),p(7,"async"),s(),a(8,"div",6)(9,"ds-button",7),h("clicked",function(){return r.onCreateSentenceClicked()}),s()()(),Z(10,pu,3,3,"div",8),s()()),i&2){let m;d("title",E(14,Ms,r.translationKey+"TITLE"))("breadcrumb",f(1,10,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(4),C((m=f(7,12,r.authorizedTags$))?6:-1,m),l(3),d("label",E(16,Ms,r.translationKey+"CREATE_BTN"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.plus)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0)}},dependencies:[j,$,Ye,$e,ie,q,Qn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var uu=t=>({label:t});function hu(t,o){if(t&1){let n=b();a(0,"biorius-sentence-general-info-form",4),p(1,"async"),h("changePendingEmitter",function(i){S(n);let r=c(2);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c().dsLoading,e=c();d("sentence",n)("tagsByTypes",f(1,3,e.tagsByType$))("updateSentenceTrigger",e.updateSentenceTrigger)}}function fu(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(5,"div",2),_(6,hu,2,5,"biorius-sentence-general-info-form",3),p(7,"async"),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(13,uu,e.sentence))("breadcrumb",f(2,5,i.breadcrumb$))("tabs",f(3,7,i.headerTabs$)??void 0)("defaultTab",f(4,9,i.selectedHeaderTabs$)),l(5),C((n=f(7,11,i.selectedHeaderTabs$))===i.SentenceDetailTab.GENERAL_INFORMATION?6:-1)}}var ko=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F){super(W.FORM,e,void 0,"ADMINISTRATION.SENTENCE.EDITION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.regulatoryCheckService=m,this.pendingChangesGuard=v,this.tagsStore=F,this.translationKey="ADMINISTRATION.SENTENCE.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(pn.GENERAL_INFORMATION),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.SentenceDetailTab=pn,this.refreshSentence$=new P,this.destroyRef=pe(ue),this.updateSentenceTrigger=(ae,Ce)=>this.regulatoryCheckService.updateSentence(ae,Ce).pipe(X(this.destroyRef),J(()=>this.refreshSentence$.next()))}ngOnInit(){this.sentenceId=+this.activatedRoute.snapshot.params.id,this.tagsByType$=this.tagsStore.tagsByType$,this.headerTabs$.next(this.fetchHeaderTabs()),this.initSentenceFetch()}ngOnDestroy(){this.clearPending(),this.closeModal()}initSentenceFetch(){this.sentence$=we(this.fetchSentence(this.sentenceId),this.refreshSentence$.pipe(He(()=>this.fetchSentence(this.sentenceId)))).pipe(X(this.destroyRef),ne({bufferSize:1,refCount:!0}))}fetchSentence(e){return this.regulatoryCheckService.getSentence(e).pipe(J(i=>{this.refreshBreadcrumb(i)}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.SENTENCES.TITLE"},url:`/${g.BASE}/${g.SENTENCES}`},{label:{label:e.sentence}}];this.breadcrumb$.next({show:!0,items:i})}fetchHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:pn.GENERAL_INFORMATION}]}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Ge),u(de),u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-sentence-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","clickOnReturn","title","breadcrumb","tabs","defaultTab"],["id","content",1,"-content-detail-with-tabs"],[3,"sentence","tagsByTypes","updateSentenceTrigger"],[3,"changePendingEmitter","sentence","tagsByTypes","updateSentenceTrigger"]],template:function(i,r){i&1&&Z(0,fu,8,15,"ng-container",0),i&2&&d("dsLoading",r.sentence$)},dependencies:[$,ie,Li,x],encapsulation:2,changeDetection:0});let t=o;return t})();var _u=t=>({label:t}),$o=(()=>{let o=class o extends he{constructor(e,i,r,m){super(W.FORM,e,void 0,"ADMINISTRATION.SENTENCE.CREATION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.regulatoryCheckService=r,this.tagsStore=m,this.translationKey="ADMINISTRATION.SENTENCE.",this.breadcrumb$=new I({show:!1,items:[]}),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.destroyRef=pe(ue),this.createSentenceTrigger=v=>this.regulatoryCheckService.createSentence(v)}ngOnInit(){this.initBreadcrumb(),this.tagsByType$=this.tagsStore.tagsByType$}ngOnDestroy(){this.clearPending(),this.closeModal()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.REGULATORY_CHECK_CONFIGURATIONS"},url:`/${g.BASE}/${g.REGULATORY_CHECK_CONFIGURATIONS}`},{label:{label:"ADMINISTRATION.SENTENCES.TITLE"},url:`/${g.BASE}/${g.SENTENCES}`},{label:{label:`${this.translationKey}CREATION_TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Ge),u(Qe))},o.\u0275cmp=R({type:o,selectors:[["biorius-sentence-creation"]],standalone:!1,features:[V],decls:5,vars:10,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin"],[3,"changePendingEmitter","tagsByTypes","createSentenceTrigger"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1)(3,"biorius-sentence-general-info-form",2),p(4,"async"),h("changePendingEmitter",function(v){return r.changePendingAndType(v,r.PendingChangeType.FORM)}),s()()),i&2&&(d("title",E(8,_u,r.translationKey+"CREATION_TITLE"))("breadcrumb",f(1,4,r.breadcrumb$)),l(3),d("tagsByTypes",f(4,6,r.tagsByType$))("createSentenceTrigger",r.createSentenceTrigger))},dependencies:[$,Li,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Ps=[Bo,Lo,wo,Io,No,Po,xo,Mo,Oo,Do,Ao,$o,ko,Fo];var ws=t=>({label:t});function Cu(t,o){if(t&1){let n=b();a(0,"div",10)(1,"ds-simple-table",11),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function gu(t,o){if(t&1&&(a(0,"div",9),_(1,Cu,2,5,"div",10),p(2,"async"),s()),t&2){let n,e=c();l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Go=(()=>{let o=class o extends nt{constructor(e,i){super(),this.navigationService=e,this.rolesAndPermissionsService=i,this.translationKey="ADMINISTRATION.ALL_ROLES.",this.DS_ButtonTypeEnum=M,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.breadcrumb$=new I({show:!1,items:[]}),this.allowSearchOnEmptyQuery=!0,this.initSearchGetter()}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders())}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new gi(e?te({},e):{});return r.page=i,this.rolesAndPermissionsService.searchRoles(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_ROLES"}}];this.breadcrumb$.next({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("NAME"),value:e=>e.name,isStrong:!0,isLarge:!0},{label:this.tableBaseTranslationKey("ROLE_TYPE"),value:e=>e.roleType?Zr(e.roleType):void 0},{label:this.tableBaseTranslationKey("IS_AUTO_ASSIGNED"),value:e=>e.isAutoAssigned?"COMMON.YES":"COMMON.NO"},{label:this.tableBaseTranslationKey("IS_DELETABLE"),value:e=>e.isDeletable?"COMMON.YES":"COMMON.NO"}]}onCreateRoleClicked(){this.navigationService.goToRoleCreation()}goToDetails(e){this.navigationService.goToRoleDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Zt))},o.\u0275cmp=R({type:o,selectors:[["biorius-all-roles"]],standalone:!1,features:[V],decls:10,vars:15,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"query"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(3,"div",2)(4,"div",3)(5,"div",4)(6,"biorius-roles-search",5),h("query",function(v){return r.onQuery(v)}),s()(),a(7,"div",6)(8,"ds-button",7),h("clicked",function(){return r.onCreateRoleClicked()}),s()()(),Z(9,gu,3,3,"div",8),s()()),i&2&&(d("title",E(11,ws,r.translationKey+"TITLE"))("breadcrumb",f(1,9,r.breadcrumb$)),l(2),d("scrollWindow",!1),l(6),d("label",E(13,ws,r.translationKey+"CREATE_BTN"))("type",r.DS_ButtonTypeEnum.PRIMARY)("icon",r.DS_IconsEnum.plus)("iconPlacement",r.DS_IconPlacementEnum.before),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0))},dependencies:[j,$,Ye,$e,ie,q,zn,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Su=t=>({label:t});function Tu(t,o){if(t&1){let n=b();a(0,"biorius-role-general-info-form",3),h("changePendingEmitter",function(i){S(n);let r=c();return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c();d("createRoleTrigger",n.createRoleTrigger)("permissionMetadata",o)("getEntitiesIdsTrigger",n.getEntitiesIdsTrigger)("getEntitiesSubTypesTrigger",n.getEntitiesSubTypesTrigger)}}var Ho=(()=>{let o=class o extends he{constructor(e,i,r,m){super(W.FORM,e,void 0,"ADMINISTRATION.ROLE.CREATION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.navigationService=i,this.rolesAndPermissionsService=r,this.permissionEntitiesService=m,this.translationKey="ADMINISTRATION.ROLE.",this.breadcrumb$=new I({show:!1,items:[]}),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.destroyRef=pe(ue),this.createRoleTrigger=v=>this.rolesAndPermissionsService.createRole(v),this.getEntitiesIdsTrigger=v=>this.permissionEntitiesService.getEntitiesIds(v),this.getEntitiesSubTypesTrigger=v=>this.permissionEntitiesService.getEntitiesSubTypes(v),this.permissionMetadata$=this.fetchPermissionMetadata()}ngOnInit(){this.initBreadcrumb()}ngOnDestroy(){this.clearPending()}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_ROLES"},url:`/${g.BASE}/${g.ALL_ROLES}`},{label:{label:`${this.translationKey}CREATION_TITLE`}}];this.breadcrumb$.next({show:!0,items:e})}fetchPermissionMetadata(){return this.rolesAndPermissionsService.getPermissionMetadata().pipe(X(this.destroyRef),ne({bufferSize:1,refCount:!0}))}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(w),u(Zt),u(Cn))},o.\u0275cmp=R({type:o,selectors:[["biorius-role-creation"]],standalone:!1,features:[V],decls:5,vars:9,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content",1,"-admin"],[3,"createRoleTrigger","permissionMetadata","getEntitiesIdsTrigger","getEntitiesSubTypesTrigger"],[3,"changePendingEmitter","createRoleTrigger","permissionMetadata","getEntitiesIdsTrigger","getEntitiesSubTypesTrigger"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),p(1,"async"),h("clickOnReturn",function(){return r.goBack()}),s(),a(2,"div",1),_(3,Tu,1,4,"biorius-role-general-info-form",2),p(4,"async"),s()),i&2){let m;d("title",E(7,Su,r.translationKey+"CREATION_TITLE"))("breadcrumb",f(1,3,r.breadcrumb$)),l(3),C((m=f(4,5,r.permissionMetadata$))?3:-1,m)}},dependencies:[$,Bi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Eu=t=>({label:t});function yu(t,o){if(t&1){let n=b();a(0,"biorius-role-general-info-form",4),h("changePendingEmitter",function(i){S(n);let r=c(3);return T(r.changePendingAndType(i,r.PendingChangeType.FORM))}),s()}if(t&2){let n=c(2).dsLoading,e=c();d("role",n)("permissionMetadata",o)("updateRoleTrigger",e.updateRoleTrigger)("getEntitiesIdsTrigger",e.getEntitiesIdsTrigger)("getEntitiesSubTypesTrigger",e.getEntitiesSubTypesTrigger)}}function vu(t,o){if(t&1&&(_(0,yu,1,5,"biorius-role-general-info-form",3),p(1,"async")),t&2){let n,e=c(2);C((n=f(1,1,e.permissionMetadata$))?0:-1,n)}}function bu(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),h("onTabChanged",function(i){S(n);let r=c();return T(r.onTabChanged(i))})("onRightButtonClicked",function(i){S(n);let r=c();return T(r.onHeaderActionClicked(i))})("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),a(6,"div",2),_(7,vu,2,3),p(8,"async"),s(),Ke()}if(t&2){let n,e=o.dsLoading,i=c();l(),d("title",E(16,Eu,e.name))("breadcrumb",f(2,6,i.breadcrumb$))("tabs",f(3,8,i.headerTabs$)??void 0)("defaultTab",f(4,10,i.selectedHeaderTabs$))("rightButtons",f(5,12,i.headerRightActions$)),l(6),C((n=f(8,14,i.selectedHeaderTabs$))===i.RoleDetailTab.GENERAL_INFORMATION?7:-1)}}var Vo=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae){super(W.FORM,e,void 0,"ADMINISTRATION.ROLE.EDITION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.activatedRoute=i,this.navigationService=r,this.rolesAndPermissionsService=m,this.permissionEntitiesService=v,this.pendingChangesGuard=F,this.modalService=ae,this.translationKey="ADMINISTRATION.ROLE.",this.breadcrumb$=new I({show:!1,items:[]}),this.headerTabs$=new I(void 0),this.selectedHeaderTabs$=new I(u
1n.GENERAL_INFORMATION),this.headerRightActions$=new I([]),this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.RoleDetailTab=un,this.refreshRole$=new P,this.destroyRef=pe(ue),this.deleteRoleGetter=()=>this.rolesAndPermissionsService.deleteRole(this.roleId).pipe(J(Ce=>this.navigationService.goToRoles(!0))),this.updateRoleTrigger=(Ce,ot)=>this.rolesAndPermissionsService.updateRole(Ce,ot).pipe(X(this.destroyRef),J(()=>this.refreshRole$.next())),this.getEntitiesIdsTrigger=Ce=>this.permissionEntitiesService.getEntitiesIds(Ce),this.getEntitiesSubTypesTrigger=Ce=>this.permissionEntitiesService.getEntitiesSubTypes(Ce)}ngOnInit(){this.roleId=+this.activatedRoute.snapshot.params.id,this.headerTabs$.next(this.fetchHeaderTabs()),this.initRoleFetch(),this.permissionMetadata$=this.fetchPermissionMetadata()}ngOnDestroy(){this.clearPending(),this.closeModal()}initRoleFetch(){this.role$=we(this.fetchRole(this.roleId),this.refreshRole$.pipe(He(()=>this.fetchRole(this.roleId)))).pipe(X(this.destroyRef),ne({bufferSize:1,refCount:!0}))}fetchRole(e){return this.rolesAndPermissionsService.getRole(e).pipe(J(i=>{this.headerRightActions$.next(this.getHeaderRightActions(i)),this.refreshBreadcrumb(i)}))}fetchPermissionMetadata(){return this.rolesAndPermissionsService.getPermissionMetadata().pipe(X(this.destroyRef),ne({bufferSize:1,refCount:!0}))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"ADMINISTRATION.ALL_ROLES.TITLE"},url:`/${g.BASE}/${g.ALL_ROLES}`},{label:{label:e.name}}];this.breadcrumb$.next({show:!0,items:i})}fetchHeaderTabs(){return[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:un.GENERAL_INFORMATION}]}getHeaderRightActions(e){return e.isDeletable?[{label:{label:`${this.translationKey}HEADER.ACTIONS.DELETE`},type:M.DANGER,eventType:or.DELETE}]:[]}onTabChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.confirmTabChanged(e))}):this.confirmTabChanged(e)}onHeaderActionClicked(e){e===or.DELETE&&this.openDeleteRoleConfirmationModal()}openDeleteRoleConfirmationModal(){this.modalRef=this.modalService.show(We,{initialState:{title:{label:`${this.translationKey}CONFIRM_DELETE_MODAL.TITLE`},contentLine1:{label:`${this.translationKey}CONFIRM_DELETE_MODAL.CONTENT`},contentLine2:{label:`${this.translationKey}CONFIRM_DELETE_MODAL.CONTENT2`},confirmationGetter:this.deleteRoleGetter}}),this.modalRef.content.closeEmitter.pipe(X(this.destroyRef)).subscribe(()=>{this.closeModal()})}confirmTabChanged(e){this.selectedHeaderTabs$.next(e)}goBack(){this.navigationService.goBack()}closeModal(){this.modalRef?.hide()}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Je),u(w),u(Zt),u(Cn),u(de),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-role-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"onTabChanged","onRightButtonClicked","clickOnReturn","title","breadcrumb","tabs","defaultTab","rightButtons"],["id","content",1,"-content-detail-with-tabs"],[3,"role","permissionMetadata","updateRoleTrigger","getEntitiesIdsTrigger","getEntitiesSubTypesTrigger"],[3,"changePendingEmitter","role","permissionMetadata","updateRoleTrigger","getEntitiesIdsTrigger","getEntitiesSubTypesTrigger"]],template:function(i,r){i&1&&Z(0,bu,9,18,"ng-container",0),i&2&&d("dsLoading",r.role$)},dependencies:[$,ie,Bi,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Ls=[Go,Ho,Vo];var Bs=gt(Pt());var Fs=t=>({label:t}),Ru=t=>({action:t}),Iu=t=>[t];function Au(t,o){if(t&1){let n=b();a(0,"biorius-services-search",8),h("query",function(i){S(n);let r=c();return T(r.onQuery(i))}),s()}t&2&&d("allRegionsItems",o)}function Du(t,o){if(t&1){let n=b();a(0,"div",9)(1,"ds-button",10),h("clicked",function(){S(n);let i=c();return T(i.onCreateServiceClicked())}),s()()}if(t&2){let n=c();l(),d("label",E(4,Fs,n.translationKey+"CREATE_BTN"))("type",n.DS_ButtonTypeEnum.PRIMARY)("icon",n.DS_IconsEnum.plus)("iconPlacement",n.DS_IconPlacementEnum.before)}}function Ou(t,o){if(t&1){let n=b();a(0,"div",12)(1,"ds-simple-table",13),h("rowClicked",function(i){S(n);let r=c(2);return T(r.goToDetails(i))}),s()()}if(t&2){let n=c().dsLoading,e=c();l(),d("ngClass",e.isLoadingAfterSearch?"table-can-load -loading":"table-can-load")("headers",o)("isLoadingAfterScroll",e.isLoadingAfterScroll)("data",n)("clickable",!0)}}function Nu(t,o){if(t&1&&(a(0,"div",11),_(1,Ou,2,5,"div",12),p(2,"async"),s()),t&2){let n,e=c();
1l(),C((n=f(2,1,e.headers$))?1:-1,n)}}var Uo=(()=>{let o=class o extends nt{constructor(e,i,r,m,v){super(),this.navigationService=e,this.servicesService=i,this.serviceDefinitionService=r,this.tagsStore=m,this.modalService=v,this.translationKey="ADMINISTRATION.ALL_SERVICES.",this.DS_ButtonTypeEnum=M,this.DS_IconsEnum=A,this.DS_IconPlacementEnum=L,this.PermissionActionEnum=se,this.breadcrumb=Re({show:!1,items:[]}),this.regionItems=Rt(()=>{if(this.regionTags()){let F=(0,Bs.orderBy)(this.regionTags()??[],ae=>ae.name.toLowerCase()).map(ae=>({value:ae.id,label:ae.name}));return F.push({value:-1,label:"COMMON.NONE"}),F}else return}),this.allowSearchOnEmptyQuery=!0,this.initSearchGetter(),this.regionTags=$i(this.tagsStore.tagRegions$)}ngOnInit(){super.ngOnInit(),this.initBreadcrumb(),this.headers$.next(this.buildHeaders())}initSearchGetter(){this.searchItemsGetter=(e,i)=>{let r=new fi(e?te({},e):{});return r.page=i,this.servicesService.searchServices(r)}}initBreadcrumb(){let e=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}/${g.ADMINISTRATION}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.ALL_SERVICES"}}];this.breadcrumb.set({show:!0,items:e})}buildHeaders(){return[{label:this.tableBaseTranslationKey("DESCRIPTION"),value:e=>e.description,isStrong:!0,isLarge:!0},{label:this.tableBaseTranslationKey("CODE"),value:e=>e.name},{label:this.tableBaseTranslationKey("PIF_TYPE"),value:e=>e.pifType},{label:this.tableBaseTranslationKey("REGION"),value:e=>e.regionName},{label:this.tableBaseTranslationKey("COMPOSITION_TYPE"),value:e=>na(e.compositionType)},{label:this.tableBaseTranslationKey("PURCHASABLE"),value:e=>e.isPurchasable?"COMMON.YES":"COMMON.NO"}]}onCreateServiceClicked(){this.modalRef=this.modalService.show(po,{initialState:{searchProcessTypesGetter:e=>this.serviceDefinitionService.searchCalmosProcessTypes(e),regionTags:this.regionTags()??[]},ignoreBackdropClick:!0,class:"-full-screen"}),this.modalRef.content.closeEmitter.pipe(Le(e=>e?this.serviceDefinitionService.createService(e):Wt(void 0))).subscribe(e=>{e&&this.navigationService.goToServiceDetail(e.id),this.modalRef?.hide()})}goToDetails(e){this.navigationService.goToServiceDetail(e.id)}goBack(){this.navigationService.goBack()}};o.\u0275fac=function(i){return new(i||o)(u(w),u(Tn),u(vn),u(Qe),u(xe))},o.\u0275cmp=R({type:o,selectors:[["biorius-all-services"]],standalone:!1,features:[V],decls:8,vars:13,consts:[[3,"clickOnReturn","title","breadcrumb"],["id","content","infiniteScroll","",1,"search-results","-admin",3,"scrolled","scrollWindow"],[1,"container","pb-xl","pt-m","vh-100"],[1,"row","pb-m"],[1,"col-10"],[3,"allRegionsItems"],["class","col-2 flex flex-end flex-top mt-xxs",4,"canAccess"],["class","row",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[3,"query","allRegionsItems"],[1,"col-2","flex","flex-end","flex-top","mt-xxs"],[3,"clicked","label","type","icon","iconPlacement"],[1,"row"],[1,"col-12"],[3,"rowClicked","ngClass","headers","isLoadingAfterScroll","data","clickable"]],template:function(i,r){if(i&1&&(a(0,"biorius-basic-header",0),h("clickOnReturn",function(){return r.goBack()}),s(),a(1,"div",1),h("scrolled",function(v){return r.onScrollDown(v)}),a(2,"div",2)(3,"div",3)(4,"div",4),_(5,Au,1,1,"biorius-services-search",5),s(),Z(6,Du,2,6,"div",6),s(),Z(7,Nu,3,3,"div",7),s()()),i&2){let m;d("title",E(7,Fs,r.translationKey+"TITLE"))("breadcrumb",r.breadcrumb()),l(),d("scrollWindow",!1),l(4),C((m=r.regionItems())?5:-1,m),l(),d("canAccess",E(11,Iu,E(9,Ru,r.PermissionActionEnum.CreateService))),l(),d("dsLoading",r.items$)("dsLoadingContinueToShowLoaderIfNil",!0)}},dependencies:[j,$,Ye,$e,ie,q,ka,oo,x],encapsulation:2,changeDetection:0});let t=o;return t})();var Mu=t=>({label:t}),xu=(t,o)=>({"-has-left-menu-opened":t,"-has-left-menu-reduced":o}),Pu=()=>["-with-basic-header"];function wu(t,o){if(t&1){let n=b();a(0,"ds-side-menu",5),h("onReduceMenuClickedEmitter",function(i){S(n);let r=c(2);return T(r.onReduceLeftMenuClicked(i))})("onMenuItemClickedEmitter",function(i){S(n);let r=c(2);return T(r.onSideBarMenuSelectionChanged(i))}),s()}if(t&2){let n=c(2);d("menuItems",o)("selectedItem",n.selectedMenu())("customClasses",it(3,Pu))}}function Lu(t,o){if(t&1&&N(0,"biorius-service-general-info-form",6),t&2){let n=c(2).dsLoading;d("service",n)("regions",o)}}
1function Bu(t,o){if(t&1&&_(0,Lu,1,2,"biorius-service-general-info-form",6),t&2){let n,e=c(2);C((n=e.regionTags())?0:-1,n)}}function Fu(t,o){if(t&1){let n=b();a(0,"biorius-service-handle-documents",7),p(1,"async"),h("pageTypeChanged",function(i){S(n);let r=c(2);return T(r.onPageTypeChange(i))}),s()}if(t&2){let n=c(2);d("documentKindToHandle",n.DocumentKind.Output)("documentTypes",f(1,5,n.serviceOutputDocumentTypes$))("allDocumentTypesGetter",n.getAllDocumentTypesForKind(n.DocumentKind.Output))("serviceDocumentUpdater",n.updateServiceDocuments)("canEdit",n.canEditService())}}function ku(t,o){if(t&1){let n=b();a(0,"biorius-service-tasks",10),h("pageTypeChanged",function(i){S(n);let r=c(4);return T(r.onPageTypeChange(i))}),s()}if(t&2){let n=o.dsLoading,e=c(),i=c(3);d("serviceLegacyTasks",e)("calmosTaskTypes",n)("serviceLegacyTasksUpdater",i.updateServiceLegacyTasks)("canEdit",i.canEditService())}}function $u(t,o){if(t&1&&Z(0,ku,1,4,"biorius-service-tasks",9),t&2){let n=c(3);d("dsLoading",n.calmosTaskTypes$)("dsLoadingContinueToShowLoaderIfNil",!0)}}function Gu(t,o){if(t&1&&(_(0,$u,1,2,"biorius-service-tasks",8),p(1,"async")),t&2){let n,e=c(2);C((n=f(1,1,e.serviceLegacyTasks$))?0:-1,n)}}function Hu(t,o){if(t&1){let n=b();Ue(0),a(1,"biorius-basic-header",1),h("clickOnReturn",function(){S(n);let i=c();return T(i.goBack())}),s(),_(2,wu,1,4,"ds-side-menu",2),a(3,"div",3),_(4,Bu,1,1)(5,Fu,2,7,"biorius-service-handle-documents",4)(6,Gu,2,3),s(),Ke()}if(t&2){let n,e,i=o.dsLoading,r=c();l(),d("title",E(5,Mu,i.name))("breadcrumb",r.breadcrumb()),l(),C((n=r.sideBarMenuItems())?2:-1,n),l(),d("ngClass",dt(7,xu,r.isSideBarOpened(),!r.isSideBarOpened())),l(),C((e=(e=r.selectedMenu())==null?null:e.value)===r.ServiceDetailTab.GENERAL_INFORMATION?4:e===r.ServiceDetailTab.OUTPUT_DOCUMENTS?5:e===r.ServiceDetailTab.TASKS?6:-1)}}var Ko=(()=>{let o=class o extends he{constructor(e,i,r,m,v,F,ae,Ce){super(W.FORM,e,void 0,"ADMINISTRATION.SERVICE.EDITION_EXIT_MODAL_TITLE"),this.userProfileService=e,this.authenticationService=i,this.activatedRoute=r,this.navigationService=m,this.serviceDefinitionService=v,this.pendingChangesGuard=F,this.tagsStore=ae,this.documentTypesService=Ce,this.DS_IconsEnum=A,this.DS_ColorStateEnum=z,this.PendingChangeType=W,this.ServiceDetailTab=Yi,this.DocumentKind=Kt,this.translationKey="ADMINISTRATION.SERVICE.",this.destroyRef=pe(ue),this.breadcrumb=Re({show:!1,items:[]}),this.selectedMenu=Re(void 0),this.isSideBarOpened=Re(!0),this.sideBarMenuItems=Re([]),this.refreshService$=new P,this.refreshServiceOutputDocumentTypes$=new P,this.refreshServiceLegacyTasks$=new P,this.updateServiceLegacyTasks=ot=>this.serviceDefinitionService.updateServiceLegacyTasks(this.serviceId,ot).pipe(J(Ct=>this.refreshServiceLegacyTasks$.next())),this.updateServiceDocuments=(ot,Ct)=>this.serviceDefinitionService.updateServiceDocumentTypes(this.serviceId,ot,Ct).pipe(J(oi=>this.refreshServiceOutputDocumentTypes$.next())),this.regionTags=$i(this.tagsStore.tagRegions$),this.initSideBar(),this.serviceId=+this.activatedRoute.snapshot.params.id,this.canEditService=$i(this.authenticationService.canAccess([{action:se.UpdateService,entityIds:[this.serviceId]}]))}ngOnInit(){this.initServiceFetch(),this.serviceOutputDocumentTypes$=this.initServiceDocumentTypes(Kt.Output,this.refreshServiceOutputDocumentTypes$),this.serviceLegacyTasks$=this.initServiceLegacyTasks()}ngOnDestroy(){this.clearPending()}initServiceDocumentTypes(e,i){return we(this.getDocumentTypesForService(e),i.pipe(Le(()=>this.getDocumentTypesForService(e)))).pipe(X(this.destroyRef))}initServiceFetch(){let e=this.serviceDefinitionService.getService(this.serviceId).pipe(J(i=>{this.calmosTaskTypes$=this.initCalmosTaskTypes(i.name),this.refreshBreadcrumb(i)}));this.service$=we(e,this.refreshService$.pipe(Le(()=>e))).pipe(X(this.destroyRef))}initCalmosTaskTypes(e){return this.serviceDefinitionService.searchCalmosTaskTypes(e,"")}initServiceLegacyTasks(){let e=this.serviceDefinitionService.getServiceLegacyTasks(this.serviceId);return we(e,this.refreshServiceLegacyTasks$.pipe(Le(()=>e))).pipe(X(this.destroyRef))}refreshBreadcrumb(e){let i=[{label:{label:"SHARED.BREADCRUMB.HOME"},url:`/${D.BASE}/${D.DASHBOARD}`},{label:{label:"SHARED.BREADCRUMB.ADMIN.HOME"},url:`/${g.BASE}
1/${g.ADMINISTRATION}`},{label:{label:"ADMINISTRATION.ALL_SERVICES.TITLE"},url:`/${g.BASE}/${g.ALL_SERVICES}`},{label:{label:e.name}}];this.breadcrumb.set({show:!0,items:i})}initSideBar(){let e=[{label:{label:`${this.translationKey}HEADER.TABS.GENERAL_INFO`},value:Yi.GENERAL_INFORMATION},{label:{label:`${this.translationKey}HEADER.TABS.OUTPUT_DOCUMENTS`},value:Yi.OUTPUT_DOCUMENTS},{label:{label:`${this.translationKey}HEADER.TABS.TASKS`},value:Yi.TASKS}];this.sideBarMenuItems.set(e),this.selectedMenu.set(e[0])}onReduceLeftMenuClicked(e){this.isSideBarOpened.set(!e)}onSideBarMenuSelectionChanged(e){this.pending?this.pendingChangesGuard.modalDeactivate(this.type,this.customTranslationKey).pipe(ye(1)).subscribe(i=>{i&&(this.clearPending(),this.selectedMenu.set(e))}):this.selectedMenu.set(e)}goBack(){this.navigationService.goBack()}onPageTypeChange(e){switch(e){case y.EDITION:case y.CREATION:this.changePending(!0);break;default:this.changePending(!1);break}}getDocumentTypesForService(e){return this.serviceDefinitionService.getServiceDocumentTypes(this.serviceId,e)}getAllDocumentTypesForKind(e){return this.documentTypesService.getAllDocumentTypes([e]).pipe(me(i=>i.getDocumentTypesForKind(e)))}};o.\u0275fac=function(i){return new(i||o)(u(ce),u(Si),u(Je),u(w),u(vn),u(de),u(Qe),u(yi))},o.\u0275cmp=R({type:o,selectors:[["biorius-service-detail"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[4,"dsLoading"],[3,"clickOnReturn","title","breadcrumb"],[3,"menuItems","selectedItem","customClasses"],["id","content",1,"-content-detail-with-tabs",3,"ngClass"],[3,"documentKindToHandle","documentTypes","allDocumentTypesGetter","serviceDocumentUpdater","canEdit"],[3,"onReduceMenuClickedEmitter","onMenuItemClickedEmitter","menuItems","selectedItem","customClasses"],[3,"service","regions"],[3,"pageTypeChanged","documentKindToHandle","documentTypes","allDocumentTypesGetter","serviceDocumentUpdater","canEdit"],[3,"serviceLegacyTasks","calmosTaskTypes","serviceLegacyTasksUpdater","canEdit"],[3,"serviceLegacyTasks","calmosTaskTypes","serviceLegacyTasksUpdater","canEdit","pageTypeChanged",4,"dsLoading","dsLoadingContinueToShowLoaderIfNil"],[3,"pageTypeChanged","serviceLegacyTasks","calmosTaskTypes","serviceLegacyTasksUpdater","canEdit"]],template:function(i,r){i&1&&Z(0,Hu,7,10,"ng-container",0),i&2&&d("dsLoading",r.service$)},dependencies:[j,$,ie,Vr,io,no,ao,x],encapsulation:2,changeDetection:0});let t=o;return t})();var ks=[Uo,Ko];var hI=[...Ps,...Ls,...ks,bn,To,vo,Co,Eo,Rn,yo,In,Ro,bo,Wi,ho,fo,So,go];var Vu=[{path:"",redirectTo:g.PROFILES,pathMatch:"full"},{path:g.PROFILES,component:ho,canActivate:Ee([ve,Ii]),data:{permissions:[{action:se.ManageUsers}],unauthorizedRedirect:Ti.isOverviewFeatureEnabled()?D.OVERVIEW:D.DASHBOARD}},{path:g.PROFILE_DEFINITION,canDeactivate:Ze([de]),component:Wi,canActivate:Ee([ve,Ii]),data:{permissions:[{action:se.ManageUsers}],unauthorizedRedirect:Ti.isOverviewFeatureEnabled()?D.OVERVIEW:D.DASHBOARD}},{path:g.MY_PROFILE,component:Wi,canDeactivate:Ze([de]),canActivate:Ee([Ii]),data:{unauthorizedRedirect:Ti.isOverviewFeatureEnabled()?D.OVERVIEW:D.DASHBOARD}},{path:g.EXPLANATION_HELP,component:Rn},{path:g.ADMINISTRATION,component:bn,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.MANAGE_SURVEYS,component:In,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ALL_TAGS,component:Co,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.TAG_DETAIL,component:go,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.TAG_CREATION,component:So,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.SURVEY_CREATION,component:fo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ALL_DOCUMENT_REQUESTS,component:To,canActivate:Ee([ve,be]),data:{permissions:[{action:se.ManageRequirementSubjects}],unauthorizedRedirect:D.DASHBOARD}},{path:g.DOCUMENT_REQUEST_DETAIL,component:Eo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.ManageRequirementSubjects}],unauthorizedRedirect:D.DASHBOARD}},{path:g.CATEGORIES,component:yo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ALL_MONITORING_TOPICS,component:vo,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.MONITORING_TOPIC_DETAIL,component:bo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.MONITORING_TOPIC_CREATION,component:Ro,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.REGULATORY_CHECK_CONFIGURATIONS,component:Io,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.RULE_SETS,component:Ao,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.RULE_SET_DETAIL,component:Do,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.RULE_SET_CREATION,component:Oo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.REGULATORY_RULE_DETAIL,component:No,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.RULE_PACKS,component:Mo,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.RULE_PACK_DETAIL,component:xo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.RULE_PACK_CREATION,component:Po,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.POSITIVE_LISTS,component:wo,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.POSITIVE_LIST_DETAIL,component:Lo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.POSITIVE_LIST_CREATION,component:Bo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.SENTENCES,component:Fo,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.SENTENCE_DETAIL,component:ko,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.SENTENCE_CREATION,component:$o,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ALL_ROLES,component:Go,canActivate:Ee([ve,be]),data:{permissions:[{action:se.ManageRoles}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ROLE_CREATION,component:Ho,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.ManageRoles}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ROLE_DETAIL,component:Vo,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.ManageRoles}],unauthorizedRedirect:D.DASHBOARD}},{path:g.ALL_SERVICES,component:Uo,canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}},{path:g.SERVICE_DETAIL,component:Ko,canDeactivate:Ze([de]),canActivate:Ee([ve,be]),data:{permissions:[{action:se.Administration}],unauthorizedRedirect:D.DASHBOARD}}],$s=(()=>{let o=class o{};o.\u0275fac=function(i){return new(i||o)}
1,o.\u0275mod=Ji({type:o}),o.\u0275inj=Xi({providers:[...Xa],imports:[zo.forChild(Vu),zo]});let t=o;return t})();var Uu=[Wo,kr,Fr,Mr,Ir,Wo,xr,Ar,Rr,Gr,Or,$r,Kr,jr,wr,Br,qr,Ur,Hr],aA=(()=>{let o=class o{};o.\u0275fac=function(i){return new(i||o)},o.\u0275mod=Ji({type:o}),o.\u0275inj=Xi({providers:[...Za,Ii,be,Mt],imports:[zr.forRoot(),$s,fr,za,_r,gr,Sr,Lr,Wr,Qr.forChild({extras:{lazyRender:!0},types:[{name:"mfa",component:An,wrappers:["simple-field-wrapper"]}]}),Uu,Ga]});let t=o;return t})();export{aA as AdministrationModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.