import{g as T,i as O,aH as N,a as w,j as e,_ as n,h as a,f as P,bG as S}from"./main-634.js";import{F as t}from"./bf-767-388.js";import{F as p}from"./bf-457-387.js";import{S as c}from"./bf-982-242.js";import{S as b}from"./bf-497-246.js";import"./bf-534-247.js";import"./bf-25-81.js";import"./bf-299-245.js";import"./bf-641-107.js";import"./bf-400-72.js";import"./bf-438-114.js";function R(){var u,x,f;const{fieldKey:r}=T(),[h,j]=O(N),{css:i}=w();if(!r)return null;const d=h[r],l=(d==null?void 0:d.config)||{},y=(u=d==null?void 0:d.lbl)!=null?u:r,o=(s,g)=>{const v=P(h,m=>{m[r].config=m[r].config||{},m[r].config[s]=g});j(v),S({event:`OTP ${s} changed to ${String(g)}: ${y}`,type:`otp_${s}_changed`,state:{fields:v,fldKey:r}})};return e.jsxs(e.Fragment,{children:[e.jsx(c,{id:"otp-btn-texts-stng",title:n("Button Texts"),className:i([t.fieldSection,t.hover_tip]),tip:n("Customize the label text shown on the Send, Resend, and Verify buttons."),open:!0,children:e.jsxs("div",{className:i([t.placeholder,a.pt1]),children:[e.jsxs("label",{htmlFor:"send-btn-txt",children:[e.jsx("span",{className:i(a.inputLabel),children:n("Send OTP")}),e.jsx("input",{id:"send-btn-txt",type:"text",className:i([t.input,a.mt1,a.mb3]),value:l.sendBtnTxt||"",onChange:s=>o("sendBtnTxt",s.target.value)})]}),e.jsxs("label",{htmlFor:"resend-btn-txt",children:[e.jsx("span",{className:i(a.inputLabel),children:n("Resend OTP")}),e.jsx("input",{id:"resend-btn-txt",type:"text",className:i([t.input,a.mt1,a.mb3]),value:l.resendBtnTxt||"",onChange:s=>o("resendBtnTxt",s.target.value)})]}),e.jsxs("label",{htmlFor:"verify-btn-txt",children:[e.jsx("span",{className:i(a.inputLabel),children:n("Verify OTP")}),e.jsx("input",{id:"verify-btn-txt",type:"text",className:i([t.input,a.mt1,a.mb3]),value:l.verifyBtnTxt||"",onChange:s=>o("verifyBtnTxt",s.target.value)})]})]})}),e.jsx(p,{}),e.jsx(c,{id:"otp-wait-txt-stng",title:n("Resend OTP Countdown Text"),className:i([t.fieldSection,t.hover_tip]),tip:n("Text shown while the user waits to resend. Use ${bf_resend_countdown} as a placeholder for the live countdown number."),open:!0,children:e.jsxs("div",{className:i(t.placeholder),children:[e.jsx("input",{id:"wait-txt",type:"text",className:i(t.input),value:l.waitTxt||"",onChange:s=>o("waitTxt",s.target.value)}),e.jsx("p",{className:i(a.helpText),children:n("Use ${bf_resend_countdown} as placeholder for the resend countdown number.")})]})}),e.jsx(p,{}),e.jsx(c,{id:"otp-max-attempts-stng",title:n("Maximum OTP Verification Attempts"),className:i([t.fieldSection,t.hover_tip]),open:!0,tip:n("Limits the number of OTP verification attempts on the frontend. Once the maximum limit is reached, the field will be locked until the page is reloaded."),children:e.jsxs("div",{className:i(t.placeholder),children:[e.jsx("input",{id:"max-attempts",type:"number",className:i([t.input,t.hover_tip]),value:(x=l.maxAttempts)!=null?x:5,onChange:s=>o("maxAttempts",Math.max(1,parseInt(s.target.value,10)||5))}),e.jsx("p",{className:i(a.helpText),children:n("Limits the number of OTP verification attempts on the frontend. Once the maximum limit is reached, the field will be locked until the page is reloaded.")})]})}),e.jsx(p,{}),e.jsx(c,{id:"otp-expiry-stng",title:n("OTP Expiration Time (Minutes)"),className:i([t.fieldSection,t.hover_tip]),tip:n("How long the OTP remains valid in minutes. The expiration is verified on the server during form submission."),open:!0,children:e.jsxs("div",{className:i(t.placeholder),children:[e.jsx("input",{id:"expiry-delay",type:"number",className:i(t.input),value:(f=l.expiryDelay)!=null?f:15,onChange:s=>o("expiryDelay",Math.max(1,parseInt(s.target.value,10)||15))}),e.jsx("p",{className:i(a.helpText),children:n("Defines how long the OTP remains valid. The expiration is verified on the server during form submission.")})]})}),e.jsx(p,{}),e.jsx("div",{className:i(t.fieldSection,t.hover_tip,t.singleOption),children:e.jsx(b,{id:"otp-send-on-validate-stng",tip:n('When enabled, the OTP will be automatically sent if the user attempts to submit the form or move to the next step without clicking "Send OTP" first.'),title:n("Automatically Send OTP on Validation"),action:()=>o("sendOnValidate",!l.sendOnValidate),isChecked:l.sendOnValidate,isPro:!0,proProperty:"sendOnValidate"})}),e.jsx(p,{}),e.jsx("div",{className:i(t.fieldSection,t.hover_tip,t.singleOption),children:e.jsx(b,{id:"otp-auto-verify-on-input-stng",tip:n("When enabled, OTP verification is triggered automatically once the user has entered all digits (via typing, pasting, or autofill)."),title:n("Automatically Verify OTP on Input"),action:()=>o("autoVerifyOnInput",!l.autoVerifyOnInput),isChecked:l.autoVerifyOnInput})})]})}export{R as default};
