'use client';'use strict';

var chunkTFTGREQH_cjs = require('./chunk-TFTGREQH.cjs');
var chunkWPULNWES_cjs = require('./chunk-WPULNWES.cjs');
var css = require('@onbeam/styled-system/css');
var react = require('react');
var inputOtp = require('input-otp');
var recipes = require('@onbeam/styled-system/recipes');
var utils = require('@onbeam/utils');
var jsxRuntime = require('react/jsx-runtime');

var m=react.forwardRef(({className:i,maxLength:o=6,errorMessage:t,hasError:f=!1,...s},u)=>{let n=recipes.inputOTP(),a=react.useMemo(()=>new Array(o).fill(null).map(()=>({id:utils.nanoId()})),[o]);return jsxRuntime.jsxs(inputOtp.OTPInput,{ref:u,containerClassName:css.cx(n.root,i),maxLength:o,...s,children:[jsxRuntime.jsx("div",{className:n.group,children:a.map(({id:P},l)=>jsxRuntime.jsx(chunkTFTGREQH_cjs.a,{hasError:!!(t||f),index:l},P))}),jsxRuntime.jsx(chunkWPULNWES_cjs.a,{children:t})]})});m.displayName="InputOTP";

exports.a = m;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-WUU4F3JD.cjs.map