var Zo=Object.create;var po=Object.defineProperty;var Qo=Object.getOwnPropertyDescriptor;var Go=Object.getOwnPropertyNames;var Ko=Object.getPrototypeOf,Ho=Object.prototype.hasOwnProperty;var mo=o=>{throw TypeError(o)};var x=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Wo=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Go(e))!Ho.call(o,i)&&i!==r&&po(o,i,{get:()=>e[i],enumerable:!(t=Qo(e,i))||t.enumerable});return o};var Yo=(o,e,r)=>(r=o!=null?Zo(Ko(o)):{},Wo(e||!o||!o.__esModule?po(r,"default",{value:o,enumerable:!0}):r,o));var Y=(o,e,r)=>e.has(o)||mo("Cannot "+r);var s=(o,e,r)=>(Y(o,e,"read from private field"),r?r.call(o):e.get(o)),j=(o,e,r)=>e.has(o)?mo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),I=(o,e,r,t)=>(Y(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r),w=(o,e,r)=>(Y(o,e,"access private method"),r);var zo=x(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.tipoUsuarioResiduos=y.tx=y.camposComuns=y.uuid_null=void 0;y.uuid_null="00000000-0000-0000-0000-000000000000";var xo;(function(o){o.codigo="codigo",o.excluido="excluido",o.data_hora_criacao="data_hora_criacao",o.data_hora_atualizacao="data_hora_atualizacao",o.codigo_usuario_criacao="codigo_usuario_criacao",o.codigo_usuario_atualizacao="codigo_usuario_atualizacao",o.versao="__versao"})(xo||(y.camposComuns=xo={}));var ho;(function(o){o.token="token"})(ho||(y.tx=ho={}));var bo;(function(o){o.Usuario="usuario",o.Fornecedor="fornecedor"})(bo||(y.tipoUsuarioResiduos=bo={}))});var $o=x(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.operadores=void 0;var yo;(function(o){o["="]="=",o["!="]="!=",o[">"]=">",o[">="]=">=",o["<"]="<",o["<="]="<=",o.like="like",o.in="in"})(yo||(V.operadores=yo={}))});var Po=x(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.aleatorio=void 0;var jo="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),re=o=>`eli-${Array.from({length:o||8}).map(()=>jo[(999*Math.random()|0)%jo.length]).join("")}`;B.aleatorio=re});var So=x(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.texto_busca=void 0;var te=(...o)=>o.map(e=>e==null?"":String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").toLowerCase()).join(" ");J.texto_busca=te});var Oo=x(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.unidades_medida=void 0;X.unidades_medida=[{unidade:"kg",nome:"Quilograma",unidade_normalizada:"kg",normalizar:o=>o,tipo:"massa"},{unidade:"g",nome:"Grama",unidade_normalizada:"kg",normalizar:o=>o/1e3,tipo:"massa"},{unidade:"ton",nome:"Tonelada",unidade_normalizada:"kg",normalizar:o=>o*1e3,tipo:"massa"},{unidade:"L",nome:"Litro",unidade_normalizada:"L",normalizar:o=>o,tipo:"volume"},{unidade:"m3",nome:"Metro C\xFAbico",unidade_normalizada:"L",normalizar:o=>o*1e3,tipo:"volume"},{unidade:"mL",nome:"Mililitro",unidade_normalizada:"L",normalizar:o=>o/1e3,tipo:"volume"},{unidade:"cm",nome:"Cent\xEDmetro",unidade_normalizada:"m",normalizar:o=>o/100,tipo:"comprimento"},{unidade:"mm",nome:"Mil\xEDmetro",unidade_normalizada:"m",normalizar:o=>o/1e3,tipo:"comprimento"},{unidade:"m",nome:"Metro",unidade_normalizada:"m",normalizar:o=>o,tipo:"comprimento"},{unidade:"km",nome:"Quil\xF4metro",unidade_normalizada:"m",normalizar:o=>o*1e3,tipo:"comprimento"}]});var Co=x(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.uuid=void 0;var oo="0123456789abcdef".split(""),ie=()=>(oo.sort(()=>Math.random()-.5),"xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx".split("").map(r=>r==="x"?oo[(1e3*Math.random()|0)%oo.length]:r).join(""));k.uuid=ie});var Eo=x(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.provedores=void 0;var wo;(function(o){o["betha-sistemas"]="Betha Sistemas",o["e-licencie"]="e-licencie"})(wo||(Z.provedores=wo={}))});var Ro=x(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.cdn_carro_de_boi=void 0;Q.cdn_carro_de_boi="https://carro-de-boi-idz-one.b-cdn.net"});var To=x(E=>{"use strict";var ae=E&&E.__createBinding||(Object.create?function(o,e,r,t){t===void 0&&(t=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(o,t,i)}:function(o,e,r,t){t===void 0&&(t=r),o[t]=e[r]}),ne=E&&E.__exportStar||function(o,e){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ae(e,o,r)};Object.defineProperty(E,"__esModule",{value:!0});ne(Ro(),E)});var Lo=x(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.nomeVariavel=q.esperar=void 0;var se=o=>new Promise(e=>setTimeout(()=>e(!0),o));q.esperar=se;var ce=o=>Object.keys(o).join("/");q.nomeVariavel=ce});var Uo=x(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.TipagemRotas=void 0;var eo=class{constructor(...e){this._partesCaminho=[],e.forEach(r=>{String(r).split("/").forEach(t=>{t&&this._partesCaminho.push(t)})})}get caminho(){return`/${this._partesCaminho.join("/")}`}set caminho(e){this._partesCaminho=e.split("/").filter(r=>r)}endereco(e,r){let t=new URL(typeof window<"u"?window.location.href:"http://localhost");t.pathname=this.caminho,t.search="";let i=Object.entries(e);for(let[d,f]of i)t.searchParams.set(String(d),f);return r&&(t.hash=`#${t.search}`,t.search=""),t.href}ir(e){typeof window<"u"&&(window.location.href=this.endereco(e))}get parametros(){let e=new URL(typeof window<"u"?window.location.href:"http://localhost"),r=e.searchParams,t=Object.fromEntries(r.entries()),i=e.hash;if(i){let d=Object.fromEntries(new URLSearchParams(i.slice(1)).entries());return{...t,...d}}return t}};G.TipagemRotas=eo});var qo=x(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.tipoArquivo=R.extensoes=void 0;R.extensoes=[{ext:"gif",tipo:"imagem",mime:"image/gif"},{ext:"jpg",tipo:"imagem",mime:"image/jpeg"},{ext:"jpeg",tipo:"imagem",mime:"image/jpeg"},{ext:"png",tipo:"imagem",mime:"image/png"},{ext:"bmp",tipo:"imagem",mime:"image/bmp"},{ext:"webp",tipo:"imagem",mime:"image/webp"},{ext:"tiff",tipo:"imagem",mime:"image/tiff"},{ext:"svg",tipo:"imagem",mime:"image/svg+xml"},{ext:"ico",tipo:"imagem",mime:"image/x-icon"},{ext:"pdf",tipo:"documento",mime:"application/pdf"},{ext:"doc",tipo:"documento",mime:"application/msword"},{ext:"docx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:"xls",tipo:"documento",mime:"application/vnd.ms-excel"},{ext:"xlsx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:"ppt",tipo:"documento",mime:"application/vnd.ms-powerpoint"},{ext:"pptx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:"txt",tipo:"documento",mime:"text/plain"},{ext:"odt",tipo:"documento",mime:"application/vnd.oasis.opendocument.text"},{ext:"ods",tipo:"documento",mime:"application/vnd.oasis.opendocument.spreadsheet"},{ext:"rtf",tipo:"documento",mime:"application/rtf"},{ext:"csv",tipo:"documento",mime:"text/csv"},{ext:"mp4",tipo:"v\xEDdeo",mime:"video/mp4"},{ext:"avi",tipo:"v\xEDdeo",mime:"video/x-msvideo"},{ext:"mkv",tipo:"v\xEDdeo",mime:"video/x-matroska"},{ext:"mov",tipo:"v\xEDdeo",mime:"video/quicktime"},{ext:"wmv",tipo:"v\xEDdeo",mime:"video/x-ms-wmv"},{ext:"flv",tipo:"v\xEDdeo",mime:"video/x-flv"},{ext:"webm",tipo:"v\xEDdeo",mime:"video/webm"},{ext:"3gp",tipo:"v\xEDdeo",mime:"video/3gpp"},{ext:"mpeg",tipo:"v\xEDdeo",mime:"video/mpeg"}];var pe=o=>{let e=String(o||"").toLocaleLowerCase().split(".").pop();return R.extensoes.find(t=>t.ext===e)?.tipo||"outros"};R.tipoArquivo=pe});var Do=x(g=>{"use strict";var me=g&&g.__createBinding||(Object.create?function(o,e,r,t){t===void 0&&(t=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(o,t,i)}:function(o,e,r,t){t===void 0&&(t=r),o[t]=e[r]}),z=g&&g.__exportStar||function(o,e){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&me(e,o,r)};Object.defineProperty(g,"__esModule",{value:!0});z(zo(),g);z($o(),g);z(Po(),g);z(So(),g);z(Oo(),g);z(Co(),g);z(Eo(),g);z(To(),g);z(Lo(),g);z(Uo(),g);z(qo(),g)});var $;(function(o){o[o.sucesso=200]="sucesso",o[o.erroConhecido=400]="erroConhecido",o[o.erroPermissao=401]="erroPermissao",o[o.erroNaoEncontrado=404]="erroNaoEncontrado",o[o.erroDesconhecido=500]="erroDesconhecido",o[o.tempoEsgotado=504]="tempoEsgotado"})($||($={}));var oe=o=>{let e=(n,p)=>({cod:$.sucesso,valor:n,mensagem:void 0,eErro:!1,eCerto:!0,detalhes:p}),r=n=>({cod:$.sucesso,valor:!0,mensagem:void 0,eErro:!1,eCerto:!0,detalhes:n}),t=(n,p)=>({cod:$.erroConhecido,valor:void 0,mensagem:n,eErro:!0,eCerto:!1,detalhes:p}),i=(n,p)=>({cod:$.erroPermissao,valor:void 0,mensagem:n||"Sem permiss\xE3o para esse recurso.",eErro:!0,eCerto:!1,detalhes:p}),d=(n,p)=>({cod:$.erroNaoEncontrado,valor:void 0,mensagem:n||"Registro n\xE3o encontrado ou a execu\xE7\xE3o dessa a\xE7\xE3o depende de um registro existente.",eErro:!0,eCerto:!1,detalhes:p}),f=n=>{let p=o(n),v=`${n.mensagem||"Erro interno"}`;return{cod:$.erroDesconhecido,valor:void 0,mensagem:v,eErro:!0,eCerto:!1,...p}},c=(n,p)=>({cod:$.tempoEsgotado,valor:void 0,mensagem:n||"Tempo de resposta esgotado ao tentar acessar o recurso.",eErro:!0,eCerto:!1,detalhes:p});return{valor:e,valorTrue:r,erro:t,erroPermissao:i,erroInterno:f,naoEncontrado:d,tempoEsgotado:c,erroEspera:c}},l=oe(()=>({}));import{z as u}from"zod";var lo=u.object({tabela:u.string(),codigos:u.array(u.string())}),$e=u.enum(["desenvolvimento","producao"]),P="/pilao-de-dados",uo=(o,e,r)=>{let t=o.safeParse(e);return t.success?l.valor(t.data):l.erro(r,t.error.errors.map(i=>`${i.path} ${i.message}`))},_o=u.object({produto:u.string(),conta:u.string(),emDesenvolvimento:u.boolean().optional(),ver_log:u.boolean().optional()}),N=u.enum(["texto","numero","confirmacao","lista_texto","lista_numero","lista_mes","lista_data","mes","data"]),F=u.enum(["=","!=",">","<",">=","<=","\u2229"]),go={confirmacao:["=","!="],data:["=","!=",">","<",">=","<="],lista_numero:["\u2229"],lista_texto:["\u2229"],lista_mes:["\u2229"],lista_data:["\u2229"],mes:["=","!=",">","<",">=","<="],numero:["=","!=",">","<",">=","<="],texto:["=","!="]},je={texto:u.string().nullable(),numero:u.number().nullable(),confirmacao:u.boolean().nullable(),lista_texto:u.array(u.string()).nullable(),lista_numero:u.array(u.number()).nullable()},ee=o=>({api:(o?"http://127.0.0.1:5080":"https://carro-de-boi.idz.one")+P,site:(o?"http://127.0.0.1:5081":"https://carro-de-boi.idz.one")+P});import{z as h}from"zod";var fo=h.object({tabela:h.string(),colunas:h.array(h.object({coluna:h.string(),tipo:N}))}),vo=h.object({tabela:h.string(),registros:h.array(h.record(h.string(),h.object({valor:h.any(),tipo:N.optional().nullable()})))});var Mo=Yo(Do());import ro from"cross-fetch";var H=(e=>(e["enviar-registros"]="enviar-registros",e["deletar-registros"]="deletar-registros",e["consultar-serie"]="consultar-serie",e.laborat\u00F3rio="laborat\xF3rio",e))(H||{}),S,O,D,T,C,L,b,Ao,K,Io,No,io=class io{constructor({conta:e,produto:r,emDesenvolvimento:t=!1,ver_log:i=!1}){j(this,b);j(this,S);j(this,O);j(this,D);j(this,T);j(this,C,{});j(this,L,{});I(this,S,r),I(this,O,e),I(this,D,t),I(this,T,i)}rotaEnviarRegistros(){return w(this,b,K).call(this,"enviar-registros")}rotaDeletarRegistro(){return w(this,b,K).call(this,"deletar-registros")}rotaConsultarSerie(){return w(this,b,K).call(this,"consultar-serie")}rotaIframeSerie(e){let r=`${P}/consultar-serie/${s(this,S)}/${s(this,O)}/${e}`,t=`${this.baseUrlSite}${r}`;return{rota:r,url:t}}rotaFuncaoApi(e){return w(this,b,Ao).call(this,e)}async consultarApi(e,r){try{let i=await(await ro(this.rotaFuncaoApi(e).url,{body:JSON.stringify(r),method:"POST",headers:{"Content-Type":"application/json"}})).text();try{return JSON.parse(i)}catch{return l.erro("Consulta n\xE3o retornou json v\xE1lido",[i])}}catch(t){return console.error(t),l.erroInterno({erro:t,local:(0,Mo.nomeVariavel)({ClassPilao:io})})}}get baseUrlApi(){return s(this,D)?"http://localhost:5080":"https://carro-de-boi.idz.one"}get baseUrlSite(){return s(this,D)?"http://localhost:5081":"https://carro-de-boi.idz.one"}validarCliente(e){return e?.conta?e?.produto?l.valor(e):l.erro("Produto n\xE3o informado"):l.erro("Conta n\xE3o informada")}adicionarRegistroParaEnviar(e,...r){return s(this,C)[e]=[...s(this,C)[e]||[],...r],this}adicionarCodigoParaDeletar(e,...r){return s(this,L)[e]=[...s(this,L)[e]||[],...r],this}async processarRegistros(e,r,t,i){for(;r.length>0;){let f=r.splice(0,1e3).map(m=>Object.fromEntries(Object.entries(m).map(([n,p])=>[n,p===void 0?null:p]))),c=await ro(e,{method:"POST",body:JSON.stringify({tabela:t,registros:f}),headers:{"Content-Type":"application/json"}}).then(async m=>{let n=await m.text();try{return JSON.parse(n)}catch{return l.erro("Consulta n\xE3o retornou json v\xE1lido",[n])}}).catch(m=>l.erro(`Erro ao ${i} registros`,[m.message]));if(c.eErro)return c}return l.valor(!0)}async enviarRegistros(){let e=await w(this,b,Io).call(this);if(e.eErro)return e;let r=await w(this,b,No).call(this);return r.eErro?r:l.valor(!0)}serieConsultar(e,r,t){let i={...r,...Object.fromEntries(Object.entries(t||{}).filter(([c,m])=>m!==void 0))};return{dados:async()=>{let c=this.rotaConsultarSerie().url;c.searchParams.set("visao",e);let m=await ro(c.toString(),{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).then(async n=>{let p=await n.text();try{return JSON.parse(p)}catch{return l.erro("Consulta n\xE3o retornou json v\xE1lido",[p])}}).catch(n=>l.erro("Erro ao enviar registros",[n.message]));return s(this,T)&&console.log(`[PIL\xC3O]: buscar dados de "${JSON.stringify(i)}" para "${c}".`),m},url:()=>{let c=this.rotaIframeSerie(e).url,m=encodeURIComponent(JSON.stringify(i,null,2));return s(this,T)&&console.log(`[PIL\xC3O]: Serie Consultar url de "${JSON.stringify(m)}" para "${c}".`),`${c}?serie=${m}`}}}urlLaboratorio(){let e=`${P}/${H}/${s(this,S)}/${s(this,O)}`,r=`${this.baseUrlSite}${e}`;return{rota:e,url:r}}};S=new WeakMap,O=new WeakMap,D=new WeakMap,T=new WeakMap,C=new WeakMap,L=new WeakMap,b=new WeakSet,Ao=function(e){let r=`${P}/api/${e}/${s(this,S)}/${s(this,O)}`,t=new URL(`${this.baseUrlApi}${r}`);return{rota:r,url:t}},K=function(e){let r=`${P}/${e}/${s(this,S)}/${s(this,O)}`,t=new URL(`${this.baseUrlApi}${r}`);return{rota:r,url:t}},Io=async function(){for(let e of Object.keys(s(this,C))){let r=s(this,C)[e]||[],t=this.rotaEnviarRegistros().url;s(this,T)&&console.log(`[PIL\xC3O]: Enviando ${r.length} registros na tabela "${e}" para "${t}".`);let i=await this.processarRegistros(t.href,r,e,"enviar");if(i.eErro)return i;s(this,C)[e]=[]}return l.valor(!0)},No=async function(){for(let e of Object.keys(s(this,L))){let r=[...s(this,L)[e]||[]],t=this.rotaDeletarRegistro().url,i=await this.processarRegistros(t.href,r,e,"deletar");if(i.eErro)return i}return l.valor(!0)};var to=io,Xe=o=>new to(o);import{z as ao}from"zod";var W=ao.object({coluna:ao.string(),valor:ao.any(),operador:F});var Fo={visao:"z_contagem_em_barra_vertical",rotulo:"Contagem em Barra Vertical",tabela:({tabela:o})=>o,descricao:({tabela:o,descricao_pelo_usuario:e,colanuEixoX:r,filtros:t,colunaAgrupamento:i})=>String(e||"").trim()?String(e||"").trim():`Contagem de ${o} por ${r}${t?.length?`, quando ${t.map(({coluna:d,operador:f,valor:c})=>`${d} ${f} ${c}`).join(", ")}`:""}${i?.length?`, agrupado por ${i.join(", ")}`:""}.`,campos:{tabela:{rotulo:"Tabela",tipo_campo:"tabela",order:1},colanuEixoX:{rotulo:"Coluna do Eixo X",tipo_campo:"coluna",order:2},colunaAgrupamento:{rotulo:"Colunas de Agrupamento",tipo_campo:"lista_colunas",order:3},descricao_pelo_usuario:{rotulo:"Descri\xE7\xE3o (opcional)",tipo_campo:"texto",order:4},filtros:{rotulo:"Filtros",tipo_campo:"lista_filtros",order:5}}};var Vo={visao:"z_contagem_em_pizza",rotulo:"Contagem em Pizza",tabela:({tabela:o})=>o,descricao:({tabela:o,descricao_pelo_usuario:e,classes:r,filtros:t})=>String(e||"").trim()?String(e||"").trim():`Contagem de ${o} por ${r}${t?.length?`, quando ${t.map(({coluna:i,operador:d,valor:f})=>`${i} ${d} ${f}`).join(", ")}`:""}.`,campos:{tabela:{rotulo:"Tabela",tipo_campo:"tabela",order:1},classes:{rotulo:"Classes",tipo_campo:"coluna",order:2},descricao_pelo_usuario:{rotulo:"Descri\xE7\xE3o (opcional)",tipo_campo:"texto",order:3},filtros:{rotulo:"Filtros",tipo_campo:"lista_filtros",order:4}}};var Bo={visao:"z_soma_em_barra_vertical",rotulo:"Soma em Barra Vertical",tabela:({tabela:o})=>o,descricao:({descricao_pelo_usuario:o,colanuEixoX:e,filtros:r,colunaAgrupamento:t,colunaSoma:i,exibirComoPorcentagem:d})=>String(o||"").trim()?String(o||"").trim():`${d?"Porcentagem ":"Soma"} de ${i} por ${e}${r?.length?`, quando ${r.map(({coluna:f,operador:c,valor:m})=>`${f} ${c} ${m}`).join(", ")}`:""}${t?.length?`, agrupado por ${t.join(", ")}`:""}.`,campos:{tabela:{rotulo:"Tabela",tipo_campo:"tabela",order:1},colunaSoma:{rotulo:"Coluna de Somat\xF3ria",tipo_campo:"coluna",order:2},unidadeSoma:{rotulo:"Unidade de Somat\xF3ria",tipo_campo:"texto",order:3},colanuEixoX:{rotulo:"Coluna do Eixo X",tipo_campo:"coluna",order:4},colunaAgrupamento:{rotulo:"Colunas de Agrupamento",tipo_campo:"lista_colunas",order:5},descricao_pelo_usuario:{rotulo:"Descri\xE7\xE3o (opcional)",tipo_campo:"texto",order:6},exibirComoPorcentagem:{rotulo:"Exibir como porcentagem",order:7,tipo_campo:"booleana"},filtros:{rotulo:"Filtros",tipo_campo:"lista_filtros",order:8}}};var Jo={visao:"z_tabela",rotulo:"Tabela",tabela:({tabela:o})=>o,descricao:({tabela:o,descricao_pelo_usuario:e,filtros:r})=>String(e||"").trim()?String(e||"").trim():`Consulta na ${o} ${r?.length?`, quando ${r.map(({coluna:t,operador:i,valor:d})=>`${t} ${i} ${d}`).join(", ")}`:""}.`,campos:{tabela:{rotulo:"Tabela",tipo_campo:"tabela",order:1},colunas:{rotulo:"Colunas",tipo_campo:"lista_colunas",order:2},descricao_pelo_usuario:{rotulo:"Descri\xE7\xE3o (opcional)",tipo_campo:"texto",order:3},coluna_ordem:{rotulo:"Coluna de Ordem",tipo_campo:"coluna",order:4},direcao_ordem:{rotulo:"Dire\xE7\xE3o de Ordem",tipo_campo:"ordem",order:5},filtros:{rotulo:"Filtros",tipo_campo:"lista_filtros",order:6}}};var Xo={z_contagem_em_barra_vertical:Fo,z_contagem_em_pizza:Vo,z_soma_em_barra_vertical:Bo,z_tabela:Jo};import{z as _}from"zod";var M=_.object({tabela:_.string(),filtros:W.array().optional(),descricao_pelo_usuario:_.string().optional()}),le=_.object({colanuEixoX:_.string(),colunaAgrupamento:_.string().array().optional()}).extend(M.shape),ue=_.object({colanuEixoX:_.string(),colunaSoma:_.string(),unidadeSoma:_.string().optional(),colunaAgrupamento:_.string().array().optional(),exibirComoPorcentagem:_.boolean().optional()}).extend(M.shape),de=_.object({classes:_.string()}).extend(M.shape),_e=_.object({colunas:_.string().array(),coluna_ordem:_.string().optional(),direcao_ordem:_.enum(["asc","desc","1","-1"]).optional()}).extend(M.shape),no={z_contagem_em_barra_vertical:le,z_contagem_em_pizza:de,z_tabela:_e,z_soma_em_barra_vertical:ue};var vr={zp_deletar_registros:lo,zp_registrar_base_dados:fo,z_tipos_dados_registro:N,zp_enviar_registros:vo,zp_produto_conta:_o,validarZ:uo,operadores_pilao:F,operadores_permitidos_por_tipo:go,z_filtro:W,visoes_pilao:no,...no,extruturas_de_campos:Xo,z_padroes:M,pilao_enderecos:H};import{z as a}from"zod";var jr=a.object({codigo_token:a.string().optional(),codigo_usuario:a.string().uuid(),nome_usuario:a.string(),email_usuario:a.string(),documento_usuario:a.string(),$cliente:a.string(),rotas:a.object({}),url_usuarios:a.string().url(),url_empreendedores:a.string().url(),url_empreendimentos:a.string().url(),tipo_usuario:a.string(),sistema:a.string(),sistema_cor:a.string(),sistema_nome:a.string(),sistema_logo:a.string()}),Pr=a.object({codigo:a.string().uuid(),documento:a.string(),excluido:a.boolean(),nome:a.string(),permicoes:a.record(a.any()),versao:a.number().int(),credenciais_sinir:a.object({login:a.string().optional(),senha:a.string().optional()}).optional()}),Sr=a.object({codigo:a.string().uuid(),documento:a.string(),excluido:a.boolean(),nome:a.string(),versao:a.number().int()}),Or=a.object({codigo:a.string().uuid(),codigo_empreendedor:a.string().uuid(),documento:a.string(),excluido:a.boolean(),nome:a.string(),unidade_sinir:a.string().nullable().optional(),versao:a.number().int()}),Cr=a.enum(["usuarios","empreendedores","empreendimentos"]);var Rr=o=>async e=>{let r=o?"http://localhost:5040/nps":"https://carro-de-boi.idz.one/nps",t=`${r}/api`,{sistema:i,$cliente:d,codigo_usuario:f}=e,c=`nps_proxima_avaliacao_${i}_${f}_${d}_0`,m=localStorage.getItem(c);if(!m){let U=new URL(`${t}/${i}/proxima_avaliacao`);for(let[A,ko]of Object.entries(e))U.searchParams.append(A,ko);let co=(await fetch(U.href).then(A=>A.json()).catch(A=>l.erro(A.message))).valor;co&&localStorage.setItem(c,co)}if(!(m&&new Date().toISOString().slice(0,10)>=m))return;localStorage.removeItem(c);let p=new URL(r);for(let[U,so]of Object.entries(e))p.searchParams.append(U,so);let v=document.createElement("iframe");v.src=p.href,v.style.position="fixed",v.style.top="0",v.style.left="0",v.style.width="100%",v.style.height="100%",v.style.border="none",v.style.zIndex="999999",document.body.appendChild(v),window.addEventListener("message",U=>{U.data==="fechar"&&document.body.removeChild(v)})};import{z as ge}from"zod";var fe=ge.enum(["ativo","inativo"]),Ur=fe;export{fe as $clienteStatus,to as ClassPilao,P as PREFIXO_PILAO,Xe as Pilao,Rr as abrirNps,Cr as nomesSincronizacoes,vr as pPilao,H as pilao_enderecos,Ur as status$cliente,ee as urlPilao,jr as zAuntenticacaoResiduosSolicitar,Sr as zEmpreendedorSincronizar,Or as zEmpreendimentoSincronizar,Pr as zUsuarioSincronizar};