import{a as j,g as $,i as b,aH as M,u as N,k as w,H as v,j as t,_ as h,f as A,bG as C}from"./main-634.js";import{F as a}from"./bf-767-388.js";import{E as y}from"./bf-178-233.js";import{S as T}from"./bf-982-242.js";import"./bf-692-111.js";import"./bf-400-72.js";import"./bf-25-81.js";import"./bf-438-114.js";import"./bf-486-243.js";import"./bf-497-246.js";import"./bf-723-244.js";import"./bf-299-245.js";import"./bf-534-247.js";import"./bf-962-248.js";import"./bf-343-249.js";import"./bf-791-250.js";import"./bf-641-107.js";import"./bf-570-251.js";import"./bf-838-80.js";import"./bf-297-103.js";import"./bf-284-252.js";import"./bf-17-106.js";import"./bf-671-253.js";import"./bf-334-254.js";import"./bf-710-385.js";import"./bf-676-386.js";import"./bf-638-271.js";import"./bf-247-269.js";import"./bf-423-273.js";import"./bf-457-387.js";import"./bf-577-275.js";import"./bf-288-389.js";import"./bf-939-390.js";function le(){const{css:n}=j(),{fieldKey:s}=$(),[p,V]=b(M),r=N(w);if(!s)return null;const i=v(p[s]),e=(r==null?void 0:r.err)||{},{minValue:u,maxValue:l}=i.config,d=(m,o)=>{var f,c;i.config[o]=m,o==="minValue"?i.err.minValue.dflt=((f=e==null?void 0:e[i.typ])==null?void 0:f.minValue)||(e==null?void 0:e.minValue)||`Invalid amount. The minimum amount allowed is ${m}.`:o==="maxValue"&&(i.err.maxValue.dflt=((c=e==null?void 0:e[i.typ])==null?void 0:c.maxValue)||(e==null?void 0:e.maxValue)||`Invalid amount. The maximum amount allowed is ${m}.`);const x=A(p,g=>{g[s]=i});V(x),C({event:`${S[o]} '${m}': ${i.lbl||s}`,type:`${o}_changed`,state:{fields:x,fldKey:s}})};return t.jsx(T,{id:"nmbr-stng",title:"Input Amount Range(Min/Max):",className:n(a.fieldSection),isPro:!0,proProperty:"minMaxValue",children:t.jsxs("div",{className:n({mx:5}),children:[t.jsxs("div",{className:n(a.fieldNumber,{py:"0px !important"}),children:[t.jsx("span",{children:h("Minimum amount:")}),t.jsx("input",{"data-testid":"nmbr-stng-min-inp",title:"Minimum amount for this field","aria-label":"Minimum amount for this field",placeholder:"Type minimum amount here...",className:n(a.input,a.w140),type:"number",value:u||"",onChange:m=>d(m.target.value,"minValue")})]}),u&&t.jsx(y,{id:"nmbr-stng-min",type:"minValue",title:"Minimum amount Error Message",tipTitle:`By enabling this feature, user will see the error message when input amount is less than ${u}`}),t.jsxs("div",{className:n(a.fieldNumber,{py:"0px !important"}),children:[t.jsx("span",{children:h("Maximum amount:")}),t.jsx("input",{"data-testid":"nmbr-stng-max-inp",title:"Maximum amount for this field","aria-label":"Maximum amount for this field",placeholder:"Type maximum amount here...",className:n(a.input,a.w140),type:"number",value:l||"",onChange:m=>d(m.target.value,"maxValue")})]}),l&&t.jsx(y,{id:"nmbr-stng-max",type:"maxValue",title:"Max Error Message",tipTitle:`By enabling this feature, user will see the error message when input amount is greater than ${l}`})]})})}const S={minValue:"Minimum Amount Changed to",maxValue:"Maximum Amount Changed to"};export{le as default};
