import{D as r}from"./index.CPcBO1Os.js";function f(t,s,i,c){for(var o=t.length,e=i+-1;++e<o;)if(s(t[e],e,t))return e;return-1}const h=t=>({[t.componentCls]:{["".concat(t.antCls,"-motion-collapse-legacy")]:{overflow:"hidden","&-active":{transition:"height ".concat(t.motionDurationMid," ").concat(t.motionEaseInOut,",\n        opacity ").concat(t.motionDurationMid," ").concat(t.motionEaseInOut," !important")}},["".concat(t.antCls,"-motion-collapse")]:{overflow:"hidden",transition:"height ".concat(t.motionDurationMid," ").concat(t.motionEaseInOut,",\n        opacity ").concat(t.motionDurationMid," ").concat(t.motionEaseInOut," !important")}}});function n(t,s){if(t.classList)return t.classList.contains(s);const i=t.className;return" ".concat(i," ").indexOf(" ".concat(s," "))>-1}function a(t,s){t.classList?t.classList.add(s):n(t,s)||(t.className="".concat(t.className," ").concat(s))}function l(t,s){if(t.classList)t.classList.remove(s);else if(n(t,s)){const i=t.className;t.className=" ".concat(i," ").replace(" ".concat(s," ")," ")}}const m=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"ant-motion-collapse",s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{name:t,appear:s,css:!0,onBeforeEnter:i=>{i.style.height="0px",i.style.opacity="0",a(i,t)},onEnter:i=>{r(()=>{i.style.height="".concat(i.scrollHeight,"px"),i.style.opacity="1"})},onAfterEnter:i=>{i&&(l(i,t),i.style.height=null,i.style.opacity=null)},onBeforeLeave:i=>{a(i,t),i.style.height="".concat(i.offsetHeight,"px"),i.style.opacity=null},onLeave:i=>{setTimeout(()=>{i.style.height="0px",i.style.opacity="0"})},onAfterLeave:i=>{i&&(l(i,t),i.style&&(i.style.height=null,i.style.opacity=null))}}};export{a,f as b,m as c,h as g,l as r};
