define(['exports', 'preact/jsx-runtime', 'preact', 'preact/compat', 'preact/hooks', './HiddenAccessible-037ef42d', './LiveRegion-dbefb95b', './TabBar-92bac52f', './mergeInterpolations-9ede4cf7', './flexitem-5db48325', './collectionUtils-77dc5fa1', './useUser-08901aba', './LayerHost-0b288129', './useReorderableItem-7b4b2c3d', './ReorderableContext-6d10a1b7', './UNSAFE_ReorderableTabBar/themes/ReorderableTabBarItemStyles.css', './keys-4755c121', './classNames-08d99695', 'css!./DragAndDropStyles.styles.css', 'css!./ReorderableItemStyles.styles.css'], (function(e,r,t,s,a,o,l,i,d,n,c,y,b,m,u,R,f,g,v,x){"use strict";const p='[role="tab"]';function I({children:e,dragKey:t,setDragKey:s,onReorder:o,layout:l,rootRef:i,isFirstItem:b,isLastItem:u}){const v=a.useRef(null),x=a.useCallback((()=>v?.current?.querySelector(p)),[]),I=a.useCallback((e=>{e.dataTransfer?.setData("text/tabbar-item-key",c.getKey(x())+"")}),[x]),{direction:h}=y.useUser(),j="rtl"===h,D=d.mergeInterpolations([...Object.values(n.flexitemInterpolations)])({flex:"stretch"===l?"1 0 auto":"0 0 auto"}),{rootProps:S,isDragged:F,overlayZoneBeforeProps:K,overlayZoneAfterProps:O}=m.useReorderableItem({isDisabled:!o,dragKey:t,setDragKey:s,onReorder:o,rootRef:i,ref:v,getItem:x,setTransferData:I,itemStyles:{itemOverlayFront:R.styles.itemOverlayFront,itemOverlayRear:R.styles.itemOverlayRear,itemDragger:R.styles.itemDragger},itemSelector:p}),C=g.classNames([K?.class,!j&&b&&R.styles.itemOverlayFrontFirst,j&&u&&R.styles.itemOverlayFrontFirst]),L=g.classNames([O?.class,!j&&u&&R.styles.itemOverlayRearLast,j&&b&&R.styles.itemOverlayRearLast]);return r.jsxs("div",{...S,draggable:!!o,"data-oj-draggable":o?"":void 0,style:D,children:[e,!F&&f.isKeyDefined(t)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{...K,class:C}),r.jsx("div",{...O,class:L})]})]})}const h=s.forwardRef((({"aria-label":e,"aria-labelledby":s,children:d,layout:n="stretch",display:c="standard",size:y="md",edge:b="top",selection:R,onSelect:f,onRemove:g,onReorder:v,contextMenuConfig:x,testId:h},j)=>{const D=a.useRef(null),[S,F]=a.useState(void 0),K=t.toChildArray(d),O="stacked"===c?{display:c}:{display:c,size:y},{reorderProps:C,reorderContext:L,reorderInstructionsId:T,reorderStatus:k,reorderInstructions:A}=m.useReorderable({onReorder:v,rootRef:D,itemSelector:p}),B={currentItemKey:L.currentItemKey,onReorder:v};return r.jsxs("div",{ref:D,...C,children:[r.jsx(u.ReorderableContext.Provider,{value:B,children:r.jsx(i.TabBar,{ref:j,"aria-label":e,"aria-labelledby":s,layout:n,edge:b,selection:R,onSelect:f,onRemove:g,testId:h,...O,"aria-describedby":T,contextMenuConfig:x,children:K.map(((e,t)=>r.jsx(I,{dragKey:S,setDragKey:F,onReorder:v,layout:n,rootRef:D,isFirstItem:0===t,isLastItem:t===K.length-1,children:e})))})}),r.jsx("span",{id:T,children:r.jsx(o.HiddenAccessible,{children:A})}),r.jsx(l.LiveRegion,{children:k})]})}));e.ReorderableTabBar=h}));
//# sourceMappingURL=ReorderableTabBar-19a503c7.js.map
