import{a0 as e,ai as n,P as t,I as r,k as o}from"./DE-SIukw.js";import{l as s}from"./CFYXg6N-.js";import{F as i}from"./6Np5euiX.js";var a=t=>{const{present:r,children:o}=t,i=function(n){const[t,r]=e.useState(),o=e.useRef(null),i=e.useRef(n),a=e.useRef("none"),u=n?"mounted":"unmounted",[l,m]=function(n,t){return e.useReducer((e,n)=>t[e][n]??e,n)}(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=c(o.current);a.current="mounted"===l?e:"none"},[l]),s(()=>{const e=o.current,t=i.current;if(t!==n){const r=a.current,o=c(e);m(n?"MOUNT":"none"===o||"none"===e?.display?"UNMOUNT":t&&r!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=n}},[n,m]),s(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const s=c(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&s&&(m("ANIMATION_END"),!i.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=c(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(r),a="function"==typeof o?o({present:i.isPresent}):e.Children.only(o),u=n(i.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof o||i.isPresent?e.cloneElement(a,{ref:u}):null};function c(e){return e?.animationName||"none"}a.displayName="Presence";const u=({iconProps:e,link:n,action:s,children:a,className:c})=>t.jsxs(i,{direction:"row",className:o(c,"items-center justify-between group text-md"),children:[t.jsxs(i,{direction:"right"===e?.iconPosition?"row-reverse":"row",className:o("items-center !gap-2"),children:[e&&t.jsx(r,{icon:e.icon,className:o(e.iconClass,"circle"===e.icon&&"h-3 w-3","warning"===e.iconColor&&"text-rsp-warning","success"===e.iconColor&&"text-rsp-success","error"===e.iconColor&&"text-rsp-error","simplybook"===e.iconColor&&"text-simplybook","rsssl"===e.iconColor&&"text-rss","cmplz"===e.iconColor&&"text-complianz")}),n?t.jsx("a",{href:n,target:"_blank",className:o(c,"text-md"),children:a}):t.jsx("div",{className:o(c,"text-md"),children:a})]}),s&&s]});export{u as L,a as P};
