import{a as S,g as j,i as F,aH as _,u,k,$ as O,H as N,j as s,_ as f,f as b,bG as g}from"./main-634.js";import{F as d}from"./bf-767-388.js";import{E as D}from"./bf-178-233.js";import{S as P}from"./bf-982-242.js";import{S as w}from"./bf-497-246.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-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 xe(){const{css:o}=S(),{fieldKey:t}=j(),[l,x]=F(_),n=u(k),h=u(O),{isPro:a}=h;if(!t)return null;const e=N(l[t]),c=e.adminLbl||"",v=e.mx||"",p=(n==null?void 0:n.err)||{},y=i=>{var m;if(!a)return;i.target.value===""?delete e.mx:(e.mx=i.target.value,e.err||(e.err={}),e.err.mx||(e.err.mx={}),e.err.mx.dflt=((m=p==null?void 0:p[e.typ])==null?void 0:m.mx)||`<p style="margin:0">Maximum ${i.target.value} option${Number(i.target.value)>1?"s":""}</p>`,e.err.mx.show=!0);const r=b(l,$=>{$[t]=e});x(r),g({event:`Max value updated to ${i.target.value}: ${e.lbl||c||t}`,type:"set_max",state:{fields:r,fldKey:t}})},M=i=>{if(!a)return;i.target.checked?e.valid.disableOnMax=!0:delete e.valid.disableOnMax;const r=b(l,m=>{m[t]=e});x(r),g({event:`Disable on max selected ${i.target.checked?"on":"off"}: ${e.lbl||c||t}`,type:"set_disable_on_max",state:{fields:r,fldKey:t}})};return s.jsxs(P,{id:"mxmm-stng",title:f("Maximum"),className:o(d.fieldSection),tip:"Set maximum number to be selected for checkbox option",isPro:!0,proProperty:"maximumOption",children:[s.jsx("div",{className:o(d.placeholder),children:s.jsx("input",{"data-testid":"mxmm-stng-inp","aria-label":"maximim number",className:o(d.input),value:v,type:"number",onChange:y,disabled:!a})}),e.mx&&s.jsxs(s.Fragment,{children:[s.jsx(D,{id:"mxmm-stng",type:"mx",title:"Max Error Message",tipTitle:`By enabling this feature, user will see the error message when selected checkbox is greater than ${e.mx}`}),s.jsx(w,{id:"mxmm-slctd",title:f("Disable if maximum selected:"),action:M,isChecked:e.valid.disableOnMax,disabled:!a,className:"mt-3 mb-2"})]})]})}export{xe as default};
