1import{a as f}from"./chunk-2L2ZYCSH.js";import{H as M,R as S,ba as b,ka as L,p as I,s as E,sa as A,v as d,va as R}from"./chunk-ZIECK5QA.js";import{m as u}from"./chunk-3JMZ37NM.js";var p=function(n){return n.EMAIL="EMAIL",n.NAME="NAME",n.PHONE_NUMBER="PHONE_NUMBER",n.ADDRESS="ADDRESS",n}(p||{}),k=function(n){return n.FIXED="FIXED",n.REGULAR="REGULAR",n.INTERCALATED="INTERCALATED",n}(k||{});var j=(()=>{let l=class l{constructor(e){this.baseStoreService=e,this.currentBaseStore=this.baseStoreService.getCurrentBaseStore()}isMaskingEnabled$(){return this.currentBaseStore.pipe(S(1),d(e=>e.enableMasking))}isMaskingEnabled(){return u(this,null,function*(){return E(this.isMaskingEnabled$())})}isClickToRevealEnabled$(){return this.currentBaseStore.pipe(S(1),d(e=>e.enableClickToReveal))}isClickToRevealEnabled(){return u(this,null,function*(){return E(this.isClickToRevealEnabled$())})}getMaskConfig$(e){return this.currentBaseStore.pipe(S(1),b("itemMasks"),M(r=>r?.length>0),d(r=>r.find(t=>t.maskField===e)))}getMaskConfig(e){return u(this,null,function*(){return this.getMaskConfig$(e).toPromise()})}getMaskedPiiInformation(e,r=""){let t=r,c=r.indexOf("..."),h="";if(c!==-1&&(t=r.substring(0,c)),e.mask1StartIndex>0){let m=t,o=null;if(t.includes("@")&&e.maskField===p.EMAIL){let a=t.indexOf("@");a-(e.mask1Length+e.mask1StartIndex)<0&&a>e.mask1StartIndex-1&&(h=Array(e.mask1Length+(e.mask1StartIndex-1)-a).fill("*").join("")),m=t.substring(0,a),o=t.substring(a)}else t.length-(e.mask1Length+e.mask1StartIndex)<0&&t.length>e.mask1StartIndex&&(h=Array(e.mask1Length+(e.mask1StartIndex-1)-t.length).fill("*").join(""));let i=e.mask1StartIndex-1,s=m;switch(e.maskMode){case k.REGULAR:s=this.maskString(s,i,e.mask1Length),e.mask2StartIndex>0&&(e.mask2Length>0?s=this.maskString(s,e.mask2StartIndex-1,e.mask2Length):s=this.maskString(s,e.mask2StartIndex-1,s.length));break;case k.FIXED:s=this.maskString(s,i,e.mask1Length),s=s.slice(0,i+e.mask1Length)+h;break;case k.INTERCALATED:{let a=0;for(;a<t.length;){let g=s.slice(0,a),x=s.slice(a,a+i+e.mask1Length),v=s.slice(a+i+e.mask1Length),N=this.maskString(x,i,e.mask1Length);s=g+N+v,a+=i+e.mask1Length}}break}return o?s+o:s+(c!==-1?"...":"")}else return t}maskString(e,r,t){if(t||(t=e.length),r>e.length)return e;r+t>e.length&&(t=e.length-r);let c=Math.min(e.length,r+t),h=e.slice(0,r),m=e.slice(c),o=Array(t).fill("*").join("");return h+o+m}mask(e,r){return this.isMaskingEnabled$().pipe(L(t=>t?this.getMaskConfig$(r).pipe(d(c=>this.getMaskedPiiInformation(c,e))):I(e)))}};l.\u0275fac=function(r){return new(r||l)(R(f))},l.\u0275prov=A({token:l,factory:l.\u0275fac,providedIn:"root"});let n=l;return n})();export{p as a,j as b};
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.