import{a as H,g as N,i as f,aH as P,aX as T,u as _,b2 as $,r as I,H as E,j as t,_ as l,M as R,e3 as z,f as b,bG as S,eb as C,d5 as L,e9 as K,ec as V,ea as w}from"./main-634.js";import{F as i}from"./bf-767-388.js";import{A as G}from"./bf-710-385.js";import{I as O}from"./bf-457-387.js";import{S as X}from"./bf-982-242.js";import{F as h}from"./bf-676-386.js";import"./bf-534-247.js";import"./bf-25-81.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";import"./bf-638-271.js";import"./bf-247-269.js";function le(){const{css:n}=H(),{fieldKey:o}=N(),[c,u]=f(P),[j]=f(T),y=_($),[v,r]=I.useState(!1),[F,g]=I.useState("");if(!o)return null;const e=E(c[o]),{txt:M}=e,A=s=>{const{value:a}=s.target,d=z(a);e.txt=d;const x=b(c,B=>{B[o]=e});u(x),S({event:`Button text updated : ${e.txt}`,type:"change_btn_txt",state:{fields:x,fldKey:o}})},m=s=>{C(j,o,L[s])||K(y,s),V(s,o),g(s),r(!0)},p=s=>{if(e[s]){delete e[s];const a=b(c,d=>{d[o]=e});u(a),S({event:`${w[s]} Icon Deleted`,type:`delete_${s}`,state:{fldKey:o,fields:a}})}};return t.jsxs(t.Fragment,{children:[t.jsxs(X,{id:"btn-txt-stng",title:l("Button Text"),className:n(i.fieldSection),open:!0,children:[t.jsx("div",{className:n(i.placeholder),children:t.jsx(G,{id:"btn-txt","aria-label":"Button text",placeholder:"Type text here...",value:M,changeAction:A})}),t.jsxs("div",{className:n(i.iconLayoutHorizontal),children:[t.jsx(h,{label:l("Prefix Icon"),iconSrc:e==null?void 0:e.btnPreIcn,styleRoute:"btn-pre-i",setIcon:()=>m("btnPreIcn"),removeIcon:()=>p("btnPreIcn"),position:"prefix"}),t.jsx("span",{className:n(i.iconSeparator),children:"|"}),t.jsx(h,{label:l("Suffix Icon"),iconSrc:e==null?void 0:e.btnSufIcn,styleRoute:"btn-suf-i",setIcon:()=>m("btnSufIcn"),removeIcon:()=>p("btnSufIcn"),position:"suffix"})]})]}),t.jsxs(R,{md:!0,autoHeight:!0,show:v,setModal:r,className:"o-v",title:l("Icons"),children:[t.jsx("div",{className:"pos-rel"}),t.jsx(O,{iconType:F,addPaddingOnSelect:!1,setModal:r})]})]})}export{le as default};
