import{a as h,c as S}from"./chunk-4JPVW6MI.js";import{wa as v,xa as m,ya as k}from"./chunk-QH7CG3K4.js";import{Ja as f,Rb as a,Sd as M,kc as g,lc as d,zc as u}from"./chunk-XJKQ67XR.js";import{e as L}from"./chunk-SZAW6ZBW.js";var I,y=L(()=>{k();S();M();k();I=(()=>{class l{constructor(){this.riskLevel=0,this.tooltipText="",this.riskColor=""}ngOnInit(){this.setRiskColor()}ngOnChanges(o){o.riskLevel&&this.setRiskColor()}setRiskColor(){let o=[{offset:0,color:{r:18,g:152,b:6}},{offset:.25,color:{r:63,g:191,b:8}},{offset:.5,color:{r:215,g:191,b:9}},{offset:.75,color:{r:230,g:124,b:10}},{offset:1,color:{r:211,g:9,b:9}}],t=Math.max(0,Math.min(100,this.riskLevel))/100,r=0;for(let i=0;i<o.length-1;i++)if(t>=o[i].offset&&t<=o[i+1].offset){r=i;break}let e=o[r],n=o[r+1],p=n.offset-e.offset,c=p>0?(t-e.offset)/p:0,C=Math.round(e.color.r+(n.color.r-e.color.r)*c),T=Math.round(e.color.g+(n.color.g-e.color.g)*c),b=Math.round(e.color.b+(n.color.b-e.color.b)*c);this.riskColor=`#${C.toString(16).padStart(2,"0")}${T.toString(16).padStart(2,"0")}${b.toString(16).padStart(2,"0")}`.toUpperCase()}static{this.\u0275fac=function(s){return new(s||l)}}static{this.\u0275cmp=a({type:l,selectors:[["dvls-privileged-access-risk-level-tag"]],inputs:{riskLevel:"riskLevel",tooltipText:"tooltipText"},features:[f],decls:1,vars:7,consts:[[3,"severity","value","pTooltip"]],template:function(s,t){if(s&1&&u(0,"p-tag",0),s&2){let r;d("background-color",t.riskColor)("color","#fff"),g("severity","info")("value",(r=t.riskLevel==null?null:t.riskLevel.toString())!==null&&r!==void 0?r:"N/A")("pTooltip",t.tooltipText)}},dependencies:[m,v,h],encapsulation:2})}}return l})()});export{I as a,y as b};
