1import{o as e,s as t}from"./ambiente-D_z21eLl.js";import{t as n}from"./moment-CIyM6JMc.js";var r=e=>{if(!e)return``;if(e=e.toUpperCase().replace(/[^0-9A-Z]/g,``),e.length<=11)return e=e.replace(/(\d{3})(\d)/,`$1.$2`),e=e.replace(/(\d{3})(\d)/,`$1.$2`),e=e.replace(/(\d{3})(\d{1,2})$/,`$1-$2`),e;let t=e.substring(0,2);return e.length>2&&(t+=`.`+e.substring(2,5)),e.length>5&&(t+=`.`+e.substring(5,8)),e.length>8&&(t+=`/`+e.substring(8,12)),e.length>12&&(t+=`-`+e.substring(12,14)),t},i=e=>{if(e=(e||``).toUpperCase().replace(/[^0-9A-Z]/g,``),e.length===11){let t=0,n;if(/^(\d)\1{10}$/.test(e))return!1;for(let n=1;n<=9;n++)t+=parseInt(e.substring(n-1,n))*(11-n);if(n=t*10%11,(n===10||n===11)&&(n=0),n!==parseInt(e.substring(9,10)))return!1;t=0;for(let n=1;n<=10;n++)t+=parseInt(e.substring(n-1,n))*(12-n);return n=t*10%11,(n===10||n===11)&&(n=0),n===parseInt(e.substring(10,11))}else if(e.length===14)return o(e)},a=e=>e.charCodeAt(0)-48,o=e=>{if(e=(e||``).toUpperCase(),e===``||e.length!==14||/^(\d)\1{13}$/.test(e))return!1;let t=e.length-2,n=e.substring(0,t),r=e.substring(t),i=0,o=t-7;for(let e=t;e>=1;e--)i+=a(n.charAt(t-e))*o--,o<2&&(o=9);let s=i%11<2?0:11-i%11;if(s.toString()!==r.charAt(0))return!1;t+=1,n=e.substring(0,t),i=0,o=t-7;for(let e=t;e>=1;e--)i+=a(n.charAt(t-e))*o--,o<2&&(o=9);return s=i%11<2?0:11-i%11,s.toString()===r.charAt(1)},s=e=>{let t=``;return t=e.length===11?`CPF`:`CNPJ`,t};function c(e){return e||=0,typeof e==`string`&&(e=parseFloat(e)),e.toLocaleString(`pt-br`,{style:`currency`,currency:`BRL`})}function l(e){return(e||``).toString().replace(/\D/g,``)}function u(e){return(e||``).toString().replace(/[^a-zA-Z0-9]/g,``)}function d(e){return(e||``).toString().replace(/[^01234567890,.]/g,``)}function f(e,t){e.key===`Enter`&&t()}var p=e=>{if(!e)return``;let t=e.replace(/\D/g,``);return t.length<=2?`(${t}`:t.length<=7?`(${t.slice(0,2)}) ${t.slice(2)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7,11)}`},m=e=>{for(var t=``,n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`,r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t};async function h(e){return new Promise(t=>setTimeout(t,e))}function g(e){return/^(\(?\d{2}\)?\s?)?(9\d{4}-?\d{4})$/.test(e)}function _(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}var v=/^[A-Za-zÃ-ÃÃ-öø-ÿ]+(?:[ 'â-][A-Za-zÃ-ÃÃ-öø-ÿ]+)*$/,y=`O nome não pode conter números ou caracteres especiais`;function b(e){let t=(e||``).toString().trim().replace(/\s+/g,` `);return t.length>=2&&v.test(t)}var x=/[^A-Za-z .'-]/g;function S(e){return(e||``).toString().normalize(`NFD`).replace(/[Ì-ͯ]/g,``).replace(x,``)}function C(e){return S(e).replace(/\s+/g,` `).trim()}var w=e=>{let t=``;switch(e){case`CpfCnpj`:t=`CPF/CNPJ`;break;case`Email`:t=`E-mail`;break;default:t=e;break}return t},T=(e,t)=>{let n=``;switch(t){case`CpfCnpj`:n=r(e);break;case`Telefone`:n=p(e);break;default:n=e;break}return n},E=/^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i;function D(e){return E.test((e||``).toString().trim().replace(/\s/g,``))}function O(e){let t=(e||``).toString().trim();if(!t)return{tipo:``,perguntarCelular:!1};if(t.includes(`@`))return{tipo:`Email`,perguntarCelular:!1};if(D(t))return{tipo:`Chave aleatória`,perguntarCelular:!1};let n=t.replace(/\D/g,``),r=t.toUpperCase().replace(/[^0-9A-Z]/g,``);if((t.startsWith(`+`)||n.startsWith(`55`))&&n.length>=12&&n.length<=13)return{tipo:`Telefone`,perguntarCelular:!1};if(r.length===14)return{tipo:`CpfCnpj`,perguntarCelular:!1};if(n.length===11&&r.length===11){let e=i(n);return g(p(n))?{tipo:e?`CpfCnpj`:`Telefone`,perguntarCelular:!0}:{tipo:`CpfCnpj`,perguntarCelular:!1}}return/[A-Za-z]/.test(t)?{tipo:`Chave aleatória`,perguntarCelular:!1}:{tipo:`CpfCnpj`,perguntarCelular:!1}}function k(e,t,r){return n(t).diff(e,`days`)<=r}var A=e=>e?parseFloat(parseFloat(e||0).toFixed(2)):``,j=e=>{let t=e.toUpperCase().replace(/[^A-Z0-9]/g,``);return t.length>3&&t.length<=7&&(t=/^[A-Z]{3}[0-9]{1}[A-Z]{1}/.test(t)?t.replace(/^([A-Z]{3})([0-9]{1})([A-Z]{1})([0-9]{2})?$/,`$1$2$3$4`):t.replace(/^([A-Z]{3})([0-9]{0,4})$/,`$1-$2`)),t},M=e=>n(e).format(`DD/MM/YYYY`),N=e=>e===`png`||e===`jpg`||e===`jpeg`,P=e=>e===`pdf`,F=e=>e===`mp4`||e===`webm`||e===`ogg`||e===`mov`;function I(e,t,n){n/=100;let r=1,i=1;for(let e=1;e<=t;e++)i*=n+1,r+=i;return r-=i,e*=i,parseFloat((e/r).toFixed(2))}
1function L(n){if(t()){window.location.href=`http://localhost:3004${n}`;return}if(e()){window.location.href=`https://site.homologacao.quitaboletos.com${n}`;return}window.location.href=`https://quitaboletos.com.br${n}`}function R(n){if(t()){window.location.href=`http://localhost:3001/app/area-cliente${n}`;return}if(e()){window.location.href=`https://app.homologacao.quitaboletos.com/app/area-cliente${n}`;return}window.location.href=`https://app.quitaboletos.com.br/app/area-cliente${n}`}function z(e){let t={},n=0;for(;n+4<=e.length;){let r=e.substring(n,n+2),i=parseInt(e.substring(n+2,n+4),10);if(isNaN(i)||n+4+i>e.length)break;t[r]=e.substring(n+4,n+4+i),n+=4+i}return t}function B(e){let t=65535;for(let n=0;n<e.length;n++){t^=e.charCodeAt(n)<<8;for(let e=0;e<8;e++)t=t&32768?t<<1^4129:t<<1,t&=65535}return t.toString(16).toUpperCase().padStart(4,`0`)}function V(e){if(!e||typeof e!=`string`)return!1;let t=e.trim();if(!t.toUpperCase().startsWith(`000201`))return console.warn(`[PIX] Chave inválida: não começa com 000201`,t.slice(0,10)),!1;if(t.length<8)return console.warn(`[PIX] Chave inválida: muito curta`,t.length),!1;if(t.slice(-8,-4).toUpperCase()!==`6304`)return console.warn(`[PIX] Chave inválida: campo CRC ausente (esperado '6304' antes dos últimos 4 chars)`,t.slice(-8)),!1;let n=t.slice(-4).toUpperCase();if(!/^[0-9A-F]{4}$/.test(n))return console.warn(`[PIX] Chave inválida: CRC não é hex válido`,n),!1;let r=B(t.slice(0,-4));return r===n?(console.log(`[PIX] Chave válida`),!0):(console.warn(`[PIX] Chave inválida: CRC incorreto â esperado`,r,`recebido`,n),!1)}function H(e){let t=z(e.trim().toUpperCase());if(console.log(`[PIX] Campos EMV parseados:`,t),!t[62])return console.log(`[PIX] Campo 62 ausente â sem validade`),null;let n=z(t[62]);console.log(`[PIX] Subcampos do campo 62:`,n);let r=n[`07`]||``;if(!r)return console.log(`[PIX] Subcampo 62.07 ausente â sem validade`),null;if(/^\d{14}$/.test(r)){let e=new Date(`${r.slice(0,4)}-${r.slice(4,6)}-${r.slice(6,8)}T${r.slice(8,10)}:${r.slice(10,12)}:${r.slice(12,14)}`);return console.log(`[PIX] Validade extraÃda (YYYYMMDDHHMMSS):`,e),e}if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(r)){let e=new Date(r);if(!isNaN(e))return console.log(`[PIX] Validade extraÃda (ISO):`,e),e}return console.warn(`[PIX] Subcampo 62.07 presente mas formato não reconhecido:`,r),null}function U(e){let t=z(e.trim().toUpperCase())[54]||``;if(!t)return null;let n=parseFloat(t);return isNaN(n)?null:n}export{_ as A,j as C,h as D,S as E,s as M,i as N,g as O,o as P,A as S,b as T,C as _,d as a,T as b,R as c,P as d,F as f,M as g,U as h,u as i,r as j,V as k,L as l,H as m,O as n,l as o,k as p,f as r,I as s,y as t,N as u,c as v,m as w,w as x,p as y};
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.