1import{b as w}from"./chunk-UTIROFZB.js";import{d as F}from"./chunk-E6SPOSAE.js";import{C as $,M as C,R as x,W as b,Z as m,cg as T,l as p,p as d,r as S,rd as y,wd as N}from"./chunk-CECBUGKR.js";import{h as f}from"./chunk-O7S4L63H.js";function l(t){return t?t.replace(/[.\-\/\s]/g,"").toUpperCase():""}function I(t){return t.charCodeAt(0)-48}function M(t,e){let n=0;for(let o=0;o<e.length;o++)n+=I(t[o])*e[o];let r=n%11;return r<2?0:11-r}function U(t){let e=l(t);if(!/^\d{11}$/.test(e)||/^(\d)\1{10}$/.test(e))return!1;let n=0;for(let i=0;i<9;i++)n+=Number(e[i])*(10-i);let r=n*10%11;if(r===10&&(r=0),r!==Number(e[9]))return!1;n=0;for(let i=0;i<10;i++)n+=Number(e[i])*(11-i);let o=n*10%11;return o===10&&(o=0),o===Number(e[10])}function j(t){let e=l(t);if(!/^[0-9A-Z]{12}\d{2}$/.test(e)||/^([0-9A-Z])\1{13}$/.test(e))return!1;let n=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2],o=M(e.slice(0,12),n),i=M(e.slice(0,12)+String(o),r);return e[12]===String(o)&&e[13]===String(i)}function P(t){let e=l(t);return e.length===11?U(e):e.length===14?j(e):!1}function v(t){if(!t)return"";let e=l(t);return e.length===11?`${e.slice(0,3)}.${e.slice(3,6)}.${e.slice(6,9)}-${e.slice(9)}`:e.length===14?`${e.slice(0,2)}.${e.slice(2,5)}.${e.slice(5,8)}/${e.slice(8,12)}-${e.slice(12)}`:t}function Z(t){return Object.keys(t).forEach(e=>{(!t[e]&&t[e]!=!1||t[e]===""||t[e].length==0)&&delete t[e]}),t}var A=[],H=(t,e=0,n=200)=>{clearTimeout(A[e]),A[e]=setTimeout(()=>{t()},n)};function W(t){return t>=1e9?(t/1e9).toFixed(1)+"B":t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":t.toString()}function K(t){return new Date(t.getFullYear(),t.getMonth(),1)}function E(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function G(t,e){let n=(t??"").trim(),r=(e??"").trim();if(n===r)return 0;if(!n)return 1;if(!r)return-1;let o=n.split("."),i=r.split("."),a=Math.max(o.length,i.length);for(let s=0;s<a;s++){let c=o[s],u=i[s];if(c===void 0)return-1;if(u===void 0)return 1;let O=/^\d+$/.test(c),_=/^\d+$/.test(u);if(O&&_){let h=parseInt(c,10),D=parseInt(u,10);if(h!==D)return h-D;continue}let g=c.localeCompare(u,"pt-BR",{numeric:!0,sensitivity:"base"});if(g!==0)return g}return 0}function Q(t){let e=new Date(t).getMonth(),n=new Date(t).getFullYear();return new Date(n,e+1,0)}function X(t){let e=new Date(t).getMonth(),n=new Date(t).getFullYear();return new Date(n,e,1)}function tt(t,e,n,r){n.reset&&t.get(e)?.reset(),n.clear&&t.get(e)?.clearValidators(),n.disable?t.get(e)?.disable():t.get(e)?.enable(),r&&r?.length>0&&r.includes("required")&&t.get(e)?.addValidators(F.required),t.get(e)?.updateValueAndValidity()}function et(t){return t===null||t===void 0?!1:["true","1",!0,1].includes(t)}function nt(t){let e=new Date(t),n=e.getMonth()+1<10?`0${e.getMonth()+1}`:e.getMonth()+1,r=e.getFullYear();return`${n}/${r}`}function rt(t){switch(t){case"ANTES_COMPETENCIA":t="Antes da compete\u0302ncia";break;case"NA_COMPETENCIA":t="Na compete\u0302ncia";break;default:t="Apo\u0301s a compete\u0302ncia"}return t}function ot(t,e){let n=new Date(e);return Math.floor((t.getTime()-n.getTime())/864e5)}function it(t,e=""){return t?.toString().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]/g,e).replace(/(_)\1+/g,"$1")}function at(t){let e=sessionStorage.getItem("pessoa_selected");if(!e)return;let n=JSON.parse(e);return!t||!t.length||n.type===t||t?.includes(n.type)?n.uuid:void 0}function st({type:t,uuid:e}){e?sessionStorage.setItem("pessoa_selected",JSON.stringify({type:t,uuid:e})):sessionStorage.removeItem("pessoa_selected")}function ct(){let t=sessionStorage.getItem("profileData");return t&&JSON.parse(t)?.uuid||""}function ut(){let t=sessionStorage.getItem("profileData");if(!t)return null;try{return JSON.parse(t)}catch{return null}}function lt(t){!t||typeof t!="object"||sessionStorage.setItem("profileData",JSON.stringify(t))}function ft(t){return t?v(t):""}function pt(t){Object.keys(t.value).forEach(e=>{[null,void 0,"1970-01-01T00:00:00.000",""].includes(t.get(e)?.value)&&delete t.value[e]})}function dt({parcela:t,totalParcelas:e,planoDeContas:n,descricao:r,tipo_acordo:o,n_acordo:i}){let a="";return e&&e>0&&t&&(a+=`${t}/${e} - `),n&&(a+=`${n}`),r&&(a+=` - ${r}`),o&&(a+=` ${o.toUpperCase()} N\xBA ${i}`),a.trim().replace(/- $/,"")}function mt(t,e=0){let n=e.toString(),r=t-n.length;return r>0&&(n="0".repeat(r)+n),n}function B(t){let e=t?new Date(t):null;return e?new Date(e.getTime()+e.getTimezoneOffset()*6e4):null}function gt(t){let e=new Date(t),n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),o=e.getFullYear();return`${n}/${r}/${o}`}function V(t){let e=new Date(t);return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}function ht(t,e){let r=N(new Date,e);return y(t,r)}function Dt(t){if(!t)return"";let e=typeof t=="string"?new Date(t):t,n=e.getUTCFullYear(),r=String(e.getUTCMonth()+1).padStart(2,"0"),o=String(e.getUTCDate()).padStart(2,"0");return`${n}-${r}-${o}`}function R(t){if(t==null)return;let e=typeof t=="string"?V(t):E(t instanceof Date?t:new Date(t));if(!e||Number.isNaN(e.getTime()))return;let n=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return`${n}-${r}-${o}`}function St(t){let e=t.codigo!=null?String(t.codigo).padStart(2,"0"):null,n=t.banco?.nome?.trim()??"",r=t.digito_conta?.trim()?`${t.numero}-${t.digito_conta.trim()}`:t.numero,o=`Ag ${t.agencia} \xB7 Cc ${r}`;return e?`${e} \xB7 ${n||"Conta"} \xB7 ${o}`:`${n||"Conta"} \xB7 ${o}`}function $t(t){if(t==null||t==="")return"\u2014";if(typeof t=="string"){let i=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(i)){let[a,s,c]=i.split("-");return`${c}/${s}/${a}`}}let e=typeof t=="string"?new Date(t):t;if(Number.isNaN(e.getTime()))return"\u2014";let n=String(e.getUTCDate()).padStart(2,"0"),r=String(e.getUTCMonth()+1).padStart(2,"0"),o=e.getUTCFullYear();return`${n}/${r}/${o}`}var Y=35;function Ct(t){if(t==null)return null;let e=R(t);if(!e)return null;let[n,r,o]=e.split("-").map(Number);return new Date(n,r-1,o+Y)}
1function xt(){let t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function L(t){if(!t)return[];if(typeof t=="string")try{let e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return Array.isArray(t)?t:[]}function bt(t){return L(t).sort((n,r)=>n.ordem-r.ordem).map(n=>{let r=n.data?new Date(n.data).toLocaleDateString("pt-BR",{timeZone:"UTC"}):"\u2014",o=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(n.valor??0);return`At\xE9 ${r}: ${o}`})}function yt(t){let e=B(t),n=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),o=new Date(n.getFullYear(),n.getMonth(),n.getDate());return r<o?"vencido":"a_vencer"}function Nt(t,e){let n=String(e||"arquivo").replace(/[<>:"/\\|?*\u0000-\u001f]/g,"_").trim()||"arquivo",r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=n,o.rel="noopener",o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>URL.revokeObjectURL(r),1e3)}function wt(t,e){if(t){let n=/filename\*?=(?:UTF-8'')?["']?([^"';]+)/i.exec(t);if(n?.[1])return decodeURIComponent(n[1].trim())}return e}function Tt(t){return(t??[]).map((e,n)=>{let r=e.arquivo,o=e.arquivo_uuid??r?.uuid??e.uuid,i=r?.nome??e.nome,a=r?.url??e.url;return{id:r?.id??e.id,local_id:o??`existing-${n}`,arquivo_uuid:o,tipo_documento_id:r?.tipo_documento_id??e.tipo_documento_id??null,descricao_documento_id:r?.descricao_documento_id??e.descricao_documento_id??null,competencia:r?.competencia??e.competencia,nome:i,url:a}}).filter(e=>!!e.arquivo_uuid||!!e.nome)}function Ft(t){if(!t)return"-";let e=t.percentual_isencao??null,n=t.valor_beneficio??null;if(t.tipo_beneficio==="ISENTO"||(e??0)>=100)return"Isen\xE7\xE3o (100%)";if(t.tipo_beneficio==="DESCONTO"||(e??0)>0&&(e??0)<100){if(t.tipo_valor_beneficio==="VALORIZADO"&&n!=null)return`De
1sconto R$ ${n.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2})}`;let r=n??e;return r!=null&&r>0?`Desconto ${r}%`:"Desconto"}return t.tipo_valor_beneficio==="VALORIZADO"&&n!=null?`Desconto R$ ${n.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2})}`:e!=null&&e>0&&e<100?`Desconto ${e}%`:(t.tipo_beneficio==="SEM_BENEFICIO","Sem benef\xEDcio")}var Ut=(()=>{class t{constructor(n,r){this.api=n,this.modalService=r,this.grantedCache=new Map,this.inflightChecks=new Map}clearCache(){this.grantedCache.clear(),this.inflightChecks.clear()}resolvePermission(n){let r=this.grantedCache.get(n);if(r!==void 0)return p(r);let o=this.inflightChecks.get(n);if(o)return o;let i=this.api.post("/permissions/check",{action:n}).pipe(S(a=>!!(a?.cargos?.length||a?.usuarios?.length)),x(a=>{this.grantedCache.set(n,a),this.inflightChecks.delete(n)}),$(()=>(this.inflightChecks.delete(n),p(!1))),C(1));return this.inflightChecks.set(n,i),i}validate(n,r,o=()=>{},i=!0){this.resolvePermission(n).subscribe(a=>{if(a){r();return}o(),i&&this.modalService.error({nzTitle:"Acesso negado",nzContent:"Sem permiss\xE3o para esta a\xE7\xE3o"})})}validateWithoutModal(n,r,o=()=>{}){this.resolvePermission(n).subscribe(i=>{i?r():o()})}validateMany(n,r,o=()=>{}){return f(this,null,function*(){(yield Promise.all(n.map(s=>d(this.resolvePermission(s))))).every(Boolean)?r():(o(),this.modalService.error({nzTitle:"Acesso negado",nzContent:"Sem permiss\xE3o para esta a\xE7\xE3o"}))})}validateManyWithoutModal(n,r,o=()=>{}){return f(this,null,function*(){(yield Promise.all(n.map(s=>d(this.resolvePermission(s))))).every(Boolean)?r():o()})}static{this.\u0275fac=function(r){return new(r||t)(m(w),m(T))}}static{this.\u0275prov=b({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{l as a,j as b,P as c,v as d,Z as e,H as f,W as g,K as h,E as i,G as j,Q as k,X as l,tt as m,et as n,nt as o,rt as p,ot as q,it as r,at as s,st as t,ct as u,ut as v,lt as w,ft as x,pt as y,dt as z,mt as A,B,gt as C,V as D,ht as E,Dt as F,R as G,St as H,$t as I,Ct as J,xt as K,bt as L,yt as M,Nt as N,wt as O,Tt as P,Ft as Q,Ut as R};
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.