@radui/ui 0.0.43 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var pe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),me="undefined"==typeof Element,ve=me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ge=!me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},he=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ye=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!he(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{ve.call(l,pe)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!he(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},we=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},be=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!we(e)?0:e.tabIndex},xe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return"INPUT"===e.tagName},Re=function(e){return function(e){return Ee(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ge(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Le=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ve.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ve.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ce(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=ge(e);if(l&&!l.shadowRoot&&!0===r(l))return Ce(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&ge(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=ge(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Se=function(e,t){return!(t.disabled||he(t)||function(e){return Ee(e)&&"hidden"===e.type}(t)||Le(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ve.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Oe=function(e,t){return!(Re(t)||be(t)<0||!Se(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ae=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=be(e);return n<0&&t&&!we(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(xe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Pe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ye([e],t.includeContainer,{filter:Oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):function(e,t,n){if(he(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pe));return t&&ve.call(e,pe)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Oe.bind(null,t)),Ae(n)};function ke(e,t,n){let{reference:r,floating:o}=e;const i=ue(t),l=ce(t),u=le(l),c=re(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(oe(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function Me(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ne(t,e),m=fe(p),v=u[d?"floating"===f?"reference":"floating":f],g=de(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=de(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function De(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ne(e){return $.some((t=>e[t]>=0))}function Fe(e){const t=A(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=G(n)!==i||G(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Ie(e){return b(e)?e:e.contextElement}function We(e){const t=Ie(e);if(!x(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Fe(t);let l=(i?G(n.width):n.width)/r,u=(i?G(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const He=Q(0);function je(e){const t=h(e);return O()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:He}function Be(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ie(e);let l=Q(1);t&&(r?b(r)&&(l=We(r)):l=We(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==h(e))&&t}(i,n,r)?je(i):Q(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=h(i),t=r&&b(r)?h(r):r;let n=e,o=N(n);for(;o&&r&&t!==n;){const e=We(o),t=o.getBoundingClientRect(),r=A(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=h(o),o=N(n)}}return de({width:a,height:f,x:c,y:s})}function Ve(e,t){const n=P(e).scrollLeft;return t?t.left+n:Be(y(e)).left+n}function _e(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ve(e,r)),y:r.top+t.scrollTop}}function qe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=h(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=O();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=P(e),r=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ve(e);const u=-n.scrollTop;return"rtl"===A(r).direction&&(l+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(y(e));else if(b(t))r=function(e,t){const n=Be(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?We(e):Q(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=je(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return de(r)}function Ke(e,t){const n=k(e);return!(n===t||!b(n)||T(n))&&("fixed"===A(n).position||Ke(n,t))}function Xe(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=Be(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Q(0);if(r||!r&&!i)if(("body"!==g(t)||R(o))&&(u=P(t)),r){const e=Be(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Ve(o));const s=!o||r||i?Q(0):_e(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function Ue(e){return"static"===A(e).position}function Ye(e,t){if(!x(e)||"fixed"===A(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function $e(e,t){const n=h(e);if(L(e))return n;if(!x(e)){let t=k(e);for(;t&&!T(t);){if(b(t)&&!Ue(t))return t;t=k(t)}return n}let r=Ye(e,t);for(;r&&C(r)&&Ue(r);)r=Ye(r,t);return r&&T(r)&&Ue(r)&&!S(r)?n:r||function(e){let t=k(e);for(;x(t)&&!T(t);){if(S(t))return t;if(L(t))return null;t=k(t)}return null}(e)||n}const ze={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),u=!!t&&L(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=Q(1);const a=Q(0),f=x(r);if((f||!f&&!i)&&(("body"!==g(r)||R(l))&&(c=P(r)),x(r))){const e=Be(r);s=We(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?Q(0):_e(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?L(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=D(e,[],!1).filter((e=>b(e)&&"body"!==g(e))),o=null;const i="fixed"===A(e).position;let l=i?k(e):e;for(;b(l)&&!T(l);){const t=A(l),n=S(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&Ke(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=qe(t,n,o);return e.top=Z(r.top,e.top),e.right=z(r.right,e.right),e.bottom=z(r.bottom,e.bottom),e.left=Z(r.left,e.left),e}),qe(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:$e,getElementRects:async function(e){const t=this.getOffsetParent||$e,n=this.getDimensions,r=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Fe(e);return{width:t,height:n}},getScale:We,isElement:b,isRTL:function(e){return"rtl"===A(e).direction}},Ze=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=re(n),u=oe(n),c="y"===ue(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=ne(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ge=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ne(e,t),s={x:n,y:r},a=await Me(t,c),f=ue(re(o)),d=ie(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=te(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=te(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Qe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=ne(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=re(o),y=ue(u),w=re(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[ae(u)]:function(e){const t=ae(e);return[se(e),t,se(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=oe(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(re(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(se)))),i}(u,v,m,b));const R=[u,...x],C=await Me(t,g),L=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&L.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=oe(e),o=ce(e),i=le(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ae(l)),[l,ae(l)]}(o,l,b);L.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:L}],!L.every((e=>e<=0))){var O,T;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(T=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=S.filter((e=>{if(E){const t=ue(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Je=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ne(e,t);switch(r){case"referenceHidden":{const e=De(await Me(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ne(e)}}}case"escaped":{const e=De(await Me(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ne(e)}}}default:return{}}}}},et=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=ne(e,t)||{};if(null==s)return{};const f=fe(a),d={x:n,y:r},p=ce(o),m=le(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,L=R/2-v[m]/2-1,S=z(f[h],L),O=z(f[y],L),T=S,A=R-v[m]-O,P=R/2-v[m]/2+C,k=te(T,P,A),M=!c.arrow&&null!=oe(o)&&P!==k&&i.reference[m]/2-(P<T?S:O)-v[m]/2<0,D=M?P<T?P-T:P-A:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:P-k-D,...M&&{alignmentOffset:D}},reset:M}}}),tt=(e,t,n)=>{const r=new Map,o={platform:ze,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=ke(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ke(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var nt="undefined"!=typeof document?r:o;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!rt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!rt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){const n=ot(e);return Math.round(t*n)/n}function lt(t){const n=e.useRef(t);return nt((()=>{n.current=t})),n}const ut=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?et({element:n.current,padding:r}).fn(t):{}:n?et({element:n,padding:r}).fn(t):{};var o}});function ct(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const st={...e},at=st.useInsertionEffect||(e=>e());function ft(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return at((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var dt="undefined"!=typeof document?r:o;let pt=!1,mt=0;const vt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+mt++;const gt=st.useId||function(){const[t,n]=e.useState((()=>pt?vt():void 0));return dt((()=>{null==t&&n(vt())}),[]),e.useEffect((()=>{pt=!0}),[]),t};let ht;"production"!==process.env.NODE_ENV&&(ht=new Set);const yt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ht)&&e.has(o)||(null==(i=ht)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=gt(),[b,x]=e.useState(!1);if(dt((()=>{if(!o)return;"rtl"===A(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let L=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(L=null);const S=2*d,O=S/2,T=u/2*(f/-8+1),P=a/2*f/4,k=!!v,M=L&&"end"===R?"bottom":"top";let D=L&&"end"===R?"right":"left";L&&b&&(D="end"===R?"left":"right");const N=null!=(null==i?void 0:i.x)?L||i.x:"",F=null!=(null==i?void 0:i.y)?L||i.y:"",I=v||"M0,0 H"+u+" L"+(u-T)+","+(a-P)+" Q"+u/2+","+a+" "+T+","+(a-P)+" Z",W={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return c("svg",{...y,"aria-hidden":!0,ref:n,width:k?u:u+S,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[D]:N,[M]:F,[E]:C||k?"100%":"calc(100% - "+S/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[S>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:S+(v?0:1),d:I}),s("path",{stroke:S&&!v?y.fill:"none",d:I}),s("clipPath",{id:w,children:s("rect",{x:-O,y:O*(k?-1:1),width:u+S,height:u})})]})}));const wt=e.createContext(null),bt=e.createContext(null),xt=()=>{var t;return(null==(t=e.useContext(wt))?void 0:t.id)||null},Et=()=>e.useContext(bt);function Rt(e){return"data-floating-ui-"+e}function Ct(e){const t=i(e);return dt((()=>{t.current=e})),t}const Lt=Rt("safe-polygon");function St(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Ot=0;function Tt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ot);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ot=requestAnimationFrame(i)}function At(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Pt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let kt=new WeakMap,Mt=new WeakSet,Dt={},Nt=0;const Ft=e=>e&&(e.host||Ft(e.parentNode));function It(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=Ft(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];Dt[o]||(Dt[o]=new WeakMap);const f=Dt[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==g(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=kt.get(t)||0,l=i?r+1:r,u=(f.get(t)||0)+1;kt.set(t,l),f.set(t,u),a.push(t),1===l&&n&&Mt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Nt++,()=>{a.forEach((e=>{const t=kt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;kt.set(e,n),f.set(e,r),n||(!Mt.has(e)&&i&&e.removeAttribute(i),Mt.delete(e)),r||e.removeAttribute(o)})),Nt--,Nt||(kt=new WeakMap,kt=new WeakMap,Mt=new WeakSet,Dt={})}}function Wt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=q(e[0]).body;return It(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ht=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jt(e,t){const n=Pe(e,Ht());"prev"===t&&n.reverse();const r=n.indexOf(F(q(e)));return n.slice(r+1)[0]}function Bt(){return jt(document.body,"next")}function Vt(){return jt(document.body,"prev")}function _t(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!I(n,r)}function qt(e){Pe(e,Ht()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Kt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Xt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ut(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Yt=e.forwardRef((function(t,n){const[r,o]=e.useState();dt((()=>(B()&&o("button"),document.addEventListener("keydown",Ut),()=>{document.removeEventListener("keydown",Ut)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Rt("focus-guard")]:"",style:Xt};return s("span",{...t,...i})})),$t=e.createContext(null),zt=Rt("portal");const Zt=()=>e.useContext($t),Gt="data-floating-ui-focusable";function Qt(e){return e?e.hasAttribute(Gt)?e:e.querySelector("["+Gt+"]")||e:null}let Jt=[];function en(e){Jt=Jt.filter((e=>e.isConnected)),e&&"body"!==g(e)&&(Jt.push(e),Jt.length>20&&(Jt=Jt.slice(-20)))}function tn(){return Jt.slice().reverse().find((e=>e.isConnected))}function nn(e){const t=Ht();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ve.call(e,pe)&&Oe(t,e)}(e,t)?e:Pe(e,t)[0]||e}const rn=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:Xt})}));let on=0;let ln=()=>{};const un=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return dt((()=>{if(n)return on++,1===on&&(ln=function(){const e=/iP(hone|ad|od)|iOS/.test(W()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{on--,0===on&&ln()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),cn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},an=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function fn(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=gt(),l=e.useRef({}),[u]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),c=null!=xt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ht)&&e.has(o)||(null==(i=ht)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=ft(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const dn="active",pn="selected";function mn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[pn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Gt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[dn,pn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var gn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=gt(),i=Zt(),[l,u]=e.useState(null),c=e.useRef(null);return dt((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),dt((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(zt,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),dt((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(zt,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),g=null==u?void 0:u.modal,h=null==u?void 0:u.open,y=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!g)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&_t(e)){("focusin"===e.type?Kt:qt)(l)}}}),[l,i,g]),e.useEffect((()=>{l&&(h||Kt(l))}),[h,l]),c($t.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:a})),[i,l]),children:[y&&l&&s(Yt,{"data-type":"outside",ref:d,onFocus:e=>{if(_t(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Vt()||(null==u?void 0:u.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:Xt}),l&&f.createPortal(n,l),y&&l&&s(Yt,{"data-type":"outside",ref:p,onFocus:e=>{if(_t(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Bt()||(null==u?void 0:u.domReference);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:un,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:g=!1}=t,{open:h,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:R}}=n,C=ft((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),L="number"==typeof u&&u<0,S=!!(O=E)&&"combobox"===O.getAttribute("role")&&U(O)&&L;var O;const T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,A=!T||l,P=!A||T&&g,k=Ct(i),M=Ct(u),D=Ct(f),N=Et(),W=Zt(),H=e.useRef(null),B=e.useRef(null),_=e.useRef(!1),K=e.useRef(!1),$=e.useRef(-1),z=null!=W,Z=Qt(R),G=ft((function(e){return void 0===e&&(e=Z),e?Pe(e,Ht()):[]})),Q=ft((e=>{const t=G(e);return k.current.map((e=>E&&"reference"===e?E:Z&&"floating"===e?Z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){I(Z,F(q(Z)))&&0===G().length&&!S&&Y(e);const t=Q(),n=X(e);"reference"===k.current[0]&&n===E&&(Y(e),e.shiftKey?Tt(t[t.length-1]):Tt(t[1])),"floating"===k.current[1]&&n===Z&&e.shiftKey&&(Y(e),Tt(t[0]))}}const t=q(Z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,Z,p,k,S,G,Q]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=X(e),n=G().indexOf(t);-1!==n&&($.current=n)}}),[o,R,G]),e.useEffect((()=>{if(!o&&v)return R&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=C(),r=!(I(E,t)||I(R,t)||I(t,R)||I(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Rt("focus-guard"))||N&&(Pt(N.nodesRef.current,n).find((e=>{var n,r;return I(null==(n=e.context)?void 0:n.elements.floating,t)||I(null==(r=e.context)?void 0:r.elements.domReference,t)}))||At(N.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Qt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&F(q(Z))===q(Z).body){x(Z)&&Z.focus();const e=$.current,t=G(),n=t[e]||t[t.length-1]||Z;x(n)&&n.focus()}!S&&p||!t||!r||K.current||t===tn()||(_.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,R,Z,p,N,W,y,v,d,G,S,C]);const J=e.useRef(null),ee=e.useRef(null),te=ct([J,null==W?void 0:W.beforeInsideRef]),ne=ct([ee,null==W?void 0:W.afterInsideRef]);function re(e){return!o&&m&&p?s(rn,{ref:"start"===e?H:B,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Rt("portal")+"]"))||[]),n=N&&!p?At(null==N?void 0:N.nodesRef.current,C()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,H.current,B.current,J.current,ee.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,k.current.includes("reference")||S?E:null].filter((e=>null!=e)),i=p||S?Wt(r,!P,P):Wt(r);return()=>{i()}}),[o,E,R,p,k,W,S,A,P,N,C]),dt((()=>{if(o||!x(Z))return;const e=F(q(Z));queueMicrotask((()=>{const t=Q(Z),n=M.current,r=("number"==typeof n?t[n]:n.current)||Z,o=I(Z,e);L||o||!h||Tt(r,{preventScroll:r===Z})}))}),[o,h,Z,L,Q,M]),dt((()=>{if(o||!Z)return;let e=!1;const t=q(Z),n=F(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&E&&en(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(_.current=!0),"outside-press"===o&&(l?(_.current=!1,e=!0):_.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(V()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||j(i)))}en(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Xt),z&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=F(t),o=I(R,n)||N&&Pt(N.nodesRef.current,C()).some((e=>{var t;return I(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&en(E);const u="boolean"==typeof D.current?tn()||l:D.current.current||l;queueMicrotask((()=>{const r=nn(u);D.current&&!_.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,Z,D,b,w,N,z,E,C]),e.useEffect((()=>{queueMicrotask((()=>{_.current=!1}))}),[o]),dt((()=>{if(!o&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:v,open:h,onOpenChange:y,domReference:E}),()=>{W.setFocusManagerState(null)}}),[o,W,p,h,y,v,E]),dt((()=>{if(o)return;if(!Z)return;if("function"!=typeof MutationObserver)return;if(L)return;const e=()=>{const e=Z.getAttribute("tabindex"),t=G(),n=F(q(R)),r=t.indexOf(n);-1!==r&&($.current=r),k.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&Z.setAttribute("tabindex","0"):"-1"!==e&&Z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,Z,E,k,G,L]);const oe=!o&&A&&(!p||!S)&&(z||p);return c(a,{children:[oe&&s(Yt,{"data-type":"inside",ref:te,onFocus:e=>{if(p){const e=Q();Tt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(_.current=!1,_t(e,W.portalNode)){const e=Bt()||E;null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!S&&re("start"),r,re("end"),oe&&s(Yt,{"data-type":"inside",ref:ne,onFocus:e=>{if(p)Tt(Q()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(v&&(_.current=!0),_t(e,W.portalNode)){const e=Vt()||E;null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=fn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[c,s]=e.useState(null),a=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=Et();dt((()=>{a&&(d.current=a)}),[a]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:c=!0,whileElementsMounted:s,open:a}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);rt(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),L=e.useRef(null),S=e.useRef(d),O=null!=s,T=lt(s),A=lt(i),P=lt(a),k=e.useCallback((()=>{if(!C.current||!L.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),tt(C.current,L.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!rt(S.current,t)&&(S.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);nt((()=>{!1===a&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const M=e.useRef(!1);nt((()=>(M.current=!0,()=>{M.current=!1})),[]),nt((()=>{if(E&&(C.current=E),R&&(L.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,O]);const D=e.useMemo((()=>({reference:C,floating:L,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=it(N.floating,d.x),n=it(N.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ot(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:F})),[d,k,D,N,F])}({...t,elements:{...i,...c&&{reference:c}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,u(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),h=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),y=e.useMemo((()=>({...m.elements,domReference:a})),[m.elements,a]),w=e.useMemo((()=>({...m,...o,refs:h,elements:y,nodeId:n})),[m,h,y,n,o]);return dt((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:h,elements:y})),[m,h,y,w])},Arrow:yt,arrow:(e,t)=>({...ut(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=vn.get(u))?r:u,s=gt(),a=null!=xt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useFocus:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:l,elements:u}=t,{enabled:c=!0,visibleOnly:s=!0}=n,a=e.useRef(!1),f=e.useRef(),d=e.useRef(!0);e.useEffect((()=>{if(!c)return;const e=h(u.domReference);function t(){!r&&x(u.domReference)&&u.domReference===F(q(u.domReference))&&(a.current=!0)}function n(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",n,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",n,!0)}}),[u.domReference,r,c]),e.useEffect((()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[i,c]),e.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const p=e.useMemo((()=>({onPointerDown(e){j(e.nativeEvent)||(d.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=X(e.nativeEvent);if(s&&b(t))try{if(B()&&W().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!U(t))return}o(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=b(t)&&t.hasAttribute(Rt("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const i=F(u.domReference?u.domReference.ownerDocument:document);(t||i!==u.domReference)&&(I(null==(e=l.current.floatingContext)?void 0:e.refs.floating.current,i)||I(u.domReference,i)||r||o(!1,n,"focus"))}))}})),[l,u.domReference,o,s]);return e.useMemo((()=>c?{reference:p}:{}),[c,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>mn(e,t,"reference")),n),l=e.useCallback((e=>mn(e,t,"floating")),r),u=e.useCallback((e=>mn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=Et(),h=ft("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=an(m),{escapeKey:L,outsidePress:S}=an(v),P=e.useRef(!1),M=ft((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?Pt(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),N=ft((e=>{var t;const n=()=>{var t;M(e),null==(t=X(e))||t.removeEventListener("keydown",n)};null==(t=X(e))||t.addEventListener("keydown",n)})),F=ft((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const u=X(e),c="["+Rt("inert")+"]",s=q(i.floating).querySelectorAll(c);let f=b(u)?u:null;for(;f&&!T(f);){const e=k(f);if(T(e)||!b(e))break;f=e}if(s.length&&b(u)&&!u.matches("html,body")&&!I(u,i.floating)&&Array.from(s).every((e=>!I(f,e))))return;if(x(u)&&j){const t=T(u),n=A(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&Pt(g.nodesRef.current,d).some((t=>{var n;return K(e,null==(n=t.context)?void 0:n.elements.floating)}));if(K(e,i.floating)||K(e,i.domReference)||p)return;const m=g?Pt(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ft((e=>{var t;const n=()=>{var t;F(e),null==(t=X(e))||t.removeEventListener(a,n)};null==(t=X(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout((()=>{P.current=!1}),O()?5:0)}const f=q(i.floating);c&&(f.addEventListener("keydown",L?N:M,L),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,S?W:F,S);let d=[];return p&&(b(i.domReference)&&(d=D(i.domReference)),b(i.floating)&&(d=d.concat(D(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(D(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",L?N:M,L),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,S?W:F,S),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,y,a,r,o,p,u,R,C,M,L,N,F,S,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const H=e.useMemo((()=>({onKeyDown:M,...f&&{[cn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[M,o,f,d]),j=e.useMemo((()=>({onKeyDown:M,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[sn[a]]:()=>{w.current=!0}})),[M,a]);return e.useMemo((()=>u?{reference:H,floating:j}:{}),[u,H,j])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=Et(),v=xt(),g=Ct(a),h=Ct(s),y=Ct(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),L=e.useRef(!1),S=e.useRef((()=>{})),O=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=q(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=St(h.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[h,o]),P=ft((()=>{S.current(),E.current=void 0})),k=ft((()=>{if(L.current){const e=q(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Lt),L.current=!1}})),M=ft((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&b(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!_(w.current)||d>0&&!St(h.current,"open"))return;const t=St(h.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;S.current();const t=q(u.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!I(u.floating,e.relatedTarget))&&A(e)}function l(e){M()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,y,m,h,g,i,M]),dt((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){L.current=!0;const e=u.floating;if(b(u.domReference)&&e){var t;const n=q(u.floating).body;n.setAttribute(Lt,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),dt((()=>{r||(w.current=void 0,O.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const D=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!_(w.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),N=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){M()||A(e.nativeEvent,!1)}})),[A,M]);return e.useMemo((()=>c?{reference:D,floating:N}:{}),[c,D,N])},flip:(e,t)=>({...Qe(e),options:[e,t]}),shift:(e,t)=>({...Ge(e),options:[e,t]}),hide:(e,t)=>({...Je(e),options:[e,t]}),offset:(e,t)=>({...Ze(e),options:[e,t]}),useMergeRefs:ct},hn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)};function yn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yn(e))&&(r&&(r+=" "),r+=t);return r}var bn="HoverCard",xn=["div","span","button","input","a","img","p","h2"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=p(n,["asChild","children"]);if(i){var c=t.Children.toArray(l);if(1!==c.length||!t.isValidElement(c[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,d(d({},u),{ref:r}),l);var s=c[0];return t.cloneElement(s,d(d(d({},u),s.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=s.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,d(d({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),En=function(){return console.warn("Direct usage of HoverCard is not supported. Please use HoverCard.Root, HoverCard.Trigger, etc. instead."),null};En.Root=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,s=void 0===c?"":c,a=e.openDelay,f=void 0===a?100:a,v=e.closeDelay,g=void 0===v?200:v,h=p(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=hn(s,bn),w=hn(s,"".concat(bn,"-trigger")),b=i(null),x=gn.useFloating({placement:"bottom",strategy:"fixed",middleware:[gn.arrow({element:b}),gn.offset(10),gn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,L=l(!1),S=L[0],O=L[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:S,M=function(e){P||O(e),null==u||u(e)},D=gn.useRole(C),N=gn.useDismiss(C),F=gn.useHover(C,{delay:100}),I=gn.useInteractions([F,D,N]),W=I.getReferenceProps,H=I.getFloatingProps,j={isOpen:k,handleOpenChange:M,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:H,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&M(!1),e}))}),g)},closeWithoutDelay:function(){M(!1)},openWithDelay:function(){A(!1),setTimeout((function(){M(!0)}),f)}};return t.createElement(m.Provider,{value:j},t.createElement("div",d({className:wn(y)},h),n))},En.Trigger=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=p(e,["children","className"]),l=u(m),c=l.floatingRefs,s=l.closeWithDelay,a=l.openWithDelay,f=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(xn.span,d({className:wn(f,o),onClick:function(){},onMouseEnter:a,onMouseLeave:s,ref:c.setReference},i),n))},En.Portal=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=p(e,["children","rootElement"]),l=u(m).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(gn.Portal,d({root:c},i),n)},En.Content=function(e){var n=e.children,r=p(e,["children"]),i=u(m),l=i.isOpen,c=i.floatingRefs,s=i.floatingStyles,a=i.getFloatingProps,f=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",d({onPointerEnter:h,onPointerLeave:v,className:wn(f)},r,{ref:c.setFloating,style:s},a()),n):null},En.Arrow=function(e){var n=p(e,[]),r=u(m),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(gn.Arrow,d({className:wn("".concat(l,"-arrow"))},n,{context:o,ref:i}))};export{En as default};
5
+ */var pe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),me="undefined"==typeof Element,ve=me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ge=!me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},he=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ye=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!he(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{ve.call(l,pe)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!he(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},we=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},be=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!we(e)?0:e.tabIndex},xe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ee=function(e){return"INPUT"===e.tagName},Re=function(e){return function(e){return Ee(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ge(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Le=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ve.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ve.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ce(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=ge(e);if(l&&!l.shadowRoot&&!0===r(l))return Ce(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&ge(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=ge(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Se=function(e,t){return!(t.disabled||he(t)||function(e){return Ee(e)&&"hidden"===e.type}(t)||Le(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ve.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Oe=function(e,t){return!(Re(t)||be(t)<0||!Se(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ae=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=be(e);return n<0&&t&&!we(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(xe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Pe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ye([e],t.includeContainer,{filter:Oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):function(e,t,n){if(he(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pe));return t&&ve.call(e,pe)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Oe.bind(null,t)),Ae(n)};function ke(e,t,n){let{reference:r,floating:o}=e;const i=ue(t),l=ce(t),u=le(l),c=re(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(oe(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function Me(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ne(t,e),m=fe(p),v=u[d?"floating"===f?"reference":"floating":f],g=de(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=de(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function De(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ne(e){return $.some((t=>e[t]>=0))}function Fe(e){const t=A(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=G(n)!==i||G(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Ie(e){return b(e)?e:e.contextElement}function We(e){const t=Ie(e);if(!x(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Fe(t);let l=(i?G(n.width):n.width)/r,u=(i?G(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const He=Q(0);function je(e){const t=h(e);return O()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:He}function Be(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ie(e);let l=Q(1);t&&(r?b(r)&&(l=We(r)):l=We(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==h(e))&&t}(i,n,r)?je(i):Q(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=h(i),t=r&&b(r)?h(r):r;let n=e,o=N(n);for(;o&&r&&t!==n;){const e=We(o),t=o.getBoundingClientRect(),r=A(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=h(o),o=N(n)}}return de({width:a,height:f,x:c,y:s})}function Ve(e,t){const n=P(e).scrollLeft;return t?t.left+n:Be(y(e)).left+n}function _e(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ve(e,r)),y:r.top+t.scrollTop}}function qe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=h(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=O();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=P(e),r=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ve(e);const u=-n.scrollTop;return"rtl"===A(r).direction&&(l+=Z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(y(e));else if(b(t))r=function(e,t){const n=Be(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?We(e):Q(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=je(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return de(r)}function Ke(e,t){const n=k(e);return!(n===t||!b(n)||T(n))&&("fixed"===A(n).position||Ke(n,t))}function Xe(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=Be(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=Q(0);if(r||!r&&!i)if(("body"!==g(t)||R(o))&&(u=P(t)),r){const e=Be(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Ve(o));const s=!o||r||i?Q(0):_e(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function Ue(e){return"static"===A(e).position}function Ye(e,t){if(!x(e)||"fixed"===A(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function $e(e,t){const n=h(e);if(L(e))return n;if(!x(e)){let t=k(e);for(;t&&!T(t);){if(b(t)&&!Ue(t))return t;t=k(t)}return n}let r=Ye(e,t);for(;r&&C(r)&&Ue(r);)r=Ye(r,t);return r&&T(r)&&Ue(r)&&!S(r)?n:r||function(e){let t=k(e);for(;x(t)&&!T(t);){if(S(t))return t;if(L(t))return null;t=k(t)}return null}(e)||n}const ze={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),u=!!t&&L(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=Q(1);const a=Q(0),f=x(r);if((f||!f&&!i)&&(("body"!==g(r)||R(l))&&(c=P(r)),x(r))){const e=Be(r);s=We(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?Q(0):_e(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?L(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=D(e,[],!1).filter((e=>b(e)&&"body"!==g(e))),o=null;const i="fixed"===A(e).position;let l=i?k(e):e;for(;b(l)&&!T(l);){const t=A(l),n=S(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&Ke(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=qe(t,n,o);return e.top=Z(r.top,e.top),e.right=z(r.right,e.right),e.bottom=z(r.bottom,e.bottom),e.left=Z(r.left,e.left),e}),qe(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:$e,getElementRects:async function(e){const t=this.getOffsetParent||$e,n=this.getDimensions,r=await n(e.floating);return{reference:Xe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Fe(e);return{width:t,height:n}},getScale:We,isElement:b,isRTL:function(e){return"rtl"===A(e).direction}},Ze=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=re(n),u=oe(n),c="y"===ue(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=ne(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ge=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ne(e,t),s={x:n,y:r},a=await Me(t,c),f=ue(re(o)),d=ie(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=te(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=te(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Qe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=ne(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=re(o),y=ue(u),w=re(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[ae(u)]:function(e){const t=ae(e);return[se(e),t,se(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=oe(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(re(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(se)))),i}(u,v,m,b));const R=[u,...x],C=await Me(t,g),L=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&L.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=oe(e),o=ce(e),i=le(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ae(l)),[l,ae(l)]}(o,l,b);L.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:L}],!L.every((e=>e<=0))){var O,T;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(T=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=S.filter((e=>{if(E){const t=ue(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Je=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ne(e,t);switch(r){case"referenceHidden":{const e=De(await Me(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ne(e)}}}case"escaped":{const e=De(await Me(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ne(e)}}}default:return{}}}}},et=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=ne(e,t)||{};if(null==s)return{};const f=fe(a),d={x:n,y:r},p=ce(o),m=le(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,L=R/2-v[m]/2-1,S=z(f[h],L),O=z(f[y],L),T=S,A=R-v[m]-O,P=R/2-v[m]/2+C,k=te(T,P,A),M=!c.arrow&&null!=oe(o)&&P!==k&&i.reference[m]/2-(P<T?S:O)-v[m]/2<0,D=M?P<T?P-T:P-A:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:P-k-D,...M&&{alignmentOffset:D}},reset:M}}}),tt=(e,t,n)=>{const r=new Map,o={platform:ze,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=ke(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ke(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var nt="undefined"!=typeof document?r:o;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!rt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!rt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function it(e,t){const n=ot(e);return Math.round(t*n)/n}function lt(t){const n=e.useRef(t);return nt((()=>{n.current=t})),n}const ut=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?et({element:n.current,padding:r}).fn(t):{}:n?et({element:n,padding:r}).fn(t):{};var o}});function ct(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const st={...e},at=st.useInsertionEffect||(e=>e());function ft(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return at((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var dt="undefined"!=typeof document?r:o;let pt=!1,mt=0;const vt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+mt++;const gt=st.useId||function(){const[t,n]=e.useState((()=>pt?vt():void 0));return dt((()=>{null==t&&n(vt())}),[]),e.useEffect((()=>{pt=!0}),[]),t};let ht;"production"!==process.env.NODE_ENV&&(ht=new Set);const yt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ht)&&e.has(o)||(null==(i=ht)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=gt(),[b,x]=e.useState(!1);if(dt((()=>{if(!o)return;"rtl"===A(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let L=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(L=null);const S=2*d,O=S/2,T=u/2*(f/-8+1),P=a/2*f/4,k=!!v,M=L&&"end"===R?"bottom":"top";let D=L&&"end"===R?"right":"left";L&&b&&(D="end"===R?"left":"right");const N=null!=(null==i?void 0:i.x)?L||i.x:"",F=null!=(null==i?void 0:i.y)?L||i.y:"",I=v||"M0,0 H"+u+" L"+(u-T)+","+(a-P)+" Q"+u/2+","+a+" "+T+","+(a-P)+" Z",W={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return c("svg",{...y,"aria-hidden":!0,ref:n,width:k?u:u+S,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[D]:N,[M]:F,[E]:C||k?"100%":"calc(100% - "+S/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[S>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:S+(v?0:1),d:I}),s("path",{stroke:S&&!v?y.fill:"none",d:I}),s("clipPath",{id:w,children:s("rect",{x:-O,y:O*(k?-1:1),width:u+S,height:u})})]})}));const wt=e.createContext(null),bt=e.createContext(null),xt=()=>{var t;return(null==(t=e.useContext(wt))?void 0:t.id)||null},Et=()=>e.useContext(bt);function Rt(e){return"data-floating-ui-"+e}function Ct(e){const t=i(e);return dt((()=>{t.current=e})),t}const Lt=Rt("safe-polygon");function St(e,t,n){return n&&!_(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Ot=0;function Tt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ot);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ot=requestAnimationFrame(i)}function At(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Pt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let kt=new WeakMap,Mt=new WeakSet,Dt={},Nt=0;const Ft=e=>e&&(e.host||Ft(e.parentNode));function It(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=Ft(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];Dt[o]||(Dt[o]=new WeakMap);const f=Dt[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==g(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=kt.get(t)||0,l=i?r+1:r,u=(f.get(t)||0)+1;kt.set(t,l),f.set(t,u),a.push(t),1===l&&n&&Mt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Nt++,()=>{a.forEach((e=>{const t=kt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;kt.set(e,n),f.set(e,r),n||(!Mt.has(e)&&i&&e.removeAttribute(i),Mt.delete(e)),r||e.removeAttribute(o)})),Nt--,Nt||(kt=new WeakMap,kt=new WeakMap,Mt=new WeakSet,Dt={})}}function Wt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=q(e[0]).body;return It(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ht=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jt(e,t){const n=Pe(e,Ht());"prev"===t&&n.reverse();const r=n.indexOf(F(q(e)));return n.slice(r+1)[0]}function Bt(){return jt(document.body,"next")}function Vt(){return jt(document.body,"prev")}function _t(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!I(n,r)}function qt(e){Pe(e,Ht()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Kt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Xt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ut(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Yt=e.forwardRef((function(t,n){const[r,o]=e.useState();dt((()=>(B()&&o("button"),document.addEventListener("keydown",Ut),()=>{document.removeEventListener("keydown",Ut)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Rt("focus-guard")]:"",style:Xt};return s("span",{...t,...i})})),$t=e.createContext(null),zt=Rt("portal");const Zt=()=>e.useContext($t),Gt="data-floating-ui-focusable";function Qt(e){return e?e.hasAttribute(Gt)?e:e.querySelector("["+Gt+"]")||e:null}let Jt=[];function en(e){Jt=Jt.filter((e=>e.isConnected)),e&&"body"!==g(e)&&(Jt.push(e),Jt.length>20&&(Jt=Jt.slice(-20)))}function tn(){return Jt.slice().reverse().find((e=>e.isConnected))}function nn(e){const t=Ht();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ve.call(e,pe)&&Oe(t,e)}(e,t)?e:Pe(e,t)[0]||e}const rn=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:Xt})}));let on=0;let ln=()=>{};const un=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return dt((()=>{if(n)return on++,1===on&&(ln=function(){const e=/iP(hone|ad|od)|iOS/.test(W()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{on--,0===on&&ln()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),cn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},an=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function fn(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=gt(),l=e.useRef({}),[u]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),c=null!=xt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ht)&&e.has(o)||(null==(i=ht)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=ft(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const dn="active",pn="selected";function mn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[pn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Gt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[dn,pn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const vn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var gn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=gt(),i=Zt(),[l,u]=e.useState(null),c=e.useRef(null);return dt((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),dt((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(zt,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),dt((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(zt,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),g=null==u?void 0:u.modal,h=null==u?void 0:u.open,y=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!g)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&_t(e)){("focusin"===e.type?Kt:qt)(l)}}}),[l,i,g]),e.useEffect((()=>{l&&(h||Kt(l))}),[h,l]),c($t.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:a})),[i,l]),children:[y&&l&&s(Yt,{"data-type":"outside",ref:d,onFocus:e=>{if(_t(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Vt()||(null==u?void 0:u.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:Xt}),l&&f.createPortal(n,l),y&&l&&s(Yt,{"data-type":"outside",ref:p,onFocus:e=>{if(_t(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Bt()||(null==u?void 0:u.domReference);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:un,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:g=!1}=t,{open:h,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:R}}=n,C=ft((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),L="number"==typeof u&&u<0,S=!!(O=E)&&"combobox"===O.getAttribute("role")&&U(O)&&L;var O;const T="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,A=!T||l,P=!A||T&&g,k=Ct(i),M=Ct(u),D=Ct(f),N=Et(),W=Zt(),H=e.useRef(null),B=e.useRef(null),_=e.useRef(!1),K=e.useRef(!1),$=e.useRef(-1),z=null!=W,Z=Qt(R),G=ft((function(e){return void 0===e&&(e=Z),e?Pe(e,Ht()):[]})),Q=ft((e=>{const t=G(e);return k.current.map((e=>E&&"reference"===e?E:Z&&"floating"===e?Z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){I(Z,F(q(Z)))&&0===G().length&&!S&&Y(e);const t=Q(),n=X(e);"reference"===k.current[0]&&n===E&&(Y(e),e.shiftKey?Tt(t[t.length-1]):Tt(t[1])),"floating"===k.current[1]&&n===Z&&e.shiftKey&&(Y(e),Tt(t[0]))}}const t=q(Z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,Z,p,k,S,G,Q]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=X(e),n=G().indexOf(t);-1!==n&&($.current=n)}}),[o,R,G]),e.useEffect((()=>{if(!o&&v)return R&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=C(),r=!(I(E,t)||I(R,t)||I(t,R)||I(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Rt("focus-guard"))||N&&(Pt(N.nodesRef.current,n).find((e=>{var n,r;return I(null==(n=e.context)?void 0:n.elements.floating,t)||I(null==(r=e.context)?void 0:r.elements.domReference,t)}))||At(N.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Qt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&F(q(Z))===q(Z).body){x(Z)&&Z.focus();const e=$.current,t=G(),n=t[e]||t[t.length-1]||Z;x(n)&&n.focus()}!S&&p||!t||!r||K.current||t===tn()||(_.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,R,Z,p,N,W,y,v,d,G,S,C]);const J=e.useRef(null),ee=e.useRef(null),te=ct([J,null==W?void 0:W.beforeInsideRef]),ne=ct([ee,null==W?void 0:W.afterInsideRef]);function re(e){return!o&&m&&p?s(rn,{ref:"start"===e?H:B,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Rt("portal")+"]"))||[]),n=N&&!p?At(null==N?void 0:N.nodesRef.current,C()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,H.current,B.current,J.current,ee.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,k.current.includes("reference")||S?E:null].filter((e=>null!=e)),i=p||S?Wt(r,!P,P):Wt(r);return()=>{i()}}),[o,E,R,p,k,W,S,A,P,N,C]),dt((()=>{if(o||!x(Z))return;const e=F(q(Z));queueMicrotask((()=>{const t=Q(Z),n=M.current,r=("number"==typeof n?t[n]:n.current)||Z,o=I(Z,e);L||o||!h||Tt(r,{preventScroll:r===Z})}))}),[o,h,Z,L,Q,M]),dt((()=>{if(o||!Z)return;let e=!1;const t=q(Z),n=F(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&E&&en(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(_.current=!0),"outside-press"===o&&(l?(_.current=!1,e=!0):_.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(V()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||j(i)))}en(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Xt),z&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=F(t),o=I(R,n)||N&&Pt(N.nodesRef.current,C()).some((e=>{var t;return I(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&en(E);const u="boolean"==typeof D.current?tn()||l:D.current.current||l;queueMicrotask((()=>{const r=nn(u);D.current&&!_.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,Z,D,b,w,N,z,E,C]),e.useEffect((()=>{queueMicrotask((()=>{_.current=!1}))}),[o]),dt((()=>{if(!o&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:v,open:h,onOpenChange:y,domReference:E}),()=>{W.setFocusManagerState(null)}}),[o,W,p,h,y,v,E]),dt((()=>{if(o)return;if(!Z)return;if("function"!=typeof MutationObserver)return;if(L)return;const e=()=>{const e=Z.getAttribute("tabindex"),t=G(),n=F(q(R)),r=t.indexOf(n);-1!==r&&($.current=r),k.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&Z.setAttribute("tabindex","0"):"-1"!==e&&Z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,Z,E,k,G,L]);const oe=!o&&A&&(!p||!S)&&(z||p);return c(a,{children:[oe&&s(Yt,{"data-type":"inside",ref:te,onFocus:e=>{if(p){const e=Q();Tt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(_.current=!1,_t(e,W.portalNode)){const e=Bt()||E;null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!S&&re("start"),r,re("end"),oe&&s(Yt,{"data-type":"inside",ref:ne,onFocus:e=>{if(p)Tt(Q()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(v&&(_.current=!0),_t(e,W.portalNode)){const e=Vt()||E;null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=fn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[c,s]=e.useState(null),a=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=Et();dt((()=>{a&&(d.current=a)}),[a]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:c=!0,whileElementsMounted:s,open:a}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);rt(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),L=e.useRef(null),S=e.useRef(d),O=null!=s,T=lt(s),A=lt(i),P=lt(a),k=e.useCallback((()=>{if(!C.current||!L.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),tt(C.current,L.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!rt(S.current,t)&&(S.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);nt((()=>{!1===a&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const M=e.useRef(!1);nt((()=>(M.current=!0,()=>{M.current=!1})),[]),nt((()=>{if(E&&(C.current=E),R&&(L.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,O]);const D=e.useMemo((()=>({reference:C,floating:L,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=it(N.floating,d.x),n=it(N.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ot(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:F})),[d,k,D,N,F])}({...t,elements:{...i,...c&&{reference:c}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,u(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),h=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),y=e.useMemo((()=>({...m.elements,domReference:a})),[m.elements,a]),w=e.useMemo((()=>({...m,...o,refs:h,elements:y,nodeId:n})),[m,h,y,n,o]);return dt((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:h,elements:y})),[m,h,y,w])},Arrow:yt,arrow:(e,t)=>({...ut(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=vn.get(u))?r:u,s=gt(),a=null!=xt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useFocus:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:l,elements:u}=t,{enabled:c=!0,visibleOnly:s=!0}=n,a=e.useRef(!1),f=e.useRef(),d=e.useRef(!0);e.useEffect((()=>{if(!c)return;const e=h(u.domReference);function t(){!r&&x(u.domReference)&&u.domReference===F(q(u.domReference))&&(a.current=!0)}function n(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",n,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",n,!0)}}),[u.domReference,r,c]),e.useEffect((()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[i,c]),e.useEffect((()=>()=>{clearTimeout(f.current)}),[]);const p=e.useMemo((()=>({onPointerDown(e){j(e.nativeEvent)||(d.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=X(e.nativeEvent);if(s&&b(t))try{if(B()&&W().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints)throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!U(t))return}o(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=b(t)&&t.hasAttribute(Rt("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout((()=>{var e;const i=F(u.domReference?u.domReference.ownerDocument:document);(t||i!==u.domReference)&&(I(null==(e=l.current.floatingContext)?void 0:e.refs.floating.current,i)||I(u.domReference,i)||r||o(!1,n,"focus"))}))}})),[l,u.domReference,o,s]);return e.useMemo((()=>c?{reference:p}:{}),[c,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>mn(e,t,"reference")),n),l=e.useCallback((e=>mn(e,t,"floating")),r),u=e.useCallback((e=>mn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=Et(),h=ft("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=an(m),{escapeKey:L,outsidePress:S}=an(v),P=e.useRef(!1),M=ft((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?Pt(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),N=ft((e=>{var t;const n=()=>{var t;M(e),null==(t=X(e))||t.removeEventListener("keydown",n)};null==(t=X(e))||t.addEventListener("keydown",n)})),F=ft((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const u=X(e),c="["+Rt("inert")+"]",s=q(i.floating).querySelectorAll(c);let f=b(u)?u:null;for(;f&&!T(f);){const e=k(f);if(T(e)||!b(e))break;f=e}if(s.length&&b(u)&&!u.matches("html,body")&&!I(u,i.floating)&&Array.from(s).every((e=>!I(f,e))))return;if(x(u)&&j){const t=T(u),n=A(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&Pt(g.nodesRef.current,d).some((t=>{var n;return K(e,null==(n=t.context)?void 0:n.elements.floating)}));if(K(e,i.floating)||K(e,i.domReference)||p)return;const m=g?Pt(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ft((e=>{var t;const n=()=>{var t;F(e),null==(t=X(e))||t.removeEventListener(a,n)};null==(t=X(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout((()=>{P.current=!1}),O()?5:0)}const f=q(i.floating);c&&(f.addEventListener("keydown",L?N:M,L),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,S?W:F,S);let d=[];return p&&(b(i.domReference)&&(d=D(i.domReference)),b(i.floating)&&(d=d.concat(D(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(D(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",L?N:M,L),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,S?W:F,S),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,y,a,r,o,p,u,R,C,M,L,N,F,S,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const H=e.useMemo((()=>({onKeyDown:M,...f&&{[cn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[M,o,f,d]),j=e.useMemo((()=>({onKeyDown:M,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[sn[a]]:()=>{w.current=!0}})),[M,a]);return e.useMemo((()=>u?{reference:H,floating:j}:{}),[u,H,j])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=Et(),v=xt(),g=Ct(a),h=Ct(s),y=Ct(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),L=e.useRef(!1),S=e.useRef((()=>{})),O=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=q(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=St(h.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[h,o]),P=ft((()=>{S.current(),E.current=void 0})),k=ft((()=>{if(L.current){const e=q(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Lt),L.current=!1}})),M=ft((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&b(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!_(w.current)||d>0&&!St(h.current,"open"))return;const t=St(h.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;S.current();const t=q(u.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!I(u.floating,e.relatedTarget))&&A(e)}function l(e){M()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),M()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,y,m,h,g,i,M]),dt((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){L.current=!0;const e=u.floating;if(b(u.domReference)&&e){var t;const n=q(u.floating).body;n.setAttribute(Lt,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),dt((()=>{r||(w.current=void 0,O.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const D=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!_(w.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),N=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){M()||A(e.nativeEvent,!1)}})),[A,M]);return e.useMemo((()=>c?{reference:D,floating:N}:{}),[c,D,N])},flip:(e,t)=>({...Qe(e),options:[e,t]}),shift:(e,t)=>({...Ge(e),options:[e,t]}),hide:(e,t)=>({...Je(e),options:[e,t]}),offset:(e,t)=>({...Ze(e),options:[e,t]}),useMergeRefs:ct},hn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)};function yn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function wn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yn(e))&&(r&&(r+=" "),r+=t);return r}var bn="HoverCard",xn=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=p(n,["asChild","children"]);if(i){var c=t.Children.toArray(l);if(1!==c.length||!t.isValidElement(c[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),t.createElement(e,d(d({},u),{ref:r}),l);var s=c[0];return t.cloneElement(s,d(d(d({},u),s.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var t=s.ref;"function"==typeof t?t(e):t&&(t.current=e)}}:{}))}return t.createElement(e,d(d({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),En=function(){return console.warn("Direct usage of HoverCard is not supported. Please use HoverCard.Root, HoverCard.Trigger, etc. instead."),null};En.Root=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,s=void 0===c?"":c,a=e.openDelay,f=void 0===a?100:a,v=e.closeDelay,g=void 0===v?200:v,h=p(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=hn(s,bn),w=hn(s,"".concat(bn,"-trigger")),b=i(null),x=gn.useFloating({placement:"bottom",strategy:"fixed",middleware:[gn.arrow({element:b}),gn.offset(10),gn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,L=l(!1),S=L[0],O=L[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:S,M=function(e){P||O(e),null==u||u(e)},D=gn.useRole(C),N=gn.useDismiss(C),F=gn.useHover(C,{delay:100}),I=gn.useInteractions([F,D,N]),W=I.getReferenceProps,H=I.getFloatingProps,j={isOpen:k,handleOpenChange:M,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:H,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&M(!1),e}))}),g)},closeWithoutDelay:function(){M(!1)},openWithDelay:function(){A(!1),setTimeout((function(){M(!0)}),f)}};return t.createElement(m.Provider,{value:j},t.createElement("div",d({className:wn(y)},h),n))},En.Trigger=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=p(e,["children","className"]),l=u(m),c=l.floatingRefs,s=l.closeWithDelay,a=l.openWithDelay,f=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(xn.span,d({className:wn(f,o),onClick:function(){},onMouseEnter:a,onMouseLeave:s,ref:c.setReference},i),n))},En.Portal=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=p(e,["children","rootElement"]),l=u(m).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(gn.Portal,d({root:c},i),n)},En.Content=function(e){var n=e.children,r=p(e,["children"]),i=u(m),l=i.isOpen,c=i.floatingRefs,s=i.floatingStyles,a=i.getFloatingProps,f=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",d({onPointerEnter:h,onPointerLeave:v,className:wn(f)},r,{ref:c.setFloating,style:s},a()),n):null},En.Arrow=function(e){var n=p(e,[]),r=u(m),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(gn.Arrow,d({className:wn("".concat(l,"-arrow"))},n,{context:o,ref:i}))};export{En as default};
@@ -1 +1 @@
1
- 'use client';import r,{useCallback as e}from"react";var t=function(){return t=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},t.apply(this,arguments)};function n(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}function o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=o(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function a(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var i=["div","span","button","input","a","img","p","h2"].reduce((function(e,o){return e[o]=function(e){var o=r.forwardRef((function(o,a){var i=o.asChild,c=void 0!==i&&i,f=o.children,l=n(o,["asChild","children"]);if(c){var u=r.Children.toArray(f);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,t(t({},l),{ref:a}),f);var s=u[0];return r.cloneElement(s,t(t(t({},l),s.props),a?{ref:function(r){"function"==typeof a?a(r):a&&(a.current=r);var e=s.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,t(t({},l),{ref:a}),f)}));return o.displayName="Primitive.".concat(e),o}(o),e}),{}),c="Link",f=function(o){var f,l,u=o.children,s=o.href,p=void 0===s?"#":s,d=o.customRootClass,v=o.className,m=o.size,y=void 0===m?"":m,h=n(o,["children","href","customRootClass","className","size"]),b=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(d,c),O=e((function(){return l?Object.fromEntries(Object.entries(l).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(f,"-").concat(e),t]}))):{}}),[f="link",l={size:y}]);return r.createElement(i.a,t({href:p,className:a(b,v)},O(),h),u)};f.displayName=c;export{f as default};
1
+ 'use client';import r,{useCallback as e}from"react";var t=function(){return t=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},t.apply(this,arguments)};function n(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}function o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=o(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function a(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var i=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,o){return e[o]=function(e){var o=r.forwardRef((function(o,a){var i=o.asChild,c=void 0!==i&&i,f=o.children,l=n(o,["asChild","children"]);if(c){var u=r.Children.toArray(f);if(1!==u.length||!r.isValidElement(u[0]))return console.warn("Primitive.".concat(e,": asChild prop requires exactly one valid child element.")),r.createElement(e,t(t({},l),{ref:a}),f);var s=u[0];return r.cloneElement(s,t(t(t({},l),s.props),a?{ref:function(r){"function"==typeof a?a(r):a&&(a.current=r);var e=s.ref;"function"==typeof e?e(r):e&&(e.current=r)}}:{}))}return r.createElement(e,t(t({},l),{ref:a}),f)}));return o.displayName="Primitive.".concat(e),o}(o),e}),{}),c="Link",f=function(o){var f,l,u=o.children,s=o.href,p=void 0===s?"#":s,d=o.customRootClass,v=o.className,m=o.size,y=void 0===m?"":m,h=n(o,["children","href","customRootClass","className","size"]),b=function(r,e){void 0===r&&(r="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r?"".concat(r,"-").concat(t):"".concat("rad-ui","-").concat(t)}(d,c),O=e((function(){return l?Object.fromEntries(Object.entries(l).filter((function(r){r[0];var e=r[1];return void 0!==e&&""!==e})).map((function(r){var e=r[0],t=r[1];return["data-".concat(f,"-").concat(e),t]}))):{}}),[f="link",l={size:y}]);return r.createElement(i.a,t({href:p,className:a(b,v)},O(),h),u)};f.displayName=c;export{f as default};
@@ -1 +1 @@
1
- 'use client';import e,{createContext as r,useContext as t}from"react";function a(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(t=a(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function n(){for(var e,r,t=0,n="",o=arguments.length;t<o;t++)(e=arguments[t])&&(r=a(e))&&(n&&(n+=" "),n+=r);return n}var o=r({value:0,minValue:0,maxValue:100,rootClass:""}),i=function(){return i=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var l=function(r){var t=e.forwardRef((function(t,a){var n=t.asChild,o=void 0!==n&&n,l=t.children,c=function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(t[a[n]]=e[a[n]])}return t}(t,["asChild","children"]);if(o){var u=e.Children.toArray(l);if(1!==u.length||!e.isValidElement(u[0]))return console.warn("Primitive.".concat(r,": asChild prop requires exactly one valid child element.")),e.createElement(r,i(i({},c),{ref:a}),l);var s=u[0];return e.cloneElement(s,i(i(i({},c),s.props),a?{ref:function(e){"function"==typeof a?a(e):a&&(a.current=e);var r=s.ref;"function"==typeof r?r(e):r&&(r.current=e)}}:{}))}return e.createElement(r,i(i({},c),{ref:a}),l)}));return t.displayName="Primitive.".concat(r),t},c=["div","span","button","input","a","img","p","h2"].reduce((function(e,r){return e[r]=l(r),e}),{});var u="Progress";function s(){return console.warn("Direct usage of Progress is not supported. Please use Progress.Root, Progress.Indicator, etc. instead."),null}s.Root=function(r){var t=r.value,a=void 0===t?0:t,i=r.minValue,l=void 0===i?0:i,u=r.maxValue,s=void 0===u?100:u,f=r.children,p=function(e,r){void 0===e&&(e="");var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(r.customRootClass,"Progress"),v={value:a,minValue:l,maxValue:s,rootClass:p};return e.createElement(o.Provider,{value:v},e.createElement(c.div,{className:n(p)},f))},s.Indicator=function(r){var a=r.asChild,l=t(o),u=l.value,s=l.minValue,f=l.maxValue,p=l.rootClass,v=Math.min(Math.max(u,s),f);return e.createElement(c.div,i({role:"progressbar",className:n("".concat(p,"-indicator")),style:{transform:"translateX(-".concat(f-v,"%)")},"aria-valuenow":v,"aria-valuemax":f,"aria-valuemin":s,asChild:a},{}))};export{u as COMPONENT_NAME,s as default};
1
+ 'use client';import e,{createContext as r,useContext as t}from"react";function a(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(t=a(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function n(){for(var e,r,t=0,n="",o=arguments.length;t<o;t++)(e=arguments[t])&&(r=a(e))&&(n&&(n+=" "),n+=r);return n}var o=r({value:0,minValue:0,maxValue:100,rootClass:""}),i=function(){return i=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var l=function(r){var t=e.forwardRef((function(t,a){var n=t.asChild,o=void 0!==n&&n,l=t.children,c=function(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(t[a[n]]=e[a[n]])}return t}(t,["asChild","children"]);if(o){var u=e.Children.toArray(l);if(1!==u.length||!e.isValidElement(u[0]))return console.warn("Primitive.".concat(r,": asChild prop requires exactly one valid child element.")),e.createElement(r,i(i({},c),{ref:a}),l);var s=u[0];return e.cloneElement(s,i(i(i({},c),s.props),a?{ref:function(e){"function"==typeof a?a(e):a&&(a.current=e);var r=s.ref;"function"==typeof r?r(e):r&&(r.current=e)}}:{}))}return e.createElement(r,i(i({},c),{ref:a}),l)}));return t.displayName="Primitive.".concat(r),t},c=["div","span","button","input","a","img","p","h2","label"].reduce((function(e,r){return e[r]=l(r),e}),{});var u="Progress";function s(){return console.warn("Direct usage of Progress is not supported. Please use Progress.Root, Progress.Indicator, etc. instead."),null}s.Root=function(r){var t=r.value,a=void 0===t?0:t,i=r.minValue,l=void 0===i?0:i,u=r.maxValue,s=void 0===u?100:u,f=r.children,p=function(e,r){void 0===e&&(e="");var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(r.customRootClass,"Progress"),v={value:a,minValue:l,maxValue:s,rootClass:p};return e.createElement(o.Provider,{value:v},e.createElement(c.div,{className:n(p)},f))},s.Indicator=function(r){var a=r.asChild,l=t(o),u=l.value,s=l.minValue,f=l.maxValue,p=l.rootClass,v=Math.min(Math.max(u,s),f);return e.createElement(c.div,i({role:"progressbar",className:n("".concat(p,"-indicator")),style:{transform:"translateX(-".concat(f-v,"%)")},"aria-valuenow":v,"aria-valuemax":f,"aria-valuemin":s,asChild:a},{}))};export{u as COMPONENT_NAME,s as default};
@@ -0,0 +1 @@
1
+ 'use client';import e,{useCallback as r}from"react";var n=function(){return n=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var a in r=arguments[n])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},n.apply(this,arguments)};function t(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(t=Object.getOwnPropertySymbols(e);a<t.length;a++)r.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(n[t[a]]=e[t[a]])}return n}"function"==typeof SuppressedError&&SuppressedError;var a=["div","span","button","input","a","img","p","h2","label"].reduce((function(r,a){return r[a]=function(r){var a=e.forwardRef((function(a,i){var o=a.asChild,c=void 0!==o&&o,l=a.children,u=t(a,["asChild","children"]);if(c){var d=e.Children.toArray(l);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(r,": asChild prop requires exactly one valid child element.")),e.createElement(r,n(n({},u),{ref:i}),l);var s=d[0];return e.cloneElement(s,n(n(n({},u),s.props),i?{ref:function(e){"function"==typeof i?i(e):i&&(i.current=e);var r=s.ref;"function"==typeof r?r(e):r&&(r.current=e)}}:{}))}return e.createElement(r,n(n({},u),{ref:i}),l)}));return a.displayName="Primitive.".concat(r),a}(a),r}),{});function i(r){var i=r.name,o=r.value,c=r.id,l=r.checked,u=r.required,d=r.onChange,s=r.disabled,f=r.asChild,p=r.className,v=t(r,["name","value","id","checked","required","onChange","disabled","asChild","className"]);return e.createElement(a.input,n({type:"radio",checked:l,name:i,tabIndex:-1,value:o,onChange:d,id:c,"aria-disabled":s,disabled:s,required:u,"aria-required":u,asChild:f,className:p},v))}function o(e){var r,n,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(n=o(e[r]))&&(t&&(t+=" "),t+=n)}else for(n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function c(){for(var e,r,n=0,t="",a=arguments.length;n<a;n++)(e=arguments[n])&&(r=o(e))&&(t&&(t+=" "),t+=r);return t}var l=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return r((function(){return Object.assign.apply(Object,function(e,r,n){if(n||2===arguments.length)for(var t,a=0,i=r.length;a<i;a++)!t&&a in r||(t||(t=Array.prototype.slice.call(r,0,a)),t[a]=r[a]);return e.concat(t||Array.prototype.slice.call(r))}([{}],e.filter((function(e){return null!==e})),!1))}),[e])};function u(a){var o,u,d=a.name,s=a.value,f=a.id,p=a.checked,v=void 0!==p&&p,h=a.required,m=a.onChange,y=a.disabled,b=a.asChild,g=a.className,C=a.customRootClass,O=a.variant,j=void 0===O?"":O,E=a.size,q=void 0===E?"":E,k=a.color,w=void 0===k?"":k,N=t(a,["name","value","id","checked","required","onChange","disabled","asChild","className","customRootClass","variant","size","color"]),A=function(e,r){void 0===e&&(e="");var n=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)}(C,"Radio"),P=e.useState(v),x=P[0],S=P[1],z=r((function(){return u?Object.fromEntries(Object.entries(u).filter((function(e){e[0];var r=e[1];return void 0!==r&&""!==r})).map((function(e){var r=e[0],n=e[1];return["data-".concat(o,"-").concat(r),n]}))):{}}),[o="button",u={variant:j,size:q}]),R=function(e){return r((function(){return e?{"data-rad-ui-accent-color":e}:{}}),[e])}(w),I=l(z(),R());return e.createElement(i,n({name:d,id:f,value:s,checked:x,required:h,onChange:function(){m&&m(),S(!x)},disabled:y,asChild:b,className:c(A,g),"data-checked":x},I(),N))}export{u as default};
@@ -1 +1 @@
1
- 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input","a","img","p","h2"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);if(l){var d=e.Children.toArray(i);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,o(o({},u),{ref:r}),i);var f=d[0];return e.cloneElement(f,o(o(o({},u),f.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=f.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(t){var r=t.name,c=void 0===r?"":r,i=t.value,u=void 0===i?"":i,d=t.checked,f=void 0!==d&&d;t.onClick;var s=t.onChange,v=a(t,["name","value","checked","onClick","onChange"]),h=n(f),m=h[0],p=h[1],C={"data-checked":m.toString()};return e.createElement(l.input,o({id:u,type:"radio",value:u,name:c,onChange:function(e){var n=e.target.checked;console.log(n),"function"==typeof s&&(p(n),s({value:u,checked:n}))}},v,C))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),s=n(i),v=s[0],h=s[1],m={checkedItem:v,setCheckedItem:h,onChange:function(e){h(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:m},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,s=d.checkedItem,v=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:s===r,onChange:function(e){f(r),"function"==typeof v&&v(r)}}),e.createElement("label",{htmlFor:r},l))};var s=r({defaultChecked:null,rootClass:"",onChange:null}),v=function(){return console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null};v.Root=function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,v=void 0===d?"":d,h=function(e,n){void 0===e&&(e="");var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(v,"RadioCards");return e.createElement(s.Provider,{value:{defaultChecked:c,rootClass:h,onChange:i}},e.createElement(u.Root,{className:f(h,o),customRootClass:v},t))},v.Item=function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(s).rootClass;return e.createElement(u.Item,o({className:f("".concat(d,"-item"),l)},i),r)};export{v as default};
1
+ 'use client';import e,{createContext as r,useRef as t,useState as n,useId as a,useEffect as o,forwardRef as i,useContext as l,useCallback as c}from"react";var u=function(){return u=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},u.apply(this,arguments)};function d(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}function s(e,r,t){if(t||2===arguments.length)for(var n,a=0,o=r.length;a<o;a++)!n&&a in r||(n||(n=Array.prototype.slice.call(r,0,a)),n[a]=r[a]);return e.concat(n||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var f=["div","span","button","input","a","img","p","h2","label"].reduce((function(r,t){return r[t]=function(r){var t=e.forwardRef((function(t,n){var a=t.asChild,o=void 0!==a&&a,i=t.children,l=d(t,["asChild","children"]);if(o){var c=e.Children.toArray(i);if(1!==c.length||!e.isValidElement(c[0]))return console.warn("Primitive.".concat(r,": asChild prop requires exactly one valid child element.")),e.createElement(r,u(u({},l),{ref:n}),i);var s=c[0];return e.cloneElement(s,u(u(u({},l),s.props),n?{ref:function(e){"function"==typeof n?n(e):n&&(n.current=e);var r=s.ref;"function"==typeof r?r(e):r&&(r.current=e)}}:{}))}return e.createElement(r,u(u({},l),{ref:n}),i)}));return t.displayName="Primitive.".concat(r),t}(t),r}),{}),v=e.createContext(null),p=r({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1}),b=r({focusedItemId:null,setFocusedItemId:function(){},focusItems:[],setFocusItems:function(){},addFocusItem:function(){},groupRef:null}),m=i((function(r,t){var n,i=r.children,c=r["aria-label"],s=r["aria-labelledby"],v=r.role,m=void 0===v?"button":v,h=d(r,["children","aria-label","aria-labelledby","role"]),g=a(),y=l(b),I=y.focusedItemId,C=y.setFocusedItemId,E=y.addFocusItem,R=y.focusItems,w=y.groupRef,O=l(p),N=O.orientation,x=O.loop,D=O.disableTabIndexing,S=O.dir,A=e.Children.toArray(i)[0],P=!0===(null===(n=null==A?void 0:A.props)||void 0===n?void 0:n.disabled),j=I===g,F=D||!P&&j?0:-1;o((function(){R.includes(g)||E(g)}),[R,I,g,E]);var V=function(e){if(w&&w.current){C(e);var r=CSS.escape(e),t=w.current.querySelector("#".concat(r));t&&t.focus()}},q=function(e,r){for(var t,n=e,a=0;a<R.length;a++){if(n+=r,x)n<0&&(n=R.length-1),n>=R.length&&(n=0);else if(n<0||n>=R.length)return-1;var o=R[n],i=null===(t=null==w?void 0:w.current)||void 0===t?void 0:t.querySelector("#".concat(CSS.escape(o)));if(i)if(!("true"===i.getAttribute("data-child-disabled")))return n}return-1},k=function(){var e=R.indexOf(g),r=q(e,-1);-1!==r&&V(R[r])},z=function(){var e=R.indexOf(g),r=q(e,1);-1!==r&&V(R[r])};return e.createElement(f.button,u({asChild:!0,onFocus:function(e){e.preventDefault(),P&&e.target.blur(),P||C(g)},tabIndex:F,ref:t,id:g,onKeyDown:function(e){if(!P)switch(e.key){case"ArrowUp":e.preventDefault(),"vertical"!==N&&"both"!==N||k();break;case"ArrowLeft":e.preventDefault(),"horizontal"!==N&&"both"!==N||("rtl"===S?z():k());break;case"ArrowDown":e.preventDefault(),"vertical"!==N&&"both"!==N||z();break;case"ArrowRight":e.preventDefault(),"horizontal"!==N&&"both"!==N||("rtl"===S?k():z());break;case"Home":e.preventDefault(),function(){if(R.length>0){var e=q(-1,1);-1!==e&&V(R[e])}}();break;case"End":e.preventDefault(),function(){if(R.length>0){var e=q(R.length,-1);-1!==e&&V(R[e])}}()}},"data-child-disabled":P,role:m,"aria-selected":j,"aria-disabled":P,"aria-label":c,"aria-labelledby":s},h),i)}));m.displayName="RovingFocusItem";var h={Root:function(r){var t=r.children,n=r.orientation,a=void 0===n?"horizontal":n,o=r.loop,i=void 0===o||o,l=r["aria-label"],c=r["aria-labelledby"],s=r.disableTabIndexing,v=void 0!==s&&s,b=r.dir,m=void 0===b?"ltr":b,h=d(r,["children","orientation","loop","aria-label","aria-labelledby","disableTabIndexing","dir"]),g={orientation:a,loop:i,disableTabIndexing:v,dir:m};return e.createElement(p.Provider,{value:g},e.createElement(f.div,u({role:"listbox","aria-orientation":"both"===a?void 0:a,"aria-label":l,"aria-labelledby":c},h),t))},Group:function(r){var i=r.children,l=r["aria-label"],c=r["aria-labelledby"],v=d(r,["children","aria-label","aria-labelledby"]),p=t(null),m=n([]),h=m[0],g=m[1],y=n(null),I=y[0],C=y[1],E=a();o((function(){!I&&h.length>0&&C(h[0])}),[h,I]);var R={focusedItemId:I,setFocusedItemId:C,focusItems:h,setFocusItems:g,addFocusItem:function(e){g((function(r){return s(s([],r,!0),[e],!1)}))},groupRef:p};return e.createElement(b.Provider,{value:R},e.createElement(f.div,u({id:E,ref:p,role:"group","aria-label":l,"aria-labelledby":c},v),i))},Item:m};var g=e.createContext({itemSelected:!1}),y=function(){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root, RadioGroup.Item, etc. instead."),null};function I(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=I(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function C(){for(var e,r,t=0,n="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=I(e))&&(n&&(n+=" "),n+=r);return n}y.Root=function(r){var a=r.value,i=r.defaultValue,l=void 0===i?"":i,s=r.onValueChange,p=r.children,b=r.disabled,m=void 0!==b&&b,g=r.required,y=void 0!==g&&g,I=r.name,C=void 0===I?"":I;r.orientation,r.loop,r.dir;var E=d(r,["value","defaultValue","onValueChange","children","disabled","required","name","orientation","loop","dir"]),R=function(e,r,a){var i=n(r),l=i[0],u=i[1],d=void 0!==e,s=d?e:l,f=t(d),v=t(e);o((function(){"production"!==process.env.NODE_ENV&&(f.current!==d&&console.warn("Component changed from ".concat(f.current?"controlled":"uncontrolled"," to ").concat(d?"controlled":"uncontrolled",".")),f.current=d)}),[d]),o((function(){"production"!==process.env.NODE_ENV&&d&&!a&&e!==v.current&&console.warn("A component is changing a controlled value without an onChange handler. This will render a controlled component as uncontrolled."),v.current=e}),[e,d,a]);var p=c((function(e){var r="function"==typeof e?e(s):e;d||u(r),a&&a(r)}),[d,a,s]);return[s,p]}(a,l,s),w=R[0],O={selectedValue:w,setSelectedValue:R[1],groupDisabled:m};return e.createElement(f.div,u({},E,{"aria-required":y,role:"radiogroup","aria-disabled":m}),e.createElement(h.Root,null,e.createElement(v.Provider,{value:O},e.createElement(h.Group,null,p))),e.createElement("input",{type:"radio",hidden:!0,name:C,value:w,disabled:m,required:y}))},y.Item=function(r){var t=r.value,n=r.children,a=r.disabled,o=r.required,i=void 0!==o&&o,c=r.className,s=void 0===c?"":c,p=r.asChild,b=void 0!==p&&p,m=d(r,["value","children","disabled","required","className","asChild"]),y=l(v);if(!y)throw new Error("RadioGroup.Item must be used within a RadioGroup.Root");var I=y.groupDisabled,C=y.selectedValue,E=y.setSelectedValue,R=t===C;return e.createElement(h.Item,null,e.createElement(f.button,u({role:"radio",type:"button",disabled:I||a,onClick:function(){return E(t)},onFocus:function(){return E(t)},"aria-disabled":I||a,"aria-checked":t===C,"data-checked":t===C,"aria-required":i,asChild:b,className:s},m),e.createElement(g.Provider,{value:{itemSelected:R}},n)))},y.Indicator=function(r){var t=r.children,n=r.className,a=r.asChild,o=void 0!==a&&a,i=d(r,["children","className","asChild"]);return e.useContext(g).itemSelected?e.createElement(f.span,u({className:n,asChild:o},i),t):null};var E=r({rootClass:""}),R=function(){return console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null};R.Root=function(r){var t,n,a=r.children,o=r.className,i=void 0===o?"":o,l=r.customRootClass,f=void 0===l?"":l,v=r.variant,p=void 0===v?"":v,b=r.size,m=void 0===b?"":b,h=r.color,g=void 0===h?"":h,I=d(r,["children","className","customRootClass","variant","size","color"]),R=function(e,r){void 0===e&&(e="");var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(f,"RadioCards"),w=c((function(){return n?Object.fromEntries(Object.entries(n).filter((function(e){e[0];var r=e[1];return void 0!==r&&""!==r})).map((function(e){var r=e[0],n=e[1];return["data-".concat(t,"-").concat(r),n]}))):{}}),[t="radio-cards",n={variant:p,size:m}]),O=function(e){return c((function(){return e?{"data-rad-ui-accent-color":e}:{}}),[e])}(g),N=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return c((function(){return Object.assign.apply(Object,s([{}],e.filter((function(e){return null!==e})),!1))}),[e])}(w(),O());return e.createElement(E.Provider,{value:{rootClass:R}},e.createElement(y.Root,u({className:C(R,i)},N,I),a))},R.Item=function(r){var t=r.children,n=r.className,a=void 0===n?"":n,o=r.value,i=d(r,["children","className","value"]),c=l(E).rootClass;return e.createElement(y.Item,u({className:C("".concat(c,"-item"),a)},i,{value:o}),t)};export{R as default};
@@ -1 +1 @@
1
- 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input","a","img","p","h2"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);if(l){var d=e.Children.toArray(i);if(1!==d.length||!e.isValidElement(d[0]))return console.warn("Primitive.".concat(n,": asChild prop requires exactly one valid child element.")),e.createElement(n,o(o({},u),{ref:r}),i);var f=d[0];return e.cloneElement(f,o(o(o({},u),f.props),r?{ref:function(e){"function"==typeof r?r(e):r&&(r.current=e);var n=f.ref;"function"==typeof n?n(e):n&&(n.current=e)}}:{}))}return e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(t){var r=t.name,c=void 0===r?"":r,i=t.value,u=void 0===i?"":i,d=t.checked,f=void 0!==d&&d;t.onClick;var s=t.onChange,v=a(t,["name","value","checked","onClick","onChange"]),h=n(f),p=h[0],m=h[1],C={"data-checked":p.toString()};return e.createElement(l.input,o({id:u,type:"radio",value:u,name:c,onChange:function(e){var n=e.target.checked;console.log(n),"function"==typeof s&&(m(n),s({value:u,checked:n}))}},v,C))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),s=n(i),v=s[0],h=s[1],p={checkedItem:v,setCheckedItem:h,onChange:function(e){h(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:p},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,s=d.checkedItem,v=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:s===r,onChange:function(e){f(r),"function"==typeof v&&v(r)}}),e.createElement("label",{htmlFor:r},l))};var s=r({defaultChecked:null,customRootClass:null,onChange:null}),v=function(){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null};v.Root=function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,v=void 0===d?"":d,h=function(e,n){void 0===e&&(e="");var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(v,"RadioGroup");return e.createElement(s.Provider,{value:{defaultChecked:c,rootClass:h,onChange:i}},e.createElement(u.Root,{className:f(h,o),customRootClass:v},t))},v.Item=function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(s).rootClass;return e.createElement(u.Item,o({className:f("".concat(d,"-item"),l)},i),r)};export{v as default};
1
+ 'use client';import e,{createContext as r,useRef as t,useState as n,useId as a,useEffect as o,forwardRef as l,useContext as i,useCallback as c}from"react";var u=function(){return u=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},u.apply(this,arguments)};function d(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}function s(e,r,t){if(t||2===arguments.length)for(var n,a=0,o=r.length;a<o;a++)!n&&a in r||(n||(n=Array.prototype.slice.call(r,0,a)),n[a]=r[a]);return e.concat(n||Array.prototype.slice.call(r))}"function"==typeof SuppressedError&&SuppressedError;var f=["div","span","button","input","a","img","p","h2","label"].reduce((function(r,t){return r[t]=function(r){var t=e.forwardRef((function(t,n){var a=t.asChild,o=void 0!==a&&a,l=t.children,i=d(t,["asChild","children"]);if(o){var c=e.Children.toArray(l);if(1!==c.length||!e.isValidElement(c[0]))return console.warn("Primitive.".concat(r,": asChild prop requires exactly one valid child element.")),e.createElement(r,u(u({},i),{ref:n}),l);var s=c[0];return e.cloneElement(s,u(u(u({},i),s.props),n?{ref:function(e){"function"==typeof n?n(e):n&&(n.current=e);var r=s.ref;"function"==typeof r?r(e):r&&(r.current=e)}}:{}))}return e.createElement(r,u(u({},i),{ref:n}),l)}));return t.displayName="Primitive.".concat(r),t}(t),r}),{}),v=e.createContext(null),p=r({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1}),m=r({focusedItemId:null,setFocusedItemId:function(){},focusItems:[],setFocusItems:function(){},addFocusItem:function(){},groupRef:null}),b=l((function(r,t){var n,l=r.children,c=r["aria-label"],s=r["aria-labelledby"],v=r.role,b=void 0===v?"button":v,h=d(r,["children","aria-label","aria-labelledby","role"]),g=a(),y=i(m),I=y.focusedItemId,C=y.setFocusedItemId,E=y.addFocusItem,R=y.focusItems,N=y.groupRef,w=i(p),O=w.orientation,x=w.loop,D=w.disableTabIndexing,S=w.dir,A=e.Children.toArray(l)[0],P=!0===(null===(n=null==A?void 0:A.props)||void 0===n?void 0:n.disabled),j=I===g,F=D||!P&&j?0:-1;o((function(){R.includes(g)||E(g)}),[R,I,g,E]);var G=function(e){if(N&&N.current){C(e);var r=CSS.escape(e),t=N.current.querySelector("#".concat(r));t&&t.focus()}},V=function(e,r){for(var t,n=e,a=0;a<R.length;a++){if(n+=r,x)n<0&&(n=R.length-1),n>=R.length&&(n=0);else if(n<0||n>=R.length)return-1;var o=R[n],l=null===(t=null==N?void 0:N.current)||void 0===t?void 0:t.querySelector("#".concat(CSS.escape(o)));if(l)if(!("true"===l.getAttribute("data-child-disabled")))return n}return-1},q=function(){var e=R.indexOf(g),r=V(e,-1);-1!==r&&G(R[r])},k=function(){var e=R.indexOf(g),r=V(e,1);-1!==r&&G(R[r])};return e.createElement(f.button,u({asChild:!0,onFocus:function(e){e.preventDefault(),P&&e.target.blur(),P||C(g)},tabIndex:F,ref:t,id:g,onKeyDown:function(e){if(!P)switch(e.key){case"ArrowUp":e.preventDefault(),"vertical"!==O&&"both"!==O||q();break;case"ArrowLeft":e.preventDefault(),"horizontal"!==O&&"both"!==O||("rtl"===S?k():q());break;case"ArrowDown":e.preventDefault(),"vertical"!==O&&"both"!==O||k();break;case"ArrowRight":e.preventDefault(),"horizontal"!==O&&"both"!==O||("rtl"===S?q():k());break;case"Home":e.preventDefault(),function(){if(R.length>0){var e=V(-1,1);-1!==e&&G(R[e])}}();break;case"End":e.preventDefault(),function(){if(R.length>0){var e=V(R.length,-1);-1!==e&&G(R[e])}}()}},"data-child-disabled":P,role:b,"aria-selected":j,"aria-disabled":P,"aria-label":c,"aria-labelledby":s},h),l)}));b.displayName="RovingFocusItem";var h={Root:function(r){var t=r.children,n=r.orientation,a=void 0===n?"horizontal":n,o=r.loop,l=void 0===o||o,i=r["aria-label"],c=r["aria-labelledby"],s=r.disableTabIndexing,v=void 0!==s&&s,m=r.dir,b=void 0===m?"ltr":m,h=d(r,["children","orientation","loop","aria-label","aria-labelledby","disableTabIndexing","dir"]),g={orientation:a,loop:l,disableTabIndexing:v,dir:b};return e.createElement(p.Provider,{value:g},e.createElement(f.div,u({role:"listbox","aria-orientation":"both"===a?void 0:a,"aria-label":i,"aria-labelledby":c},h),t))},Group:function(r){var l=r.children,i=r["aria-label"],c=r["aria-labelledby"],v=d(r,["children","aria-label","aria-labelledby"]),p=t(null),b=n([]),h=b[0],g=b[1],y=n(null),I=y[0],C=y[1],E=a();o((function(){!I&&h.length>0&&C(h[0])}),[h,I]);var R={focusedItemId:I,setFocusedItemId:C,focusItems:h,setFocusItems:g,addFocusItem:function(e){g((function(r){return s(s([],r,!0),[e],!1)}))},groupRef:p};return e.createElement(m.Provider,{value:R},e.createElement(f.div,u({id:E,ref:p,role:"group","aria-label":i,"aria-labelledby":c},v),l))},Item:b};var g=e.createContext({itemSelected:!1}),y=function(){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root, RadioGroup.Item, etc. instead."),null};function I(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=I(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function C(){for(var e,r,t=0,n="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=I(e))&&(n&&(n+=" "),n+=r);return n}y.Root=function(r){var a=r.value,l=r.defaultValue,i=void 0===l?"":l,s=r.onValueChange,p=r.children,m=r.disabled,b=void 0!==m&&m,g=r.required,y=void 0!==g&&g,I=r.name,C=void 0===I?"":I;r.orientation,r.loop,r.dir;var E=d(r,["value","defaultValue","onValueChange","children","disabled","required","name","orientation","loop","dir"]),R=function(e,r,a){var l=n(r),i=l[0],u=l[1],d=void 0!==e,s=d?e:i,f=t(d),v=t(e);o((function(){"production"!==process.env.NODE_ENV&&(f.current!==d&&console.warn("Component changed from ".concat(f.current?"controlled":"uncontrolled"," to ").concat(d?"controlled":"uncontrolled",".")),f.current=d)}),[d]),o((function(){"production"!==process.env.NODE_ENV&&d&&!a&&e!==v.current&&console.warn("A component is changing a controlled value without an onChange handler. This will render a controlled component as uncontrolled."),v.current=e}),[e,d,a]);var p=c((function(e){var r="function"==typeof e?e(s):e;d||u(r),a&&a(r)}),[d,a,s]);return[s,p]}(a,i,s),N=R[0],w={selectedValue:N,setSelectedValue:R[1],groupDisabled:b};return e.createElement(f.div,u({},E,{"aria-required":y,role:"radiogroup","aria-disabled":b}),e.createElement(h.Root,null,e.createElement(v.Provider,{value:w},e.createElement(h.Group,null,p))),e.createElement("input",{type:"radio",hidden:!0,name:C,value:N,disabled:b,required:y}))},y.Item=function(r){var t=r.value,n=r.children,a=r.disabled,o=r.required,l=void 0!==o&&o,c=r.className,s=void 0===c?"":c,p=r.asChild,m=void 0!==p&&p,b=d(r,["value","children","disabled","required","className","asChild"]),y=i(v);if(!y)throw new Error("RadioGroup.Item must be used within a RadioGroup.Root");var I=y.groupDisabled,C=y.selectedValue,E=y.setSelectedValue,R=t===C;return e.createElement(h.Item,null,e.createElement(f.button,u({role:"radio",type:"button",disabled:I||a,onClick:function(){return E(t)},onFocus:function(){return E(t)},"aria-disabled":I||a,"aria-checked":t===C,"data-checked":t===C,"aria-required":l,asChild:m,className:s},b),e.createElement(g.Provider,{value:{itemSelected:R}},n)))},y.Indicator=function(r){var t=r.children,n=r.className,a=r.asChild,o=void 0!==a&&a,l=d(r,["children","className","asChild"]);return e.useContext(g).itemSelected?e.createElement(f.span,u({className:n,asChild:o},l),t):null};var E=r({rootClass:""}),R=function(){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null};R.Root=function(r){var t,n,a=r.children,o=r.className,l=void 0===o?"":o,i=r.customRootClass,f=void 0===i?"":i,v=r.variant,p=void 0===v?"":v,m=r.size,b=void 0===m?"":m,h=r.color,g=void 0===h?"":h,I=d(r,["children","className","customRootClass","variant","size","color"]),R=function(e,r){void 0===e&&(e="");var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(t):"".concat("rad-ui","-").concat(t)}(f,"RadioGroup"),N=c((function(){return n?Object.fromEntries(Object.entries(n).filter((function(e){e[0];var r=e[1];return void 0!==r&&""!==r})).map((function(e){var r=e[0],n=e[1];return["data-".concat(t,"-").concat(r),n]}))):{}}),[t="radio-group",n={variant:p,size:b}]),w=function(e){return c((function(){return e?{"data-rad-ui-accent-color":e}:{}}),[e])}(g),O=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return c((function(){return Object.assign.apply(Object,s([{}],e.filter((function(e){return null!==e})),!1))}),[e])}(N(),w());return e.createElement(E.Provider,{value:{rootClass:R}},e.createElement(y.Root,u({className:C("".concat(R,"-root"),R,l)},O,I)," ",a," "))},R.Item=function(r){var t=r.children,n=r.className,a=void 0===n?"":n,o=r.value,l=d(r,["children","className","value"]),c=i(E).rootClass;return e.createElement(y.Item,u({className:C("".concat(c,"-item"),a),value:o},l),t)},R.Indicator=function(r){var t=r.className,n=void 0===t?"":t,a=r.children,o=d(r,["className","children"]),l=e.useContext(E).rootClass;return e.createElement(y.Indicator,u({className:C("".concat(l,"-indicator"),n)},o),a)},R.Label=function(r){var t=r.className,n=void 0===t?"":t,a=r.asChild,o=void 0!==a&&a,l=r.children,i=d(r,["className","asChild","children"]),c=e.useContext(E).rootClass;return e.createElement(f.label,u({},i,{className:C("".concat(c,"-label"),c,n),asChild:o})," ",l," ")};export{R as default};
@@ -1 +1 @@
1
- 'use client';import e,{createContext as r,useRef as n,useEffect as t,useContext as o,useCallback as c}from"react";var l=function(){return l=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},l.apply(this,arguments)};function u(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}function i(e){var r,n,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(n=i(e[r]))&&(t&&(t+=" "),t+=n)}else for(n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function a(){for(var e,r,n=0,t="",o=arguments.length;n<o;n++)(e=arguments[n])&&(r=i(e))&&(t&&(t+=" "),t+=r);return t}"function"==typeof SuppressedError&&SuppressedError;var s=r({rootClass:""}),v=function(){return console.warn("Direct usage of ScrollArea is not supported. Please use ScrollArea.Root and ScrollArea.Viewport instead."),null};v.Root=function(r){var o=r.children,c=r.className,i=void 0===c?"":c,v=r.customRootClass,d=void 0===v?"":v,f=u(r,["children","className","customRootClass"]),m=function(e,r){void 0===e&&(e="");var n=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)}(d,"ScrollArea"),p=n(null),h=n(null);t((function(){g()}),[p,h]),t((function(){var e=h.current;if(e){var r=function(){g()},n=new ResizeObserver((function(n){for(var t=0,o=n;t<o.length;t++){var c=o[t];(c.target===e||e.contains(c.target))&&r()}}));n.observe(e);var t=function(e){n.observe(e),Array.from(e.children).forEach((function(e){t(e)}))};Array.from(e.children).forEach((function(e){t(e)}));var o=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t(e)}))})),r()}));return o.observe(e,{childList:!0,subtree:!0}),window.addEventListener("resize",r),function(){n.disconnect(),o.disconnect(),window.removeEventListener("resize",r)}}}),[]);var g=function(){var e,r,n=(null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.clientHeight)||0,t=n/(((null===(r=null==h?void 0:h.current)||void 0===r?void 0:r.scrollHeight)||0)/n);t<24&&(t=24),p.current&&(p.current.style.height="".concat(t,"px"))},y=function(e){if(h.current){var r=h.current.scrollTop,n=e-r,t=performance.now(),o=function(e){var c=e-t,l=Math.min(c/150,1),u=1-Math.pow(1-l,3),i=r+n*u;h.current&&(h.current.scrollTop=i),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}};return e.createElement(s.Provider,{value:{rootClass:m,scrollXThumbRef:p,scrollAreaViewportRef:h,handleScroll:function(){var e,r,n,t,o=(null===(e=h.current)||void 0===e?void 0:e.clientHeight)||0,c=(null===(r=h.current)||void 0===r?void 0:r.scrollHeight)||0,l=((null===(n=h.current)||void 0===n?void 0:n.scrollTop)||0)/(c-o)*(o-((null===(t=p.current)||void 0===t?void 0:t.clientHeight)||0));p.current&&(p.current.style.top="".concat(l,"px"))},handleScrollbarClick:function(e){!function(e){var r,n,t,o=(null===(r=null==h?void 0:h.current)||void 0===r?void 0:r.clientHeight)||0,c=((null===(n=null==h?void 0:h.current)||void 0===n?void 0:n.scrollHeight)||0)/o;if(p.current){var l=p.current.getBoundingClientRect().top,u=l+p.current.clientHeight,i=(null===(t=p.current)||void 0===t?void 0:t.clientHeight)||0;if(e>l&&e<u)return;if(e<l){var a=h.current.scrollTop-i*c;y(a)}e>u&&(a=h.current.scrollTop+i*c,y(a))}}(e.clientY)}}},e.createElement("div",l({className:a(m,i)},f),o))},v.Viewport=function(r){var n=r.children,t=r.className,c=void 0===t?"":t,i=u(r,["children","className"]),v=o(s),d=v.rootClass,f=v.scrollAreaViewportRef,m=v.handleScroll;return e.createElement("div",l({ref:f,className:a(d+"-viewport",c),onScroll:m},i),n)},v.Scrollbar=function(r){var t=r.children,i=r.className,v=void 0===i?"":i,d=u(r,["children","className"]),f=o(s),m=f.rootClass,p=f.handleScrollbarClick,h=f.scrollXThumbRef,g=n(null),y=n(!1),E=n(0),b=c((function(e){if(!(null==h?void 0:h.current))return!1;var r=h.current.getBoundingClientRect(),n=r.top,t=r.bottom;return!(e>=n&&e<=t)}),[h]),w=c((function(e){p&&(e.preventDefault(),E.current=e.clientY,p({clientY:e.clientY}),setTimeout((function(){y.current&&(g.current=setInterval((function(){y.current&&b(E.current)?p({clientY:E.current}):T()}),50))}),300),y.current=!0)}),[p,b]),T=c((function(){y.current=!1,g.current&&(clearInterval(g.current),g.current=null)}),[]);return e.useEffect((function(){var e=function(){return T()},r=function(){return T()};return document.addEventListener("mouseup",e),document.addEventListener("mouseleave",r),function(){document.removeEventListener("mouseup",e),document.removeEventListener("mouseleave",r),T()}}),[T]),e.createElement("div",l({className:a(m+"-scrollbar",v),onMouseDown:w,onMouseUp:T,onMouseLeave:T},d),t)},v.Thumb=function(r){var t=r.children,i=r.className,v=void 0===i?"":i,d=u(r,["children","className"]),f=o(s),m=f.rootClass,p=f.scrollXThumbRef,h=f.scrollAreaViewportRef,g=n(!1),y=n({y:0,scrollTop:0}),E=c((function(e){(null==h?void 0:h.current)&&(null==p?void 0:p.current)&&(e.preventDefault(),e.stopPropagation(),g.current=!0,y.current={y:e.clientY,scrollTop:h.current.scrollTop},document.body.style.userSelect="none")}),[h,p]),b=c((function(e){var r;if(g.current&&(null==h?void 0:h.current)&&(null==p?void 0:p.current)){e.preventDefault();var n=e.clientY-y.current.y,t=null===(r=p.current.parentElement)||void 0===r?void 0:r.getBoundingClientRect();if(t){var o=h.current.clientHeight,c=h.current.scrollHeight,l=p.current.clientHeight,u=n/(t.height-l),i=c-o,a=y.current.scrollTop+u*i,s=Math.max(0,Math.min(a,i));h.current.scrollTop=s}}}),[h,p]),w=c((function(){g.current=!1,document.body.style.cursor="",document.body.style.userSelect=""}),[]);return e.useEffect((function(){var e=function(e){return b(e)},r=function(){return w()};return g.current&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",r)),document.addEventListener("mousemove",e),document.addEventListener("mouseup",r),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",r),w()}}),[b,w]),e.createElement("div",l({ref:p,className:a(m+"-thumb",v),onMouseDown:E},d),t)},v.Corner=function(r){var n=r.children,t=u(r,["children"]);return e.createElement("div",l({},t),n)};export{v as default};
1
+ 'use client';import e,{createContext as r,useRef as n,useEffect as t,useContext as o,useCallback as c}from"react";var l=function(){return l=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},l.apply(this,arguments)};function u(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}function i(e){var r,n,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(r=0;r<o;r++)e[r]&&(n=i(e[r]))&&(t&&(t+=" "),t+=n)}else for(n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function a(){for(var e,r,n=0,t="",o=arguments.length;n<o;n++)(e=arguments[n])&&(r=i(e))&&(t&&(t+=" "),t+=r);return t}"function"==typeof SuppressedError&&SuppressedError;var s=r({rootClass:""}),v=function(){return console.warn("Direct usage of ScrollArea is not supported. Please use ScrollArea.Root and ScrollArea.Viewport instead."),null};v.Root=function(r){var o=r.children,c=r.className,i=void 0===c?"":c,v=r.customRootClass,d=void 0===v?"":v,f=u(r,["children","className","customRootClass"]),m=function(e,r){void 0===e&&(e="");var n=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e?"".concat(e,"-").concat(n):"".concat("rad-ui","-").concat(n)}(d,"ScrollArea"),p=n(null),h=n(null);t((function(){g()}),[p,h]),t((function(){var e=h.current;if(e){var r=function(){g()},n=new ResizeObserver((function(n){for(var t=0,o=n;t<o.length;t++){var c=o[t];(c.target===e||e.contains(c.target))&&r()}}));n.observe(e);var t=function(e){n.observe(e),Array.from(e.children).forEach((function(e){t(e)}))};Array.from(e.children).forEach((function(e){t(e)}));var o=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t(e)}))})),r()}));return o.observe(e,{childList:!0,subtree:!0}),window.addEventListener("resize",r),function(){n.disconnect(),o.disconnect(),window.removeEventListener("resize",r)}}}),[]);var g=function(){var e,r,n=(null===(e=null==h?void 0:h.current)||void 0===e?void 0:e.clientHeight)||0,t=n/(((null===(r=null==h?void 0:h.current)||void 0===r?void 0:r.scrollHeight)||0)/n);t<24&&(t=24),p.current&&(p.current.style.height="".concat(t,"px"))},y=function(e){if(h.current){var r=h.current.scrollTop,n=e-r,t=performance.now(),o=function(e){var c=e-t,l=Math.min(c/150,1),u=1-Math.pow(1-l,3),i=r+n*u;h.current&&(h.current.scrollTop=i),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}};return e.createElement(s.Provider,{value:{rootClass:m,scrollXThumbRef:p,scrollAreaViewportRef:h,handleScroll:function(){var e,r,n,t,o=(null===(e=h.current)||void 0===e?void 0:e.clientHeight)||0,c=(null===(r=h.current)||void 0===r?void 0:r.scrollHeight)||0,l=((null===(n=h.current)||void 0===n?void 0:n.scrollTop)||0)/(c-o)*(o-((null===(t=p.current)||void 0===t?void 0:t.clientHeight)||0));p.current&&(p.current.style.top="".concat(l,"px"))},handleScrollbarClick:function(e){!function(e){var r,n,t,o=(null===(r=null==h?void 0:h.current)||void 0===r?void 0:r.clientHeight)||0,c=((null===(n=null==h?void 0:h.current)||void 0===n?void 0:n.scrollHeight)||0)/o;if(p.current){var l=p.current.getBoundingClientRect().top,u=l+p.current.clientHeight,i=(null===(t=p.current)||void 0===t?void 0:t.clientHeight)||0;if(e>l&&e<u)return;if(e<l){var a=h.current.scrollTop-i*c;y(a)}e>u&&(a=h.current.scrollTop+i*c,y(a))}}(e.clientY)}}},e.createElement("div",l({className:a(m,i)},f),o))},v.Viewport=function(r){var n=r.children,t=r.className,c=void 0===t?"":t,i=u(r,["children","className"]),v=o(s),d=v.rootClass,f=v.scrollAreaViewportRef,m=v.handleScroll;return e.createElement("div",l({ref:f,className:a(d+"-viewport",c),onScroll:m},i),n)},v.Scrollbar=function(r){var t=r.children,i=r.className,v=void 0===i?"":i,d=r.orientation,f=u(r,["children","className","orientation"]),m=o(s),p=m.rootClass,h=m.handleScrollbarClick,g=m.scrollXThumbRef,y=n(null),E=n(!1),b=n(0),w=c((function(e){if(!(null==g?void 0:g.current))return!1;var r=g.current.getBoundingClientRect(),n=r.top,t=r.bottom;return!(e>=n&&e<=t)}),[g]),T=c((function(e){h&&(e.preventDefault(),b.current=e.clientY,h({clientY:e.clientY}),setTimeout((function(){E.current&&(y.current=setInterval((function(){E.current&&w(b.current)?h({clientY:b.current}):L()}),50))}),300),E.current=!0)}),[h,w]),L=c((function(){E.current=!1,y.current&&(clearInterval(y.current),y.current=null)}),[]);return e.useEffect((function(){var e=function(){return L()},r=function(){return L()};return document.addEventListener("mouseup",e),document.addEventListener("mouseleave",r),function(){document.removeEventListener("mouseup",e),document.removeEventListener("mouseleave",r),L()}}),[L]),e.createElement("div",l({className:a(p+"-scrollbar",v),"data-orientation":d,onMouseDown:T,onMouseUp:L,onMouseLeave:L},f),t)},v.Thumb=function(r){var t=r.children,i=r.className,v=void 0===i?"":i,d=u(r,["children","className"]),f=o(s),m=f.rootClass,p=f.scrollXThumbRef,h=f.scrollAreaViewportRef,g=n(!1),y=n({y:0,scrollTop:0}),E=c((function(e){(null==h?void 0:h.current)&&(null==p?void 0:p.current)&&(e.preventDefault(),e.stopPropagation(),g.current=!0,y.current={y:e.clientY,scrollTop:h.current.scrollTop},document.body.style.userSelect="none")}),[h,p]),b=c((function(e){var r;if(g.current&&(null==h?void 0:h.current)&&(null==p?void 0:p.current)){e.preventDefault();var n=e.clientY-y.current.y,t=null===(r=p.current.parentElement)||void 0===r?void 0:r.getBoundingClientRect();if(t){var o=h.current.clientHeight,c=h.current.scrollHeight,l=p.current.clientHeight,u=n/(t.height-l),i=c-o,a=y.current.scrollTop+u*i,s=Math.max(0,Math.min(a,i));h.current.scrollTop=s}}}),[h,p]),w=c((function(){g.current=!1,document.body.style.cursor="",document.body.style.userSelect=""}),[]);return e.useEffect((function(){var e=function(e){return b(e)},r=function(){return w()};return g.current&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",r)),document.addEventListener("mousemove",e),document.addEventListener("mouseup",r),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",r),w()}}),[b,w]),e.createElement("div",l({ref:p,className:a(m+"-thumb",v),onMouseDown:E},d),t)},v.Corner=function(r){var n=r.children,t=u(r,["children"]);return e.createElement("div",l({},t),n)};export{v as default};