'use client';'use strict';

var chunkQOC26J56_cjs = require('./chunk-QOC26J56.cjs');
var chunkWHYG63JU_cjs = require('./chunk-WHYG63JU.cjs');
var chunkY3NOL3WI_cjs = require('./chunk-Y3NOL3WI.cjs');
var chunk4IQP4J4C_cjs = require('./chunk-4IQP4J4C.cjs');
var icons = require('@onbeam/icons');
var css = require('@onbeam/styled-system/css');
var react = require('react');
var recipes = require('@onbeam/styled-system/recipes');
var utils = require('@onbeam/utils');
var jsxRuntime = require('react/jsx-runtime');

var o=(e=>(e[e.MIN=.1]="MIN",e[e.DEFAULT=.5]="DEFAULT",e[e.MAX=1]="MAX",e))(o||{});var y=Object.keys(o).filter(n=>Number.isNaN(Number(n))),i=2,m=10**i,g=n=>n.toFixed(i),c=n=>g(n/m);var I=react.forwardRef(({className:n,value:a,onChange:b,...e},x)=>{let[h,v]=react.useState(""),s=recipes.transactionSlippageSettings(),l=(t,L)=>{v(t);let p=utils.parseFloatToInt(t,i);!utils.isDefined(p)||p>=5e3||p<0||b(p,!!L);};return jsxRuntime.jsxs("div",{className:css.cx(s.slippage,n),children:[jsxRuntime.jsx(chunk4IQP4J4C_cjs.a,{ref:x,value:h,onChange:t=>l(t.currentTarget.value),onBlur:()=>l(c(a)),placeholder:c(a),inputMode:"numeric",size:"sm",rightAddon:"%",label:jsxRuntime.jsxs(chunkQOC26J56_cjs.a,{children:[jsxRuntime.jsx("span",{children:"Slippage tolerance"}),jsxRuntime.jsx(chunkWHYG63JU_cjs.a,{width:250,label:"Your transaction will revert if the price changes unfavorably by more than this percentage",children:jsxRuntime.jsx(icons.TooltipGreyIcon,{height:16,width:16})})]}),...e}),jsxRuntime.jsx("div",{className:s.slippageButtonContainer,children:y.map(t=>jsxRuntime.jsxs(chunkY3NOL3WI_cjs.a,{type:"button",size:"sm",variant:a/m===o[t]?"primary":"secondary",className:s.slippageButton,onClick:()=>l(g(o[t]),!0),children:[o[t],"%"]},t))})]})});I.displayName="TransactionSlippageSettings";

exports.a = o;
exports.b = I;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-NK3UXT3U.cjs.map