define(['exports', 'preact/jsx-runtime', 'preact', 'preact/hooks', './useTranslationBundle-e4dd341e', './clientHints-6d361eaa', './mergeInterpolations-9ede4cf7', './flexitem-5db48325', './classNames-08d99695', './NavigationList-a6bb123d', './NavigationListItem-10bf6656', 'css!./NavigationListSeparator.styles.css', './Icon-234f9eb8', './useTabBarContext-15a23bb6', './Dropdown-7eca9554', './Sheet-1d02491d', './BaseTabBarItem-d7c2922b', './UNSAFE_TabBarCommon/themes/OverflowTabBarItemStyles.css', './NavigationListLinkItem-df1826e6', './RemovableNavigationListItem-60593d4c'], (function(e,a,t,s,n,i,o,l,r,c,d,m,b,u,v,f,g,p,h,y){"use strict";const x=e=>a.jsx(b.Icon,{viewBox:"0 0 24 24",...e,children:a.jsx("g",{fill:"none",children:a.jsx("path",{d:"M6 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8 0a2 2 0 1 1-4 0 2 2 0 0 1 4 0z",fill:"currentcolor"})})});const I=()=>{const{deviceRenderMode:e}=i.getClientHints();return"phone"===e};e.OverflowTabBarItem=function({overflowItemKey:e,icon:i,badge:m,overflowItems:b,isOpen:j,onClose:B}){const{selection:C,showFocusRing:w,isEdgeBottom:R,onSelect:L,onRemove:N,layout:K}=u.useTabBarContext(),k=s.useRef(!1);s.useEffect((()=>{j||(k.current=!1)}),[j]);const O=s.useRef(null),T=t.createRef(),F=s.useCallback((e=>{"pointer"===e.reason&&(k.current=!0),L?.({value:e.value}),B?.({reason:"itemAction"})}),[L,B]),S=s.useCallback((e=>{B?.({reason:e.reason})}),[B]),D=s.useCallback((()=>{B?.({reason:"dismissed"})}),[B]),z=w&&!k.current&&!I(),A=b?.find((e=>e.itemKey===C))?.tabPanelId,E=n.useTranslationBundle("@oracle/oraclejet-preact"),H=void 0!==C&&(M=C,null!=b?.find((e=>e.itemKey===M)));var M;const P=o.mergeInterpolations([...Object.values(l.flexitemInterpolations)])({flex:"stretch"===K?"1 0 auto":"0 0 auto"}),U=r.classNames([p.styles.navContainerBase]),_=s.useRef(null),q=s.useCallback((e=>{"ArrowDown"===e.key&&(e.preventDefault(),T.current?.focus())}),[T]),G=s.useCallback((()=>a.jsx("div",{onKeyDown:q,tabIndex:0,ref:_,class:U,children:a.jsx(c.NavigationList,{ref:T,selection:C,onSelectionChange:F,onRemove:N,children:b?.map((e=>null!=e.href?a.jsx(h.NavigationListLinkItem,{href:e.href,itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity}):e.isRemovable?a.jsx(y.RemovableNavigationListItem,{itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity}):a.jsx(d.NavigationListItem,{itemKey:e.itemKey,label:e.label,badge:e.badge,metadata:e.metadata,severity:e.severity})))})})),[q,U,T,C,F,N,b]);return a.jsxs(a.Fragment,{children:[b&&b.length>0&&a.jsx("div",{ref:O,style:P,children:a.jsx(g.BaseTabBarItem,{"aria-controls":A,itemKey:e,label:E.overflowItemLabel(),icon:i||a.jsx(x,{}),badge:m,showFocusRingOverride:z,selectionOverride:H,displayOverride:"icons","aria-haspopup":!0})}),I()?a.jsx(f.Sheet,{isOpen:j,onClose:D,initialFocus:"firstFocusable",children:G()}):a.jsx(v.Dropdown,{initialFocus:"firstFocusable",isOpen:j,onClose:S,placement:R?"top-end":"bottom-end",anchorRef:O,children:G()})]})}}));
//# sourceMappingURL=OverflowTabBarItem-0aa39512.js.map
