@gearbox-protocol/ui-kit 3.14.0-next.4 → 3.14.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),I=require("class-variance-authority"),A=require("react"),ee=require("react-dom"),te=require("../currency-button/currency-button.cjs"),ne=require("@fortawesome/free-solid-svg-icons"),re=require("../icons/fa-icon.cjs"),y=require("../../hooks/use-media-query.cjs"),h=require("../../test-ids/smart-number-input.cjs"),se=require("../../utils/bn-to-input-view.cjs");require("@gearbox-protocol/sdk");const ae=require("../../utils/parse-input-to-bn.cjs"),w=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const oe=require("./balance-indicator.cjs");function ie(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const i in o)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>o[i]})}}return r.default=o,Object.freeze(r)}const a=ie(A),ce=I.cva("relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",{variants:{size:{sm:"px-3 py-[7px] h-[60px] rounded-[8px]",md:"pl-4 pr-3 py-[10px] h-[82px] rounded-lg"}},defaultVariants:{size:"md"}}),ue=I.cva("font-medium text-foreground",{variants:{size:{sm:"text-xs",md:"text-sm"}},defaultVariants:{size:"md"}}),le=I.cva("w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",{variants:{size:{sm:"text-[18px]! leading-[21px]!",md:"text-[28px]! leading-[33px]!"}},defaultVariants:{size:"md"}}),_=a.forwardRef(({amount:o,token:r,label:i="Amount",maxAmount:s,maxAmountLimit:x,maxButtonLabel:k,chainId:B,network:L,maxButton:M=!0,disabled:c=!1,active:S=!1,size:T="md",symbolMaxLength:V,tokenOptions:b,onSetAmount:l,onShowSelectDialog:N,onRemove:j,onFocus:E,onBlur:R},O)=>{const q=r?.decimals??18,D=e=>{const n=e.target.value,[m,g]=ae.parseInputToBN(n,q);m===null||g===null||l&&l(m,g)},F=()=>{if(l){const e=s&&x&&s>x?x:s||0n,n=se.bnToInputView(e,q);l(e,n)}},[P,z]=a.useState(!1),W=()=>{z(!0),E?.()},Q=()=>{z(!1),R?.()},d=T??"md",X=y.useIsMobile(),$=y.useIsTablet(),G=y.useIsDesktop(),H=V??(X?20:$?30:G?22:30),[u,v]=a.useState(!1),f=a.useRef(null),C=a.useRef(null),[J,K]=a.useState({});a.useLayoutEffect(()=>{if(!u||!f.current)return;const e=()=>{const n=f.current?.getBoundingClientRect();n&&K({position:"fixed",top:n.bottom+4,right:window.innerWidth-n.right,minWidth:n.width,zIndex:9999})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[u]),a.useEffect(()=>{if(!u)return;const e=n=>{const m=n.target,g=f.current?.contains(m),Z=C.current?.contains(m);!g&&!Z&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);const p=!!(b&&b.length>0),U=!c&&p?()=>v(e=>!e):N,Y=!!(r||N||p);return t.jsxs("div",{ref:O,className:ce({size:d}),"data-testid":h.smartNumberInputTestIds.root,"data-active":P,"data-disabled":c,children:[j&&t.jsx("div",{className:"absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center","data-testid":h.smartNumberInputTestIds.close,children:t.jsx("button",{type:"button",onClick:j,className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",children:t.jsx(re.FaIcon,{icon:ne.faXmark,className:"size-3"})})}),t.jsxs("div",{className:"mb-2 flex justify-between text-sm leading-[120%]",children:[t.jsx("span",{className:w.cn(ue({size:d}),"grow shrink-0 basis-0"),"data-testid":h.smartNumberInputTestIds.label,children:i}),s!==void 0&&r&&t.jsx(oe.BalanceIndicator,{title:k,token:r,maxAmount:s,size:d,disabled:c,maxButton:M,onMaxButtonClick:F})]}),t.jsxs("div",{className:w.cn("flex w-full max-w-full shrink-0 basis-full items-center"),children:[t.jsx("div",{className:"mr-3 grow shrink-0 basis-0",children:t.jsx("input",{type:"text",inputMode:"decimal",autoComplete:"off",autoCorrect:"off",spellCheck:"false",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:"0",value:o,onChange:D,onFocus:W,onBlur:Q,disabled:c||!l,className:w.cn(le({size:d}),c&&"cursor-not-allowed"),"data-testid":h.smartNumberInputTestIds.input,minLength:1,maxLength:79,title:"Amount"})}),Y?t.jsxs("div",{ref:f,className:"shrink-0",children:[t.jsx(te.CurrencyButton,{active:p?u:S,size:d,disabled:c,token:r,showSelectDialog:U,chainId:B,network:L,maxLength:H,children:r?.symbol??"Select token"}),p&&u&&ee.createPortal(t.jsx("div",{ref:C,style:J,className:"overflow-hidden rounded-lg border border-gray-30 bg-gray-20 shadow-lg",children:b?.map((e,n)=>t.jsxs("button",{type:"button",onClick:()=>{e.onSelect(),v(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30 text-left",children:[e.icon?t.jsx("span",{className:"inline-flex shrink-0 items-center",children:e.icon}):null,t.jsx("span",{className:"truncate",children:e.label})]},n))}),document.body)]}):null]})]})});_.displayName="SmartNumberInput";exports.SmartNumberInput=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("class-variance-authority"),de=require("react"),me=require("react-dom"),pe=require("../checkbox/checkbox.cjs");require("../checkbox/checkbox-labeled.cjs");const fe=require("../currency-button/currency-button.cjs"),he=require("../health-factor/health-factor.cjs"),xe=require("@fortawesome/free-solid-svg-icons"),ge=require("../icons/fa-icon.cjs"),be=require("../slider/slider.cjs");require("../slider/slider-context.cjs");const I=require("../typed-intl/index.cjs"),j=require("../../hooks/use-media-query.cjs"),v=require("../../test-ids/smart-number-input.cjs"),ve=require("../../utils/bn-to-input-view.cjs");require("@gearbox-protocol/sdk");const ye=require("../../utils/parse-input-to-bn.cjs"),y=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const we=require("./balance-indicator.cjs");function Ne(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}return r.default=n,Object.freeze(r)}const c=Ne(de),Ie=q.cva("relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",{variants:{size:{sm:"px-3 py-[7px] min-h-[60px] rounded-[8px]",md:"pl-4 pr-3 py-[10px] min-h-[82px] rounded-lg"}},defaultVariants:{size:"md"}}),je=q.cva("font-medium text-foreground",{variants:{size:{sm:"text-xs",md:"text-sm"}},defaultVariants:{size:"md"}}),ke=q.cva("w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",{variants:{size:{sm:"text-[18px]! leading-[21px]!",md:"text-[28px]! leading-[33px]!"}},defaultVariants:{size:"md"}});function k(n){return Math.round(n*100)}function qe(n){return n/100}function Me(n,r){const o=parseFloat(n.replace(",",".")||"0");if(!Number.isFinite(o)||o===0)return"$0";const a=o*r,x=Math.abs(a)<100;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:x?2:0,maximumFractionDigits:x?2:0}).format(a)}catch{return"$0"}}const S=c.forwardRef(({amount:n,token:r,label:o,maxAmount:a,maxAmountLimit:h,maxButtonLabel:x,chainId:L,network:B,maxButton:V=!0,disabled:d=!1,active:D=!1,size:R="md",symbolMaxLength:E,tokenOptions:w,multiSelectMode:O=!1,onSetAmount:p,onShowSelectDialog:M,onRemove:_,onFocus:P,onBlur:$,usdPrice:C,hfSlider:l},H)=>{const{formatMessage:U}=I.useIntlTyped(),W=c.useId(),T=r?.decimals??18,Q=t=>{const s=t.target.value,[i,u]=ye.parseInputToBN(s,T);i===null||u===null||p&&p(i,u)},X=()=>{if(p){const t=a&&h&&a>h?h:a||0n,s=ve.bnToInputView(t,T);p(t,s)}},[G,z]=c.useState(!1),J=()=>{z(!0),P?.()},K=()=>{z(!1),$?.()},Y=j.useIsMobile(),Z=l?.min??1,A=l?.max??3,ee=l?.step??.01,te=Math.max(1,Math.round(1/ee)),f=R??"md",ne=Y,se=j.useIsTablet(),re=j.useIsDesktop(),ae=E??(ne?20:se?30:re?22:30),[m,N]=c.useState(!1),g=c.useRef(null),F=c.useRef(null),[oe,ce]=c.useState({});c.useLayoutEffect(()=>{if(!m||!g.current)return;const t=()=>{const s=g.current?.getBoundingClientRect();s&&ce({position:"fixed",top:s.bottom+4,right:window.innerWidth-s.right,minWidth:s.width,zIndex:9999})};return t(),window.addEventListener("scroll",t,!0),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}},[m]),c.useEffect(()=>{if(!m)return;const t=s=>{const i=s.target,u=g.current?.contains(i),ue=F.current?.contains(i);!u&&!ue&&N(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[m]);const b=!!(w&&w.length>0),ie=!d&&b?()=>N(t=>!t):M,le=!!(r||M||b);return e.jsxs("div",{ref:H,className:Ie({size:f}),"data-testid":v.smartNumberInputTestIds.root,"data-active":G,"data-disabled":d,children:[_&&e.jsx("div",{className:"absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center","data-testid":v.smartNumberInputTestIds.close,children:e.jsx("button",{type:"button",onClick:_,className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",children:e.jsx(ge.FaIcon,{icon:xe.faXmark,className:"size-3"})})}),e.jsxs("div",{className:"mb-2 flex justify-between text-sm leading-[120%]",children:[e.jsx("span",{className:y.cn(je({size:f}),"grow shrink-0 basis-0"),"data-testid":v.smartNumberInputTestIds.label,children:o??e.jsx(I.FormattedMessageTyped,{messageId:"components.smartNumberInput.amountLabel"})}),l!==void 0?e.jsxs("div",{className:"ml-auto flex w-1/2 min-w-0 items-center gap-1",children:[e.jsx("span",{className:"shrink-0 text-xs text-secondary-foreground",children:"HF"}),e.jsx("div",{className:"min-w-0 flex-1 [&>div]:px-0 [&>div]:pb-0",children:e.jsx(be.Slider,{from:k(Z),to:k(A),value:k(l.value),precision:te,markerStep:0,epsilon:0,onChangeValue:t=>l.onChange(qe(t))})}),e.jsx(he.HealthFactor,{value:Math.round(l.value*1e4),debt:1n,decimals:2,className:"shrink-0 text-xs tabular-nums"})]}):a!==void 0&&r&&e.jsx(we.BalanceIndicator,{title:x,token:r,maxAmount:a,size:f,disabled:d,maxButton:V,onMaxButtonClick:X})]}),e.jsxs("div",{className:y.cn("flex w-full max-w-full shrink-0 basis-full items-center"),children:[e.jsx("div",{className:"mr-3 grow shrink-0 basis-0",children:e.jsx("input",{type:"text",inputMode:"decimal",autoComplete:"off",autoCorrect:"off",spellCheck:"false",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:"0",value:n,onChange:Q,onFocus:J,onBlur:K,disabled:d||!p,className:y.cn(ke({size:f}),d&&"cursor-not-allowed"),"data-testid":v.smartNumberInputTestIds.input,minLength:1,maxLength:79,title:U({messageId:"components.smartNumberInput.inputTitle"})})}),le?e.jsxs("div",{ref:g,className:"shrink-0",children:[e.jsx(fe.CurrencyButton,{active:b?m:D,size:f,disabled:d,token:r,showSelectDialog:ie,chainId:L,network:B,maxLength:ae,children:r?.symbol??e.jsx(I.FormattedMessageTyped,{messageId:"components.smartNumberInput.selectToken"})}),b&&m&&me.createPortal(e.jsx("div",{ref:F,style:oe,className:"overflow-hidden rounded-lg border border-gray-30 bg-gray-20 shadow-lg",children:w?.map((t,s)=>{const i=`${W}-${s}`,u="flex w-full min-w-0 items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30";return O?e.jsxs("div",{className:u,children:[e.jsx(pe.Checkbox,{id:i,checked:!!t.checked,color:"secondary",size:"md",className:"shrink-0",onCheckedChange:()=>t.onSelect()}),e.jsxs("label",{htmlFor:i,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left",children:[t.icon?e.jsx("span",{className:"inline-flex shrink-0 items-center",children:t.icon}):null,e.jsx("span",{className:"truncate",children:t.label})]})]},s):e.jsxs("button",{type:"button",onClick:()=>{t.onSelect(),N(!1)},className:y.cn(u,"text-left"),children:[t.icon?e.jsx("span",{className:"inline-flex shrink-0 items-center",children:t.icon}):null,e.jsx("span",{className:"truncate",children:t.label})]},s)})}),document.body)]}):null]}),C!==void 0&&e.jsx("div",{className:"mt-1 text-xs leading-[130%] text-secondary-foreground",children:Me(n,C)})]})});S.displayName="SmartNumberInput";exports.SmartNumberInput=S;
@@ -1 +1 @@
1
- "use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard","components.poolAssetsTable.asset":"Asset","components.poolAssetsTable.rate":"Effective rate","components.poolAssetsTable.limits":"Limits Usage","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.bonusAPY.title":"Target Bonuses Yield","components.rewardsTooltip.with.bonusAPY.tip":"Expected Bonuses APY is calculated by the Asset Issuer and represents the expected value to be paid out in points.","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy is available on RWA market."};module.exports=e;
1
+ "use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.amountLabel":"Amount","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.smartNumberInput.selectToken":"Select token","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard","components.poolAssetsTable.asset":"Asset","components.poolAssetsTable.rate":"Effective rate","components.poolAssetsTable.limits":"Limits Usage","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.bonusAPY.title":"Target Bonuses Yield","components.rewardsTooltip.with.bonusAPY.tip":"Expected Bonuses APY is calculated by the Asset Issuer and represents the expected value to be paid out in points.","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy is available on RWA market."};module.exports=e;
@@ -1,5 +1,5 @@
1
1
  import { jsxs as f, jsx as c } from "react/jsx-runtime";
2
- import { PERCENTAGE_FACTOR as p, formatPercentage as v } from "@gearbox-protocol/sdk";
2
+ import { formatPercentage as p, PERCENTAGE_FACTOR as v } from "@gearbox-protocol/sdk";
3
3
  import { cva as x } from "class-variance-authority";
4
4
  import "react";
5
5
  import { cn as C } from "../../utils/cn.js";
@@ -10,7 +10,7 @@ import "../../utils/z-index.js";
10
10
  import { StatusBars as F } from "../status-elements/status-elements.js";
11
11
  const g = 15e3, A = 11e3, H = 10500, N = (t) => {
12
12
  if (t)
13
- return t >= g ? "good" : t > A ? "medium" : t > H ? "bad" : t > p ? "critical" : "liquidation";
13
+ return t >= g ? "good" : t > A ? "medium" : t > H ? "bad" : t > v ? "critical" : "liquidation";
14
14
  }, b = x(
15
15
  "inline-flex items-center font-medium [text-decoration:inherit]",
16
16
  {
@@ -38,7 +38,7 @@ function G({
38
38
  const n = e !== void 0 && e === 0n, r = !n && i === "color" ? o === void 0 ? N(t) : o : void 0, s = r === void 0 ? void 0 : r === null ? "unset" : r, d = () => {
39
39
  if (n) return "N/A";
40
40
  const l = Number(t);
41
- return v(l, a);
41
+ return p(l, a);
42
42
  };
43
43
  return /* @__PURE__ */ f(
44
44
  "span",
@@ -1,33 +1,39 @@
1
- import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { cva as b } from "class-variance-authority";
3
- import * as n from "react";
4
- import { createPortal as _ } from "react-dom";
5
- import { CurrencyButton as A } from "../currency-button/currency-button.js";
6
- import { faXmark as ee } from "@fortawesome/free-solid-svg-icons";
7
- import { FaIcon as te } from "../icons/fa-icon.js";
8
- import { useIsMobile as re, useIsTablet as ne, useIsDesktop as se } from "../../hooks/use-media-query.js";
9
- import { smartNumberInputTestIds as h } from "../../test-ids/smart-number-input.js";
10
- import { bnToInputView as oe } from "../../utils/bn-to-input-view.js";
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { cva as k } from "class-variance-authority";
3
+ import * as r from "react";
4
+ import { createPortal as de } from "react-dom";
5
+ import { Checkbox as ue } from "../checkbox/checkbox.js";
6
+ import "../checkbox/checkbox-labeled.js";
7
+ import { CurrencyButton as me } from "../currency-button/currency-button.js";
8
+ import { HealthFactor as fe } from "../health-factor/health-factor.js";
9
+ import { faXmark as pe } from "@fortawesome/free-solid-svg-icons";
10
+ import { FaIcon as he } from "../icons/fa-icon.js";
11
+ import { Slider as ge } from "../slider/slider.js";
12
+ import "../slider/slider-context.js";
13
+ import { useIntlTyped as xe, FormattedMessageTyped as B } from "../typed-intl/index.js";
14
+ import { useIsMobile as be, useIsTablet as ve, useIsDesktop as we } from "../../hooks/use-media-query.js";
15
+ import { smartNumberInputTestIds as w } from "../../test-ids/smart-number-input.js";
16
+ import { bnToInputView as ye } from "../../utils/bn-to-input-view.js";
11
17
  import "@gearbox-protocol/sdk";
12
- import { parseInputToBN as ae } from "../../utils/parse-input-to-bn.js";
13
- import { cn as w } from "../../utils/cn.js";
18
+ import { parseInputToBN as Ne } from "../../utils/parse-input-to-bn.js";
19
+ import { cn as y } from "../../utils/cn.js";
14
20
  import "sonner";
15
21
  import "@gearbox-protocol/sdk/common-utils";
16
22
  import "luxon";
17
23
  import "../../utils/z-index.js";
18
- import { BalanceIndicator as ie } from "./balance-indicator.js";
19
- const le = b(
24
+ import { BalanceIndicator as Ie } from "./balance-indicator.js";
25
+ const Ce = k(
20
26
  "relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",
21
27
  {
22
28
  variants: {
23
29
  size: {
24
- sm: "px-3 py-[7px] h-[60px] rounded-[8px]",
25
- md: "pl-4 pr-3 py-[10px] h-[82px] rounded-lg"
30
+ sm: "px-3 py-[7px] min-h-[60px] rounded-[8px]",
31
+ md: "pl-4 pr-3 py-[10px] min-h-[82px] rounded-lg"
26
32
  }
27
33
  },
28
34
  defaultVariants: { size: "md" }
29
35
  }
30
- ), ce = b("font-medium text-foreground", {
36
+ ), ke = k("font-medium text-foreground", {
31
37
  variants: {
32
38
  size: {
33
39
  sm: "text-xs",
@@ -35,7 +41,7 @@ const le = b(
35
41
  }
36
42
  },
37
43
  defaultVariants: { size: "md" }
38
- }), de = b(
44
+ }), Me = k(
39
45
  "w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",
40
46
  {
41
47
  variants: {
@@ -46,123 +52,171 @@ const le = b(
46
52
  },
47
53
  defaultVariants: { size: "md" }
48
54
  }
49
- ), ue = n.forwardRef(
55
+ );
56
+ function C(s) {
57
+ return Math.round(s * 100);
58
+ }
59
+ function ze(s) {
60
+ return s / 100;
61
+ }
62
+ function Fe(s, a) {
63
+ const f = parseFloat(s.replace(",", ".") || "0");
64
+ if (!Number.isFinite(f) || f === 0) return "$0";
65
+ const o = f * a, x = Math.abs(o) < 100;
66
+ try {
67
+ return new Intl.NumberFormat("en-US", {
68
+ style: "currency",
69
+ currency: "USD",
70
+ minimumFractionDigits: x ? 2 : 0,
71
+ maximumFractionDigits: x ? 2 : 0
72
+ }).format(o);
73
+ } catch {
74
+ return "$0";
75
+ }
76
+ }
77
+ const Le = r.forwardRef(
50
78
  ({
51
- amount: I,
52
- token: s,
53
- label: k = "Amount",
54
- maxAmount: i,
79
+ amount: s,
80
+ token: a,
81
+ label: f,
82
+ maxAmount: o,
55
83
  maxAmountLimit: g,
56
- maxButtonLabel: B,
57
- chainId: M,
58
- network: V,
59
- maxButton: E = !0,
60
- disabled: o = !1,
61
- active: R = !1,
62
- size: S = "md",
63
- symbolMaxLength: T,
64
- tokenOptions: x,
65
- onSetAmount: l,
66
- onShowSelectDialog: y,
67
- onRemove: N,
68
- onFocus: j,
69
- onBlur: F
70
- }, D) => {
71
- const z = s?.decimals ?? 18, W = (e) => {
72
- const t = e.target.value, [d, p] = ae(t, z);
73
- d === null || p === null || l && l(d, p);
74
- }, O = () => {
75
- if (l) {
76
- const e = i && g && i > g ? g : i || 0n, t = oe(e, z);
77
- l(e, t);
84
+ maxButtonLabel: x,
85
+ chainId: S,
86
+ network: E,
87
+ maxButton: R = !0,
88
+ disabled: u = !1,
89
+ active: D = !1,
90
+ size: j = "md",
91
+ symbolMaxLength: $,
92
+ tokenOptions: N,
93
+ multiSelectMode: H = !1,
94
+ onSetAmount: p,
95
+ onShowSelectDialog: M,
96
+ onRemove: z,
97
+ onFocus: U,
98
+ onBlur: P,
99
+ usdPrice: F,
100
+ hfSlider: c
101
+ }, W) => {
102
+ const { formatMessage: O } = xe(), X = r.useId(), L = a?.decimals ?? 18, q = (e) => {
103
+ const n = e.target.value, [i, d] = Ne(n, L);
104
+ i === null || d === null || p && p(i, d);
105
+ }, G = () => {
106
+ if (p) {
107
+ const e = o && g && o > g ? g : o || 0n, n = ye(e, L);
108
+ p(e, n);
78
109
  }
79
- }, [P, C] = n.useState(!1), X = () => {
80
- C(!0), j?.();
81
- }, $ = () => {
82
- C(!1), F?.();
83
- }, c = S ?? "md", q = re(), G = ne(), H = se(), J = T ?? (q ? 20 : G ? 30 : H ? 22 : 30), [a, v] = n.useState(!1), m = n.useRef(null), L = n.useRef(null), [K, Q] = n.useState({});
84
- n.useLayoutEffect(() => {
85
- if (!a || !m.current) return;
110
+ }, [J, T] = r.useState(!1), K = () => {
111
+ T(!0), U?.();
112
+ }, Q = () => {
113
+ T(!1), P?.();
114
+ }, Y = be(), Z = c?.min ?? 1, _ = c?.max ?? 3, A = c?.step ?? 0.01, ee = Math.max(1, Math.round(1 / A)), h = j ?? "md", te = Y, ne = ve(), re = we(), se = $ ?? (te ? 20 : ne ? 30 : re ? 22 : 30), [m, I] = r.useState(!1), b = r.useRef(null), V = r.useRef(null), [ae, oe] = r.useState({});
115
+ r.useLayoutEffect(() => {
116
+ if (!m || !b.current) return;
86
117
  const e = () => {
87
- const t = m.current?.getBoundingClientRect();
88
- t && Q({
118
+ const n = b.current?.getBoundingClientRect();
119
+ n && oe({
89
120
  position: "fixed",
90
- top: t.bottom + 4,
91
- right: window.innerWidth - t.right,
92
- minWidth: t.width,
121
+ top: n.bottom + 4,
122
+ right: window.innerWidth - n.right,
123
+ minWidth: n.width,
93
124
  zIndex: 9999
94
125
  });
95
126
  };
96
127
  return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
97
128
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
98
129
  };
99
- }, [a]), n.useEffect(() => {
100
- if (!a) return;
101
- const e = (t) => {
102
- const d = t.target, p = m.current?.contains(d), Z = L.current?.contains(d);
103
- !p && !Z && v(!1);
130
+ }, [m]), r.useEffect(() => {
131
+ if (!m) return;
132
+ const e = (n) => {
133
+ const i = n.target, d = b.current?.contains(i), ce = V.current?.contains(i);
134
+ !d && !ce && I(!1);
104
135
  };
105
136
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
106
- }, [a]);
107
- const f = !!(x && x.length > 0), U = !o && f ? () => v((e) => !e) : y, Y = !!(s || y || f);
108
- return /* @__PURE__ */ u(
137
+ }, [m]);
138
+ const v = !!(N && N.length > 0), ie = !u && v ? () => I((e) => !e) : M, le = !!(a || M || v);
139
+ return /* @__PURE__ */ l(
109
140
  "div",
110
141
  {
111
- ref: D,
112
- className: le({ size: c }),
113
- "data-testid": h.root,
114
- "data-active": P,
115
- "data-disabled": o,
142
+ ref: W,
143
+ className: Ce({ size: h }),
144
+ "data-testid": w.root,
145
+ "data-active": J,
146
+ "data-disabled": u,
116
147
  children: [
117
- N && /* @__PURE__ */ r(
148
+ z && /* @__PURE__ */ t(
118
149
  "div",
119
150
  {
120
151
  className: "absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center",
121
- "data-testid": h.close,
122
- children: /* @__PURE__ */ r(
152
+ "data-testid": w.close,
153
+ children: /* @__PURE__ */ t(
123
154
  "button",
124
155
  {
125
156
  type: "button",
126
- onClick: N,
157
+ onClick: z,
127
158
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",
128
- children: /* @__PURE__ */ r(te, { icon: ee, className: "size-3" })
159
+ children: /* @__PURE__ */ t(he, { icon: pe, className: "size-3" })
129
160
  }
130
161
  )
131
162
  }
132
163
  ),
133
- /* @__PURE__ */ u("div", { className: "mb-2 flex justify-between text-sm leading-[120%]", children: [
134
- /* @__PURE__ */ r(
164
+ /* @__PURE__ */ l("div", { className: "mb-2 flex justify-between text-sm leading-[120%]", children: [
165
+ /* @__PURE__ */ t(
135
166
  "span",
136
167
  {
137
- className: w(
138
- ce({ size: c }),
168
+ className: y(
169
+ ke({ size: h }),
139
170
  "grow shrink-0 basis-0"
140
171
  ),
141
- "data-testid": h.label,
142
- children: k
172
+ "data-testid": w.label,
173
+ children: f ?? /* @__PURE__ */ t(B, { messageId: "components.smartNumberInput.amountLabel" })
143
174
  }
144
175
  ),
145
- i !== void 0 && s && /* @__PURE__ */ r(
146
- ie,
176
+ c !== void 0 ? /* @__PURE__ */ l("div", { className: "ml-auto flex w-1/2 min-w-0 items-center gap-1", children: [
177
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-xs text-secondary-foreground", children: "HF" }),
178
+ /* @__PURE__ */ t("div", { className: "min-w-0 flex-1 [&>div]:px-0 [&>div]:pb-0", children: /* @__PURE__ */ t(
179
+ ge,
180
+ {
181
+ from: C(Z),
182
+ to: C(_),
183
+ value: C(c.value),
184
+ precision: ee,
185
+ markerStep: 0,
186
+ epsilon: 0,
187
+ onChangeValue: (e) => c.onChange(ze(e))
188
+ }
189
+ ) }),
190
+ /* @__PURE__ */ t(
191
+ fe,
192
+ {
193
+ value: Math.round(c.value * 1e4),
194
+ debt: 1n,
195
+ decimals: 2,
196
+ className: "shrink-0 text-xs tabular-nums"
197
+ }
198
+ )
199
+ ] }) : o !== void 0 && a && /* @__PURE__ */ t(
200
+ Ie,
147
201
  {
148
- title: B,
149
- token: s,
150
- maxAmount: i,
151
- size: c,
152
- disabled: o,
153
- maxButton: E,
154
- onMaxButtonClick: O
202
+ title: x,
203
+ token: a,
204
+ maxAmount: o,
205
+ size: h,
206
+ disabled: u,
207
+ maxButton: R,
208
+ onMaxButtonClick: G
155
209
  }
156
210
  )
157
211
  ] }),
158
- /* @__PURE__ */ u(
212
+ /* @__PURE__ */ l(
159
213
  "div",
160
214
  {
161
- className: w(
215
+ className: y(
162
216
  "flex w-full max-w-full shrink-0 basis-full items-center"
163
217
  ),
164
218
  children: [
165
- /* @__PURE__ */ r("div", { className: "mr-3 grow shrink-0 basis-0", children: /* @__PURE__ */ r(
219
+ /* @__PURE__ */ t("div", { className: "mr-3 grow shrink-0 basis-0", children: /* @__PURE__ */ t(
166
220
  "input",
167
221
  {
168
222
  type: "text",
@@ -172,58 +226,93 @@ const le = b(
172
226
  spellCheck: "false",
173
227
  pattern: "^[0-9]*[.,]?[0-9]*$",
174
228
  placeholder: "0",
175
- value: I,
176
- onChange: W,
177
- onFocus: X,
178
- onBlur: $,
179
- disabled: o || !l,
180
- className: w(
181
- de({ size: c }),
182
- o && "cursor-not-allowed"
229
+ value: s,
230
+ onChange: q,
231
+ onFocus: K,
232
+ onBlur: Q,
233
+ disabled: u || !p,
234
+ className: y(
235
+ Me({ size: h }),
236
+ u && "cursor-not-allowed"
183
237
  ),
184
- "data-testid": h.input,
238
+ "data-testid": w.input,
185
239
  minLength: 1,
186
240
  maxLength: 79,
187
- title: "Amount"
241
+ title: O({
242
+ messageId: "components.smartNumberInput.inputTitle"
243
+ })
188
244
  }
189
245
  ) }),
190
- Y ? /* @__PURE__ */ u("div", { ref: m, className: "shrink-0", children: [
191
- /* @__PURE__ */ r(
192
- A,
246
+ le ? /* @__PURE__ */ l("div", { ref: b, className: "shrink-0", children: [
247
+ /* @__PURE__ */ t(
248
+ me,
193
249
  {
194
- active: f ? a : R,
195
- size: c,
196
- disabled: o,
197
- token: s,
198
- showSelectDialog: U,
199
- chainId: M,
200
- network: V,
201
- maxLength: J,
202
- children: s?.symbol ?? "Select token"
250
+ active: v ? m : D,
251
+ size: h,
252
+ disabled: u,
253
+ token: a,
254
+ showSelectDialog: ie,
255
+ chainId: S,
256
+ network: E,
257
+ maxLength: se,
258
+ children: a?.symbol ?? /* @__PURE__ */ t(B, { messageId: "components.smartNumberInput.selectToken" })
203
259
  }
204
260
  ),
205
- f && a && _(
206
- /* @__PURE__ */ r(
261
+ v && m && de(
262
+ /* @__PURE__ */ t(
207
263
  "div",
208
264
  {
209
- ref: L,
210
- style: K,
265
+ ref: V,
266
+ style: ae,
211
267
  className: "overflow-hidden rounded-lg border border-gray-30 bg-gray-20 shadow-lg",
212
- children: x?.map((e, t) => /* @__PURE__ */ u(
213
- "button",
214
- {
215
- type: "button",
216
- onClick: () => {
217
- e.onSelect(), v(!1);
268
+ children: N?.map((e, n) => {
269
+ const i = `${X}-${n}`, d = "flex w-full min-w-0 items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30";
270
+ return H ? /* @__PURE__ */ l(
271
+ "div",
272
+ {
273
+ className: d,
274
+ children: [
275
+ /* @__PURE__ */ t(
276
+ ue,
277
+ {
278
+ id: i,
279
+ checked: !!e.checked,
280
+ color: "secondary",
281
+ size: "md",
282
+ className: "shrink-0",
283
+ onCheckedChange: () => e.onSelect()
284
+ }
285
+ ),
286
+ /* @__PURE__ */ l(
287
+ "label",
288
+ {
289
+ htmlFor: i,
290
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left",
291
+ children: [
292
+ e.icon ? /* @__PURE__ */ t("span", { className: "inline-flex shrink-0 items-center", children: e.icon }) : null,
293
+ /* @__PURE__ */ t("span", { className: "truncate", children: e.label })
294
+ ]
295
+ }
296
+ )
297
+ ]
218
298
  },
219
- className: "flex w-full items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30 text-left",
220
- children: [
221
- e.icon ? /* @__PURE__ */ r("span", { className: "inline-flex shrink-0 items-center", children: e.icon }) : null,
222
- /* @__PURE__ */ r("span", { className: "truncate", children: e.label })
223
- ]
224
- },
225
- t
226
- ))
299
+ n
300
+ ) : /* @__PURE__ */ l(
301
+ "button",
302
+ {
303
+ type: "button",
304
+ onClick: () => {
305
+ e.onSelect(), I(!1);
306
+ },
307
+ className: y(d, "text-left"),
308
+ children: [
309
+ e.icon ? /* @__PURE__ */ t("span", { className: "inline-flex shrink-0 items-center", children: e.icon }) : null,
310
+ /* @__PURE__ */ t("span", { className: "truncate", children: e.label })
311
+ ]
312
+ },
313
+ n
314
+ );
315
+ })
227
316
  }
228
317
  ),
229
318
  document.body
@@ -231,13 +320,14 @@ const le = b(
231
320
  ] }) : null
232
321
  ]
233
322
  }
234
- )
323
+ ),
324
+ F !== void 0 && /* @__PURE__ */ t("div", { className: "mt-1 text-xs leading-[130%] text-secondary-foreground", children: Fe(s, F) })
235
325
  ]
236
326
  }
237
327
  );
238
328
  }
239
329
  );
240
- ue.displayName = "SmartNumberInput";
330
+ Le.displayName = "SmartNumberInput";
241
331
  export {
242
- ue as SmartNumberInput
332
+ Le as SmartNumberInput
243
333
  };
@@ -20,8 +20,10 @@ const e = {
20
20
  "components.loading.loadingPercent": "Loading {percent}%",
21
21
  "components.loading.wait": "Please wait...",
22
22
  "components.smartNumberInput.balance": "Balance",
23
+ "components.smartNumberInput.amountLabel": "Amount",
23
24
  "components.smartNumberInput.inputTitle": "Token Amount",
24
25
  "components.smartNumberInput.confirm.input": "Input",
26
+ "components.smartNumberInput.selectToken": "Select token",
25
27
  "components.tipWindow.title": "Tip",
26
28
  "components.healthFactor.low": "Extremely low! This HF may not cover possible oracle deviations.",
27
29
  "components.headCell": "Sort by {value}",