p+t){S=w-1;break}}for(var O=0,T=C-1;T>=0;T-=1){var M=e.get(s[T].key)||Uy;if(M[v]=S?[0,0]:[O,S]},[e,t,r,a,i,p,c,s.map(function(C){return C.key}).join("_"),f])}function Ky(e){var t;return e instanceof Map?(t={},e.forEach(function(n,r){t[r]=n})):t=e,JSON.stringify(t)}var iR="TABS_DQ";function Gy(e){return String(e).replace(/"/g,iR)}function Yy(e,t,n,r){return!(!n||r||e===!1||e===void 0&&(t===!1||t===null))}function lR(e,t){var n=e.prefixCls,r=e.editable,a=e.locale,i=e.style;return!r||r.showAdd===!1?null:o.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(a==null?void 0:a.addAriaLabel)||"Add tab",onClick:function(s){r.onEdit("add",{event:s})}},r.addIcon||"+")}var Xy=o.forwardRef(lR),sR=o.forwardRef(function(e,t){var n=e.position,r=e.prefixCls,a=e.extra;if(!a)return null;var i,l={};return(0,ce.Z)(a)==="object"&&!o.isValidElement(a)?l=a:l.right=a,n==="right"&&(i=l.right),n==="left"&&(i=l.left),i?o.createElement("div",{className:"".concat(r,"-extra-content"),ref:t},i):null}),qy=sR;function cR(e,t){var n=e.prefixCls,r=e.id,a=e.tabs,i=e.locale,l=e.mobile,s=e.moreIcon,c=s===void 0?"More":s,f=e.moreTransitionName,h=e.style,v=e.className,p=e.editable,C=e.tabBarGutter,S=e.rtl,w=e.removeAriaLabel,x=e.onTabClick,O=e.getPopupContainer,T=e.popupClassName,M=(0,o.useState)(!1),R=(0,_e.Z)(M,2),I=R[0],P=R[1],F=(0,o.useState)(null),k=(0,_e.Z)(F,2),H=k[0],D=k[1],U="".concat(r,"-more-popup"),j="".concat(n,"-dropdown"),V=H!==null?"".concat(U,"-").concat(H):null,K=i==null?void 0:i.dropdownAriaLabel;function Q(ve,me){ve.preventDefault(),ve.stopPropagation(),p.onEdit("remove",{key:me,event:ve})}var X=o.createElement(Xp,{onClick:function(me){var ye=me.key,ge=me.domEvent;x(ye,ge),P(!1)},prefixCls:"".concat(j,"-menu"),id:U,tabIndex:-1,role:"listbox","aria-activedescendant":V,selectedKeys:[H],"aria-label":K!==void 0?K:"expanded dropdown"},a.map(function(ve){var me=ve.closable,ye=ve.disabled,ge=ve.closeIcon,pe=ve.key,$e=ve.label,xe=Yy(me,ge,p,ye);return o.createElement(od,{key:pe,id:"".concat(U,"-").concat(pe),role:"option","aria-controls":r&&"".concat(r,"-panel-").concat(pe),disabled:ye},o.createElement("span",null,$e),xe&&o.createElement("button",{type:"button","aria-label":w||"remove",tabIndex:0,className:"".concat(j,"-menu-item-remove"),onClick:function(Pe){Pe.stopPropagation(),Q(Pe,pe)}},ge||p.removeIcon||"\xD7"))}));function G(ve){for(var me=a.filter(function(xe){return!xe.disabled}),ye=me.findIndex(function(xe){return xe.key===H})||0,ge=me.length,pe=0;peun?"left":"right"})}),K=(0,_e.Z)(V,2),Q=K[0],X=K[1],G=Zy(0,function(Dn,un){!j&&M&&M({direction:Dn>un?"top":"bottom"})}),q=(0,_e.Z)(G,2),se=q[0],ie=q[1],ue=(0,o.useState)([0,0]),ve=(0,_e.Z)(ue,2),me=ve[0],ye=ve[1],ge=(0,o.useState)([0,0]),pe=(0,_e.Z)(ge,2),$e=pe[0],xe=pe[1],Ee=(0,o.useState)([0,0]),Pe=(0,_e.Z)(Ee,2),Se=Pe[0],Me=Pe[1],de=(0,o.useState)([0,0]),Oe=(0,_e.Z)(de,2),Ze=Oe[0],ke=Oe[1],Ue=aR(new Map),et=(0,_e.Z)(Ue,2),Ge=et[0],We=et[1],mt=tR(i,Ge,$e[0]),rt=k6(me,j),At=k6($e,j),Kt=k6(Se,j),en=k6(Ze,j),pt=rtlt?lt:Dn}var Vt=(0,o.useRef)(),Yt=(0,o.useState)(),bn=(0,_e.Z)(Yt,2),wn=bn[0],Sn=bn[1];function Fn(){Sn(Date.now())}function Un(){window.clearTimeout(Vt.current)}rR(k,function(Dn,un){function dn(fn,An){fn(function($n){var zr=Rt($n+An);return zr})}return pt?(j?dn(X,Dn):dn(ie,un),Un(),Fn(),!0):!1}),(0,o.useEffect)(function(){return Un(),wn&&(Vt.current=window.setTimeout(function(){Sn(0)},100)),Un},[wn]);var vr=oR(mt,Wt,j?Q:se,At,Kt,en,(0,L.Z)((0,L.Z)({},e),{},{tabs:i})),rn=(0,_e.Z)(vr,2),qn=rn[0],Mn=rn[1],xn=Oa(function(){var Dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,un=mt.get(Dn)||{width:0,height:0,left:0,right:0,top:0};if(j){var dn=Q;v?un.rightQ+Wt&&(dn=un.right+un.width-Wt):un.left<-Q?dn=-un.left:un.left+un.width>-Q+Wt&&(dn=-(un.left+un.width-Wt)),ie(0),X(Rt(dn))}else{var fn=se;un.top<-se?fn=-un.top:un.top+un.height>-se+Wt&&(fn=-(un.top+un.height-Wt)),X(0),ie(Rt(fn))}}),cn={};w==="top"||w==="bottom"?cn[v?"marginRight":"marginLeft"]=x:cn.marginTop=x;var Ut=i.map(function(Dn,un){var dn=Dn.key;return o.createElement(fR,{id:c,prefixCls:a,key:dn,tab:Dn,style:un===0?void 0:cn,closable:Dn.closable,editable:C,active:dn===h,renderWrapper:O,removeAriaLabel:S==null?void 0:S.removeAriaLabel,onClick:function(An){T(dn,An)},onFocus:function(){xn(dn),Fn(),k.current&&(v||(k.current.scrollLeft=0),k.current.scrollTop=0)}})}),On=function(){return We(function(){var un,dn=new Map,fn=(un=H.current)===null||un===void 0?void 0:un.getBoundingClientRect();return i.forEach(function(An){var $n,zr=An.key,gr=($n=H.current)===null||$n===void 0?void 0:$n.querySelector('[data-node-key="'.concat(Gy(zr),'"]'));if(gr){var Jr=hR(gr,fn),Za=(0,_e.Z)(Jr,4),Va=Za[0],Xa=Za[1],Ka=Za[2],wo=Za[3];dn.set(zr,{width:Va,height:Xa,left:Ka,top:wo})}}),dn})};(0,o.useEffect)(function(){On()},[i.map(function(Dn){return Dn.key}).join("_")]);var gn=Wy(function(){var Dn=t0(I),un=t0(P),dn=t0(F);ye([Dn[0]-un[0]-dn[0],Dn[1]-un[1]-dn[1]]);var fn=t0(U);Me(fn);var An=t0(D);ke(An);var $n=t0(H);xe([$n[0]-fn[0],$n[1]-fn[1]]),On()}),Gt=i.slice(0,qn),Pt=i.slice(Mn+1),yn=[].concat((0,yt.Z)(Gt),(0,yt.Z)(Pt)),Hn=mt.get(h),Wn=eR({activeTabOffset:Hn,horizontal:j,rtl:v,indicatorSize:R}),wr=Wn.style;(0,o.useEffect)(function(){xn()},[h,sn,lt,Ky(Hn),Ky(mt),j]),(0,o.useEffect)(function(){gn()},[v]);var lr=!!yn.length,vt="".concat(a,"-nav-wrap"),Mt,Nn,Qn,sr;return j?v?(Nn=Q>0,Mt=Q!==lt):(Mt=Q<0,Nn=Q!==sn):(Qn=se<0,sr=se!==sn),o.createElement(Zr,{onResize:gn},o.createElement("div",{ref:(0,fe.x1)(t,I),role:"tablist",className:N()("".concat(a,"-nav"),l),style:s,onKeyDown:function(){Fn()}},o.createElement(qy,{ref:P,position:"left",extra:p,prefixCls:a}),o.createElement(Zr,{onResize:gn},o.createElement("div",{className:N()(vt,(n={},(0,re.Z)(n,"".concat(vt,"-ping-left"),Mt),(0,re.Z)(n,"".concat(vt,"-ping-right"),Nn),(0,re.Z)(n,"".concat(vt,"-ping-top"),Qn),(0,re.Z)(n,"".concat(vt,"-ping-bottom"),sr),n)),ref:k},o.createElement(Zr,{onResize:gn},o.createElement("div",{ref:H,className:"".concat(a,"-nav-list"),style:{transform:"translate(".concat(Q,"px, ").concat(se,"px)"),transition:wn?"none":void 0}},Ut,o.createElement(Xy,{ref:U,prefixCls:a,locale:S,editable:C,style:(0,L.Z)((0,L.Z)({},Ut.length===0?void 0:cn),{},{visibility:lr?"hidden":null})}),o.createElement("div",{className:N()("".concat(a,"-ink-bar"),(0,re.Z)({},"".concat(a,"-ink-bar-animated"),f.inkBar)),style:wr}))))),o.createElement(uR,(0,W.Z)({},e,{removeAriaLabel:S==null?void 0:S.removeAriaLabel,ref:D,prefixCls:a,tabs:yn,className:!lr&&Cn,tabMoving:!!wn})),o.createElement(qy,{ref:F,position:"right",extra:p,prefixCls:a})))}var Qy=o.forwardRef(mR),vR=["renderTabBar"],gR=["label","key"];function pR(e){var t=e.renderTabBar,n=(0,Kn.Z)(e,vR),r=o.useContext(F6),a=r.tabs;if(t){var i=(0,L.Z)((0,L.Z)({},n),{},{panes:a.map(function(l){var s=l.label,c=l.key,f=(0,Kn.Z)(l,gR);return o.createElement(Hy,(0,W.Z)({tab:s,key:c,tabKey:c},f))})});return t(i,Qy)}return o.createElement(Qy,n)}function bR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!1}:t=(0,L.Z)({inkBar:!0},(0,ce.Z)(e)==="object"?e:{}),t.tabPaneMotion&&t.tabPane===void 0&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}var yR=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Jy=0;function CR(e,t){var n,r=e.id,a=e.prefixCls,i=a===void 0?"rc-tabs":a,l=e.className,s=e.items,c=e.direction,f=e.activeKey,h=e.defaultActiveKey,v=e.editable,p=e.animated,C=e.tabPosition,S=C===void 0?"top":C,w=e.tabBarGutter,x=e.tabBarStyle,O=e.tabBarExtraContent,T=e.locale,M=e.moreIcon,R=e.moreTransitionName,I=e.destroyInactiveTabPane,P=e.renderTabBar,F=e.onChange,k=e.onTabClick,H=e.onTabScroll,D=e.getPopupContainer,U=e.popupClassName,j=e.indicatorSize,V=(0,Kn.Z)(e,yR),K=o.useMemo(function(){return(s||[]).filter(function(ke){return ke&&(0,ce.Z)(ke)==="object"&&"key"in ke})},[s]),Q=c==="rtl",X=bR(p),G=(0,o.useState)(!1),q=(0,_e.Z)(G,2),se=q[0],ie=q[1];(0,o.useEffect)(function(){ie(x1())},[]);var ue=br(function(){var ke;return(ke=K[0])===null||ke===void 0?void 0:ke.key},{value:f,defaultValue:h}),ve=(0,_e.Z)(ue,2),me=ve[0],ye=ve[1],ge=(0,o.useState)(function(){return K.findIndex(function(ke){return ke.key===me})}),pe=(0,_e.Z)(ge,2),$e=pe[0],xe=pe[1];(0,o.useEffect)(function(){var ke=K.findIndex(function(et){return et.key===me});if(ke===-1){var Ue;ke=Math.max(0,Math.min($e,K.length-1)),ye((Ue=K[ke])===null||Ue===void 0?void 0:Ue.key)}xe(ke)},[K.map(function(ke){return ke.key}).join("_"),me,$e]);var Ee=br(null,{value:r}),Pe=(0,_e.Z)(Ee,2),Se=Pe[0],Me=Pe[1];(0,o.useEffect)(function(){r||(Me("rc-tabs-".concat(Jy)),Jy+=1)},[]);function de(ke,Ue){k==null||k(ke,Ue);var et=ke!==me;ye(ke),et&&(F==null||F(ke))}var Oe={id:Se,activeKey:me,animated:X,tabPosition:S,rtl:Q,mobile:se},Ze=(0,L.Z)((0,L.Z)({},Oe),{},{editable:v,locale:T,moreIcon:M,moreTransitionName:R,tabBarGutter:w,onTabClick:de,onTabScroll:H,extra:O,style:x,panes:null,getPopupContainer:D,popupClassName:U,indicatorSize:j});return o.createElement(F6.Provider,{value:{tabs:K,prefixCls:i}},o.createElement("div",(0,W.Z)({ref:t,id:r,className:N()(i,"".concat(i,"-").concat(S),(n={},(0,re.Z)(n,"".concat(i,"-mobile"),se),(0,re.Z)(n,"".concat(i,"-editable"),v),(0,re.Z)(n,"".concat(i,"-rtl"),Q),n),l)},V),o.createElement(pR,(0,W.Z)({},Ze,{renderTabBar:P})),o.createElement(Q_,(0,W.Z)({destroyInactiveTabPane:I},Oe,{animated:X}))))}var SR=o.forwardRef(CR),wR=SR,xR=wR;const ER={motionAppear:!1,motionEnter:!0,motionLeave:!0};function OR(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},n;return t===!1?n={inkBar:!1,tabPane:!1}:t===!0?n={inkBar:!0,tabPane:!0}:n=Object.assign({inkBar:!0},typeof t=="object"?t:{}),n.tabPane&&(n.tabPaneMotion=Object.assign(Object.assign({},ER),{motionName:ai(e,"switch")})),n}var AR=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a