import{f as C,a5 as k,a6 as A,V as B,L as d,q as M,y as f,P as F,K as s,U as I,v as r,a7 as v,u as y,a8 as D,a9 as K,S as L,T as S,e as V,g as q,b as U}from"./vue-CbNcDebW.js";import{x as b,aF as E}from"./index-Ct76C36l.js";const W={class:"d-flex flex-row mt-2 ga-2 align-center"},j={class:"autofill-container d-flex flex-grow-1 align-center border border-opacity-50 pa-2 rounded-lg"},z=["disabled"],H=C({inheritAttrs:!1,__name:"AutofillableField",props:k({title:{},prependIcon:{},prependIconInner:{},appendIcon:{},appendIconInner:{},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:k(["click:prepend","click:prependInner","click:append","click:appendInner","submit"],["update:modelValue"]),setup(e,{emit:c}){const o=c,u=A(e,"modelValue");function w(n){const t="on"+n,i=q(),g=i&&i.vnode&&i.vnode.props||{};return!!g[t]||Object.keys(g).some($=>{const h=$.toLowerCase(),x=n.toLowerCase();return h.endsWith(x)||h.endsWith(x.replace(":",""))})}function l(n){return V(()=>e.disabled?{}:w(n)?{click:t=>{t.preventDefault(),o(n)}}:{})}const p=l("click:prepend"),a=l("click:prependInner"),m=l("click:appendInner"),P=l("click:append");return(n,t)=>(d(),B("div",{class:M([{"autofill-container--disabled":e.disabled},"my-2 border-0"])},[f("div",null,F(e.title),1),f("div",W,[e.prependIcon?(d(),s(b,r({key:0,icon:e.prependIcon,color:"accent"},v(y(p))),null,16,["icon"])):I("",!0),f("div",j,[e.prependIconInner?(d(),s(b,r({key:0,icon:e.prependIconInner,color:"accent"},v(y(a))),null,16,["icon"])):I("",!0),D(f("input",r({"onUpdate:modelValue":t[0]||(t[0]=i=>u.value=i),disabled:e.disabled,class:"flex-grow-1",style:{height:"32px"}},n.$attrs,{onKeydown:t[1]||(t[1]=L(S(i=>!e.disabled&&n.$emit("submit"),["prevent"]),["enter"]))}),null,16,z),[[K,u.value]]),e.appendIconInner?(d(),s(b,r({key:1,icon:e.appendIconInner,color:"accent"},v(y(m))),null,16,["icon"])):I("",!0)]),e.appendIcon?(d(),s(b,r({key:1,icon:e.appendIcon,color:"accent"},v(y(P))),null,16,["icon"])):I("",!0)])],2))}}),O=E(H,[["__scopeId","data-v-6578322c"]]),J=C({inheritAttrs:!1,__name:"PasswordField",props:k({title:{},hideIcon:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:k(["submit"],["update:modelValue"]),setup(e){const c=A(e,"modelValue"),o=U(!1);function u(){o.value=!o.value}const w=V(()=>o.value?"text":"password"),l=V(()=>o.value?"mdi-eye":"mdi-eye-off");return(p,a)=>(d(),s(O,r({modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=m=>c.value=m),"append-icon-inner":e.hideIcon?"":l.value,title:e.title,type:w.value,name:"password"},p.$attrs,{onSubmit:a[1]||(a[1]=m=>p.$emit("submit")),"onClick:appendInner":u}),null,16,["modelValue","append-icon-inner","title","type"]))}});export{O as A,J as _};
