import{u as ce}from"./index-Cv7zOydE.js";import{ai as W,T as me,aq as ge,as as ve,q as w,aU as A,P as q,L as be,B as d,bd as fe,D as $e,E as we,G as he,b7 as V,d as J,H as Z,J as x,g as v,z as X,y as L,N as ye,aX as H}from"./app-D7zH3Nl5.js";import{d as U,s as Ce,e as Se,f as Oe,g as xe,E as Pe,j as _e,D as Re}from"./index-BUzTR6QN.js";import{a2 as De,a3 as Ie,b as Be,S as Ne,i as Q,B as z,h as F,c as G,a4 as Te,o as Ae}from"./useFlexGapSupport-CpBR-RD-.js";import{i as Y}from"./move-DTmUXir3.js";function Je(){const t=W({});let e=null;const o=ce();return me(()=>{e=o.value.subscribe(i=>{t.value=i})}),ge(()=>{o.value.unsubscribe(e)}),t}function Ze(t){const e=W();return ve(()=>{e.value=t()},{flush:"sync"}),e}const K=()=>({arrow:be([Boolean,Object]),trigger:{type:[Array,String]},menu:A(),overlay:q.any,visible:w(),open:w(),disabled:w(),danger:w(),autofocus:w(),align:A(),getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:A(),forceRender:w(),mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:w(),destroyPopupOnHide:w(),onVisibleChange:{type:Function},"onUpdate:visible":{type:Function},onOpenChange:{type:Function},"onUpdate:open":{type:Function}}),E=De(),Ee=()=>d(d({},K()),{type:E.type,size:String,htmlType:E.htmlType,href:String,disabled:w(),prefixCls:String,icon:q.any,title:String,loading:E.loading,onClick:fe()}),Le=t=>{const{componentCls:e,antCls:o,paddingXS:i,opacityLoading:a}=t;return{[`${e}-button`]:{whiteSpace:"nowrap",[`&${o}-btn-group > ${o}-btn`]:{[`&-loading, &-loading + ${o}-btn`]:{cursor:"default",pointerEvents:"none",opacity:a},[`&:last-child:not(:first-child):not(${o}-btn-icon-only)`]:{paddingInline:i}}}}},ze=t=>{const{componentCls:e,menuCls:o,colorError:i,colorTextLightSolid:a}=t,l=`${o}-item`;return{[`${e}, ${e}-menu-submenu`]:{[`${o} ${l}`]:{[`&${l}-danger:not(${l}-disabled)`]:{color:i,"&:hover":{color:a,backgroundColor:i}}}}}},je=t=>{const{componentCls:e,menuCls:o,zIndexPopup:i,dropdownArrowDistance:a,dropdownArrowOffset:l,sizePopupArrow:b,antCls:n,iconCls:u,motionDurationMid:f,dropdownPaddingVertical:h,fontSize:y,dropdownEdgeChildPadding:p,colorTextDisabled:m,fontSizeIcon:g,controlPaddingHorizontal:C,colorBgElevated:r,boxShadowPopoverArrow:s}=t;return[{[e]:d(d({},he(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:i,display:"block","&::before":{position:"absolute",insetBlock:-a+b/2,zIndex:-9999,opacity:1e-4,content:'""'},[`${e}-wrap`]:{position:"relative",[`${n}-btn > ${u}-down`]:{fontSize:g},[`${u}-down::before`]:{transition:`transform ${f}`}},[`${e}-wrap-open`]:{[`${u}-down::before`]:{transform:"rotate(180deg)"}},"\n        &-hidden,\n        &-menu-hidden,\n        &-menu-submenu-hidden\n      ":{display:"none"},[`
        &-show-arrow${e}-placement-topLeft,
        &-show-arrow${e}-placement-top,
        &-show-arrow${e}-placement-topRight
      `]:{paddingBottom:a},[`
        &-show-arrow${e}-placement-bottomLeft,
        &-show-arrow${e}-placement-bottom,
        &-show-arrow${e}-placement-bottomRight
      `]:{paddingTop:a},[`${e}-arrow`]:d({position:"absolute",zIndex:1,display:"block"},Ne(b,t.borderRadiusXS,t.borderRadiusOuter,r,s)),[`
        &-placement-top > ${e}-arrow,
        &-placement-topLeft > ${e}-arrow,
        &-placement-topRight > ${e}-arrow
      `]:{bottom:a,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${e}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft > ${e}-arrow`]:{left:{_skip_check_:!0,value:l}},[`&-placement-topRight > ${e}-arrow`]:{right:{_skip_check_:!0,value:l}},[`
          &-placement-bottom > ${e}-arrow,
          &-placement-bottomLeft > ${e}-arrow,
          &-placement-bottomRight > ${e}-arrow
        `]:{top:a,transform:"translateY(-100%)"},[`&-placement-bottom > ${e}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateY(-100%) translateX(-50%)"},[`&-placement-bottomLeft > ${e}-arrow`]:{left:{_skip_check_:!0,value:l}},[`&-placement-bottomRight > ${e}-arrow`]:{right:{_skip_check_:!0,value:l}},[`&${n}-slide-down-enter${n}-slide-down-enter-active${e}-placement-bottomLeft,
          &${n}-slide-down-appear${n}-slide-down-appear-active${e}-placement-bottomLeft,
          &${n}-slide-down-enter${n}-slide-down-enter-active${e}-placement-bottom,
          &${n}-slide-down-appear${n}-slide-down-appear-active${e}-placement-bottom,
          &${n}-slide-down-enter${n}-slide-down-enter-active${e}-placement-bottomRight,
          &${n}-slide-down-appear${n}-slide-down-appear-active${e}-placement-bottomRight`]:{animationName:xe},[`&${n}-slide-up-enter${n}-slide-up-enter-active${e}-placement-topLeft,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-placement-topLeft,
          &${n}-slide-up-enter${n}-slide-up-enter-active${e}-placement-top,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-placement-top,
          &${n}-slide-up-enter${n}-slide-up-enter-active${e}-placement-topRight,
          &${n}-slide-up-appear${n}-slide-up-appear-active${e}-placement-topRight`]:{animationName:Oe},[`&${n}-slide-down-leave${n}-slide-down-leave-active${e}-placement-bottomLeft,
          &${n}-slide-down-leave${n}-slide-down-leave-active${e}-placement-bottom,
          &${n}-slide-down-leave${n}-slide-down-leave-active${e}-placement-bottomRight`]:{animationName:Se},[`&${n}-slide-up-leave${n}-slide-up-leave-active${e}-placement-topLeft,
          &${n}-slide-up-leave${n}-slide-up-leave-active${e}-placement-top,
          &${n}-slide-up-leave${n}-slide-up-leave-active${e}-placement-topRight`]:{animationName:Ce}})},{[`${e} ${o}`]:{position:"relative",margin:0},[`${o}-submenu-popup`]:{position:"absolute",zIndex:i,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul,li":{listStyle:"none"},ul:{marginInline:"0.3em"}},[`${e}, ${e}-menu-submenu`]:{[o]:d(d({padding:p,listStyleType:"none",backgroundColor:r,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary},V(t)),{[`${o}-item-group-title`]:{padding:`${h}px ${C}px`,color:t.colorTextDescription,transition:`all ${f}`},[`${o}-item`]:{position:"relative",display:"flex",alignItems:"center",borderRadius:t.borderRadiusSM},[`${o}-item-icon`]:{minWidth:y,marginInlineEnd:t.marginXS,fontSize:t.fontSizeSM},[`${o}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${f}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${o}-item, ${o}-submenu-title`]:d(d({clear:"both",margin:0,padding:`${h}px ${C}px`,color:t.colorText,fontWeight:"normal",fontSize:y,lineHeight:t.lineHeight,cursor:"pointer",transition:`all ${f}`,"&:hover, &-active":{backgroundColor:t.controlItemBgHover}},V(t)),{"&-selected":{color:t.colorPrimary,backgroundColor:t.controlItemBgActive,"&:hover, &-active":{backgroundColor:t.controlItemBgActiveHover}},"&-disabled":{color:m,cursor:"not-allowed","&:hover":{color:m,backgroundColor:r,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${t.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:t.colorSplit},[`${e}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:t.paddingXS,[`${e}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:t.colorTextDescription,fontSize:g,fontStyle:"normal"}}}),[`${o}-item-group-list`]:{margin:`0 ${t.marginXS}px`,padding:0,listStyle:"none"},[`${o}-submenu-title`]:{paddingInlineEnd:C+t.fontSizeSM},[`${o}-submenu-vertical`]:{position:"relative"},[`${o}-submenu${o}-submenu-disabled ${e}-menu-submenu-title`]:{[`&, ${e}-menu-submenu-arrow-icon`]:{color:m,backgroundColor:r,cursor:"not-allowed"}},[`${o}-submenu-selected ${e}-menu-submenu-title`]:{color:t.colorPrimary}})}},[U(t,"slide-up"),U(t,"slide-down"),Y(t,"move-up"),Y(t,"move-down"),Be(t,"zoom-big")]]},ee=$e("Dropdown",(t,e)=>{let{rootPrefixCls:o}=e;const{marginXXS:i,sizePopupArrow:a,controlHeight:l,fontSize:b,lineHeight:n,paddingXXS:u,componentCls:f,borderRadiusOuter:h,borderRadiusLG:y}=t,p=(l-b*n)/2,{dropdownArrowOffset:m}=Ie({sizePopupArrow:a,contentRadius:y,borderRadiusOuter:h}),g=we(t,{menuCls:`${f}-menu`,rootPrefixCls:o,dropdownArrowDistance:a/2+i,dropdownArrowOffset:m,dropdownPaddingVertical:p,dropdownEdgeChildPadding:u});return[je(g),Le(g),ze(g)]},t=>({zIndexPopup:t.zIndexPopupBase+50}));var Me=function(t,e){var o={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(o[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(o[i[a]]=t[i[a]]);return o};const Ve=z.Group,Xe=J({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:Q(Ee(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:Object,setup(t,e){let{slots:o,attrs:i,emit:a}=e;const l=p=>{a("update:visible",p),a("visibleChange",p),a("update:open",p),a("openChange",p)},{prefixCls:b,direction:n,getPopupContainer:u}=Z("dropdown",t),f=x(()=>`${b.value}-button`),[h,y]=ee(b);return()=>{var p,m;const g=d(d({},t),i),{type:C="default",disabled:r,danger:s,loading:$,htmlType:P,class:c="",overlay:S=(p=o.overlay)===null||p===void 0?void 0:p.call(o),trigger:O,align:_,open:R,visible:D,onVisibleChange:B,placement:N=n.value==="rtl"?"bottomLeft":"bottomRight",href:T,title:oe,icon:ne=((m=o.icon)===null||m===void 0?void 0:m.call(o))||v(Pe,null,null),mouseEnterDelay:ae,mouseLeaveDelay:re,overlayClassName:ie,overlayStyle:le,destroyPopupOnHide:se,onClick:de,"onUpdate:open":Fe}=g,pe=Me(g,["type","disabled","danger","loading","htmlType","class","overlay","trigger","align","open","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:open"]),ue={align:_,disabled:r,trigger:r?[]:O,placement:N,getPopupContainer:u==null?void 0:u.value,onOpenChange:l,mouseEnterDelay:ae,mouseLeaveDelay:re,open:R??D,overlayClassName:ie,overlayStyle:le,destroyPopupOnHide:se},j=v(z,{danger:s,type:C,disabled:r,loading:$,onClick:de,htmlType:P,href:T,title:oe},{default:o.default}),M=v(z,{danger:s,type:C,icon:ne},null);return h(v(Ve,X(X({},pe),{},{class:L(f.value,c,y.value)}),{default:()=>[o.leftButton?o.leftButton({button:j}):j,v(te,ue,{default:()=>[o.rightButton?o.rightButton({button:M}):M],overlay:()=>S})]}))}}});var He={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};function k(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?Object(arguments[e]):{},i=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(o).filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable}))),i.forEach(function(a){Ue(t,a,o[a])})}return t}function Ue(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var I=function(e,o){var i=k({},e,o.attrs);return v(ye,k({},i,{icon:He}),null)};I.displayName="RightOutlined";I.inheritAttrs=!1;const te=J({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:Q(K(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:Object,setup(t,e){let{slots:o,attrs:i,emit:a}=e;const{prefixCls:l,rootPrefixCls:b,direction:n,getPopupContainer:u}=Z("dropdown",t),[f,h]=ee(l),y=x(()=>{const{placement:r="",transitionName:s}=t;return s!==void 0?s:r.includes("top")?`${b.value}-slide-down`:`${b.value}-slide-up`});_e({prefixCls:x(()=>`${l.value}-menu`),expandIcon:x(()=>v("span",{class:`${l.value}-menu-submenu-arrow`},[v(I,{class:`${l.value}-menu-submenu-arrow-icon`},null)])),mode:x(()=>"vertical"),selectable:x(()=>!1),onClick:()=>{},validator:r=>{let{mode:s}=r}});const p=()=>{var r,s,$;const P=t.overlay||((r=o.overlay)===null||r===void 0?void 0:r.call(o)),c=Array.isArray(P)?P[0]:P;if(!c)return null;const S=c.props||{};F(!S.mode||S.mode==="vertical","Dropdown",`mode="${S.mode}" is not supported for Dropdown's Menu.`);const{selectable:O=!1,expandIcon:_=($=(s=c.children)===null||s===void 0?void 0:s.expandIcon)===null||$===void 0?void 0:$.call(s)}=S,R=typeof _<"u"&&H(_)?_:v("span",{class:`${l.value}-menu-submenu-arrow`},[v(I,{class:`${l.value}-menu-submenu-arrow-icon`},null)]);return H(c)?G(c,{mode:"vertical",selectable:O,expandIcon:()=>R}):c},m=x(()=>{const r=t.placement;if(!r)return n.value==="rtl"?"bottomRight":"bottomLeft";if(r.includes("Center")){const s=r.slice(0,r.indexOf("Center"));return F(!r.includes("Center"),"Dropdown",`You are using '${r}' placement in Dropdown, which is deprecated. Try to use '${s}' instead.`),s}return r}),g=x(()=>typeof t.visible=="boolean"?t.visible:t.open),C=r=>{a("update:visible",r),a("visibleChange",r),a("update:open",r),a("openChange",r)};return()=>{var r,s;const{arrow:$,trigger:P,disabled:c,overlayClassName:S}=t,O=(r=o.default)===null||r===void 0?void 0:r.call(o)[0],_=G(O,d({class:L((s=O==null?void 0:O.props)===null||s===void 0?void 0:s.class,{[`${l.value}-rtl`]:n.value==="rtl"},`${l.value}-trigger`)},c?{disabled:c}:{})),R=L(S,h.value,{[`${l.value}-rtl`]:n.value==="rtl"}),D=c?[]:P;let B;D&&D.includes("contextmenu")&&(B=!0);const N=Te({arrowPointAtCenter:typeof $=="object"&&$.pointAtCenter,autoAdjustOverflow:!0}),T=Ae(d(d(d({},t),i),{visible:g.value,builtinPlacements:N,overlayClassName:R,arrow:!!$,alignPoint:B,prefixCls:l.value,getPopupContainer:u==null?void 0:u.value,transitionName:y.value,trigger:D,onVisibleChange:C,placement:m.value}),["overlay","onUpdate:visible"]);return f(v(Re,T,{default:()=>[_],overlay:p}))}}});te.Button=Xe;export{te as D,I as R,Xe as a,Ze as e,Je as u};
