(function(E,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vuetify/components/VBtn"),require("vuetify/components/VBadge"),require("vuetify/components/VCheckbox"),require("vuetify/components/VIcon"),require("vuetify/components/VRadio"),require("vuetify/components/VRadioGroup"),require("vuetify/components/VSelect"),require("vuetify/components/VTextField"),require("vuetify/components/VTextarea"),require("vuetify/components/VCard"),require("vuetify/components/VGrid")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components/VBtn","vuetify/components/VBadge","vuetify/components/VCheckbox","vuetify/components/VIcon","vuetify/components/VRadio","vuetify/components/VRadioGroup","vuetify/components/VSelect","vuetify/components/VTextField","vuetify/components/VTextarea","vuetify/components/VCard","vuetify/components/VGrid"],t):(E=typeof globalThis<"u"?globalThis:E||self,t(E.eli_vue={},E.Vue,E.VBtn,E.VBadge,E.VCheckbox,E.VIcon,E.VRadio,E.VRadioGroup,E.VSelect,E.VTextField,E.VTextarea,E.VCard,E.VGrid))})(this,(function(E,t,Ve,ke,Be,ve,we,Ce,Se,se,Me,W,Ee){"use strict";const De=t.defineComponent({name:"EliBotao",inheritAttrs:!1,props:{color:{type:String,default:"primary"},variant:{type:String,default:"elevated"},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}}}),z=(e,a)=>{const f=e.__vccOpts||e;for(const[p,h]of a)f[p]=h;return f};function Ne(e,a,f,p,h,V){return t.openBlock(),t.createBlock(Ve.VBtn,t.mergeProps({color:e.color,variant:e.variant,size:e.size,disabled:e.disabled,loading:e.loading},e.$attrs,{class:"text-none pt-1"}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["color","variant","size","disabled","loading"])}const oe=z(De,[["render",Ne]]),de={suave:"4px",pill:"10px"},Pe=t.defineComponent({name:"EliBadge",inheritAttrs:!1,props:{color:{type:String,default:"primary"},location:{type:String,default:"top right"},offsetX:{type:String,default:"0"},offsetY:{type:String,default:"0"},dot:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},badge:{type:[String,Number],default:void 0},radius:{type:String,default:"suave"}},setup(e){const a=t.computed(()=>e.radius in de?de[e.radius]:e.radius),f=t.computed(()=>e.dot||e.badge!==void 0?e.visible:!1),p=t.computed(()=>({"--eli-badge-radius":a.value}));return{showBadge:f,badgeStyle:p}}});function _e(e,a,f,p,h,V){return e.showBadge?(t.openBlock(),t.createBlock(ke.VBadge,t.mergeProps({key:0,color:e.color},e.$attrs,{location:e.location,"offset-x":e.offsetX,"offset-y":e.offsetY,dot:e.dot,content:e.badge,style:e.badgeStyle}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},16,["color","location","offset-x","offset-y","dot","content","style"])):t.renderSlot(e.$slots,"default",{key:1},void 0,!0)}const ee=z(Pe,[["render",_e],["__scopeId","data-v-de2fbf2f"]]);function Te(e){return e.replace(/\D+/g,"")}function Ie(e){const a=Te(e);return a.length<=11?a.replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"$1.$2").replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3").replace(/\.(\d{3})(\d)/,".$1/$2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,18)}function Ae(e){return e.replace(/\D+/g,"")}function Oe(e){const a=Ae(e);return a?a.length<=10?a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2").slice(0,14):a.replace(/^(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2").slice(0,15):""}function ne(e){return e.replace(/\D+/g,"")}function ue(e){const a=e.replace(/[^\d,]/g,""),f=a.split(",");return f.length>2?f[0]+","+f.slice(1).join(""):a}function Ue(e){return ue(e.replace(/%/g,""))}function Le(e){const a=ne(e);return a?(parseInt(a,10)/100).toFixed(2).replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function qe(e){const a=ne(e).slice(0,8);return a.length<=5?a:a.replace(/^(\d{5})(\d{1,3})$/,"$1-$2")}const Fe=t.defineComponent({name:"EliInput",inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array],default:""},type:{type:String,default:"text"},label:String,placeholder:String,disabled:Boolean,error:Boolean,errorMessages:{type:[String,Array],default:()=>[]},hint:String,persistentHint:Boolean,rows:{type:Number,default:4},options:{type:Array,default:()=>[]},clearable:Boolean,variant:{type:String,default:"outlined"},density:{type:String,default:"comfortable"},color:{type:String,default:"primary"},row:Boolean,showPasswordToggle:Boolean,multiple:Boolean,chips:Boolean},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:a,attrs:f}){const p=t.ref(!1),h=t.ref(!1),V=t.computed({get:()=>e.modelValue,set:w=>{a("update:modelValue",w),a("change",w)}}),l=t.computed(()=>["text","password","email","search","url","telefone","cpfCnpj","numericoInteiro","numericoDecimal","numericoMoeda","porcentagem","cep"].includes(e.type)),b=t.computed(()=>e.type==="password"?h.value?"text":"password":"text"),k=t.computed(()=>{if(e.type==="telefone")return"tel";if(e.type==="porcentagem")return"decimal";if(e.type.startsWith("numerico"))return"numeric"}),o=t.computed(()=>e.error?"error":p.value?e.color:void 0);function M(w){const _=w.target;let B=_.value;switch(e.type){case"numericoInteiro":B=ne(B);break;case"numericoDecimal":B=ue(B);break;case"numericoMoeda":B=Le(B);break;case"porcentagem":B=Ue(B);break;case"telefone":B=Oe(B);break;case"cpfCnpj":B=Ie(B);break;case"cep":B=qe(B);break}_.value=B,a("update:modelValue",B),a("change",B)}function C(){h.value=!h.value}const O=t.computed(()=>(e.options||[]).map(w=>{if(w&&typeof w=="object"&&"value"in w){const B=w.value;return{label:w.label??String(B),value:B,disabled:w.disabled}}const _=w;return{label:String(_),value:_}}));return{attrs:f,value:V,isTextLike:l,inputHtmlType:b,inputMode:k,internalColor:o,showPassword:h,togglePassword:C,onInput:M,onFocus:()=>a("focus"),onBlur:()=>a("blur"),computedItems:O}}}),je={class:"eli-input"},He={key:4,class:"checkbox-group"};function Ye(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div",je,[e.isTextLike?(t.openBlock(),t.createBlock(se.VTextField,t.mergeProps({key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l),type:e.inputHtmlType,label:e.label,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable&&e.type!=="password",error:e.error,"error-messages":e.errorMessages,hint:e.hint,"persistent-hint":e.persistentHint,density:e.density,variant:e.variant,color:e.internalColor,inputmode:e.inputMode,suffix:e.type==="porcentagem"?"%":void 0},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur,onInput:e.onInput}),t.createSlots({_:2},[e.type==="password"&&e.showPasswordToggle?{name:"append-inner",fn:t.withCtx(()=>[t.createVNode(ve.VIcon,{class:"cursor-pointer",onClick:e.togglePassword},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.showPassword?"mdi-eye-off":"mdi-eye"),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1040,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","color","inputmode","suffix","onFocus","onBlur","onInput"])):e.type==="textarea"?(t.openBlock(),t.createBlock(Me.VTextarea,t.mergeProps({key:1,modelValue:e.value,"onUpdate:modelValue":a[1]||(a[1]=l=>e.value=l),label:e.label,rows:e.rows,density:e.density,variant:e.variant},e.attrs),null,16,["modelValue","label","rows","density","variant"])):e.type==="select"?(t.openBlock(),t.createBlock(Se.VSelect,t.mergeProps({key:2,modelValue:e.value,"onUpdate:modelValue":a[2]||(a[2]=l=>e.value=l),items:e.computedItems,label:e.label,placeholder:e.placeholder,multiple:e.multiple,chips:e.chips,clearable:e.clearable,disabled:e.disabled,density:e.density,variant:e.variant,"item-title":"label","item-value":"value",error:e.error,"error-messages":e.errorMessages},e.attrs,{onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["modelValue","items","label","placeholder","multiple","chips","clearable","disabled","density","variant","error","error-messages","onFocus","onBlur"])):e.type==="radio"?(t.openBlock(),t.createBlock(Ce.VRadioGroup,{key:3,modelValue:e.value,"onUpdate:modelValue":a[3]||(a[3]=l=>e.value=l),row:e.row},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(we.VRadio,{key:String(l.value),label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","row"])):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",He,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedItems,l=>(t.openBlock(),t.createBlock(Be.VCheckbox,{key:String(l.value),modelValue:e.value,"onUpdate:modelValue":a[4]||(a[4]=b=>e.value=b),label:l.label,value:l.value,density:e.density},null,8,["modelValue","label","value","density"]))),128))])):t.createCommentVNode("",!0)])}const re=z(Fe,[["render",Ye],["__scopeId","data-v-756cb549"]]),ze=t.defineComponent({name:"EliOlaMundo",components:{EliBotao:oe,EliBadge:ee,EliInput:re},setup(){const e=t.ref(""),a=t.ref([]),f=t.ref(""),p=t.ref(""),h=t.ref(""),V=t.ref(""),l=t.ref(""),b=t.ref(""),k=t.ref(""),o=t.ref(""),M=t.ref(""),C=t.ref(null),O=t.ref([]);return{nome:e,email:b,documento:M,estado:a,telefone:p,mensagem:k,senha:o,cor:C,habilidades:O,idade:h,altura:V,cep:f,valor:l}}}),Re={class:"grid-example"};function We(e,a,f,p,h,V){const l=t.resolveComponent("EliBadge"),b=t.resolveComponent("EliInput"),k=t.resolveComponent("EliBotao");return t.openBlock(),t.createBlock(Ee.VContainer,null,{default:t.withCtx(()=>[t.createVNode(W.VCard,{class:"mx-auto",max_width:"400"},{default:t.withCtx(()=>[t.createVNode(W.VCardTitle,null,{default:t.withCtx(()=>[t.createVNode(l,{badge:"Novo","offset-x":"-15",location:"right center"},{default:t.withCtx(()=>[...a[14]||(a[14]=[t.createTextVNode(" Olá Mundo! ",-1)])]),_:1})]),_:1}),t.createVNode(W.VCardText,null,{default:t.withCtx(()=>[a[15]||(a[15]=t.createTextVNode(" Este é um componente de exemplo integrado com Vuetify. ",-1)),t.createElementVNode("div",Re,[t.createVNode(b,{modelValue:e.nome,"onUpdate:modelValue":a[0]||(a[0]=o=>e.nome=o),label:"Nome",placeholder:"Digite o nome",density:"compact"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.idade,"onUpdate:modelValue":a[1]||(a[1]=o=>e.idade=o),type:"numericoInteiro",label:"Idade",density:"default"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.altura,"onUpdate:modelValue":a[2]||(a[2]=o=>e.altura=o),type:"numericoDecimal",label:"Altura",density:"comfortable"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.valor,"onUpdate:modelValue":a[3]||(a[3]=o=>e.valor=o),type:"numericoMoeda",label:"Valor"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.telefone,"onUpdate:modelValue":a[4]||(a[4]=o=>e.telefone=o),type:"telefone",label:"Telefone"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.cep,"onUpdate:modelValue":a[5]||(a[5]=o=>e.cep=o),type:"cep",label:"CEP",placeholder:"00000-000"},null,8,["modelValue"]),t.createVNode(b,{type:"select",label:"Estado",options:[{label:"São Paulo",value:"SP"},{label:"Rio de Janeiro",value:"RJ"}],modelValue:e.estado,"onUpdate:modelValue":a[6]||(a[6]=o=>e.estado=o),multiple:""},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.documento,"onUpdate:modelValue":a[7]||(a[7]=o=>e.documento=o),type:"cpfCnpj",label:"CPF / CNPJ"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.email,"onUpdate:modelValue":a[8]||(a[8]=o=>e.email=o),label:"Email",placeholder:"email@exemplo.com"},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.senha,"onUpdate:modelValue":a[9]||(a[9]=o=>e.senha=o),label:"Senha",type:"password",showPasswordToggle:!0,placeholder:"Digite sua senha"},null,8,["modelValue"]),t.createVNode(b,{type:"textarea",modelValue:e.mensagem,"onUpdate:modelValue":a[10]||(a[10]=o=>e.mensagem=o),label:"Mensagem",rows:5},null,8,["modelValue"]),t.createVNode(b,{type:"radio",modelValue:e.cor,"onUpdate:modelValue":a[11]||(a[11]=o=>e.cor=o),label:"Cor favorita",options:[{label:"Azul",value:"azul"},{label:"Verde",value:"verde"}]},null,8,["modelValue"]),t.createVNode(b,{type:"checkbox",modelValue:e.habilidades,"onUpdate:modelValue":a[12]||(a[12]=o=>e.habilidades=o),options:[{label:"Vue",value:"vue"},{label:"React",value:"react"}]},null,8,["modelValue"]),t.createVNode(b,{modelValue:e.nome,"onUpdate:modelValue":a[13]||(a[13]=o=>e.nome=o),label:"Nome",error:!0,"error-messages":["Obrigatório"]},null,8,["modelValue"])])]),_:1}),t.createVNode(W.VCardActions,null,{default:t.withCtx(()=>[t.createVNode(k,{color:"primary",variant:"elevated",block:""},{default:t.withCtx(()=>[...a[16]||(a[16]=[t.createTextVNode(" Botão Vuetify ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})}const ce=z(ze,[["render",We]]),Ge=t.defineComponent({name:"EliCartao",components:{EliBadge:ee},inheritAttrs:!1,props:{titulo:{type:String,default:""},status:{type:String,required:!0},variant:{type:String,default:"outlined"}},emits:{clicar:e=>!0},setup(e,{emit:a}){const f=t.computed(()=>e.status),p=t.computed(()=>{switch(e.status){case"novo":return"primary";case"rascunho":return"secondary";case"vendido":return"success";case"cancelado":return"error"}}),h=t.computed(()=>`eli-cartao--${e.status}`);function V(){a("clicar",e.status)}return{rotuloStatus:f,corStatus:p,classeStatus:h,onClick:V}}}),Je={class:"eli-cartao__titulo-texto"},Ze={class:"eli-cartao__status"};function Xe(e,a,f,p,h,V){const l=t.resolveComponent("EliBadge");return t.openBlock(),t.createBlock(W.VCard,t.mergeProps({class:["eli-cartao",e.classeStatus],variant:e.variant},e.$attrs),{default:t.withCtx(()=>[t.createVNode(W.VCardTitle,{class:"eli-cartao__titulo"},{default:t.withCtx(()=>[t.createElementVNode("div",Je,[t.renderSlot(e.$slots,"titulo",{},()=>[t.createTextVNode(t.toDisplayString(e.titulo),1)],!0)]),t.createElementVNode("div",Ze,[t.createVNode(l,{badge:e.rotuloStatus,radius:"pill",color:e.corStatus},{default:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("span",null,null,-1)])]),_:1},8,["badge","color"])])]),_:3}),t.createVNode(W.VCardText,{class:"eli-cartao__conteudo"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3}),e.$slots.acoes?(t.openBlock(),t.createBlock(W.VCardActions,{key:0,class:"eli-cartao__acoes"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"acoes",{},void 0,!0)]),_:3})):t.createCommentVNode("",!0)]),_:3},16,["variant","class"])}const fe=z(Ge,[["render",Xe],["__scopeId","data-v-6c492bd9"]]);function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}},Qe=te.exports,me;function xe(){return me||(me=1,(function(e,a){(function(f,p){e.exports=p()})(Qe,(function(){var f=1e3,p=6e4,h=36e5,V="millisecond",l="second",b="minute",k="hour",o="day",M="week",C="month",O="quarter",w="year",_="date",B="Invalid Date",H=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var d=["th","st","nd","rd"],n=s%100;return"["+s+(d[(n-20)%10]||d[n]||d[0])+"]"}},K=function(s,d,n){var u=String(s);return!u||u.length>=d?s:""+Array(d+1-u.length).join(n)+s},ie={s:K,z:function(s){var d=-s.utcOffset(),n=Math.abs(d),u=Math.floor(n/60),r=n%60;return(d<=0?"+":"-")+K(u,2,"0")+":"+K(r,2,"0")},m:function s(d,n){if(d.date()1)return s(i[0])}else{var g=d.name;R[g]=d,r=g}return!u&&r&&(J=r),r||!u&&J},N=function(s,d){if(x(s))return s.clone();var n=typeof d=="object"?d:{};return n.date=s,n.args=arguments,new L(n)},v=ie;v.l=Z,v.i=x,v.w=function(s,d){return N(s,{locale:d.$L,utc:d.$u,x:d.$x,$offset:d.$offset})};var L=(function(){function s(n){this.$L=Z(n.locale,null,!0),this.parse(n),this.$x=this.$x||n.x||{},this[Q]=!0}var d=s.prototype;return d.parse=function(n){this.$d=(function(u){var r=u.date,c=u.utc;if(r===null)return new Date(NaN);if(v.u(r))return new Date;if(r instanceof Date)return new Date(r);if(typeof r=="string"&&!/Z$/i.test(r)){var i=r.match(H);if(i){var g=i[2]-1||0,y=(i[7]||"0").substring(0,3);return c?new Date(Date.UTC(i[1],g,i[3]||1,i[4]||0,i[5]||0,i[6]||0,y)):new Date(i[1],g,i[3]||1,i[4]||0,i[5]||0,i[6]||0,y)}}return new Date(r)})(n),this.init()},d.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},d.$utils=function(){return v},d.isValid=function(){return this.$d.toString()!==B},d.isSame=function(n,u){var r=N(n);return this.startOf(u)<=r&&r<=this.endOf(u)},d.isAfter=function(n,u){return N(n)[]},dica:{type:String,default:""},dicaPersistente:{type:Boolean,default:!1},densidade:{type:String,default:"comfortable"},variante:{type:String,default:"outlined"},min:{type:String,default:void 0},max:{type:String,default:void 0}},emits:{"update:modelValue":e=>!0,alterar:e=>!0,foco:()=>!0,desfoco:()=>!0},setup(e,{emit:a,attrs:f}){const p=t.computed(()=>e.modo==="data"?"date":"datetime-local");function h(o){return e.modo==="data"?ae(o).format("YYYY-MM-DD"):ae(o).format("YYYY-MM-DDTHH:mm")}function V(o){return e.modo==="data"?ae(`${o}T00:00`).format():ae(o).format()}const l=t.computed({get:()=>e.modelValue?h(e.modelValue):"",set:o=>{const M=o&&o.length>0?o:null;if(!M){a("update:modelValue",null),a("alterar",null);return}const C=V(M);a("update:modelValue",C),a("alterar",C)}}),b=t.computed(()=>{if(e.min)return h(e.min)}),k=t.computed(()=>{if(e.max)return h(e.max)});return{attrs:f,valor:l,emit:a,minLocal:b,maxLocal:k,tipoInput:p}}}),at={class:"eli-data-hora"};function ot(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div",at,[t.createVNode(se.VTextField,t.mergeProps({modelValue:e.valor,"onUpdate:modelValue":a[0]||(a[0]=l=>e.valor=l),type:e.tipoInput,label:e.rotulo,placeholder:e.placeholder,disabled:e.desabilitado,clearable:e.limpavel,error:e.erro,"error-messages":e.mensagensErro,hint:e.dica,"persistent-hint":e.dicaPersistente,density:e.densidade,variant:e.variante,min:e.minLocal,max:e.maxLocal},e.attrs,{onFocus:a[1]||(a[1]=l=>e.emit("foco")),onBlur:a[2]||(a[2]=l=>e.emit("desfoco"))}),null,16,["modelValue","type","label","placeholder","disabled","clearable","error","error-messages","hint","persistent-hint","density","variant","min","max"])])}const pe=z(tt,[["render",ot],["__scopeId","data-v-71afabb6"]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nt=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const he=e=>e==="";/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rt=(...e)=>e.filter((a,f,p)=>!!a&&a.trim()!==""&&p.indexOf(a)===f).join(" ").trim();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const be=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,f,p)=>p?p.toUpperCase():f.toLowerCase());/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const it=e=>{const a=lt(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var X={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const st=({name:e,iconNode:a,absoluteStrokeWidth:f,"absolute-stroke-width":p,strokeWidth:h,"stroke-width":V,size:l=X.width,color:b=X.stroke,...k},{slots:o})=>t.h("svg",{...X,...k,width:l,height:l,stroke:b,"stroke-width":he(f)||he(p)||f===!0||p===!0?Number(h||V||X["stroke-width"])*24/Number(l):h||V||X["stroke-width"],class:rt("lucide",k.class,...e?[`lucide-${be(it(e))}-icon`,`lucide-${be(e)}`]:["lucide-icon"]),...!o.default&&!nt(k)&&{"aria-hidden":"true"}},[...a.map(M=>t.h(...M)),...o.default?[o.default()]:[]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const le=(e,a)=>(f,{slots:p,attrs:h})=>t.h(st,{...h,...f,iconNode:a,name:e},p);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dt=le("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ge=le("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-vue-next v0.563.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ut=le("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var ye=(e=>(e[e.sucesso=200]="sucesso",e[e.erroConhecido=400]="erroConhecido",e[e.erroPermissao=401]="erroPermissao",e[e.erroNaoEncontrado=404]="erroNaoEncontrado",e[e.erroDesconhecido=500]="erroDesconhecido",e[e.tempoEsgotado=504]="tempoEsgotado",e))(ye||{});const ct=t.defineComponent({name:"EliTabelaCaixaDeBusca",props:{modelo:{type:String,required:!1,default:""}},emits:{buscar(e){return typeof e=="string"}},setup(e,{emit:a}){const f=t.ref(e.modelo??"");t.watch(()=>e.modelo,h=>{h!==void 0&&h!==f.value&&(f.value=h)});function p(){a("buscar",f.value.trim())}return{texto:f,emitirBusca:p}}}),ft={class:"eli-tabela__busca"},mt={class:"eli-tabela__busca-input-wrapper"};function pt(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div",ft,[t.createElementVNode("div",mt,[t.withDirectives(t.createElementVNode("input",{id:"eli-tabela-busca","onUpdate:modelValue":a[0]||(a[0]=l=>e.texto=l),type:"search",class:"eli-tabela__busca-input",placeholder:"Digite termos para filtrar",onKeyup:a[1]||(a[1]=t.withKeys((...l)=>e.emitirBusca&&e.emitirBusca(...l),["enter"]))},null,544),[[t.vModelText,e.texto]]),t.createElementVNode("button",{type:"button",class:"eli-tabela__busca-botao",onClick:a[2]||(a[2]=(...l)=>e.emitirBusca&&e.emitirBusca(...l))}," Buscar ")])])}const ht=z(ct,[["render",pt],["__scopeId","data-v-2aeb8274"]]),bt=t.defineComponent({name:"EliTabelaPaginacao",props:{pagina:{type:Number,required:!0},totalPaginas:{type:Number,required:!0},maximoBotoes:{type:Number,required:!1}},emits:{alterar(e){return Number.isFinite(e)}},setup(e,{emit:a}){const f=t.computed(()=>{const o=e.maximoBotoes;return typeof o=="number"&&o>=5?Math.floor(o):7}),p=t.computed(()=>{const o=e.totalPaginas,M=e.pagina,C=f.value,O=[],w=I=>{O.push({label:String(I),pagina:I,ativo:I===M})},_=()=>{O.push({label:"…",ehEllipsis:!0})};if(o<=C){for(let I=1;I<=o;I+=1)w(I);return O}const B=Math.max(3,C-2);let H=Math.max(2,M-Math.floor(B/2)),U=H+B-1;U>=o&&(U=o-1,H=U-B+1),w(1),H>2&&_();for(let I=H;I<=U;I+=1)w(I);return Ue.pagina<=1),l=t.computed(()=>e.pagina>=e.totalPaginas),b=t.computed(()=>e.pagina),k=t.computed(()=>e.totalPaginas);return{botoes:p,irParaPagina:h,anteriorDesabilitado:V,proximaDesabilitada:l,paginaAtual:b,totalPaginasExibidas:k}}}),gt={key:0,class:"eli-tabela__paginacao",role:"navigation","aria-label":"Paginação de resultados"},yt=["disabled"],$t={key:0,class:"eli-tabela__pagina-ellipsis","aria-hidden":"true"},Vt=["disabled","aria-current","aria-label","onClick"],kt=["disabled"];function Bt(e,a,f,p,h,V){return e.totalPaginasExibidas>1?(t.openBlock(),t.createElementBlock("nav",gt,[t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.anteriorDesabilitado,"aria-label":"Página anterior",onClick:a[0]||(a[0]=l=>e.irParaPagina(e.paginaAtual-1))}," << ",8,yt),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.botoes,(l,b)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`${l.label}-${b}`},[l.ehEllipsis?(t.openBlock(),t.createElementBlock("span",$t,t.toDisplayString(l.label),1)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.normalizeClass(["eli-tabela__pagina-botao",l.ativo?"eli-tabela__pagina-botao--ativo":void 0]),disabled:l.ativo,"aria-current":l.ativo?"page":void 0,"aria-label":`Ir para página ${l.label}`,onClick:k=>e.irParaPagina(l.pagina)},t.toDisplayString(l.label),11,Vt))],64))),128)),t.createElementVNode("button",{type:"button",class:"eli-tabela__pagina-botao",disabled:e.proximaDesabilitada,"aria-label":"Próxima página",onClick:a[1]||(a[1]=l=>e.irParaPagina(e.paginaAtual+1))}," >> ",8,kt)])):t.createCommentVNode("",!0)}const vt=z(bt,[["render",Bt],["__scopeId","data-v-59d12455"]]),wt=t.defineComponent({name:"EliTabela",inheritAttrs:!1,props:{tabela:{type:Object,required:!0}},setup(e){const a=t.ref(!1),f=t.ref(null),p=t.ref([]),h=t.ref(0),V=t.ref([]),l=t.ref(null),b=new Map,k=t.ref(""),o=t.ref(1),M=t.ref(null),C=t.ref("asc"),O=t.computed(()=>!!e.tabela.mostrarCaixaDeBusca),w=t.computed(()=>e.tabela.acoesTabela??[]),_=t.computed(()=>w.value.length>0),B=t.computed(()=>{const m=e.tabela.registros_por_consulta;return typeof m=="number"&&m>0?Math.floor(m):10}),H=t.computed(()=>{const m=B.value;if(!m||m<=0)return 1;const s=h.value;return s?Math.max(1,Math.ceil(s/m)):1});let U=0;function I(m,s){s?b.set(m,s):b.delete(m)}function K(m){return s=>{s instanceof HTMLElement?I(m,s):I(m,null)}}function ie(m){m&&(M.value===m?(C.value=C.value==="asc"?"desc":"asc",L()):(M.value=m,C.value="asc",o.value!==1?o.value=1:L()))}function J(m){k.value!==m&&(k.value=m,o.value!==1?o.value=1:L())}function R(m){const s=Math.min(Math.max(1,m),H.value);s!==o.value&&(o.value=s)}function Q(m){if(l.value===null)return;const s=b.get(l.value);s&&s.contains(m.target)||(l.value=null)}function x(m){return m==null||m===!1?"":m}function Z(m){return t.h("div",{class:"eli-tabela eli-tabela--erro",role:"alert"},[t.h("div",{class:"eli-tabela__erro-titulo"},"Erro"),t.h("div",{class:"eli-tabela__erro-mensagem"},m)])}function N(m){return t.h("div",{class:"eli-tabela eli-tabela--vazio"},m??"Nenhum registro encontrado.")}function v(){return t.h("div",{class:"eli-tabela eli-tabela--carregando","aria-busy":"true"},"Carregando...")}async function L(){var u,r;const m=++U;a.value=!0,f.value=null,V.value=[],l.value=null,b.clear();const s=Math.max(1,B.value),n={offSet:(o.value-1)*s,limit:s};k.value&&(n.texto_busca=k.value),M.value&&(n.coluna_ordem=M.value,n.direcao_ordem=C.value);try{const c=e.tabela,i=await c.consulta(n);if(m!==U)return;if(i.cod!==ye.sucesso){p.value=[],h.value=0,f.value=i.mensagem;return}const g=((u=i.valor)==null?void 0:u.valores)??[],y=((r=i.valor)==null?void 0:r.quantidade)??g.length;p.value=g,h.value=y;const S=Math.max(1,Math.ceil((y||0)/s));if(o.value>S){o.value=S;return}const $=c.acoesLinha??[];if(!$.length){V.value=[];return}const P=g.map(()=>$.map(A=>A.exibir===void 0?!0:typeof A.exibir=="boolean"?A.exibir:!1));V.value=P;const F=await Promise.all(g.map(async A=>Promise.all($.map(async q=>{if(q.exibir===void 0)return!0;if(typeof q.exibir=="boolean")return q.exibir;try{const j=q.exibir(A);return!!await Promise.resolve(j)}catch{return!1}}))));m===U&&(V.value=F)}catch(c){if(m!==U)return;p.value=[],h.value=0,f.value=c instanceof Error?c.message:"Erro ao carregar dados."}finally{m===U&&(a.value=!1)}}return t.onMounted(()=>{document.addEventListener("click",Q),L()}),t.watch(()=>e.tabela.mostrarCaixaDeBusca,m=>{!m&&k.value&&(k.value="",o.value!==1?o.value=1:L())}),t.watch(o,(m,s)=>{m!==s&&L()}),t.onBeforeUnmount(()=>{document.removeEventListener("click",Q),b.clear()}),t.watch(()=>e.tabela,()=>{l.value=null,b.clear(),M.value=null,C.value="asc",k.value="",o.value!==1?o.value=1:L()}),t.watch(()=>e.tabela.registros_por_consulta,()=>{o.value!==1?o.value=1:L()}),t.watch(p,()=>{l.value=null,b.clear()}),()=>{const m=e.tabela;if(a.value)return v();if(f.value)return Z(f.value);const s=m.colunas,d=m.acoesLinha??[],n=d.length>0;if(!p.value.length)return N(m.mensagemVazio);const u=s.map(c=>{const i=c.coluna_ordem!==void 0?c.coluna_ordem:void 0,g=!!i,y=g&&M.value===i,S=g?y?t.h(C.value==="asc"?ge:dt,{class:"eli-tabela__th-icone",size:16,strokeWidth:2,"aria-hidden":"true"}):t.h(ge,{class:"eli-tabela__th-icone eli-tabela__th-icone--oculto",size:16,strokeWidth:2,"aria-hidden":"true"}):null,$=g?t.h("button",{type:"button",class:["eli-tabela__th-botao",y?"eli-tabela__th-botao--ativo":void 0],onClick:()=>ie(i)},[t.h("span",{class:"eli-tabela__th-texto"},c.rotulo),S]):t.h("span",{class:"eli-tabela__th-label"},c.rotulo);return t.h("th",{class:["eli-tabela__th",g?"eli-tabela__th--ordenavel":void 0],scope:"col"},$)});n&&u.push(t.h("th",{class:"eli-tabela__th eli-tabela__th--acoes",scope:"col"},"Ações"));const r=[];if(O.value||_.value){const c=w.value.map((i,g)=>t.h("button",{key:`${i.rotulo}-${g}`,type:"button",class:"eli-tabela__acoes-cabecalho-botao",style:i.cor?{backgroundColor:i.cor}:void 0,onClick:i.acao},[i.icone?t.h(i.icone,{class:"eli-tabela__acoes-cabecalho-icone",size:16,strokeWidth:2}):null,t.h("span",{class:"eli-tabela__acoes-cabecalho-rotulo"},i.rotulo)]));r.push(t.h("div",{class:"eli-tabela__cabecalho"},[O.value?t.h(ht,{modelo:k.value,onBuscar:J}):null,_.value?t.h("div",{class:"eli-tabela__acoes-cabecalho"},c):null]))}return r.push(t.h("table",{class:"eli-tabela__table"},[t.h("thead",{class:"eli-tabela__thead"},t.h("tr",{class:"eli-tabela__tr eli-tabela__tr--header"},u)),t.h("tbody",{class:"eli-tabela__tbody"},p.value.map((c,i)=>{const g=s.map((y,S)=>t.h("td",{class:["eli-tabela__td",y.acao?"eli-tabela__td--clicavel":void 0],key:`${i}-${S}`,onClick:y.acao?()=>{var $;return($=y.acao)==null?void 0:$.call(y)}:void 0},x(y.celula(c))));if(n){const y=V.value[i]??[],S=d.map((D,Y)=>{const G=D.exibir===void 0?!0:typeof D.exibir=="boolean"?D.exibir:!1;return{acao:D,indice:Y,visivel:y[Y]??G}}).filter(D=>D.visivel),$=S.length>0;!$&&l.value===i&&(l.value=null);const P=l.value===i,F=`eli-tabela-acoes-toggle-${i}`,A=`eli-tabela-acoes-menu-${i}`,q=t.h("button",{id:F,class:"eli-tabela__acoes-toggle",type:"button",disabled:!$,onClick:D=>{D.stopPropagation(),$&&(l.value=P?null:i)},"aria-haspopup":"menu","aria-expanded":P?"true":"false","aria-controls":$?A:void 0,"aria-label":$?"Ações da linha":"Nenhuma ação disponível",title:$?"Ações":"Nenhuma ação disponível"},[t.h(ut,{class:"eli-tabela__acoes-toggle-icone",size:18,strokeWidth:2})]),j=P&&$?t.h("ul",{id:A,class:"eli-tabela__acoes-menu",role:"menu","aria-labelledby":F},S.map(({acao:D,indice:Y})=>t.h("li",{key:`acao-${Y}`,class:"eli-tabela__acoes-item",role:"none"},t.h("button",{type:"button",class:"eli-tabela__acoes-item-botao",style:{color:D.cor},onClick:G=>{G.stopPropagation(),l.value=null,D.acao(c)},role:"menuitem","aria-label":D.rotulo,title:D.rotulo},[t.h(D.icone,{class:"eli-tabela__acoes-item-icone",size:16,strokeWidth:2}),t.h("span",{class:"eli-tabela__acoes-item-texto"},D.rotulo)])))):null,T=["eli-tabela__acoes-container"];P&&T.push("eli-tabela__acoes-container--aberto"),g.push(t.h("td",{class:["eli-tabela__td","eli-tabela__td--acoes"],key:`${i}-acoes`},t.h("div",{class:T,ref:K(i)},[q,j])))}return t.h("tr",{class:"eli-tabela__tr",key:i},g)}))])),H.value>1&&h.value>0&&r.push(t.h(vt,{pagina:o.value,totalPaginas:H.value,maximoBotoes:e.tabela.maximo_botoes_paginacao,onAlterar:c=>{R(c)}})),t.h("div",{class:"eli-tabela"},r)}}});function Ct(e,a,f,p,h,V){return t.openBlock(),t.createElementBlock("div")}const $e=z(wt,[["render",Ct],["__scopeId","data-v-c6b8c95b"]]),St={install(e){e.component("EliOlaMundo",ce),e.component("EliBotao",oe),e.component("EliBadge",ee),e.component("EliInput",re),e.component("EliCartao",fe),e.component("EliDataHora",pe),e.component("EliTabela",$e)}};E.EliBadge=ee,E.EliBotao=oe,E.EliCartao=fe,E.EliDataHora=pe,E.EliInput=re,E.EliOlaMundo=ce,E.EliTabela=$e,E.default=St,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));