1import{$t as Q_,D,Di as iS,Ga as u_,Gi as ls,Li as jy,Mr as c8,Or as bM,Qi as mS,R as Eb,Sr as a_,Tr as av,Zr as dy,_a as pM,_n as T,ai as fd,ar as YS,br as a8,ca as oS,fo as xy,ho as yd,qn as Ws,ri as fM,yn as TM}from"./chunk-B6M1Bjt5.js";import{F as ln,c as Hn,p as P,u as Kn}from"./chunk-BFAe479M.js";import{a as ve,i as cs,n as as,t as Ye}from"./chunk-CHmqsmye.js";import{n as M}from"./chunk-BdmVmPS2.js";import{T as ye,w as ve$1}from"./chunk-Dm41vtTJ.js";import{a as kt,r as Vo}from"./chunk-HXnc5LXF.js";import{r as U}from"./chunk-Z80CUMfE.js";import{r as Xe}from"./chunk-C6EWKSl2.js";var J=()=>({selectAllButtonText:``});var Q=(o,r)=>r==null?null:r.id;function W(o,r){if(o&1&&(Ws(0,`ispui-select-option`,1)(1,`div`,2)(2,`ispui-tooltip`,3),YS(3),fd(),Ws(4,`ispui-tooltip`,3)(5,`span`,4),YS(6),fd()()()()),o&2){let e=r.$implicit,t=mS();xy(`value`,e.id)(`textRepresentation`,t.getDisplayLabel(e)),Eb(2),xy(`ellipsis`,!0),Eb(),yd(` `,t.getDisplayLabel(e),` `),Eb(),xy(`ellipsis`,!0),Eb(2),av(e.desc)}}var X=new T(`RolesService`);var Z=[`@admin`,`@advanced_user`,`@user`];var ge=(()=>{class o extends Xe{constructor(){super(),this.disablePlaceholder=c8(!0),this.roleChange=a8(),this.isDisabled=ls(!1),this.value=ls([]),this.rolesList=ls([]),this.rolesService=D(X),this.translate=D(M),this.onChange=()=>{},this.onTouch=()=>{},this.rolesService.roles$.pipe(U()).subscribe(e=>{this.rolesList.set(e)})}writeValue(e){e!==void 0&&this.value.set(e||[])}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouch=e}updateValue(e){let t=this.applyRoleSelectionRules(e);this.value.set(t),this.onChange(t),this.formControl?.setValue(t),this.onTouch(t),this.roleChange.emit(t)}setDisabledState(e){this.isDisabled.set(e)}applyRoleSelectionRules(e){if(!e.length)return e;let t=e.filter(s=>this.isSystemRole(s)),i=e.filter(s=>!this.isSystemRole(s)),h=this.value().filter(s=>this.isSystemRole(s)),u=this.value().filter(s=>!this.isSystemRole(s)),q=t.some(s=>!h.includes(s)),z=i.some(s=>!u.includes(s));return q?[t[t.length-1]]:z?i:t.length>1?[t[t.length-1]]:e}getDisplayLabel(e){return e?.label?this.translate.instant(e.label,e.labelParams):e.name}isSystemRole(e){if(!this.rolesList())return!1;let t=this.rolesList()?.find(i=>i.id===e);return Z.some(i=>t?.name.includes(i))}static{this.ɵfac=function(t){return new(t||o)}}static{this.ɵcmp=Q_({type:o,selectors:[[`vmdci-roles-select`]],inputs:{disablePlaceholder:[1,`disablePlaceholder`]},outputs:{roleChange:`roleChange`},features:[fM([{provide:P,useExisting:o,multi:!0}]),dy],decls:4,vars:8,consts:[[`anchorType`,`input`,`searchMode`,`off`,3,`ngModelChange`,`placeholder`,`multiple`,`disabled`,`advancedConfig`,`ngModel`],[3,`value`,`textRepresentation`],[1,`ispui-flex`,`ispui-flex__col`],[`width`,`210px`,3,`ellipsis`],[1,`ispui-text-description`,`isp-text_theme_additional`]],template:function(t,i){t&1&&(Ws(0,`ispui-select-v2`,0),bM(1,`vmdciTranslateNamespaceSimple`),jy(`ngModelChange`,function(u){return i.updateValue(u)}),oS(2,W,7,6,`ispui-select-option`,1,Q),fd(),a_()),t&2&&(xy(`placeholder`,i.disablePlaceholder()?``:TM(1,5,`USERS.ACL_MODAL.ACL_PLACEHOLDER`))(`multiple`,!0)(`disabled`,i.isDisabled())(`advancedConfig`,pM(7,J))(`ngModel`,i.value()),u_(),Eb(2),iS(i.rolesList()))},dependencies:[as,Ye,ve,cs,Vo,kt,Kn,Hn,ln,ye,ve$1],styles:[`.ispui-select-option[_ngcontent-%COMP%]{align-items:start;padding:var(--isp-spacer-8);text-overflow:ellipsis;border:none}`]})}}return o})();export{ge as n,X as t}; 2//# debugId=da5af65d-0c3e-5881-bf5c-55e57e02138a
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.