import{i as A,aH as T,g as $,u as h,b2 as N,aX as L,r as b,a as R,H as w,j as l,_ as m,M as z,e9 as y,f as I,ba as a,bG as S,eb as E,d5 as K,ec as V}from"./main-634.js";import{t as q,F}from"./bf-676-386.js";import{F as o}from"./bf-767-388.js";import{A as G}from"./bf-710-385.js";import{I as X}from"./bf-457-387.js";import{S as k}from"./bf-982-242.js";import"./bf-638-271.js";import"./bf-247-269.js";import"./bf-25-81.js";import"./bf-534-247.js";import"./bf-299-245.js";import"./bf-497-246.js";import"./bf-641-107.js";import"./bf-400-72.js";import"./bf-438-114.js";function ce(){const[c,d]=A(T),{fieldKey:t}=$(),g=h(N),j=h(L),[C,p]=b.useState(!1),[H,v]=b.useState(""),{css:i}=R(),e=w(c[t]),u=(e==null?void 0:e.clrBtn)||"",x=e.adminLbl||"",_=({target:{checked:s}})=>{s?(e.clrBtn=m("Clear"),e.clrBtnHide=!1,y(g,"clrBtn")):(delete e.clrBtn,delete e.clrPreIcn,delete e.clrSufIcn,e.clrBtnHide=!0);const r=s?"on":"off",n=I(c,P=>{P[t]=e});d(n),a(t),S({event:`Clear Button ${r}:  ${u||x||t}`,type:`clr_btn_${r}`,state:{fields:n,fldKey:t}})},M=({target:{value:s}})=>{s===""?(delete e.clrBtn,a(t)):e.clrBtn=s;const r=I(c,n=>{n[t]=e});d(r),a(t),S({event:`Clear btn text updated: ${x||u||t}`,type:"change_clr_btn_txt",state:{fields:r,fldKey:t}})},f=s=>{E(j,t,K[s])||y(g,s),V(s,t),v(s),p(!0)},B=s=>{if(e[s]){delete e[s];const r=I(c,n=>{n[t]=e});d(r),a(t)}};return l.jsxs("div",{children:[l.jsxs(k,{id:"clr-button-stng",title:m("Clear Button"),className:i(o.fieldSection,o.hover_tip),switching:!0,tip:q.clrBtn,tipProps:{width:250,icnSize:17},toggleAction:_,toggleChecked:!(e!=null&&e.clrBtnHide),open:!(e!=null&&e.clrBtnHide),disable:e==null?void 0:e.clrBtnHide,children:[l.jsx("div",{className:i(o.placeholder),children:l.jsx(G,{id:"clr-btn-stng",ariaLabel:"Clear Button for this Field",placeholder:"Type clear button txt here...",value:u,changeAction:M})}),l.jsxs("div",{className:i(o.iconLayoutHorizontal),children:[l.jsx(F,{label:"Leading Icon",iconSrc:e==null?void 0:e.clrPreIcn,styleRoute:"clr-btn-pre-i",setIcon:()=>f("clrPreIcn"),removeIcon:()=>B("clrPreIcn"),proProperty:"leadingIcon"}),l.jsx("span",{className:i(o.iconSeparator),children:"|"}),l.jsx(F,{label:"Trailing Icon",iconSrc:e==null?void 0:e.clrSufIcn,styleRoute:"undo-btn-suf-i",setIcon:()=>f("clrSufIcn"),removeIcon:()=>B("clrSufIcn"),proProperty:"trailingIcon"})]})]}),l.jsxs(z,{md:!0,autoHeight:!0,show:C,setModal:p,className:"o-v",title:m("Icons"),children:[l.jsx("div",{className:"pos-rel"}),l.jsx(X,{iconType:H,setModal:p})]})]})}export{ce as default};
