13 lines
46 KiB
JavaScript
13 lines
46 KiB
JavaScript
import{r as i,bK as oa,at as fe,ed as la,aq as D,bg as ca,ce as gt,ah as ie,cf as sa,an as Ue,ee as da,ef as ua,am as ae,C as K,eg as va,as as pe,ar as fa,ai as ht,ci as Xe,cM as ba,ak as Ne,E as ma,eh as ga,av as pt,aO as ha,aj as pa,cA as $t,x as It,ax as Ot,z as u,y as qe,bR as Ye,dx as Mt,bC as Fe,ay as Be,aB as $a,M as ya,aK as zt,ei as Sa,bQ as Je,aD as xa,aJ as Ca,S as _a}from"./index-CYM97J2V.js";var wa=function(t,n){return i.createElement(oa,fe({},t,{ref:n,icon:la}))},Ta=i.forwardRef(wa);const De=i.createContext(null);var Ea=function(t){var n=t.activeTabOffset,a=t.horizontal,r=t.rtl,o=t.indicator,c=o===void 0?{}:o,l=c.size,s=c.align,d=s===void 0?"center":s,h=i.useState(),g=D(h,2),y=g[0],T=g[1],A=i.useRef(),E=ca.useCallback(function(f){return typeof l=="function"?l(f):typeof l=="number"?l:f},[l]);function N(){gt.cancel(A.current)}return i.useEffect(function(){var f={};if(n)if(a){f.width=E(n.width);var p=r?"right":"left";d==="start"&&(f[p]=n[p]),d==="center"&&(f[p]=n[p]+n.width/2,f.transform=r?"translateX(50%)":"translateX(-50%)"),d==="end"&&(f[p]=n[p]+n.width,f.transform="translateX(-100%)")}else f.height=E(n.height),d==="start"&&(f.top=n.top),d==="center"&&(f.top=n.top+n.height/2,f.transform="translateY(-50%)"),d==="end"&&(f.top=n.top+n.height,f.transform="translateY(-100%)");return N(),A.current=gt(function(){var P=y&&f&&Object.keys(f).every(function(B){var z=f[B],G=y[B];return typeof z=="number"&&typeof G=="number"?Math.round(z)===Math.round(G):z===G});P||T(f)}),N},[JSON.stringify(n),a,r,d,E]),{style:y}},yt={width:0,height:0,left:0,top:0};function Pa(e,t,n){return i.useMemo(function(){for(var a,r=new Map,o=t.get((a=e[0])===null||a===void 0?void 0:a.key)||yt,c=o.left+o.width,l=0;l<e.length;l+=1){var s=e[l].key,d=t.get(s);if(!d){var h;d=t.get((h=e[l-1])===null||h===void 0?void 0:h.key)||yt}var g=r.get(s)||ie({},d);g.right=c-g.left-g.width,r.set(s,g)}return r},[e.map(function(a){return a.key}).join("_"),t,n])}function St(e,t){var n=i.useRef(e),a=i.useState({}),r=D(a,2),o=r[1];function c(l){var s=typeof l=="function"?l(n.current):l;s!==n.current&&t(s,n.current),n.current=s,o({})}return[n.current,c]}var Ra=.1,xt=.01,Le=20,Ct=Math.pow(.995,Le);function Ia(e,t){var n=i.useState(),a=D(n,2),r=a[0],o=a[1],c=i.useState(0),l=D(c,2),s=l[0],d=l[1],h=i.useState(0),g=D(h,2),y=g[0],T=g[1],A=i.useState(),E=D(A,2),N=E[0],f=E[1],p=i.useRef();function P(C){var R=C.touches[0],b=R.screenX,_=R.screenY;o({x:b,y:_}),window.clearInterval(p.current)}function B(C){if(r){var R=C.touches[0],b=R.screenX,_=R.screenY;o({x:b,y:_});var m=b-r.x,$=_-r.y;t(m,$);var Q=Date.now();d(Q),T(Q-s),f({x:m,y:$})}}function z(){if(r&&(o(null),f(null),N)){var C=N.x/y,R=N.y/y,b=Math.abs(C),_=Math.abs(R);if(Math.max(b,_)<Ra)return;var m=C,$=R;p.current=window.setInterval(function(){if(Math.abs(m)<xt&&Math.abs($)<xt){window.clearInterval(p.current);return}m*=Ct,$*=Ct,t(m*Le,$*Le)},Le)}}var G=i.useRef();function U(C){var R=C.deltaX,b=C.deltaY,_=0,m=Math.abs(R),$=Math.abs(b);m===$?_=G.current==="x"?R:b:m>$?(_=R,G.current="x"):(_=b,G.current="y"),t(-_,-_)&&C.preventDefault()}var O=i.useRef(null);O.current={onTouchStart:P,onTouchMove:B,onTouchEnd:z,onWheel:U},i.useEffect(function(){function C(m){O.current.onTouchStart(m)}function R(m){O.current.onTouchMove(m)}function b(m){O.current.onTouchEnd(m)}function _(m){O.current.onWheel(m)}return document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",b,{passive:!0}),e.current.addEventListener("touchstart",C,{passive:!0}),e.current.addEventListener("wheel",_,{passive:!1}),function(){document.removeEventListener("touchmove",R),document.removeEventListener("touchend",b)}},[])}function Lt(e){var t=i.useState(0),n=D(t,2),a=n[0],r=n[1],o=i.useRef(0),c=i.useRef();return c.current=e,sa(function(){var l;(l=c.current)===null||l===void 0||l.call(c)},[a]),function(){o.current===a&&(o.current+=1,r(o.current))}}function Oa(e){var t=i.useRef([]),n=i.useState({}),a=D(n,2),r=a[1],o=i.useRef(typeof e=="function"?e():e),c=Lt(function(){var s=o.current;t.current.forEach(function(d){s=d(s)}),t.current=[],o.current=s,r({})});function l(s){t.current.push(s),c()}return[o.current,l]}var _t={width:0,height:0,left:0,top:0,right:0};function Ma(e,t,n,a,r,o,c){var l=c.tabs,s=c.tabPosition,d=c.rtl,h,g,y;return["top","bottom"].includes(s)?(h="width",g=d?"right":"left",y=Math.abs(n)):(h="height",g="top",y=-n),i.useMemo(function(){if(!l.length)return[0,0];for(var T=l.length,A=T,E=0;E<T;E+=1){var N=e.get(l[E].key)||_t;if(Math.floor(N[g]+N[h])>Math.floor(y+t)){A=E-1;break}}for(var f=0,p=T-1;p>=0;p-=1){var P=e.get(l[p].key)||_t;if(P[g]<y){f=p+1;break}}return f>A?[0,-1]:[f,A]},[e,t,a,r,o,y,s,l.map(function(T){return T.key}).join("_"),d])}function wt(e){var t;return e instanceof Map?(t={},e.forEach(function(n,a){t[a]=n})):t=e,JSON.stringify(t)}var za="TABS_DQ";function Nt(e){return String(e).replace(/"/g,za)}function Qe(e,t,n,a){return!(!n||a||e===!1||e===void 0&&(t===!1||t===null))}var Bt=i.forwardRef(function(e,t){var n=e.prefixCls,a=e.editable,r=e.locale,o=e.style;return!a||a.showAdd===!1?null:i.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:o,"aria-label":(r==null?void 0:r.addAriaLabel)||"Add tab",onClick:function(l){a.onEdit("add",{event:l})}},a.addIcon||"+")}),Tt=i.forwardRef(function(e,t){var n=e.position,a=e.prefixCls,r=e.extra;if(!r)return null;var o,c={};return Ue(r)==="object"&&!i.isValidElement(r)?c=r:c.right=r,n==="right"&&(o=c.right),n==="left"&&(o=c.left),o?i.createElement("div",{className:"".concat(a,"-extra-content"),ref:t},o):null}),La=i.forwardRef(function(e,t){var n=e.prefixCls,a=e.id,r=e.tabs,o=e.locale,c=e.mobile,l=e.more,s=l===void 0?{}:l,d=e.style,h=e.className,g=e.editable,y=e.tabBarGutter,T=e.rtl,A=e.removeAriaLabel,E=e.onTabClick,N=e.getPopupContainer,f=e.popupClassName,p=i.useState(!1),P=D(p,2),B=P[0],z=P[1],G=i.useState(null),U=D(G,2),O=U[0],C=U[1],R=s.icon,b=R===void 0?"More":R,_="".concat(a,"-more-popup"),m="".concat(n,"-dropdown"),$=O!==null?"".concat(_,"-").concat(O):null,Q=o==null?void 0:o.dropdownAriaLabel;function H(x,j){x.preventDefault(),x.stopPropagation(),g.onEdit("remove",{key:j,event:x})}var V=i.createElement(da,{onClick:function(j){var Z=j.key,J=j.domEvent;E(Z,J),z(!1)},prefixCls:"".concat(m,"-menu"),id:_,tabIndex:-1,role:"listbox","aria-activedescendant":$,selectedKeys:[O],"aria-label":Q!==void 0?Q:"expanded dropdown"},r.map(function(x){var j=x.closable,Z=x.disabled,J=x.closeIcon,q=x.key,ne=x.label,ee=Qe(j,J,g,Z);return i.createElement(ua,{key:q,id:"".concat(_,"-").concat(q),role:"option","aria-controls":a&&"".concat(a,"-panel-").concat(q),disabled:Z},i.createElement("span",null,ne),ee&&i.createElement("button",{type:"button","aria-label":A||"remove",tabIndex:0,className:"".concat(m,"-menu-item-remove"),onClick:function(oe){oe.stopPropagation(),H(oe,q)}},J||g.removeIcon||"×"))}));function k(x){for(var j=r.filter(function(ee){return!ee.disabled}),Z=j.findIndex(function(ee){return ee.key===O})||0,J=j.length,q=0;q<J;q+=1){Z=(Z+x+J)%J;var ne=j[Z];if(!ne.disabled){C(ne.key);return}}}function M(x){var j=x.which;if(!B){[pe.DOWN,pe.SPACE,pe.ENTER].includes(j)&&(z(!0),x.preventDefault());return}switch(j){case pe.UP:k(-1),x.preventDefault();break;case pe.DOWN:k(1),x.preventDefault();break;case pe.ESC:z(!1);break;case pe.SPACE:case pe.ENTER:O!==null&&E(O,x);break}}i.useEffect(function(){var x=document.getElementById($);x&&x.scrollIntoView&&x.scrollIntoView(!1)},[O]),i.useEffect(function(){B||C(null)},[B]);var S=ae({},T?"marginRight":"marginLeft",y);r.length||(S.visibility="hidden",S.order=1);var te=K(ae({},"".concat(m,"-rtl"),T)),ce=c?null:i.createElement(va,fe({prefixCls:m,overlay:V,visible:r.length?B:!1,onVisibleChange:z,overlayClassName:K(te,f),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:N},s),i.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:S,"aria-haspopup":"listbox","aria-controls":_,id:"".concat(a,"-more"),"aria-expanded":B,onKeyDown:M},b));return i.createElement("div",{className:K("".concat(n,"-nav-operations"),h),style:d,ref:t},ce,i.createElement(Bt,{prefixCls:n,locale:o,editable:g}))});const Na=i.memo(La,function(e,t){return t.tabMoving});var Ba=function(t){var n=t.prefixCls,a=t.id,r=t.active,o=t.focus,c=t.tab,l=c.key,s=c.label,d=c.disabled,h=c.closeIcon,g=c.icon,y=t.closable,T=t.renderWrapper,A=t.removeAriaLabel,E=t.editable,N=t.onClick,f=t.onFocus,p=t.onBlur,P=t.onKeyDown,B=t.onMouseDown,z=t.onMouseUp,G=t.style,U=t.tabCount,O=t.currentPosition,C="".concat(n,"-tab"),R=Qe(y,h,E,d);function b(H){d||N(H)}function _(H){H.preventDefault(),H.stopPropagation(),E.onEdit("remove",{key:l,event:H})}var m=i.useMemo(function(){return g&&typeof s=="string"?i.createElement("span",null,s):s},[s,g]),$=i.useRef(null);i.useEffect(function(){o&&$.current&&$.current.focus()},[o]);var Q=i.createElement("div",{key:l,"data-node-key":Nt(l),className:K(C,ae(ae(ae(ae({},"".concat(C,"-with-remove"),R),"".concat(C,"-active"),r),"".concat(C,"-disabled"),d),"".concat(C,"-focus"),o)),style:G,onClick:b},i.createElement("div",{ref:$,role:"tab","aria-selected":r,id:a&&"".concat(a,"-tab-").concat(l),className:"".concat(C,"-btn"),"aria-controls":a&&"".concat(a,"-panel-").concat(l),"aria-disabled":d,tabIndex:d?null:r?0:-1,onClick:function(V){V.stopPropagation(),b(V)},onKeyDown:P,onMouseDown:B,onMouseUp:z,onFocus:f,onBlur:p},o&&i.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(O," of ").concat(U)),g&&i.createElement("span",{className:"".concat(C,"-icon")},g),s&&m),R&&i.createElement("button",{type:"button",role:"tab","aria-label":A||"remove",tabIndex:r?0:-1,className:"".concat(C,"-remove"),onClick:function(V){V.stopPropagation(),_(V)}},h||E.removeIcon||"×"));return T?T(Q):Q},Da=function(t,n){var a=t.offsetWidth,r=t.offsetHeight,o=t.offsetTop,c=t.offsetLeft,l=t.getBoundingClientRect(),s=l.width,d=l.height,h=l.left,g=l.top;return Math.abs(s-a)<1?[s,d,h-n.left,g-n.top]:[a,r,c,o]},_e=function(t){var n=t.current||{},a=n.offsetWidth,r=a===void 0?0:a,o=n.offsetHeight,c=o===void 0?0:o;if(t.current){var l=t.current.getBoundingClientRect(),s=l.width,d=l.height;if(Math.abs(s-r)<1)return[s,d]}return[r,c]},ze=function(t,n){return t[n?0:1]},Et=i.forwardRef(function(e,t){var n=e.className,a=e.style,r=e.id,o=e.animated,c=e.activeKey,l=e.rtl,s=e.extra,d=e.editable,h=e.locale,g=e.tabPosition,y=e.tabBarGutter,T=e.children,A=e.onTabClick,E=e.onTabScroll,N=e.indicator,f=i.useContext(De),p=f.prefixCls,P=f.tabs,B=i.useRef(null),z=i.useRef(null),G=i.useRef(null),U=i.useRef(null),O=i.useRef(null),C=i.useRef(null),R=i.useRef(null),b=g==="top"||g==="bottom",_=St(0,function(I,v){b&&E&&E({direction:I>v?"left":"right"})}),m=D(_,2),$=m[0],Q=m[1],H=St(0,function(I,v){!b&&E&&E({direction:I>v?"top":"bottom"})}),V=D(H,2),k=V[0],M=V[1],S=i.useState([0,0]),te=D(S,2),ce=te[0],x=te[1],j=i.useState([0,0]),Z=D(j,2),J=Z[0],q=Z[1],ne=i.useState([0,0]),ee=D(ne,2),be=ee[0],oe=ee[1],me=i.useState([0,0]),ge=D(me,2),L=ge[0],le=ge[1],se=Oa(new Map),ye=D(se,2),we=ye[0],He=ye[1],Y=Pa(P,we,J[0]),X=ze(ce,b),ue=ze(J,b),Te=ze(be,b),Ze=ze(L,b),ke=Math.floor(X)<Math.floor(ue+Te),de=ke?X-Ze:X-Te,Gt="".concat(p,"-nav-operations-hidden"),he=0,$e=0;b&&l?(he=0,$e=Math.max(0,ue-de)):(he=Math.min(0,de-ue),$e=0);function je(I){return I<he?he:I>$e?$e:I}var Ae=i.useRef(null),Wt=i.useState(),et=D(Wt,2),Re=et[0],tt=et[1];function Ge(){tt(Date.now())}function We(){Ae.current&&clearTimeout(Ae.current)}Ia(U,function(I,v){function w(W,F){W(function(re){var Ce=je(re+F);return Ce})}return ke?(b?w(Q,I):w(M,v),We(),Ge(),!0):!1}),i.useEffect(function(){return We(),Re&&(Ae.current=setTimeout(function(){tt(0)},100)),We},[Re]);var Kt=Ma(Y,de,b?$:k,ue,Te,Ze,ie(ie({},e),{},{tabs:P})),at=D(Kt,2),Vt=at[0],Xt=at[1],nt=fa(function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,v=Y.get(I)||{width:0,height:0,left:0,right:0,top:0};if(b){var w=$;l?v.right<$?w=v.right:v.right+v.width>$+de&&(w=v.right+v.width-de):v.left<-$?w=-v.left:v.left+v.width>-$+de&&(w=-(v.left+v.width-de)),M(0),Q(je(w))}else{var W=k;v.top<-k?W=-v.top:v.top+v.height>-k+de&&(W=-(v.top+v.height-de)),Q(0),M(je(W))}}),Ft=i.useState(),rt=D(Ft,2),Se=rt[0],Ee=rt[1],Ut=i.useState(!1),it=D(Ut,2),qt=it[0],ot=it[1],ve=P.filter(function(I){return!I.disabled}).map(function(I){return I.key}),xe=function(v){var w=ve.indexOf(Se||c),W=ve.length,F=(w+v+W)%W,re=ve[F];Ee(re)},lt=function(v,w){var W=ve.indexOf(v),F=P.find(function(Ce){return Ce.key===v}),re=Qe(F==null?void 0:F.closable,F==null?void 0:F.closeIcon,d,F==null?void 0:F.disabled);re&&(w.preventDefault(),w.stopPropagation(),d.onEdit("remove",{key:v,event:w}),W===ve.length-1?xe(-1):xe(1))},Yt=function(v,w){ot(!0),w.button===1&<(v,w)},Jt=function(v){var w=v.code,W=l&&b,F=ve[0],re=ve[ve.length-1];switch(w){case"ArrowLeft":{b&&xe(W?1:-1);break}case"ArrowRight":{b&&xe(W?-1:1);break}case"ArrowUp":{v.preventDefault(),b||xe(-1);break}case"ArrowDown":{v.preventDefault(),b||xe(1);break}case"Home":{v.preventDefault(),Ee(F);break}case"End":{v.preventDefault(),Ee(re);break}case"Enter":case"Space":{v.preventDefault(),A(Se??c,v);break}case"Backspace":case"Delete":{lt(Se,v);break}}},Ie={};b?Ie[l?"marginRight":"marginLeft"]=y:Ie.marginTop=y;var ct=P.map(function(I,v){var w=I.key;return i.createElement(Ba,{id:r,prefixCls:p,key:w,tab:I,style:v===0?void 0:Ie,closable:I.closable,editable:d,active:w===c,focus:w===Se,renderWrapper:T,removeAriaLabel:h==null?void 0:h.removeAriaLabel,tabCount:ve.length,currentPosition:v+1,onClick:function(F){A(w,F)},onKeyDown:Jt,onFocus:function(){qt||Ee(w),nt(w),Ge(),U.current&&(l||(U.current.scrollLeft=0),U.current.scrollTop=0)},onBlur:function(){Ee(void 0)},onMouseDown:function(F){return Yt(w,F)},onMouseUp:function(){ot(!1)}})}),st=function(){return He(function(){var v,w=new Map,W=(v=O.current)===null||v===void 0?void 0:v.getBoundingClientRect();return P.forEach(function(F){var re,Ce=F.key,mt=(re=O.current)===null||re===void 0?void 0:re.querySelector('[data-node-key="'.concat(Nt(Ce),'"]'));if(mt){var ta=Da(mt,W),Me=D(ta,4),aa=Me[0],na=Me[1],ra=Me[2],ia=Me[3];w.set(Ce,{width:aa,height:na,left:ra,top:ia})}}),w})};i.useEffect(function(){st()},[P.map(function(I){return I.key}).join("_")]);var Oe=Lt(function(){var I=_e(B),v=_e(z),w=_e(G);x([I[0]-v[0]-w[0],I[1]-v[1]-w[1]]);var W=_e(R);oe(W);var F=_e(C);le(F);var re=_e(O);q([re[0]-W[0],re[1]-W[1]]),st()}),Qt=P.slice(0,Vt),Zt=P.slice(Xt+1),dt=[].concat(ht(Qt),ht(Zt)),ut=Y.get(c),kt=Ea({activeTabOffset:ut,horizontal:b,indicator:N,rtl:l}),ea=kt.style;i.useEffect(function(){nt()},[c,he,$e,wt(ut),wt(Y),b]),i.useEffect(function(){Oe()},[l]);var vt=!!dt.length,Pe="".concat(p,"-nav-wrap"),Ke,Ve,ft,bt;return b?l?(Ve=$>0,Ke=$!==$e):(Ke=$<0,Ve=$!==he):(ft=k<0,bt=k!==he),i.createElement(Xe,{onResize:Oe},i.createElement("div",{ref:ba(t,B),role:"tablist","aria-orientation":b?"horizontal":"vertical",className:K("".concat(p,"-nav"),n),style:a,onKeyDown:function(){Ge()}},i.createElement(Tt,{ref:z,position:"left",extra:s,prefixCls:p}),i.createElement(Xe,{onResize:Oe},i.createElement("div",{className:K(Pe,ae(ae(ae(ae({},"".concat(Pe,"-ping-left"),Ke),"".concat(Pe,"-ping-right"),Ve),"".concat(Pe,"-ping-top"),ft),"".concat(Pe,"-ping-bottom"),bt)),ref:U},i.createElement(Xe,{onResize:Oe},i.createElement("div",{ref:O,className:"".concat(p,"-nav-list"),style:{transform:"translate(".concat($,"px, ").concat(k,"px)"),transition:Re?"none":void 0}},ct,i.createElement(Bt,{ref:R,prefixCls:p,locale:h,editable:d,style:ie(ie({},ct.length===0?void 0:Ie),{},{visibility:vt?"hidden":null})}),i.createElement("div",{className:K("".concat(p,"-ink-bar"),ae({},"".concat(p,"-ink-bar-animated"),o.inkBar)),style:ea}))))),i.createElement(Na,fe({},e,{removeAriaLabel:h==null?void 0:h.removeAriaLabel,ref:C,prefixCls:p,tabs:dt,className:!vt&&Gt,tabMoving:!!Re})),i.createElement(Tt,{ref:G,position:"right",extra:s,prefixCls:p})))}),Dt=i.forwardRef(function(e,t){var n=e.prefixCls,a=e.className,r=e.style,o=e.id,c=e.active,l=e.tabKey,s=e.children;return i.createElement("div",{id:o&&"".concat(o,"-panel-").concat(l),role:"tabpanel",tabIndex:c?0:-1,"aria-labelledby":o&&"".concat(o,"-tab-").concat(l),"aria-hidden":!c,style:r,className:K(n,c&&"".concat(n,"-active"),a),ref:t},s)}),Ha=["renderTabBar"],ja=["label","key"],Aa=function(t){var n=t.renderTabBar,a=Ne(t,Ha),r=i.useContext(De),o=r.tabs;if(n){var c=ie(ie({},a),{},{panes:o.map(function(l){var s=l.label,d=l.key,h=Ne(l,ja);return i.createElement(Dt,fe({tab:s,key:d,tabKey:d},h))})});return n(c,Et)}return i.createElement(Et,a)},Ga=["key","forceRender","style","className","destroyInactiveTabPane"],Wa=function(t){var n=t.id,a=t.activeKey,r=t.animated,o=t.tabPosition,c=t.destroyInactiveTabPane,l=i.useContext(De),s=l.prefixCls,d=l.tabs,h=r.tabPane,g="".concat(s,"-tabpane");return i.createElement("div",{className:K("".concat(s,"-content-holder"))},i.createElement("div",{className:K("".concat(s,"-content"),"".concat(s,"-content-").concat(o),ae({},"".concat(s,"-content-animated"),h))},d.map(function(y){var T=y.key,A=y.forceRender,E=y.style,N=y.className,f=y.destroyInactiveTabPane,p=Ne(y,Ga),P=T===a;return i.createElement(ma,fe({key:T,visible:P,forceRender:A,removeOnLeave:!!(c||f),leavedClassName:"".concat(g,"-hidden")},r.tabPaneMotion),function(B,z){var G=B.style,U=B.className;return i.createElement(Dt,fe({},p,{prefixCls:g,id:n,tabKey:T,animated:h,active:P,style:ie(ie({},E),G),className:K(N,U),ref:z}))})})))};function Ka(){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=ie({inkBar:!0},Ue(e)==="object"?e:{}),t.tabPaneMotion&&t.tabPane===void 0&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}var Va=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],Pt=0,Xa=i.forwardRef(function(e,t){var n=e.id,a=e.prefixCls,r=a===void 0?"rc-tabs":a,o=e.className,c=e.items,l=e.direction,s=e.activeKey,d=e.defaultActiveKey,h=e.editable,g=e.animated,y=e.tabPosition,T=y===void 0?"top":y,A=e.tabBarGutter,E=e.tabBarStyle,N=e.tabBarExtraContent,f=e.locale,p=e.more,P=e.destroyInactiveTabPane,B=e.renderTabBar,z=e.onChange,G=e.onTabClick,U=e.onTabScroll,O=e.getPopupContainer,C=e.popupClassName,R=e.indicator,b=Ne(e,Va),_=i.useMemo(function(){return(c||[]).filter(function(L){return L&&Ue(L)==="object"&&"key"in L})},[c]),m=l==="rtl",$=Ka(g),Q=i.useState(!1),H=D(Q,2),V=H[0],k=H[1];i.useEffect(function(){k(ga())},[]);var M=pt(function(){var L;return(L=_[0])===null||L===void 0?void 0:L.key},{value:s,defaultValue:d}),S=D(M,2),te=S[0],ce=S[1],x=i.useState(function(){return _.findIndex(function(L){return L.key===te})}),j=D(x,2),Z=j[0],J=j[1];i.useEffect(function(){var L=_.findIndex(function(se){return se.key===te});if(L===-1){var le;L=Math.max(0,Math.min(Z,_.length-1)),ce((le=_[L])===null||le===void 0?void 0:le.key)}J(L)},[_.map(function(L){return L.key}).join("_"),te,Z]);var q=pt(null,{value:n}),ne=D(q,2),ee=ne[0],be=ne[1];i.useEffect(function(){n||(be("rc-tabs-".concat(Pt)),Pt+=1)},[]);function oe(L,le){G==null||G(L,le);var se=L!==te;ce(L),se&&(z==null||z(L))}var me={id:ee,activeKey:te,animated:$,tabPosition:T,rtl:m,mobile:V},ge=ie(ie({},me),{},{editable:h,locale:f,more:p,tabBarGutter:A,onTabClick:oe,onTabScroll:U,extra:N,style:E,panes:null,getPopupContainer:O,popupClassName:C,indicator:R});return i.createElement(De.Provider,{value:{tabs:_,prefixCls:r}},i.createElement("div",fe({ref:t,id:n,className:K(r,"".concat(r,"-").concat(T),ae(ae(ae({},"".concat(r,"-mobile"),V),"".concat(r,"-editable"),h),"".concat(r,"-rtl"),m),o)},b),i.createElement(Aa,fe({},ge,{renderTabBar:B})),i.createElement(Wa,fe({destroyInactiveTabPane:P},me,{animated:$}))))});const Fa={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Ua(e,t={inkBar:!0,tabPane:!1}){let 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({},Fa),{motionName:ha(e,"switch")})),n}var qa=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n};function Ya(e){return e.filter(t=>t)}function Ja(e,t){if(e)return e.map(a=>{var r;const o=(r=a.destroyOnHidden)!==null&&r!==void 0?r:a.destroyInactiveTabPane;return Object.assign(Object.assign({},a),{destroyInactiveTabPane:o})});const n=pa(t).map(a=>{if(i.isValidElement(a)){const{key:r,props:o}=a,c=o||{},{tab:l}=c,s=qa(c,["tab"]);return Object.assign(Object.assign({key:String(r)},s),{label:l})}return null});return Ya(n)}const Qa=e=>{const{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[$t(e,"slide-up"),$t(e,"slide-down")]]},Za=e=>{const{componentCls:t,tabsCardPadding:n,cardBg:a,cardGutter:r,colorBorderSecondary:o,itemSelectedColor:c}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:a,border:`${u(e.lineWidth)} ${e.lineType} ${o}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:c,background:e.colorBgContainer},[`${t}-tab-focus:has(${t}-tab-btn:focus-visible)`]:Mt(e,-3),[`& ${t}-tab${t}-tab-focus ${t}-tab-btn:focus-visible`]:{outline:"none"},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:u(r)}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)} 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)}`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:u(r)}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${u(e.borderRadiusLG)} 0 0 ${u(e.borderRadiusLG)}`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)} 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},ka=e=>{const{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:a}=e;return{[`${t}-dropdown`]:Object.assign(Object.assign({},qe(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${u(a)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Ye),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${u(e.paddingXXS)} ${u(e.paddingSM)}`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorIcon,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},en=e=>{const{componentCls:t,margin:n,colorBorderSecondary:a,horizontalMargin:r,verticalItemPadding:o,verticalItemMargin:c,calc:l}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:r,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${u(e.lineWidth)} ${e.lineType} ${a}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow},
|
||
right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
|
||
> div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:"column",minWidth:l(e.controlHeight).mul(1.25).equal(),[`${t}-tab`]:{padding:o,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:c},[`${t}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:u(l(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${u(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:l(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${u(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},tn=e=>{const{componentCls:t,cardPaddingSM:n,cardPaddingLG:a,cardHeightSM:r,cardHeightLG:o,horizontalItemPaddingSM:c,horizontalItemPaddingLG:l}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:c,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:l,fontSize:e.titleFontSizeLG,lineHeight:e.lineHeightLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n},[`${t}-nav-add`]:{minWidth:r,minHeight:r}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${u(e.borderRadius)} ${u(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${u(e.borderRadius)} ${u(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${u(e.borderRadius)} ${u(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${u(e.borderRadius)} 0 0 ${u(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:a},[`${t}-nav-add`]:{minWidth:o,minHeight:o}}}}}},an=e=>{const{componentCls:t,itemActiveColor:n,itemHoverColor:a,iconCls:r,tabsHorizontalItemMargin:o,horizontalItemPadding:c,itemSelectedColor:l,itemColor:s}=e,d=`${t}-tab`;return{[d]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:c,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:"none",transition:`all ${e.motionDurationSlow}`,[`${d}-icon:not(:last-child)`]:{marginInlineEnd:e.marginSM}},"&-remove":Object.assign({flex:"none",lineHeight:1,marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorIcon,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},Fe(e)),"&:hover":{color:a},[`&${d}-active ${d}-btn`]:{color:l,textShadow:e.tabsActiveTextShadow},[`&${d}-focus ${d}-btn:focus-visible`]:Mt(e),[`&${d}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${d}-disabled ${d}-btn, &${d}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${d}-remove ${r}`]:{margin:0,verticalAlign:"middle"},[`${r}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${d} + ${d}`]:{margin:{_skip_check_:!0,value:o}}}},nn=e=>{const{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:a,cardGutter:r,calc:o}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[a]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:u(e.marginSM)}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:u(e.marginXS)},marginLeft:{_skip_check_:!0,value:u(o(e.marginXXS).mul(-1).equal())},[a]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:r},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},rn=e=>{const{componentCls:t,tabsCardPadding:n,cardHeight:a,cardGutter:r,itemHoverColor:o,itemActiveColor:c,colorBorderSecondary:l}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},qe(e)),{display:"flex",[`> ${t}-nav, > div > ${t}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${t}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${t}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${t}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${t}-nav-more`]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:Object.assign({minWidth:a,minHeight:a,marginLeft:{_skip_check_:!0,value:r},background:"transparent",border:`${u(e.lineWidth)} ${e.lineType} ${l}`,borderRadius:`${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:o},"&:active, &:focus:not(:focus-visible)":{color:c}},Fe(e,-3))},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),an(e)),{[`${t}-content`]:{position:"relative",width:"100%"},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:Object.assign(Object.assign({},Fe(e)),{"&-hidden":{display:"none"}})}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping']) > ${t}-nav-list`]:{margin:"auto"}}}}}},on=e=>{const{cardHeight:t,cardHeightSM:n,cardHeightLG:a,controlHeight:r,controlHeightLG:o}=e,c=t||o,l=n||r,s=a||o+8;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:c,cardHeightSM:l,cardHeightLG:s,cardPadding:`${(c-e.fontHeight)/2-e.lineWidth}px ${e.padding}px`,cardPaddingSM:`${(l-e.fontHeight)/2-e.lineWidth}px ${e.paddingXS}px`,cardPaddingLG:`${(s-e.fontHeightLG)/2-e.lineWidth}px ${e.padding}px`,titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:`0 0 ${e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${e.paddingSM}px 0`,horizontalItemPaddingSM:`${e.paddingXS}px 0`,horizontalItemPaddingLG:`${e.padding}px 0`,verticalItemPadding:`${e.paddingXS}px ${e.paddingLG}px`,verticalItemMargin:`${e.margin}px 0 0 0`,itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}},ln=It("Tabs",e=>{const t=Ot(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${u(e.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${u(e.horizontalItemGutter)}`});return[tn(t),nn(t),en(t),ka(t),Za(t),rn(t),Qa(t)]},on),cn=()=>null;var sn=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n};const dn=i.forwardRef((e,t)=>{var n,a,r,o,c,l,s,d,h,g,y;const{type:T,className:A,rootClassName:E,size:N,onEdit:f,hideAdd:p,centered:P,addIcon:B,removeIcon:z,moreIcon:G,more:U,popupClassName:O,children:C,items:R,animated:b,style:_,indicatorSize:m,indicator:$,destroyInactiveTabPane:Q,destroyOnHidden:H}=e,V=sn(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator","destroyInactiveTabPane","destroyOnHidden"]),{prefixCls:k}=V,{direction:M,tabs:S,getPrefixCls:te,getPopupContainer:ce}=i.useContext(Be),x=te("tabs",k),j=$a(x),[Z,J,q]=ln(x,j),ne=i.useRef(null);i.useImperativeHandle(t,()=>({nativeElement:ne.current}));let ee;T==="editable-card"&&(ee={onEdit:(se,{key:ye,event:we})=>{f==null||f(se==="add"?we:ye,se)},removeIcon:(n=z??(S==null?void 0:S.removeIcon))!==null&&n!==void 0?n:i.createElement(ya,null),addIcon:(B??(S==null?void 0:S.addIcon))||i.createElement(Ta,null),showAdd:p!==!0});const be=te(),oe=zt(N),me=Ja(R,C),ge=Ua(x,b),L=Object.assign(Object.assign({},S==null?void 0:S.style),_),le={align:(a=$==null?void 0:$.align)!==null&&a!==void 0?a:(r=S==null?void 0:S.indicator)===null||r===void 0?void 0:r.align,size:(s=(c=(o=$==null?void 0:$.size)!==null&&o!==void 0?o:m)!==null&&c!==void 0?c:(l=S==null?void 0:S.indicator)===null||l===void 0?void 0:l.size)!==null&&s!==void 0?s:S==null?void 0:S.indicatorSize};return Z(i.createElement(Xa,Object.assign({ref:ne,direction:M,getPopupContainer:ce},V,{items:me,className:K({[`${x}-${oe}`]:oe,[`${x}-card`]:["card","editable-card"].includes(T),[`${x}-editable-card`]:T==="editable-card",[`${x}-centered`]:P},S==null?void 0:S.className,A,E,J,q,j),popupClassName:K(O,J,q,j),style:L,editable:ee,more:Object.assign({icon:(y=(g=(h=(d=S==null?void 0:S.more)===null||d===void 0?void 0:d.icon)!==null&&h!==void 0?h:S==null?void 0:S.moreIcon)!==null&&g!==void 0?g:G)!==null&&y!==void 0?y:i.createElement(Sa,null),transitionName:`${be}-slide-up`},U),prefixCls:x,animated:ge,indicator:le,destroyInactiveTabPane:H??Q})))}),Ht=dn;Ht.TabPane=cn;var un=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n};const jt=e=>{var{prefixCls:t,className:n,hoverable:a=!0}=e,r=un(e,["prefixCls","className","hoverable"]);const{getPrefixCls:o}=i.useContext(Be),c=o("card",t),l=K(`${c}-grid`,n,{[`${c}-grid-hoverable`]:a});return i.createElement("div",Object.assign({},r,{className:l}))},vn=e=>{const{antCls:t,componentCls:n,headerHeight:a,headerPadding:r,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:`0 ${u(r)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${u(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)} 0 0`},Je()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},Ye),{[`
|
||
> ${n}-typography,
|
||
> ${n}-typography-edit-content
|
||
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${u(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})},fn=e=>{const{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:a,lineWidth:r}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:`
|
||
${u(r)} 0 0 0 ${n},
|
||
0 ${u(r)} 0 0 ${n},
|
||
${u(r)} ${u(r)} 0 0 ${n},
|
||
${u(r)} 0 0 0 ${n} inset,
|
||
0 ${u(r)} 0 0 ${n} inset;
|
||
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},bn=e=>{const{componentCls:t,iconCls:n,actionsLiMargin:a,cardActionsIconSize:r,colorBorderSecondary:o,actionsBg:c}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:c,borderTop:`${u(e.lineWidth)} ${e.lineType} ${o}`,display:"flex",borderRadius:`0 0 ${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)}`},Je()),{"& > li":{margin:a,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:u(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:r,lineHeight:u(e.calc(r).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${u(e.lineWidth)} ${e.lineType} ${o}`}}})},mn=e=>Object.assign(Object.assign({margin:`${u(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},Je()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},Ye),"&-description":{color:e.colorTextDescription}}),gn=e=>{const{componentCls:t,colorFillAlter:n,headerPadding:a,bodyPadding:r}=e;return{[`${t}-head`]:{padding:`0 ${u(a)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${u(e.padding)} ${u(r)}`}}},hn=e=>{const{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}},pn=e=>{const{componentCls:t,cardShadow:n,cardHeadPadding:a,colorBorderSecondary:r,boxShadowTertiary:o,bodyPadding:c,extraColor:l}=e;return{[t]:Object.assign(Object.assign({},qe(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:o},[`${t}-head`]:vn(e),[`${t}-extra`]:{marginInlineStart:"auto",color:l,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:c,borderRadius:`0 0 ${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)}`},[`${t}-grid`]:fn(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:bn(e),[`${t}-meta`]:mn(e)}),[`${t}-bordered`]:{border:`${u(e.lineWidth)} ${e.lineType} ${r}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${u(e.borderRadiusLG)} ${u(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:a}}},[`${t}-type-inner`]:gn(e),[`${t}-loading`]:hn(e),[`${t}-rtl`]:{direction:"rtl"}}},$n=e=>{const{componentCls:t,bodyPaddingSM:n,headerPaddingSM:a,headerHeightSM:r,headerFontSizeSM:o}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:r,padding:`0 ${u(a)}`,fontSize:o,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},yn=e=>{var t,n;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,headerHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:(t=e.bodyPadding)!==null&&t!==void 0?t:e.paddingLG,headerPadding:(n=e.headerPadding)!==null&&n!==void 0?n:e.paddingLG}},Sn=It("Card",e=>{const t=Ot(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[pn(t),$n(t)]},yn);var Rt=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n};const xn=e=>{const{actionClasses:t,actions:n=[],actionStyle:a}=e;return i.createElement("ul",{className:t,style:a},n.map((r,o)=>{const c=`action-${o}`;return i.createElement("li",{style:{width:`${100/n.length}%`},key:c},i.createElement("span",null,r))}))},Cn=i.forwardRef((e,t)=>{const{prefixCls:n,className:a,rootClassName:r,style:o,extra:c,headStyle:l={},bodyStyle:s={},title:d,loading:h,bordered:g,variant:y,size:T,type:A,cover:E,actions:N,tabList:f,children:p,activeTabKey:P,defaultActiveTabKey:B,tabBarExtraContent:z,hoverable:G,tabProps:U={},classNames:O,styles:C}=e,R=Rt(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:b,direction:_,card:m}=i.useContext(Be),[$]=xa("card",y,g),Q=Y=>{var X;(X=e.onTabChange)===null||X===void 0||X.call(e,Y)},H=Y=>{var X;return K((X=m==null?void 0:m.classNames)===null||X===void 0?void 0:X[Y],O==null?void 0:O[Y])},V=Y=>{var X;return Object.assign(Object.assign({},(X=m==null?void 0:m.styles)===null||X===void 0?void 0:X[Y]),C==null?void 0:C[Y])},k=i.useMemo(()=>{let Y=!1;return i.Children.forEach(p,X=>{(X==null?void 0:X.type)===jt&&(Y=!0)}),Y},[p]),M=b("card",n),[S,te,ce]=Sn(M),x=i.createElement(_a,{loading:!0,active:!0,paragraph:{rows:4},title:!1},p),j=P!==void 0,Z=Object.assign(Object.assign({},U),{[j?"activeKey":"defaultActiveKey"]:j?P:B,tabBarExtraContent:z});let J;const q=zt(T),ne=!q||q==="default"?"large":q,ee=f?i.createElement(Ht,Object.assign({size:ne},Z,{className:`${M}-head-tabs`,onChange:Q,items:f.map(Y=>{var{tab:X}=Y,ue=Rt(Y,["tab"]);return Object.assign({label:X},ue)})})):null;if(d||c||ee){const Y=K(`${M}-head`,H("header")),X=K(`${M}-head-title`,H("title")),ue=K(`${M}-extra`,H("extra")),Te=Object.assign(Object.assign({},l),V("header"));J=i.createElement("div",{className:Y,style:Te},i.createElement("div",{className:`${M}-head-wrapper`},d&&i.createElement("div",{className:X,style:V("title")},d),c&&i.createElement("div",{className:ue,style:V("extra")},c)),ee)}const be=K(`${M}-cover`,H("cover")),oe=E?i.createElement("div",{className:be,style:V("cover")},E):null,me=K(`${M}-body`,H("body")),ge=Object.assign(Object.assign({},s),V("body")),L=i.createElement("div",{className:me,style:ge},h?x:p),le=K(`${M}-actions`,H("actions")),se=N!=null&&N.length?i.createElement(xn,{actionClasses:le,actionStyle:V("actions"),actions:N}):null,ye=Ca(R,["onTabChange"]),we=K(M,m==null?void 0:m.className,{[`${M}-loading`]:h,[`${M}-bordered`]:$!=="borderless",[`${M}-hoverable`]:G,[`${M}-contain-grid`]:k,[`${M}-contain-tabs`]:f==null?void 0:f.length,[`${M}-${q}`]:q,[`${M}-type-${A}`]:!!A,[`${M}-rtl`]:_==="rtl"},a,r,te,ce),He=Object.assign(Object.assign({},m==null?void 0:m.style),o);return S(i.createElement("div",Object.assign({ref:t},ye,{className:we,style:He}),J,oe,L,se))});var _n=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n};const wn=e=>{const{prefixCls:t,className:n,avatar:a,title:r,description:o}=e,c=_n(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:l}=i.useContext(Be),s=l("card",t),d=K(`${s}-meta`,n),h=a?i.createElement("div",{className:`${s}-meta-avatar`},a):null,g=r?i.createElement("div",{className:`${s}-meta-title`},r):null,y=o?i.createElement("div",{className:`${s}-meta-description`},o):null,T=g||y?i.createElement("div",{className:`${s}-meta-detail`},g,y):null;return i.createElement("div",Object.assign({},c,{className:d}),h,T)},At=Cn;At.Grid=jt;At.Meta=wn;export{At as C,Ht as T};
|