import{Q as P,V as y,d as se,q as Ee,r as M,P as we,J as te,O as Y,a3 as ge,f as K,fp as De,R as ce,T as A,b as C,U as z,dg as Ce,be as Me,fq as je,N as ke,fr as _e,M as Le,dd as pe,k as Ve,da as Be,f7 as le,p as Ae,di as re,bC as Ie}from"./index-f4658ae7.js";var Se=function(){return{prefixCls:String,width:y.oneOfType([y.string,y.number]),height:y.oneOfType([y.string,y.number]),style:{type:Object,default:void 0},class:String,placement:{type:String},wrapperClassName:String,level:{type:[String,Array]},levelMove:{type:[Number,Function,Array]},duration:String,ease:String,showMask:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},afterVisibleChange:Function,keyboard:{type:Boolean,default:void 0},contentWrapperStyle:{type:Object,default:void 0},autofocus:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0}}},Fe=function(){return P(P({},Se()),{forceRender:{type:Boolean,default:void 0},getContainer:y.oneOfType([y.string,y.func,y.object,y.looseBool])})},He=function(){return P(P({},Se()),{getContainer:Function,getOpenCount:Function,scrollLocker:y.any,switchScrollingEffect:Function})};function ze(n){return Array.isArray(n)?n:[n]}var Oe={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},We=Object.keys(Oe).filter(function(n){if(typeof document=="undefined")return!1;var e=document.getElementsByTagName("html")[0];return n in(e?e.style:{})})[0],de=Oe[We];function fe(n,e,r,a){n.addEventListener?n.addEventListener(e,r,a):n.attachEvent&&n.attachEvent("on".concat(e),r)}function ve(n,e,r,a){n.removeEventListener?n.removeEventListener(e,r,a):n.attachEvent&&n.detachEvent("on".concat(e),r)}function Re(n,e){var r=typeof n=="function"?n(e):n;return Array.isArray(r)?r.length===2?r:[r[0],r[1]]:[r]}var he=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ie=!(typeof window!="undefined"&&window.document&&window.document.createElement),$e=function n(e,r,a,i){if(!r||r===document||r instanceof Document)return!1;if(r===e.parentNode)return!0;var T=Math.max(Math.abs(a),Math.abs(i))===Math.abs(i),N=Math.max(Math.abs(a),Math.abs(i))===Math.abs(a),x=r.scrollHeight-r.clientHeight,u=r.scrollWidth-r.clientWidth,v=document.defaultView.getComputedStyle(r),j=v.overflowY==="auto"||v.overflowY==="scroll",S=v.overflowX==="auto"||v.overflowX==="scroll",E=x&&j,D=u&&S;return T&&(!E||E&&(r.scrollTop>=x&&i<0||r.scrollTop<=0&&i>0))||N&&(!D||D&&(r.scrollLeft>=u&&a<0||r.scrollLeft<=0&&a>0))?n(e,r.parentNode,a,i):!1},Xe=globalThis&&globalThis.__rest||function(n,e){var r={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&e.indexOf(a)<0&&(r[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(n);i1||(T.startPos={x:t.touches[0].clientX,y:t.touches[0].clientY})},B=function(t){if(!(t.changedTouches.length>1)){var l=t.currentTarget,d=t.changedTouches[0].clientX-T.startPos.x,f=t.changedTouches[0].clientY-T.startPos.y;(l===v.value||l===j.value||l===S.value&&$e(l,t.target,d,f))&&t.cancelable&&t.preventDefault()}},$=function o(t){var l=t.target;ve(l,de,o),l.style.transition=""},U=function(t){a("close",t)},q=function(t){t.keyCode===Me.ESC&&(t.stopPropagation(),U(t))},ne=function(t){var l=e.open,d=e.afterVisibleChange;t.target===x.value&&t.propertyName.match(/transform$/)&&(u.value.style.transition="",!l&&g()&&(document.body.style.overflowX="",v.value&&(v.value.style.left="",v.value.style.width="")),d&&d(!!l))},Z=K(function(){var o=e.placement,t=o==="left"||o==="right",l="translate".concat(t?"X":"Y");return{isHorizontal:t,placementName:l}}),J=function(){var t=e.open,l=e.width,d=e.height,f=Z.value,m=f.isHorizontal,b=f.placementName,w=S.value?S.value.getBoundingClientRect()[m?"width":"height"]:0,O=(m?l:d)||w;ae(t,b,O)},Q=function(t,l,d,f){var m=e.placement,b=e.levelMove,w=e.duration,O=e.ease,V=e.showMask;E.forEach(function(R){R.style.transition="transform ".concat(w," ").concat(O),fe(R,de,$);var F=t?d:0;if(b){var G=Re(b,{target:R,open:t});F=t?G[0]:G[1]||0}var ee=typeof F=="number"?"".concat(F,"px"):F,H=m==="left"||m==="top"?ee:"-".concat(ee);H=V&&m==="right"&&f?"calc(".concat(H," + ").concat(f,"px)"):H,R.style.transform=F?"".concat(l,"(").concat(H,")"):""})},ae=function(t,l,d){if(!ie){var f=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?De(!0):0;Q(t,l,d,f),h(f)}a("change",t)},h=function(t){var l=e.getContainer,d=e.showMask,f=e.open,m=l==null?void 0:l();if(m&&m.parentNode===document.body&&d){var b=["touchstart"],w=[document.body,v.value,j.value,S.value];f&&document.body.style.overflow!=="hidden"?(t&&c(t),document.body.style.touchAction="none",w.forEach(function(O,V){O&&fe(O,b[V]||"touchmove",V?B:I,W)})):g()&&(document.body.style.touchAction="",t&&s(t),w.forEach(function(O,V){O&&ve(O,b[V]||"touchmove",V?B:I,W)}))}},c=function(t){var l=e.placement,d=e.duration,f=e.ease,m="width ".concat(d," ").concat(f),b="transform ".concat(d," ").concat(f);switch(u.value.style.transition="none",l){case"right":u.value.style.transform="translateX(-".concat(t,"px)");break;case"top":case"bottom":u.value.style.width="calc(100% - ".concat(t,"px)"),u.value.style.transform="translateZ(0)";break}clearTimeout(N),N=setTimeout(function(){u.value&&(u.value.style.transition="".concat(b,",").concat(m),u.value.style.width="",u.value.style.transform="")})},s=function(t){var l=e.placement,d=e.duration,f=e.ease;u.value.style.transition="none";var m,b="width ".concat(d," ").concat(f),w="transform ".concat(d," ").concat(f);switch(l){case"left":{u.value.style.width="100%",b="width 0s ".concat(f," ").concat(d);break}case"right":{u.value.style.transform="translateX(".concat(t,"px)"),u.value.style.width="100%",b="width 0s ".concat(f," ").concat(d),v.value&&(v.value.style.left="-".concat(t,"px"),v.value.style.width="calc(100% + ".concat(t,"px)"));break}case"top":case"bottom":{u.value.style.width="calc(100% + ".concat(t,"px)"),u.value.style.height="100%",u.value.style.transform="translateZ(0)",m="height 0s ".concat(f," ").concat(d);break}}clearTimeout(N),N=setTimeout(function(){u.value&&(u.value.style.transition="".concat(w,",").concat(m?"".concat(m,","):"").concat(b),u.value.style.transform="",u.value.style.width="",u.value.style.height="")})},g=function(){return!Object.keys(X).some(function(t){return X[t]})},k=function(t){var l=t.level,d=t.getContainer;if(!ie){var f=d==null?void 0:d(),m=f?f.parentNode:null;if(E=[],l==="all"){var b=m?Array.prototype.slice.call(m.children):[];b.forEach(function(w){w.nodeName!=="SCRIPT"&&w.nodeName!=="STYLE"&&w.nodeName!=="LINK"&&w!==f&&E.push(w)})}else l&&ze(l).forEach(function(w){document.querySelectorAll(w).forEach(function(O){E.push(O)})})}},p=function(t){a("handleClick",t)},L=M(!1);return Y(u,function(){te(function(){L.value=!0})}),function(){var o,t,l,d=e.width,f=e.height,m=e.open,b=e.prefixCls,w=e.placement;e.level,e.levelMove,e.ease,e.duration,e.getContainer,e.onChange,e.afterVisibleChange;var O=e.showMask,V=e.maskClosable,R=e.maskStyle,F=e.keyboard;e.getOpenCount,e.scrollLocker;var G=e.contentWrapperStyle,ee=e.style,H=e.class,Pe=Xe(e,["width","height","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","keyboard","getOpenCount","scrollLocker","contentWrapperStyle","style","class"]),oe=m&&L.value,Ne=ce(b,(o={},A(o,"".concat(b,"-").concat(w),!0),A(o,"".concat(b,"-open"),oe),A(o,H,!!H),A(o,"no-mask",!O),o)),Te=Z.value.placementName,xe=w==="left"||w==="top"?"-100%":"100%",ue=oe?"":"".concat(Te,"(").concat(xe,")");return C("div",z(z({},Ce(Pe,["switchScrollingEffect","autofocus"])),{},{tabindex:-1,class:Ne,style:ee,ref:u,onKeydown:oe&&F?q:void 0,onTransitionend:ne}),[O&&C("div",{class:"".concat(b,"-mask"),onClick:V?U:void 0,style:R,ref:v},null),C("div",{class:"".concat(b,"-content-wrapper"),style:P({transform:ue,msTransform:ue,width:he(d)?"".concat(d,"px"):d,height:he(f)?"".concat(f,"px"):f},G),ref:x},[C("div",{class:"".concat(b,"-content"),ref:S},[(t=i.default)===null||t===void 0?void 0:t.call(i)]),i.handler?C("div",{onClick:p,ref:j},[(l=i.handler)===null||l===void 0?void 0:l.call(i)]):null])])}}});const ye=Ye;var me=globalThis&&globalThis.__rest||function(n,e){var r={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&e.indexOf(a)<0&&(r[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(n);i