mirror of
https://github.com/Safe3/openresty-manager.git
synced 2025-10-04 22:01:52 +08:00
19 lines
50 KiB
JavaScript
19 lines
50 KiB
JavaScript
import{bP as ft,bQ as Xt,a2 as V,H as nt,a3 as Re,d as z,r as ie,n as D,c as s,a as G,a4 as oe,al as We,j as r,s as ee,P as de,F as Oe,w as he,bL as jt,bK as Ft,bj as Vt,bR as qt,i as Yt,p as Ut,bc as gt,_ as W,o as Ie,bg as Pe,b as Qt,br as ht,h as ot,m as it,k as lt,au as rt,aK as Bt,l as Ae,f as Rt,ar as Zt,a$ as Jt,ay as ze,u as ce,aD as ea,y as ta,A as De,q as aa,x as na,at as Ne,av as oa,bS as Be,b6 as $t,g as ia,b5 as la,v as qe,aM as Ye}from"./index-sY8U2mN5.js";import{K as It,L as ra,M as sa,O as da,Q as ca,R as ua,y as N,H as va,o as st,i as pa,p as mt,P as ba,J as fa}from"./Col-CfXYHSRU.js";import{u as ga}from"./useRefs-BdmXd5te.js";function ha(e,t,a,n){if(!ft(e))return e;t=It(t,e);for(var o=-1,l=t.length,i=l-1,d=e;d!=null&&++o<l;){var g=ra(t[o]),u=a;if(g==="__proto__"||g==="constructor"||g==="prototype")return e;if(o!=i){var f=d[g];u=void 0,u===void 0&&(u=ft(f)?f:Xt(t[o+1])?[]:{})}sa(d,g,u),d=d[g]}return e}function $a(e,t,a){for(var n=-1,o=t.length,l={};++n<o;){var i=t[n],d=da(e,i);a(d,i)&&ha(l,It(i,e),d)}return l}function ma(e,t){return $a(e,t,function(a,n){return ca(e,n)})}var Et=ua(function(e,t){return e==null?{}:ma(e,t)});function ya(e){const t=V(),a=V(!1);function n(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];a.value||(Re.cancel(t.value),t.value=Re(()=>{e(...l)}))}return nt(()=>{a.value=!0,Re.cancel(t.value)}),n}function Sa(e){const t=V([]),a=V(typeof e=="function"?e():e),n=ya(()=>{let l=a.value;t.value.forEach(i=>{l=i(l)}),t.value=[],a.value=l});function o(l){t.value.push(l),n()}return[a,o]}const xa=z({compatConfig:{MODE:3},name:"TabNode",props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:["click","resize","remove","focus"],setup(e,t){let{expose:a,attrs:n}=t;const o=ie();function l(g){var u;!((u=e.tab)===null||u===void 0)&&u.disabled||e.onClick(g)}a({domRef:o});function i(g){var u;g.preventDefault(),g.stopPropagation(),e.editable.onEdit("remove",{key:(u=e.tab)===null||u===void 0?void 0:u.key,event:g})}const d=D(()=>{var g;return e.editable&&e.closable!==!1&&!(!((g=e.tab)===null||g===void 0)&&g.disabled)});return()=>{var g;const{prefixCls:u,id:f,active:S,tab:{key:h,tab:c,disabled:v,closeIcon:m},renderWrapper:w,removeAriaLabel:C,editable:A,onFocus:L}=e,M=`${u}-tab`,b=s("div",{key:h,ref:o,class:G(M,{[`${M}-with-remove`]:d.value,[`${M}-active`]:S,[`${M}-disabled`]:v}),style:n.style,onClick:l},[s("div",{role:"tab","aria-selected":S,id:f&&`${f}-tab-${h}`,class:`${M}-btn`,"aria-controls":f&&`${f}-panel-${h}`,"aria-disabled":v,tabindex:v?null:0,onClick:x=>{x.stopPropagation(),l(x)},onKeydown:x=>{[oe.SPACE,oe.ENTER].includes(x.which)&&(x.preventDefault(),l(x))},onFocus:L},[typeof c=="function"?c():c]),d.value&&s("button",{type:"button","aria-label":C||"remove",tabindex:0,class:`${M}-remove`,onClick:x=>{x.stopPropagation(),i(x)}},[(m==null?void 0:m())||((g=A.removeIcon)===null||g===void 0?void 0:g.call(A))||"×"])]);return w?w(b):b}}}),yt={width:0,height:0,left:0,top:0};function Ca(e,t){const a=ie(new Map);return We(()=>{var n,o;const l=new Map,i=e.value,d=t.value.get((n=i[0])===null||n===void 0?void 0:n.key)||yt,g=d.left+d.width;for(let u=0;u<i.length;u+=1){const{key:f}=i[u];let S=t.value.get(f);S||(S=t.value.get((o=i[u-1])===null||o===void 0?void 0:o.key)||yt);const h=l.get(f)||r({},S);h.right=g-h.left-h.width,l.set(f,h)}a.value=new Map(l)}),a}const At=z({compatConfig:{MODE:3},name:"AddButton",inheritAttrs:!1,props:{prefixCls:String,editable:{type:Object},locale:{type:Object,default:void 0}},setup(e,t){let{expose:a,attrs:n}=t;const o=ie();return a({domRef:o}),()=>{const{prefixCls:l,editable:i,locale:d}=e;return!i||i.showAdd===!1?null:s("button",{ref:o,type:"button",class:`${l}-nav-add`,style:n.style,"aria-label":(d==null?void 0:d.addAriaLabel)||"Add tab",onClick:g=>{i.onEdit("add",{event:g})}},[i.addIcon?i.addIcon():"+"])}}}),wa={prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:de.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function},popupClassName:String,getPopupContainer:ee()},Ta=z({compatConfig:{MODE:3},name:"OperationNode",inheritAttrs:!1,props:wa,emits:["tabClick"],slots:Object,setup(e,t){let{attrs:a,slots:n}=t;const[o,l]=N(!1),[i,d]=N(null),g=c=>{const v=e.tabs.filter(C=>!C.disabled);let m=v.findIndex(C=>C.key===i.value)||0;const w=v.length;for(let C=0;C<w;C+=1){m=(m+c+w)%w;const A=v[m];if(!A.disabled){d(A.key);return}}},u=c=>{const{which:v}=c;if(!o.value){[oe.DOWN,oe.SPACE,oe.ENTER].includes(v)&&(l(!0),c.preventDefault());return}switch(v){case oe.UP:g(-1),c.preventDefault();break;case oe.DOWN:g(1),c.preventDefault();break;case oe.ESC:l(!1);break;case oe.SPACE:case oe.ENTER:i.value!==null&&e.onTabClick(i.value,c);break}},f=D(()=>`${e.id}-more-popup`),S=D(()=>i.value!==null?`${f.value}-${i.value}`:null),h=(c,v)=>{c.preventDefault(),c.stopPropagation(),e.editable.onEdit("remove",{key:v,event:c})};return Oe(()=>{he(i,()=>{const c=document.getElementById(S.value);c&&c.scrollIntoView&&c.scrollIntoView(!1)},{flush:"post",immediate:!0})}),he(o,()=>{o.value||d(null)}),jt({}),()=>{var c;const{prefixCls:v,id:m,tabs:w,locale:C,mobile:A,moreIcon:L=((c=n.moreIcon)===null||c===void 0?void 0:c.call(n))||s(Ft,null,null),moreTransitionName:M,editable:b,tabBarGutter:x,rtl:p,onTabClick:_,popupClassName:I}=e;if(!w.length)return null;const R=`${v}-dropdown`,K=C==null?void 0:C.dropdownAriaLabel,Z={[p?"marginRight":"marginLeft"]:x};w.length||(Z.visibility="hidden",Z.order=1);const te=G({[`${R}-rtl`]:p,[`${I}`]:!0}),le=A?null:s(va,{prefixCls:R,trigger:["hover"],visible:o.value,transitionName:M,onVisibleChange:l,overlayClassName:te,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:e.getPopupContainer},{overlay:()=>s(Vt,{onClick:B=>{let{key:X,domEvent:T}=B;_(X,T),l(!1)},id:f.value,tabindex:-1,role:"listbox","aria-activedescendant":S.value,selectedKeys:[i.value],"aria-label":K!==void 0?K:"expanded dropdown"},{default:()=>[w.map(B=>{var X,T;const Y=b&&B.closable!==!1&&!B.disabled;return s(qt,{key:B.key,id:`${f.value}-${B.key}`,role:"option","aria-controls":m&&`${m}-panel-${B.key}`,disabled:B.disabled},{default:()=>[s("span",null,[typeof B.tab=="function"?B.tab():B.tab]),Y&&s("button",{type:"button","aria-label":e.removeAriaLabel||"remove",tabindex:0,class:`${R}-menu-item-remove`,onClick:U=>{U.stopPropagation(),h(U,B.key)}},[((X=B.closeIcon)===null||X===void 0?void 0:X.call(B))||((T=b.removeIcon)===null||T===void 0?void 0:T.call(b))||"×"])]})})]}),default:()=>s("button",{type:"button",class:`${v}-nav-more`,style:Z,tabindex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":f.value,id:`${m}-more`,"aria-expanded":o.value,onKeydown:u},[L])});return s("div",{class:G(`${v}-nav-operations`,a.class),style:a.style},[le,s(At,{prefixCls:v,locale:C,editable:b},null)])}}}),Lt=Symbol("tabsContextKey"),_a=e=>{Ut(Lt,e)},Mt=()=>Yt(Lt,{tabs:ie([]),prefixCls:ie()}),Pa=.1,St=.01,ke=20,xt=Math.pow(.995,ke);function Ba(e,t){const[a,n]=N(),[o,l]=N(0),[i,d]=N(0),[g,u]=N(),f=ie();function S(b){const{screenX:x,screenY:p}=b.touches[0];n({x,y:p}),clearInterval(f.value)}function h(b){if(!a.value)return;b.preventDefault();const{screenX:x,screenY:p}=b.touches[0],_=x-a.value.x,I=p-a.value.y;t(_,I),n({x,y:p});const R=Date.now();d(R-o.value),l(R),u({x:_,y:I})}function c(){if(!a.value)return;const b=g.value;if(n(null),u(null),b){const x=b.x/i.value,p=b.y/i.value,_=Math.abs(x),I=Math.abs(p);if(Math.max(_,I)<Pa)return;let R=x,K=p;f.value=setInterval(()=>{if(Math.abs(R)<St&&Math.abs(K)<St){clearInterval(f.value);return}R*=xt,K*=xt,t(R*ke,K*ke)},ke)}}const v=ie();function m(b){const{deltaX:x,deltaY:p}=b;let _=0;const I=Math.abs(x),R=Math.abs(p);I===R?_=v.value==="x"?x:p:I>R?(_=x,v.value="x"):(_=p,v.value="y"),t(-_,-_)&&b.preventDefault()}const w=ie({onTouchStart:S,onTouchMove:h,onTouchEnd:c,onWheel:m});function C(b){w.value.onTouchStart(b)}function A(b){w.value.onTouchMove(b)}function L(b){w.value.onTouchEnd(b)}function M(b){w.value.onWheel(b)}Oe(()=>{var b,x;document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",L,{passive:!1}),(b=e.value)===null||b===void 0||b.addEventListener("touchstart",C,{passive:!1}),(x=e.value)===null||x===void 0||x.addEventListener("wheel",M,{passive:!1})}),nt(()=>{document.removeEventListener("touchmove",A),document.removeEventListener("touchend",L)})}function Ct(e,t){const a=ie(e);function n(o){const l=typeof o=="function"?o(a.value):o;l!==a.value&&t(l,a.value),a.value=l}return[a,n]}const wt={width:0,height:0,left:0,top:0,right:0},Ra=()=>({id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:Ie(),editable:Ie(),moreIcon:de.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:Ie(),popupClassName:String,getPopupContainer:ee(),onTabClick:{type:Function},onTabScroll:{type:Function}}),Ia=(e,t)=>{const{offsetWidth:a,offsetHeight:n,offsetTop:o,offsetLeft:l}=e,{width:i,height:d,x:g,y:u}=e.getBoundingClientRect();return Math.abs(i-a)<1?[i,d,g-t.x,u-t.y]:[a,n,l,o]},Tt=z({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:Ra(),slots:Object,emits:["tabClick","tabScroll"],setup(e,t){let{attrs:a,slots:n}=t;const{tabs:o,prefixCls:l}=Mt(),i=V(),d=V(),g=V(),u=V(),[f,S]=ga(),h=D(()=>e.tabPosition==="top"||e.tabPosition==="bottom"),[c,v]=Ct(0,(y,$)=>{h.value&&e.onTabScroll&&e.onTabScroll({direction:y>$?"left":"right"})}),[m,w]=Ct(0,(y,$)=>{!h.value&&e.onTabScroll&&e.onTabScroll({direction:y>$?"top":"bottom"})}),[C,A]=N(0),[L,M]=N(0),[b,x]=N(null),[p,_]=N(null),[I,R]=N(0),[K,Z]=N(0),[te,le]=Sa(new Map),B=Ca(o,te),X=D(()=>`${l.value}-nav-operations-hidden`),T=V(0),Y=V(0);We(()=>{h.value?e.rtl?(T.value=0,Y.value=Math.max(0,C.value-b.value)):(T.value=Math.min(0,b.value-C.value),Y.value=0):(T.value=Math.min(0,p.value-L.value),Y.value=0)});const U=y=>y<T.value?T.value:y>Y.value?Y.value:y,ue=V(),[j,ve]=N(),pe=()=>{ve(Date.now())},$e=()=>{clearTimeout(ue.value)},ye=(y,$)=>{y(P=>U(P+$))};Ba(i,(y,$)=>{if(h.value){if(b.value>=C.value)return!1;ye(v,y)}else{if(p.value>=L.value)return!1;ye(w,$)}return $e(),pe(),!0}),he(j,()=>{$e(),j.value&&(ue.value=setTimeout(()=>{ve(0)},100))});const be=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey;const $=B.value.get(y)||{width:0,height:0,left:0,right:0,top:0};if(h.value){let P=c.value;e.rtl?$.right<c.value?P=$.right:$.right+$.width>c.value+b.value&&(P=$.right+$.width-b.value):$.left<-c.value?P=-$.left:$.left+$.width>-c.value+b.value&&(P=-($.left+$.width-b.value)),w(0),v(U(P))}else{let P=m.value;$.top<-m.value?P=-$.top:$.top+$.height>-m.value+p.value&&(P=-($.top+$.height-p.value)),v(0),w(U(P))}},re=V(0),Se=V(0);We(()=>{let y,$,P,E,k,H;const ae=B.value;["top","bottom"].includes(e.tabPosition)?(y="width",E=b.value,k=C.value,H=I.value,$=e.rtl?"right":"left",P=Math.abs(c.value)):(y="height",E=p.value,k=C.value,H=K.value,$="top",P=-m.value);let F=E;k+H>E&&k<E&&(F=E-H);const J=o.value;if(!J.length)return[re.value,Se.value]=[0,0];const ne=J.length;let ge=ne;for(let Q=0;Q<ne;Q+=1){const se=ae.get(J[Q].key)||wt;if(se[$]+se[y]>P+F){ge=Q-1;break}}let O=0;for(let Q=ne-1;Q>=0;Q-=1)if((ae.get(J[Q].key)||wt)[$]<P){O=Q+1;break}return[re.value,Se.value]=[O,ge]});const me=()=>{le(()=>{var y;const $=new Map,P=(y=d.value)===null||y===void 0?void 0:y.getBoundingClientRect();return o.value.forEach(E=>{let{key:k}=E;const H=S.value.get(k),ae=(H==null?void 0:H.$el)||H;if(ae){const[F,J,ne,ge]=Ia(ae,P);$.set(k,{width:F,height:J,left:ne,top:ge})}}),$})};he(()=>o.value.map(y=>y.key).join("%%"),()=>{me()},{flush:"post"});const xe=()=>{var y,$,P,E,k;const H=((y=i.value)===null||y===void 0?void 0:y.offsetWidth)||0,ae=(($=i.value)===null||$===void 0?void 0:$.offsetHeight)||0,F=((P=u.value)===null||P===void 0?void 0:P.$el)||{},J=F.offsetWidth||0,ne=F.offsetHeight||0;x(H),_(ae),R(J),Z(ne);const ge=(((E=d.value)===null||E===void 0?void 0:E.offsetWidth)||0)-J,O=(((k=d.value)===null||k===void 0?void 0:k.offsetHeight)||0)-ne;A(ge),M(O),me()},Ce=D(()=>[...o.value.slice(0,re.value),...o.value.slice(Se.value+1)]),[Ot,Nt]=N(),fe=D(()=>B.value.get(e.activeKey)),ct=V(),ut=()=>{Re.cancel(ct.value)};he([fe,h,()=>e.rtl],()=>{const y={};fe.value&&(h.value?(e.rtl?y.right=Pe(fe.value.right):y.left=Pe(fe.value.left),y.width=Pe(fe.value.width)):(y.top=Pe(fe.value.top),y.height=Pe(fe.value.height))),ut(),ct.value=Re(()=>{Nt(y)})}),he([()=>e.activeKey,fe,B,h],()=>{be()},{flush:"post"}),he([()=>e.rtl,()=>e.tabBarGutter,()=>e.activeKey,()=>o.value],()=>{xe()},{flush:"post"});const Xe=y=>{let{position:$,prefixCls:P,extra:E}=y;if(!E)return null;const k=E==null?void 0:E({position:$});return k?s("div",{class:`${P}-extra-content`},[k]):null};return nt(()=>{$e(),ut()}),()=>{const{id:y,animated:$,activeKey:P,rtl:E,editable:k,locale:H,tabPosition:ae,tabBarGutter:F,onTabClick:J}=e,{class:ne,style:ge}=a,O=l.value,Q=!!Ce.value.length,se=`${O}-nav-wrap`;let je,Fe,vt,pt;h.value?E?(Fe=c.value>0,je=c.value+b.value<C.value):(je=c.value<0,Fe=-c.value+b.value<C.value):(vt=m.value<0,pt=-m.value+p.value<L.value);const He={};ae==="top"||ae==="bottom"?He[E?"marginRight":"marginLeft"]=typeof F=="number"?`${F}px`:F:He.marginTop=typeof F=="number"?`${F}px`:F;const bt=o.value.map((Ve,Gt)=>{const{key:_e}=Ve;return s(xa,{id:y,prefixCls:O,key:_e,tab:Ve,style:Gt===0?void 0:He,closable:Ve.closable,editable:k,active:_e===P,removeAriaLabel:H==null?void 0:H.removeAriaLabel,ref:f(_e),onClick:Kt=>{J(_e,Kt)},onFocus:()=>{be(_e),pe(),i.value&&(E||(i.value.scrollLeft=0),i.value.scrollTop=0)}},n)});return s("div",{role:"tablist",class:G(`${O}-nav`,ne),style:ge,onKeydown:()=>{pe()}},[s(Xe,{position:"left",prefixCls:O,extra:n.leftExtra},null),s(gt,{onResize:xe},{default:()=>[s("div",{class:G(se,{[`${se}-ping-left`]:je,[`${se}-ping-right`]:Fe,[`${se}-ping-top`]:vt,[`${se}-ping-bottom`]:pt}),ref:i},[s(gt,{onResize:xe},{default:()=>[s("div",{ref:d,class:`${O}-nav-list`,style:{transform:`translate(${c.value}px, ${m.value}px)`,transition:j.value?"none":void 0}},[bt,s(At,{ref:u,prefixCls:O,locale:H,editable:k,style:r(r({},bt.length===0?void 0:He),{visibility:Q?"hidden":null})},null),s("div",{class:G(`${O}-ink-bar`,{[`${O}-ink-bar-animated`]:$.inkBar}),style:Ot.value},null)])]})])]}),s(Ta,W(W({},e),{},{removeAriaLabel:H==null?void 0:H.removeAriaLabel,ref:g,prefixCls:O,tabs:Ce.value,class:!Q&&X.value}),Et(n,["moreIcon"])),s(Xe,{position:"right",prefixCls:O,extra:n.rightExtra},null),s(Xe,{position:"right",prefixCls:O,extra:n.tabBarExtraContent},null)])}}}),Ea=z({compatConfig:{MODE:3},name:"TabPanelList",inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup(e){const{tabs:t,prefixCls:a}=Mt();return()=>{const{id:n,activeKey:o,animated:l,tabPosition:i,rtl:d,destroyInactiveTabPane:g}=e,u=l.tabPane,f=a.value,S=t.value.findIndex(h=>h.key===o);return s("div",{class:`${f}-content-holder`},[s("div",{class:[`${f}-content`,`${f}-content-${i}`,{[`${f}-content-animated`]:u}],style:S&&u?{[d?"marginRight":"marginLeft"]:`-${S}00%`}:null},[t.value.map(h=>Qt(h.node,{key:h.key,prefixCls:f,tabKey:h.key,id:n,animated:u,active:h.key===o,destroyInactiveTabPane:g}))])])}}}),Aa=e=>{const{componentCls:t,motionDurationSlow:a}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${a}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${a}`}}}}},[ht(e,"slide-up"),ht(e,"slide-down")]]},La=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeadBackground:n,tabsCardGutter:o,colorSplit:l}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:a,background:n,border:`${e.lineWidth}px ${e.lineType} ${l}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:e.colorPrimary,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${o}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${o}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${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 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},Ma=e=>{const{componentCls:t,tabsHoverColor:a,dropdownEdgeChildVerticalPadding:n}=e;return{[`${t}-dropdown`]:r(r({},lt(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:`${n}px 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":r(r({},rt),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,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.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:a}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Ha=e=>{const{componentCls:t,margin:a,colorSplit:n}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:`0 0 ${a}px 0`,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${n}`,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:`${a}px`,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:e.controlHeight*1.25,[`${t}-tab`]:{padding:`${e.paddingXS}px ${e.paddingLG}px`,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:`${e.margin}px 0 0 0`},[`${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:`-${e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${e.lineWidth}px ${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:-e.lineWidth},borderRight:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},Da=e=>{const{componentCls:t,padding:a}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px 0`,fontSize:e.fontSize}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${a}px 0`,fontSize:e.fontSizeLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXXS*1.5}px ${a}px`}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${e.borderRadius}px ${e.borderRadius}px`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadius}px ${e.borderRadius}px 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadius}px 0 0 ${e.borderRadius}px`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px ${a}px ${e.paddingXXS*1.5}px`}}}}}},za=e=>{const{componentCls:t,tabsActiveColor:a,tabsHoverColor:n,iconCls:o,tabsHorizontalGutter:l}=e,i=`${t}-tab`;return{[i]:{position:"relative",display:"inline-flex",alignItems:"center",padding:`${e.paddingSM}px 0`,fontSize:`${e.fontSize}px`,background:"transparent",border:0,outline:"none",cursor:"pointer","&-btn, &-remove":r({"&:focus:not(:focus-visible), &:active":{color:a}},Bt(e)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-e.marginXXS},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},"&:hover":{color:n},[`&${i}-active ${i}-btn`]:{color:e.colorPrimary,textShadow:e.tabsActiveTextShadow},[`&${i}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${i}-disabled ${i}-btn, &${i}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${i}-remove ${o}`]:{margin:0},[o]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${i} + ${i}`]:{margin:{_skip_check_:!0,value:`0 0 0 ${l}px`}}}},ka=e=>{const{componentCls:t,tabsHorizontalGutter:a,iconCls:n,tabsCardGutter:o}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:`0 0 0 ${a}px`},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[n]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${e.marginSM}px`}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${e.marginXXS}px`},[n]:{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:`${o}px`},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},Wa=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeight:n,tabsCardGutter:o,tabsHoverColor:l,tabsActiveColor:i,colorSplit:d}=e;return{[t]:r(r(r(r({},lt(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:a,background:"transparent",border:0,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:r({minWidth:`${n}px`,marginLeft:{_skip_check_:!0,value:`${o}px`},padding:`0 ${e.paddingXS}px`,background:"transparent",border:`${e.lineWidth}px ${e.lineType} ${d}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:l},"&:active, &:focus:not(:focus-visible)":{color:i}},Bt(e))},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.colorPrimary,pointerEvents:"none"}}),za(e)),{[`${t}-content`]:{position:"relative",display:"flex",width:"100%","&-animated":{transition:"margin 0.3s"}},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:{outline:"none",flex:"none",width:"100%"}}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},Oa=ot("Tabs",e=>{const t=e.controlHeightLG,a=it(e,{tabsHoverColor:e.colorPrimaryHover,tabsActiveColor:e.colorPrimaryActive,tabsCardHorizontalPadding:`${(t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth}px ${e.padding}px`,tabsCardHeight:t,tabsCardGutter:e.marginXXS/2,tabsHorizontalGutter:32,tabsCardHeadBackground:e.colorFillAlter,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120});return[Da(a),ka(a),Ha(a),Ma(a),La(a),Wa(a),Aa(a)]},e=>({zIndexPopup:e.zIndexPopupBase+50}));let _t=0;const Ht=()=>({prefixCls:{type:String},id:{type:String},popupClassName:String,getPopupContainer:ee(),activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:De(),animated:na([Boolean,Object]),renderTabBar:ee(),tabBarGutter:{type:Number},tabBarStyle:Ie(),tabPosition:De(),destroyInactiveTabPane:aa(),hideAdd:Boolean,type:De(),size:De(),centered:Boolean,onEdit:ee(),onChange:ee(),onTabClick:ee(),onTabScroll:ee(),"onUpdate:activeKey":ee(),locale:Ie(),onPrevClick:ee(),onNextClick:ee(),tabBarExtraContent:de.any});function Na(e){return e.map(t=>{if(Zt(t)){const a=r({},t.props||{});for(const[h,c]of Object.entries(a))delete a[h],a[Jt(h)]=c;const n=t.children||{},o=t.key!==void 0?t.key:void 0,{tab:l=n.tab,disabled:i,forceRender:d,closable:g,animated:u,active:f,destroyInactiveTabPane:S}=a;return r(r({key:o},a),{node:t,closeIcon:n.closeIcon,tab:l,disabled:i===""||i,forceRender:d===""||d,closable:g===""||g,animated:u===""||u,active:f===""||f,destroyInactiveTabPane:S===""||S})}return null}).filter(t=>t)}const Ga=z({compatConfig:{MODE:3},name:"InternalTabs",inheritAttrs:!1,props:r(r({},Ae(Ht(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}})),{tabs:ta()}),slots:Object,setup(e,t){let{attrs:a,slots:n}=t;ze(e.onPrevClick===void 0&&e.onNextClick===void 0,"Tabs","`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),ze(e.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),ze(n.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");const{prefixCls:o,direction:l,size:i,rootPrefixCls:d,getPopupContainer:g}=ce("tabs",e),[u,f]=Oa(o),S=D(()=>l.value==="rtl"),h=D(()=>{const{animated:p,tabPosition:_}=e;return p===!1||["left","right"].includes(_)?{inkBar:!1,tabPane:!1}:p===!0?{inkBar:!0,tabPane:!0}:r({inkBar:!0,tabPane:!1},typeof p=="object"?p:{})}),[c,v]=N(!1);Oe(()=>{v(pa())});const[m,w]=mt(()=>{var p;return(p=e.tabs[0])===null||p===void 0?void 0:p.key},{value:D(()=>e.activeKey),defaultValue:e.defaultActiveKey}),[C,A]=N(()=>e.tabs.findIndex(p=>p.key===m.value));We(()=>{var p;let _=e.tabs.findIndex(I=>I.key===m.value);_===-1&&(_=Math.max(0,Math.min(C.value,e.tabs.length-1)),w((p=e.tabs[_])===null||p===void 0?void 0:p.key)),A(_)});const[L,M]=mt(null,{value:D(()=>e.id)}),b=D(()=>c.value&&!["left","right"].includes(e.tabPosition)?"top":e.tabPosition);Oe(()=>{e.id||(M(`rc-tabs-${_t}`),_t+=1)});const x=(p,_)=>{var I,R;(I=e.onTabClick)===null||I===void 0||I.call(e,p,_);const K=p!==m.value;w(p),K&&((R=e.onChange)===null||R===void 0||R.call(e,p))};return _a({tabs:D(()=>e.tabs),prefixCls:o}),()=>{const{id:p,type:_,tabBarGutter:I,tabBarStyle:R,locale:K,destroyInactiveTabPane:Z,renderTabBar:te=n.renderTabBar,onTabScroll:le,hideAdd:B,centered:X}=e,T={id:L.value,activeKey:m.value,animated:h.value,tabPosition:b.value,rtl:S.value,mobile:c.value};let Y;_==="editable-card"&&(Y={onEdit:(ve,pe)=>{let{key:$e,event:ye}=pe;var be;(be=e.onEdit)===null||be===void 0||be.call(e,ve==="add"?ye:$e,ve)},removeIcon:()=>s(ea,null,null),addIcon:n.addIcon?n.addIcon:()=>s(ba,null,null),showAdd:B!==!0});let U;const ue=r(r({},T),{moreTransitionName:`${d.value}-slide-up`,editable:Y,locale:K,tabBarGutter:I,onTabClick:x,onTabScroll:le,style:R,getPopupContainer:g.value,popupClassName:G(e.popupClassName,f.value)});te?U=te(r(r({},ue),{DefaultTabBar:Tt})):U=s(Tt,ue,Et(n,["moreIcon","leftExtra","rightExtra","tabBarExtraContent"]));const j=o.value;return u(s("div",W(W({},a),{},{id:p,class:G(j,`${j}-${b.value}`,{[f.value]:!0,[`${j}-${i.value}`]:i.value,[`${j}-card`]:["card","editable-card"].includes(_),[`${j}-editable-card`]:_==="editable-card",[`${j}-centered`]:X,[`${j}-mobile`]:c.value,[`${j}-editable`]:_==="editable-card",[`${j}-rtl`]:S.value},a.class)}),[U,s(Ea,W(W({destroyInactiveTabPane:Z},T),{},{animated:h.value}),null)]))}}}),we=z({compatConfig:{MODE:3},name:"ATabs",inheritAttrs:!1,props:Ae(Ht(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}}),slots:Object,setup(e,t){let{attrs:a,slots:n,emit:o}=t;const l=i=>{o("update:activeKey",i),o("change",i)};return()=>{var i;const d=Na(Rt((i=n.default)===null||i===void 0?void 0:i.call(n)));return s(Ga,W(W(W({},st(e,["onUpdate:activeKey"])),a),{},{onChange:l,tabs:d}),n)}}}),Ka=()=>({tab:de.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}}),et=z({compatConfig:{MODE:3},name:"ATabPane",inheritAttrs:!1,__ANT_TAB_PANE:!0,props:Ka(),slots:Object,setup(e,t){let{attrs:a,slots:n}=t;const o=ie(e.forceRender);he([()=>e.active,()=>e.destroyInactiveTabPane],()=>{e.active?o.value=!0:e.destroyInactiveTabPane&&(o.value=!1)},{immediate:!0});const l=D(()=>e.active?{}:e.animated?{visibility:"hidden",height:0,overflowY:"hidden"}:{display:"none"});return()=>{var i;const{prefixCls:d,forceRender:g,id:u,active:f,tabKey:S}=e;return s("div",{id:u&&`${u}-panel-${S}`,role:"tabpanel",tabindex:f?0:-1,"aria-labelledby":u&&`${u}-tab-${S}`,"aria-hidden":!f,style:[l.value,a.style],class:[`${d}-tabpane`,f&&`${d}-tabpane-active`,a.class]},[(f||o.value||g)&&((i=n.default)===null||i===void 0?void 0:i.call(n))])}}});we.TabPane=et;we.install=function(e){return e.component(we.name,we),e.component(et.name,et),e};const Xa=e=>{const{antCls:t,componentCls:a,cardHeadHeight:n,cardPaddingBase:o,cardHeadTabsMarginBottom:l}=e;return r(r({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:`0 ${o}px`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,background:"transparent",borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},Ne()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":r(r({display:"inline-block",flex:1},rt),{[`
|
||
> ${a}-typography,
|
||
> ${a}-typography-edit-content
|
||
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:l,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`}}})},ja=e=>{const{cardPaddingBase:t,colorBorderSecondary:a,cardShadow:n,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:`
|
||
${o}px 0 0 0 ${a},
|
||
0 ${o}px 0 0 ${a},
|
||
${o}px ${o}px 0 0 ${a},
|
||
${o}px 0 0 0 ${a} inset,
|
||
0 ${o}px 0 0 ${a} inset;
|
||
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}},Fa=e=>{const{componentCls:t,iconCls:a,cardActionsLiMargin:n,cardActionsIconSize:o,colorBorderSecondary:l}=e;return r(r({margin:0,padding:0,listStyle:"none",background:e.colorBgContainer,borderTop:`${e.lineWidth}px ${e.lineType} ${l}`,display:"flex",borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `},Ne()),{"& > li":{margin:n,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.cardActionsIconSize*2,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${a}`]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:`${e.fontSize*e.lineHeight}px`,transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${a}`]:{fontSize:o,lineHeight:`${o*e.lineHeight}px`}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${l}`}}})},Va=e=>r(r({margin:`-${e.marginXXS}px 0`,display:"flex"},Ne()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":r({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},rt),"&-description":{color:e.colorTextDescription}}),qa=e=>{const{componentCls:t,cardPaddingBase:a,colorFillAlter:n}=e;return{[`${t}-head`]:{padding:`0 ${a}px`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${e.padding}px ${a}px`}}},Ya=e=>{const{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}},Ua=e=>{const{componentCls:t,cardShadow:a,cardHeadPadding:n,colorBorderSecondary:o,boxShadow:l,cardPaddingBase:i}=e;return{[t]:r(r({},lt(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:l},[`${t}-head`]:Xa(e),[`${t}-extra`]:{marginInlineStart:"auto",color:"",fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:r({padding:i,borderRadius:` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},Ne()),[`${t}-grid`]:ja(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%"},img:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`}},[`${t}-actions`]:Fa(e),[`${t}-meta`]:Va(e)}),[`${t}-bordered`]:{border:`${e.lineWidth}px ${e.lineType} ${o}`,[`${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:a}},[`${t}-contain-grid`]:{[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:-e.lineWidth,marginInlineStart:-e.lineWidth,padding:0}},[`${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:n}}},[`${t}-type-inner`]:qa(e),[`${t}-loading`]:Ya(e),[`${t}-rtl`]:{direction:"rtl"}}},Qa=e=>{const{componentCls:t,cardPaddingSM:a,cardHeadHeightSM:n}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:n,padding:`0 ${a}px`,fontSize:e.fontSize,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:a}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{minHeight:n,paddingTop:0,display:"flex",alignItems:"center"}}}}},Za=ot("Card",e=>{const t=it(e,{cardShadow:e.boxShadowCard,cardHeadHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,cardHeadHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardHeadTabsMarginBottom:-e.padding-e.lineWidth,cardActionsLiMargin:`${e.paddingSM}px 0`,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[Ua(t),Qa(t)]}),Ja=()=>({prefixCls:String,width:{type:[Number,String]}}),dt=z({compatConfig:{MODE:3},name:"SkeletonTitle",props:Ja(),setup(e){return()=>{const{prefixCls:t,width:a}=e,n=typeof a=="number"?`${a}px`:a;return s("h3",{class:t,style:{width:n}},null)}}}),en=()=>({prefixCls:String,width:{type:[Number,String,Array]},rows:Number}),tn=z({compatConfig:{MODE:3},name:"SkeletonParagraph",props:en(),setup(e){const t=a=>{const{width:n,rows:o=2}=e;if(Array.isArray(n))return n[a];if(o-1===a)return n};return()=>{const{prefixCls:a,rows:n}=e,o=[...Array(n)].map((l,i)=>{const d=t(i);return s("li",{key:i,style:{width:typeof d=="number"?`${d}px`:d}},null)});return s("ul",{class:a},[o])}}}),Ge=()=>({prefixCls:String,size:[String,Number],shape:String,active:{type:Boolean,default:void 0}}),Le=e=>{const{prefixCls:t,size:a,shape:n}=e,o=G({[`${t}-lg`]:a==="large",[`${t}-sm`]:a==="small"}),l=G({[`${t}-circle`]:n==="circle",[`${t}-square`]:n==="square",[`${t}-round`]:n==="round"}),i=typeof a=="number"?{width:`${a}px`,height:`${a}px`,lineHeight:`${a}px`}:{};return s("span",{class:G(t,o,l),style:i},null)};Le.displayName="SkeletonElement";const an=new oa("ant-skeleton-loading",{"0%":{transform:"translateX(-37.5%)"},"100%":{transform:"translateX(37.5%)"}}),Ke=e=>({height:e,lineHeight:`${e}px`}),Te=e=>r({width:e},Ke(e)),nn=e=>({position:"relative",zIndex:0,overflow:"hidden",background:"transparent","&::after":{position:"absolute",top:0,insetInlineEnd:"-150%",bottom:0,insetInlineStart:"-150%",background:e.skeletonLoadingBackground,animationName:an,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite",content:'""'}}),Ue=e=>r({width:e*5,minWidth:e*5},Ke(e)),on=e=>{const{skeletonAvatarCls:t,color:a,controlHeight:n,controlHeightLG:o,controlHeightSM:l}=e;return{[`${t}`]:r({display:"inline-block",verticalAlign:"top",background:a},Te(n)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:r({},Te(o)),[`${t}${t}-sm`]:r({},Te(l))}},ln=e=>{const{controlHeight:t,borderRadiusSM:a,skeletonInputCls:n,controlHeightLG:o,controlHeightSM:l,color:i}=e;return{[`${n}`]:r({display:"inline-block",verticalAlign:"top",background:i,borderRadius:a},Ue(t)),[`${n}-lg`]:r({},Ue(o)),[`${n}-sm`]:r({},Ue(l))}},Pt=e=>r({width:e},Ke(e)),rn=e=>{const{skeletonImageCls:t,imageSizeBase:a,color:n,borderRadiusSM:o}=e;return{[`${t}`]:r(r({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:n,borderRadius:o},Pt(a*2)),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:r(r({},Pt(a)),{maxWidth:a*4,maxHeight:a*4}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},Qe=(e,t,a)=>{const{skeletonButtonCls:n}=e;return{[`${a}${n}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${a}${n}-round`]:{borderRadius:t}}},Ze=e=>r({width:e*2,minWidth:e*2},Ke(e)),sn=e=>{const{borderRadiusSM:t,skeletonButtonCls:a,controlHeight:n,controlHeightLG:o,controlHeightSM:l,color:i}=e;return r(r(r(r(r({[`${a}`]:r({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:n*2,minWidth:n*2},Ze(n))},Qe(e,n,a)),{[`${a}-lg`]:r({},Ze(o))}),Qe(e,o,`${a}-lg`)),{[`${a}-sm`]:r({},Ze(l))}),Qe(e,l,`${a}-sm`))},dn=e=>{const{componentCls:t,skeletonAvatarCls:a,skeletonTitleCls:n,skeletonParagraphCls:o,skeletonButtonCls:l,skeletonInputCls:i,skeletonImageCls:d,controlHeight:g,controlHeightLG:u,controlHeightSM:f,color:S,padding:h,marginSM:c,borderRadius:v,skeletonTitleHeight:m,skeletonBlockRadius:w,skeletonParagraphLineHeight:C,controlHeightXS:A,skeletonParagraphMarginTop:L}=e;return{[`${t}`]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:h,verticalAlign:"top",[`${a}`]:r({display:"inline-block",verticalAlign:"top",background:S},Te(g)),[`${a}-circle`]:{borderRadius:"50%"},[`${a}-lg`]:r({},Te(u)),[`${a}-sm`]:r({},Te(f))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[`${n}`]:{width:"100%",height:m,background:S,borderRadius:w,[`+ ${o}`]:{marginBlockStart:f}},[`${o}`]:{padding:0,"> li":{width:"100%",height:C,listStyle:"none",background:S,borderRadius:w,"+ li":{marginBlockStart:A}}},[`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${n}, ${o} > li`]:{borderRadius:v}}},[`${t}-with-avatar ${t}-content`]:{[`${n}`]:{marginBlockStart:c,[`+ ${o}`]:{marginBlockStart:L}}},[`${t}${t}-element`]:r(r(r(r({display:"inline-block",width:"auto"},sn(e)),on(e)),ln(e)),rn(e)),[`${t}${t}-block`]:{width:"100%",[`${l}`]:{width:"100%"},[`${i}`]:{width:"100%"}},[`${t}${t}-active`]:{[`
|
||
${n},
|
||
${o} > li,
|
||
${a},
|
||
${l},
|
||
${i},
|
||
${d}
|
||
`]:r({},nn(e))}}},Me=ot("Skeleton",e=>{const{componentCls:t}=e,a=it(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:e.controlHeight*1.5,skeletonTitleHeight:e.controlHeight/2,skeletonBlockRadius:e.borderRadiusSM,skeletonParagraphLineHeight:e.controlHeight/2,skeletonParagraphMarginTop:e.marginLG+e.marginXXS,borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.color} 25%, ${e.colorGradientEnd} 37%, ${e.color} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return[dn(a)]},e=>{const{colorFillContent:t,colorFill:a}=e;return{color:t,colorGradientEnd:a}}),cn=()=>({active:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},prefixCls:String,avatar:{type:[Boolean,Object],default:void 0},title:{type:[Boolean,Object],default:void 0},paragraph:{type:[Boolean,Object],default:void 0},round:{type:Boolean,default:void 0}});function Je(e){return e&&typeof e=="object"?e:{}}function un(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function vn(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function pn(e,t){const a={};return(!e||!t)&&(a.width="61%"),!e&&t?a.rows=3:a.rows=2,a}const q=z({compatConfig:{MODE:3},name:"ASkeleton",props:Ae(cn(),{avatar:!1,title:!0,paragraph:!0}),setup(e,t){let{slots:a}=t;const{prefixCls:n,direction:o}=ce("skeleton",e),[l,i]=Me(n);return()=>{var d;const{loading:g,avatar:u,title:f,paragraph:S,active:h,round:c}=e,v=n.value;if(g||e.loading===void 0){const m=!!u||u==="",w=!!f||f==="",C=!!S||S==="";let A;if(m){const b=r(r({prefixCls:`${v}-avatar`},un(w,C)),Je(u));A=s("div",{class:`${v}-header`},[s(Le,b,null)])}let L;if(w||C){let b;if(w){const p=r(r({prefixCls:`${v}-title`},vn(m,C)),Je(f));b=s(dt,p,null)}let x;if(C){const p=r(r({prefixCls:`${v}-paragraph`},pn(m,w)),Je(S));x=s(tn,p,null)}L=s("div",{class:`${v}-content`},[b,x])}const M=G(v,{[`${v}-with-avatar`]:m,[`${v}-active`]:h,[`${v}-rtl`]:o.value==="rtl",[`${v}-round`]:c,[i.value]:!0});return l(s("div",{class:M},[A,L]))}return(d=a.default)===null||d===void 0?void 0:d.call(a)}}}),bn=()=>r(r({},Ge()),{size:String,block:Boolean}),Dt=z({compatConfig:{MODE:3},name:"ASkeletonButton",props:Ae(bn(),{size:"default"}),setup(e){const{prefixCls:t}=ce("skeleton",e),[a,n]=Me(t),o=D(()=>G(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active,[`${t.value}-block`]:e.block},n.value));return()=>a(s("div",{class:o.value},[s(Le,W(W({},e),{},{prefixCls:`${t.value}-button`}),null)]))}}),zt=z({compatConfig:{MODE:3},name:"ASkeletonInput",props:r(r({},st(Ge(),["shape"])),{size:String,block:Boolean}),setup(e){const{prefixCls:t}=ce("skeleton",e),[a,n]=Me(t),o=D(()=>G(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active,[`${t.value}-block`]:e.block},n.value));return()=>a(s("div",{class:o.value},[s(Le,W(W({},e),{},{prefixCls:`${t.value}-input`}),null)]))}}),fn="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",kt=z({compatConfig:{MODE:3},name:"ASkeletonImage",props:st(Ge(),["size","shape","active"]),setup(e){const{prefixCls:t}=ce("skeleton",e),[a,n]=Me(t),o=D(()=>G(t.value,`${t.value}-element`,n.value));return()=>a(s("div",{class:o.value},[s("div",{class:`${t.value}-image`},[s("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",class:`${t.value}-image-svg`},[s("path",{d:fn,class:`${t.value}-image-path`},null)])])]))}}),gn=()=>r(r({},Ge()),{shape:String}),Wt=z({compatConfig:{MODE:3},name:"ASkeletonAvatar",props:Ae(gn(),{size:"default",shape:"circle"}),setup(e){const{prefixCls:t}=ce("skeleton",e),[a,n]=Me(t),o=D(()=>G(t.value,`${t.value}-element`,{[`${t.value}-active`]:e.active},n.value));return()=>a(s("div",{class:o.value},[s(Le,W(W({},e),{},{prefixCls:`${t.value}-avatar`}),null)]))}});q.Button=Dt;q.Avatar=Wt;q.Input=zt;q.Image=kt;q.Title=dt;q.install=function(e){return e.component(q.name,q),e.component(q.Button.name,Dt),e.component(q.Avatar.name,Wt),e.component(q.Input.name,zt),e.component(q.Image.name,kt),e.component(q.Title.name,dt),e};const{TabPane:hn}=we,$n=()=>({prefixCls:String,title:de.any,extra:de.any,bordered:{type:Boolean,default:!0},bodyStyle:{type:Object,default:void 0},headStyle:{type:Object,default:void 0},loading:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},type:{type:String},size:{type:String},actions:de.any,tabList:{type:Array},tabBarExtraContent:de.any,activeTabKey:String,defaultActiveTabKey:String,cover:de.any,onTabChange:{type:Function}}),Ee=z({compatConfig:{MODE:3},name:"ACard",inheritAttrs:!1,props:$n(),slots:Object,setup(e,t){let{slots:a,attrs:n}=t;const{prefixCls:o,direction:l,size:i}=ce("card",e),[d,g]=Za(o),u=h=>h.map((v,m)=>$t(v)&&!ia(v)||!$t(v)?s("li",{style:{width:`${100/h.length}%`},key:`action-${m}`},[s("span",null,[v])]):null),f=h=>{var c;(c=e.onTabChange)===null||c===void 0||c.call(e,h)},S=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c;return h.forEach(v=>{v&&fa(v.type)&&v.type.__ANT_CARD_GRID&&(c=!0)}),c};return()=>{var h,c,v,m,w,C;const{headStyle:A={},bodyStyle:L={},loading:M,bordered:b=!0,type:x,tabList:p,hoverable:_,activeTabKey:I,defaultActiveTabKey:R,tabBarExtraContent:K=Be((h=a.tabBarExtraContent)===null||h===void 0?void 0:h.call(a)),title:Z=Be((c=a.title)===null||c===void 0?void 0:c.call(a)),extra:te=Be((v=a.extra)===null||v===void 0?void 0:v.call(a)),actions:le=Be((m=a.actions)===null||m===void 0?void 0:m.call(a)),cover:B=Be((w=a.cover)===null||w===void 0?void 0:w.call(a))}=e,X=Rt((C=a.default)===null||C===void 0?void 0:C.call(a)),T=o.value,Y={[`${T}`]:!0,[g.value]:!0,[`${T}-loading`]:M,[`${T}-bordered`]:b,[`${T}-hoverable`]:!!_,[`${T}-contain-grid`]:S(X),[`${T}-contain-tabs`]:p&&p.length,[`${T}-${i.value}`]:i.value,[`${T}-type-${x}`]:!!x,[`${T}-rtl`]:l.value==="rtl"},U=s(q,{loading:!0,active:!0,paragraph:{rows:4},title:!1},{default:()=>[X]}),ue=I!==void 0,j={size:"large",[ue?"activeKey":"defaultActiveKey"]:ue?I:R,onChange:f,class:`${T}-head-tabs`};let ve;const pe=p&&p.length?s(we,j,{default:()=>[p.map(re=>{const{tab:Se,slots:me}=re,xe=me==null?void 0:me.tab;ze(!me,"Card","tabList slots is deprecated, Please use `customTab` instead.");let Ce=Se!==void 0?Se:a[xe]?a[xe](re):null;return Ce=la(a,"customTab",re,()=>[Ce]),s(hn,{tab:Ce,key:re.key,disabled:re.disabled},null)})],rightExtra:K?()=>K:null}):null;(Z||te||pe)&&(ve=s("div",{class:`${T}-head`,style:A},[s("div",{class:`${T}-head-wrapper`},[Z&&s("div",{class:`${T}-head-title`},[Z]),te&&s("div",{class:`${T}-extra`},[te])]),pe]));const $e=B?s("div",{class:`${T}-cover`},[B]):null,ye=s("div",{class:`${T}-body`,style:L},[M?U:X]),be=le&&le.length?s("ul",{class:`${T}-actions`},[u(le)]):null;return d(s("div",W(W({ref:"cardContainerRef"},n),{},{class:[Y,n.class]}),[ve,$e,X&&X.length?ye:null,be]))}}}),mn=()=>({prefixCls:String,title:qe(),description:qe(),avatar:qe()}),tt=z({compatConfig:{MODE:3},name:"ACardMeta",props:mn(),slots:Object,setup(e,t){let{slots:a}=t;const{prefixCls:n}=ce("card",e);return()=>{const o={[`${n.value}-meta`]:!0},l=Ye(a,e,"avatar"),i=Ye(a,e,"title"),d=Ye(a,e,"description"),g=l?s("div",{class:`${n.value}-meta-avatar`},[l]):null,u=i?s("div",{class:`${n.value}-meta-title`},[i]):null,f=d?s("div",{class:`${n.value}-meta-description`},[d]):null,S=u||f?s("div",{class:`${n.value}-meta-detail`},[u,f]):null;return s("div",{class:o},[g,S])}}}),yn=()=>({prefixCls:String,hoverable:{type:Boolean,default:!0}}),at=z({compatConfig:{MODE:3},name:"ACardGrid",__ANT_CARD_GRID:!0,props:yn(),setup(e,t){let{slots:a}=t;const{prefixCls:n}=ce("card",e),o=D(()=>({[`${n.value}-grid`]:!0,[`${n.value}-grid-hoverable`]:e.hoverable}));return()=>{var l;return s("div",{class:o.value},[(l=a.default)===null||l===void 0?void 0:l.call(a)])}}});Ee.Meta=tt;Ee.Grid=at;Ee.install=function(e){return e.component(Ee.name,Ee),e.component(tt.name,tt),e.component(at.name,at),e};export{Ee as C};
|