import{r as g}from"./index-NdkWRN8K.js";import{M as m}from"./Box-1mvP3NLW.js";import{u as h}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{j as f}from"./jsx-runtime-CnH95YSl.js";/*!
 * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const T=[10,20,30,40,50,60,70,80,90,100],s=t=>({default:{background:t.HueNeutral200,font:t.TypographyColorBody},attention:{background:t.PalettePrimaryMain,font:t.TypographyColorInverse},danger:{background:t.PaletteDangerMain,font:t.TypographyColorInverse}}),y=({badgeContent:t,badgeContentMax:n=100,testId:e,translate:i,type:r="default"})=>{const o=h();return g.useMemo(()=>{const a=n>0?n:1,l=a>999?999:a,p=t>l,d=`${a}+`,c=p?d:t.toString(),u={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:`calc(${o.Spacing4} + ${o.Spacing1})`,height:`calc(${o.Spacing4} + ${o.Spacing1})`,minHeight:`calc(${o.Spacing4} + ${o.Spacing1})`,padding:"0 6px",backgroundColor:s(o)[r].background,color:s(o)[r].font,borderRadius:c.length>1?`${o.BorderRadiusOuter}`:"50%",fontSize:`${o.TypographyScale0}`,fontFamily:`${o.TypographyFamilyMono}`,fontWeight:`${o.TypographyWeightBodyBold}`,lineHeight:1,transitionDuration:`${o.TransitionDurationMain}`,transitionProperty:"background-color, color"};return t&&t>0?f.jsx(m,{sx:u,testId:e,translate:i,children:c}):null},[t,n,o,e,i,r])},M=g.memo(y);M.displayName="Badge";export{M,T as b};
