@matthiaskrijgsman/mat-ui 0.0.8 → 0.0.9
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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -140,5 +140,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
140
140
|
`,...r,children:i&&i.map((a,l)=>h.jsx("option",{value:a.value,disabled:a.disabled,children:a.label},l))}),h.jsxs(Be,{children:[o&&h.jsx(Fe,{}),h.jsx(Se,{Icon:Zt})]})]}),h.jsx(he,{children:s}),h.jsx(me,{children:o})]})},At=e=>{const{children:t,onClick:n,selected:s,disabled:i=!1}=e;return h.jsxs("div",{onClick:()=>!i&&n&&n(),className:k("hover:bg-gray-100 active:bg-gray-200 px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",s&&!i&&"bg-blue-50 hover:bg-blue-100 active:bg-blue-100",i&&"text-gray-400 cursor-not-allowed hover:bg-transparent active:bg-transparent"),children:[h.jsx("div",{className:"flex-1",children:t}),s&&!i&&h.jsx("div",{className:"shrink-0",children:h.jsx(Nd,{className:"h-5 w-5"})})]})};function Jt(){return typeof window<"u"}function et(e){return Vs(e)?(e.nodeName||"").toLowerCase():"#document"}function te(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pe(e){var t;return(t=(Vs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vs(e){return Jt()?e instanceof Node||e instanceof te(e).Node:!1}function H(e){return Jt()?e instanceof Element||e instanceof te(e).Element:!1}function ge(e){return Jt()?e instanceof HTMLElement||e instanceof te(e).HTMLElement:!1}function Ns(e){return!Jt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof te(e).ShadowRoot}const Xd=new Set(["inline","contents"]);function Rt(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!Xd.has(i)}const Yd=new Set(["table","td","th"]);function Hd(e){return Yd.has(et(e))}const Gd=[":popover-open",":modal"];function Qt(e){return Gd.some(t=>{try{return e.matches(t)}catch{return!1}})}const qd=["transform","translate","scale","rotate","perspective"],Zd=["transform","translate","scale","rotate","perspective","filter"],Jd=["paint","layout","strict","content"];function Is(e){const t=Os(),n=H(e)?ce(e):e;return qd.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Zd.some(s=>(n.willChange||"").includes(s))||Jd.some(s=>(n.contain||"").includes(s))}function Qd(e){let t=Re(e);for(;ge(t)&&!tt(t);){if(Is(t))return t;if(Qt(t))return null;t=Re(t)}return null}function Os(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const eh=new Set(["html","body","#document"]);function tt(e){return eh.has(et(e))}function ce(e){return te(e).getComputedStyle(e)}function en(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Re(e){if(et(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ns(e)&&e.host||pe(e);return Ns(t)?t.host:t}function na(e){const t=Re(e);return tt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&Rt(t)?t:na(t)}function jt(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=na(e),o=i===((s=e.ownerDocument)==null?void 0:s.body),r=te(i);if(o){const a=Ls(r);return t.concat(r,r.visualViewport||[],Rt(i)?i:[],a&&n?jt(a):[])}return t.concat(i,jt(i,[],n))}function Ls(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mt=Math.min,oe=Math.max,tn=Math.round,nn=Math.floor,ye=e=>({x:e,y:e});function sa(e,t){return typeof e=="function"?e(t):e}function Fs(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function th(e){return e==="x"?"y":"x"}function nh(e){return e==="y"?"height":"width"}const sh=new Set(["top","bottom"]);function Bs(e){return sh.has(Fs(e))?"y":"x"}function ih(e){return th(Bs(e))}function rh(e){return{top:0,right:0,bottom:0,left:0,...e}}function oh(e){return typeof e!="number"?rh(e):{top:e,right:e,bottom:e,left:e}}function sn(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}/*!
|
|
141
141
|
* tabbable 6.2.0
|
|
142
142
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
143
|
-
*/var ah=["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])"],_s=ah.join(","),ra=typeof Element>"u",Dt=ra?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!ra&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},on=function e(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),o=i===""||i==="true",r=o||n&&t&&e(t.parentNode);return r},lh=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},ch=function(t,n,s){if(on(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(_s));return n&&Dt.call(t,_s)&&i.unshift(t),i=i.filter(s),i},uh=function e(t,n,s){for(var i=[],o=Array.from(t);o.length;){var r=o.shift();if(!on(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,u=e(l,!0,s);s.flatten?i.push.apply(i,u):i.push({scopeParent:r,candidates:u})}else{var c=Dt.call(r,_s);c&&s.filter(r)&&(n||!t.includes(r))&&i.push(r);var f=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),d=!on(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&d){var m=e(f===!0?r.children:f.children,!0,s);s.flatten?i.push.apply(i,m):i.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return i},oa=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},aa=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lh(t))&&!oa(t)?0:t.tabIndex},fh=function(t,n){var s=aa(t);return s<0&&n&&!oa(t)?0:s},dh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},la=function(t){return t.tagName==="INPUT"},hh=function(t){return la(t)&&t.type==="hidden"},mh=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},ph=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},gh=function(t){if(!t.name)return!0;var n=t.form||rn(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(r){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",r.message),!1}var o=ph(i,t.form);return!o||o===t},yh=function(t){return la(t)&&t.type==="radio"},vh=function(t){return yh(t)&&!gh(t)},xh=function(t){var n,s=t&&rn(t),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==t){var r,a,l;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,f;s=rn(i),i=(u=s)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return o},ca=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},bh=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=Dt.call(t,"details>summary:first-of-type"),r=o?t.parentElement:t;if(Dt.call(r,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,u=rn(t);if(l&&!l.shadowRoot&&i(l)===!0)return ca(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(xh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return ca(t);return!1},wh=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Dt.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Th=function(t,n){return!(n.disabled||on(n)||hh(n)||bh(n,t)||mh(n)||wh(n))},ua=function(t,n){return!(vh(n)||aa(n)<0||!Th(t,n))},Sh=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ch=function e(t){var n=[],s=[];return t.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=fh(a,r),u=r?e(i.candidates):a;l===0?r?n.push.apply(n,u):n.push(a):s.push({documentOrder:o,tabIndex:l,item:i,isScope:r,content:u})}),s.sort(dh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},fa=function(t,n){n=n||{};var s;return n.getShadowRoot?s=uh([t],n.includeContainer,{filter:ua.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Sh}):s=ch(t,n.includeContainer,ua.bind(null,n)),Ch(s)};function Ph(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Eh(){return/apple/i.test(navigator.vendor)}function Ah(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Rh(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ns(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function $s(e){return e?.ownerDocument||document}var jh=typeof document<"u",Mh=function(){},je=jh?T.useLayoutEffect:Mh;const Dh={...S}.useInsertionEffect||(e=>e());function kh(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Dh(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return t.current==null?void 0:t.current(...s)},[])}const da=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ha(e,t){const n=fa(e,da()),s=n.length;if(s===0)return;const i=Ah($s(e)),o=n.indexOf(i),r=o===-1?t===1?0:s-1:o+t;return n[r]}function Vh(e){return ha($s(e).body,1)||e}function Nh(e){return ha($s(e).body,-1)||e}function Ws(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Rh(n,s)}function Ih(e){fa(e,da()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ma(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function pa(e,t,n){let{reference:s,floating:i}=e;const o=Bs(t),r=ih(t),a=nh(r),l=Fs(t),u=o==="y",c=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:s.y-i.height};break;case"bottom":m={x:c,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:f};break;case"left":m={x:s.x-i.width,y:f};break;default:m={x:s.x,y:s.y}}switch(ia(t)){case"start":m[r]-=d*(n&&u?-1:1);break;case"end":m[r]+=d*(n&&u?-1:1);break}return m}const Oh=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=pa(u,s,l),d=s,m={},p=0;for(let y=0;y<a.length;y++){const{name:x,fn:v}=a[y],{x:b,y:g,data:E,reset:C}=await v({x:c,y:f,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:t}});c=b??c,f=g??f,m={...m,[x]:{...m[x],...E}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:f}=pa(u,d,l)),y=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:m}};async function Lh(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=sa(t,e),p=oh(m),x=a[d?f==="floating"?"reference":"floating":f],v=sn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=f==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(g))?await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1}:{x:1,y:1},C=sn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:g,strategy:l}):b);return{top:(v.top-C.top+p.top)/E.y,bottom:(C.bottom-v.bottom+p.bottom)/E.y,left:(v.left-C.left+p.left)/E.x,right:(C.right-v.right+p.right)/E.x}}const Fh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:o,platform:r,elements:a}=t,{apply:l=()=>{},...u}=sa(e,t),c=await Lh(t,u),f=Fs(i),d=ia(i),m=Bs(i)==="y",{width:p,height:y}=o.floating;let x,v;f==="top"||f==="bottom"?(x=f,v=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,x=d==="end"?"top":"bottom");const b=y-c.top-c.bottom,g=p-c.left-c.right,E=Mt(y-c[x],b),C=Mt(p-c[v],g),P=!t.middlewareData.shift;let A=E,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=g),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(A=b),P&&!d){const I=oe(c.left,0),U=oe(c.right,0),ne=oe(c.top,0),O=oe(c.bottom,0);m?R=p-2*(I!==0||U!==0?I+U:oe(c.left,c.right)):A=y-2*(ne!==0||O!==0?ne+O:oe(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:A});const N=await r.getDimensions(a.floating);return p!==N.width||y!==N.height?{reset:{rects:!0}}:{}}}};function ga(e){const t=ce(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=ge(e),o=i?e.offsetWidth:n,r=i?e.offsetHeight:s,a=tn(n)!==o||tn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function Us(e){return H(e)?e:e.contextElement}function nt(e){const t=Us(e);if(!ge(t))return ye(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:o}=ga(t);let r=(o?tn(n.width):n.width)/s,a=(o?tn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Bh=ye(0);function ya(e){const t=te(e);return!Os()||!t.visualViewport?Bh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _h(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==te(e)?!1:t}function _e(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Us(e);let r=ye(1);t&&(s?H(s)&&(r=nt(s)):r=nt(e));const a=_h(o,n,s)?ya(o):ye(0);let l=(i.left+a.x)/r.x,u=(i.top+a.y)/r.y,c=i.width/r.x,f=i.height/r.y;if(o){const d=te(o),m=s&&H(s)?te(s):s;let p=d,y=Ls(p);for(;y&&s&&m!==p;){const x=nt(y),v=y.getBoundingClientRect(),b=ce(y),g=v.left+(y.clientLeft+parseFloat(b.paddingLeft))*x.x,E=v.top+(y.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=g,u+=E,p=te(y),y=Ls(p)}}return sn({width:c,height:f,x:l,y:u})}function an(e,t){const n=en(e).scrollLeft;return t?t.left+n:_e(pe(e)).left+n}function va(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-an(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function $h(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const o=i==="fixed",r=pe(s),a=t?Qt(t.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ye(1);const c=ye(0),f=ge(s);if((f||!f&&!o)&&((et(s)!=="body"||Rt(r))&&(l=en(s)),ge(s))){const m=_e(s);u=nt(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const d=r&&!f&&!o?va(r,l):ye(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function Wh(e){return Array.from(e.getClientRects())}function Uh(e){const t=pe(e),n=en(e),s=e.ownerDocument.body,i=oe(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=oe(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+an(e);const a=-n.scrollTop;return ce(s).direction==="rtl"&&(r+=oe(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const xa=25;function zh(e,t){const n=te(e),s=pe(e),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(i){o=i.width,r=i.height;const c=Os();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=an(s);if(u<=0){const c=s.ownerDocument,f=c.body,d=getComputedStyle(f),m=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-m);p<=xa&&(o-=p)}else u<=xa&&(o+=u);return{width:o,height:r,x:a,y:l}}const Kh=new Set(["absolute","fixed"]);function Xh(e,t){const n=_e(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,o=ge(e)?nt(e):ye(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=s*o.y;return{width:r,height:a,x:l,y:u}}function ba(e,t,n){let s;if(t==="viewport")s=zh(e,n);else if(t==="document")s=Uh(pe(e));else if(H(t))s=Xh(t,n);else{const i=ya(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sn(s)}function wa(e,t){const n=Re(e);return n===t||!H(n)||tt(n)?!1:ce(n).position==="fixed"||wa(n,t)}function Yh(e,t){const n=t.get(e);if(n)return n;let s=jt(e,[],!1).filter(a=>H(a)&&et(a)!=="body"),i=null;const o=ce(e).position==="fixed";let r=o?Re(e):e;for(;H(r)&&!tt(r);){const a=ce(r),l=Is(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Kh.has(i.position)||Rt(r)&&!l&&wa(e,r))?s=s.filter(c=>c!==r):i=a,r=Re(r)}return t.set(e,s),s}function Hh(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const r=[...n==="clippingAncestors"?Qt(t)?[]:Yh(t,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const f=ba(t,c,i);return u.top=oe(f.top,u.top),u.right=Mt(f.right,u.right),u.bottom=Mt(f.bottom,u.bottom),u.left=oe(f.left,u.left),u},ba(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gh(e){const{width:t,height:n}=ga(e);return{width:t,height:n}}function qh(e,t,n){const s=ge(t),i=pe(t),o=n==="fixed",r=_e(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ye(0);function u(){l.x=an(i)}if(s||!s&&!o)if((et(t)!=="body"||Rt(i))&&(a=en(t)),s){const m=_e(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else i&&u();o&&!s&&i&&u();const c=i&&!s&&!o?va(i,a):ye(0),f=r.left+a.scrollLeft-l.x-c.x,d=r.top+a.scrollTop-l.y-c.y;return{x:f,y:d,width:r.width,height:r.height}}function zs(e){return ce(e).position==="static"}function Ta(e,t){if(!ge(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pe(e)===n&&(n=n.ownerDocument.body),n}function Sa(e,t){const n=te(e);if(Qt(e))return n;if(!ge(e)){let i=Re(e);for(;i&&!tt(i);){if(H(i)&&!zs(i))return i;i=Re(i)}return n}let s=Ta(e,t);for(;s&&Hd(s)&&zs(s);)s=Ta(s,t);return s&&tt(s)&&zs(s)&&!Is(s)?n:s||Qd(e)||n}const Zh=async function(e){const t=this.getOffsetParent||Sa,n=this.getDimensions,s=await n(e.floating);return{reference:qh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Jh(e){return ce(e).direction==="rtl"}const Qh={convertOffsetParentRelativeRectToViewportRelativeRect:$h,getDocumentElement:pe,getClippingRect:Hh,getOffsetParent:Sa,getElementRects:Zh,getClientRects:Wh,getDimensions:Gh,getScale:nt,isElement:H,isRTL:Jh};function Ca(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function em(e,t){let n=null,s;const i=pe(e);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:c,top:f,width:d,height:m}=u;if(a||t(),!d||!m)return;const p=nn(f),y=nn(i.clientWidth-(c+d)),x=nn(i.clientHeight-(f+m)),v=nn(c),g={rootMargin:-p+"px "+-y+"px "+-x+"px "+-v+"px",threshold:oe(0,Mt(1,l))||1};let E=!0;function C(P){const A=P[0].intersectionRatio;if(A!==l){if(!E)return r();A?r(!1,A):s=setTimeout(()=>{r(!1,1e-7)},1e3)}A===1&&!Ca(u,e.getBoundingClientRect())&&r(),E=!1}try{n=new IntersectionObserver(C,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,g)}n.observe(e)}return r(!0),o}function tm(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=Us(e),c=i||o?[...u?jt(u):[],...jt(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const f=u&&a?em(u,n):null;let d=-1,m=null;r&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let p,y=l?_e(e):null;l&&x();function x(){const v=_e(e);y&&!Ca(y,v)&&n(),y=v,p=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const nm=Fh,sm=(e,t,n)=>{const s=new Map,i={platform:Qh,...n},o={...i.platform,_c:s};return Oh(e,t,{...i,platform:o})};var im=typeof document<"u",rm=function(){},ln=im?T.useLayoutEffect:rm;function cn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!cn(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&e.$$typeof)&&!cn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ea(e,t){const n=Pa(e);return Math.round(t*n)/n}function Ks(e){const t=S.useRef(e);return ln(()=>{t.current=e}),t}function om(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,f]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=S.useState(s);cn(d,s)||m(s);const[p,y]=S.useState(null),[x,v]=S.useState(null),b=S.useCallback(V=>{V!==P.current&&(P.current=V,y(V))},[]),g=S.useCallback(V=>{V!==A.current&&(A.current=V,v(V))},[]),E=o||p,C=r||x,P=S.useRef(null),A=S.useRef(null),R=S.useRef(c),N=l!=null,I=Ks(l),U=Ks(i),ne=Ks(u),O=S.useCallback(()=>{if(!P.current||!A.current)return;const V={placement:t,strategy:n,middleware:d};U.current&&(V.platform=U.current),sm(P.current,A.current,V).then(J=>{const w={...J,isPositioned:ne.current!==!1};K.current&&!cn(R.current,w)&&(R.current=w,Qs.flushSync(()=>{f(w)}))})},[d,t,n,U,ne]);ln(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(V=>({...V,isPositioned:!1})))},[u]);const K=S.useRef(!1);ln(()=>(K.current=!0,()=>{K.current=!1}),[]),ln(()=>{if(E&&(P.current=E),C&&(A.current=C),E&&C){if(I.current)return I.current(E,C,O);O()}},[E,C,O,I,N]);const ve=S.useMemo(()=>({reference:P,floating:A,setReference:b,setFloating:g}),[b,g]),ue=S.useMemo(()=>({reference:E,floating:C}),[E,C]),_=S.useMemo(()=>{const V={position:n,left:0,top:0};if(!ue.floating)return V;const J=Ea(ue.floating,c.x),w=Ea(ue.floating,c.y);return a?{...V,transform:"translate("+J+"px, "+w+"px)",...Pa(ue.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:w}},[n,a,ue.floating,c.x,c.y]);return S.useMemo(()=>({...c,update:O,refs:ve,elements:ue,floatingStyles:_}),[c,O,ve,ue,_])}const am=(e,t)=>({...nm(e),options:[e,t]}),lm={...S};let Aa=!1,cm=0;const Ra=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cm++;function um(){const[e,t]=S.useState(()=>Aa?Ra():void 0);return je(()=>{e==null&&t(Ra())},[]),S.useEffect(()=>{Aa=!0},[]),e}const ja=lm.useId||um;let Xs;process.env.NODE_ENV!=="production"&&(Xs=new Set);function fm(){for(var e,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const i="Floating UI: "+n.join(" ");if(!((e=Xs)!=null&&e.has(i))){var o;(o=Xs)==null||o.add(i),console.error(i)}}function dm(){const e=new Map;return{emit(t,n){var s;(s=e.get(t))==null||s.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var s;(s=e.get(t))==null||s.delete(n)}}}const hm=S.createContext(null),mm=S.createContext(null),pm=()=>{var e;return((e=S.useContext(hm))==null?void 0:e.id)||null},gm=()=>S.useContext(mm);function Ma(e){return"data-floating-ui-"+e}const Da={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},ka=S.forwardRef(function(t,n){const[s,i]=S.useState();je(()=>{Eh()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[Ma("focus-guard")]:"",style:Da};return h.jsx("span",{...t,...o})}),Va=S.createContext(null),Na=Ma("portal");function ym(e){e===void 0&&(e={});const{id:t,root:n}=e,s=ja(),i=vm(),[o,r]=S.useState(null),a=S.useRef(null);return je(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),je(()=>{if(!s||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=s,u.setAttribute(Na,""),l.appendChild(u),a.current=u,r(u)},[t,s]),je(()=>{if(n===null||!s||a.current)return;let l=n||i?.portalNode;l&&!Vs(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=s,c.setAttribute(Na,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[t,n,s,i]),o}function Ia(e){const{children:t,id:n,root:s,preserveTabOrder:i=!0}=e,o=ym({id:n,root:s}),[r,a]=S.useState(null),l=S.useRef(null),u=S.useRef(null),c=S.useRef(null),f=S.useRef(null),d=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return S.useEffect(()=>{if(!o||!i||d)return;function y(x){o&&Ws(x)&&(x.type==="focusin"?ma:Ih)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,i,d]),S.useEffect(()=>{o&&(m||ma(o))},[m,o]),h.jsxs(Va.Provider,{value:S.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&h.jsx(ka,{"data-type":"outside",ref:l,onFocus:y=>{if(Ws(y,o)){var x;(x=c.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Nh(v);b?.focus()}}}),p&&o&&h.jsx("span",{"aria-owns":o.id,style:Da}),o&&Qs.createPortal(t,o),p&&o&&h.jsx(ka,{"data-type":"outside",ref:u,onFocus:y=>{if(Ws(y,o)){var x;(x=f.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Vh(v);b?.focus(),r?.closeOnFocusOut&&r?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const vm=()=>S.useContext(Va);let un=0;const Oa="--floating-ui-scrollbar-width";function xm(){const e=Ph(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Oa,o+"px"),o&&(n[i]=o+"px"),t){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,f=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(f))+"px",left:-(r-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(Oa),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let La=()=>{};const Fa=S.forwardRef(function(t,n){const{lockScroll:s=!1,...i}=t;return je(()=>{if(s)return un++,un===1&&(La=xm()),()=>{un--,un===0&&La()}},[s]),h.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function bm(e){const{open:t=!1,onOpenChange:n,elements:s}=e,i=ja(),o=S.useRef({}),[r]=S.useState(()=>dm()),a=pm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!H(m)&&fm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=S.useState(s.reference),c=kh((m,p,y)=>{o.current.openEvent=m?p:void 0,r.emit("openchange",{open:m,event:p,reason:y,nested:a}),n?.(m,p,y)}),f=S.useMemo(()=>({setPositionReference:u}),[]),d=S.useMemo(()=>({reference:l||s.reference||null,floating:s.floating||null,domReference:s.reference}),[l,s.reference,s.floating]);return S.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:d,events:r,floatingId:i,refs:f}),[t,c,d,r,i,f])}function wm(e){e===void 0&&(e={});const{nodeId:t}=e,n=bm({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||n,i=s.elements,[o,r]=S.useState(null),[a,l]=S.useState(null),c=i?.domReference||o,f=S.useRef(null),d=gm();je(()=>{c&&(f.current=c)},[c]);const m=om({...e,elements:{...i,...a&&{reference:a}}}),p=S.useCallback(g=>{const E=H(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),getClientRects:()=>g.getClientRects(),contextElement:g}:g;l(E),m.refs.setReference(E)},[m.refs]),y=S.useCallback(g=>{(H(g)||g===null)&&(f.current=g,r(g)),(H(m.refs.reference.current)||m.refs.reference.current===null||g!==null&&!H(g))&&m.refs.setReference(g)},[m.refs]),x=S.useMemo(()=>({...m.refs,setReference:y,setPositionReference:p,domReference:f}),[m.refs,y,p]),v=S.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),b=S.useMemo(()=>({...m,...s,refs:x,elements:v,nodeId:t}),[m,x,v,t,s]);return je(()=>{s.dataRef.current.floatingContext=b;const g=d?.nodesRef.current.find(E=>E.id===t);g&&(g.context=b)}),S.useMemo(()=>({...m,context:b,refs:x,elements:v}),[m,x,v,b])}const Tm={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},Ba=S.memo(({open:e,children:t,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>h.jsx(Ia,{children:h.jsx(ss,{children:e&&h.jsxs(h.Fragment,{children:[s&&h.jsx(Fa,{onClick:s}),h.jsx("div",{ref:o,style:i,className:"z-50",children:h.jsx(Pt.div,{className:n,style:{transformOrigin:Tm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),st=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=e,r=S.useMemo(()=>[am({apply({rects:f,elements:d}){s&&(d.floating.style.width=`${f.reference.width}px`),i&&(d.floating.style.minWidth=`${i}px`),o&&(d.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=wm({placement:t,middleware:r,whileElementsMounted:tm}),u=S.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t};const c=S.useMemo(()=>{const f=d=>{const{floatingStyles:m,setFloating:p,onOutsideClick:y,placement:x}=u.current,{className:v,open:b,children:g}=d;return h.jsx(Ba,{open:b,className:v,onOutsideClick:y,floatingStyles:m,setFloating:p,placement:x,children:g})};return S.memo(f)},[]);return{anchorRef:a.setReference,Popover:c}},Sm="flex flex-col bg-white border mt-1 border-gray-200 rounded-xl shadow-lg overflow-y-auto relative space-y-1",Cm={sm:"p-2",md:"p-3",lg:"p-4"},it=e=>{const{className:t,children:n,padding:s="md",...i}=e;return h.jsx("div",{className:k(Sm,Cm[s],t),...i,children:n})},fn=(e,t)=>{T.useEffect(()=>{if(!e)return;const n=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])},_a=e=>{const{className:t,label:n,description:s,options:i,onChange:o,value:r,placeholder:a,maxHeight:l=300,error:u}=e,[c,f]=T.useState(!1),d=S.useRef(null),m=i?.find(x=>x.value===r);fn(c,()=>f(!1)),T.useEffect(()=>{c&&d.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:y}=st({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return h.jsxs("div",{className:k("flex flex-col",t),children:[h.jsx(Le,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[h.jsxs("div",{ref:d,role:"button",tabIndex:0,className:k("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",u&&"border-red-600 ring-red-600/20 !pr-10",c&&"ring-4"),onKeyDown:x=>x.key===" "&&f(v=>!v),onClick:()=>f(!c),children:[m&&h.jsx("span",{children:m.label}),!m&&a&&h.jsx("span",{className:"text-gray-500",children:a})]}),h.jsxs(Be,{children:[u&&h.jsx(Fe,{}),!!r&&h.jsx(Se,{Icon:Et,onClick:()=>o(null)}),h.jsx(Se,{Icon:Zt})]}),h.jsx(y,{open:c,children:h.jsx(it,{className:"!p-0",style:{maxHeight:l},children:h.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const v=x.value===r;return h.jsx(At,{onClick:()=>{!x.disabled&&o&&(o(x.value),f(!1))},selected:v,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),h.jsx(he,{children:s}),h.jsx(me,{children:u})]})},Pm=e=>{const{className:t,label:n,description:s,options:i,onChange:o,onSearch:r,value:a,placeholder:l,maxHeight:u=300,error:c}=e,[f,d]=T.useState(!1),[m,p]=T.useState(i),[y,x]=T.useState(""),v=S.useRef(null),b=S.useRef(null),g=i?.find(P=>P.value===a);fn(f,()=>d(!1)),T.useEffect(()=>{p(r(y))},[y,i,r]),T.useEffect(()=>{f&&b.current?.focus()},[f]);const{anchorRef:E,Popover:C}=st({placement:"bottom",fullWidth:!0,onOutsideClick:()=>d(!1)});return h.jsxs("div",{className:k("flex flex-col",t),children:[h.jsx(Le,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[h.jsxs("div",{ref:v,role:"button",tabIndex:0,className:k("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",c&&"border-red-600 ring-red-600/20 !pr-10",f&&"ring-4"),onKeyDown:P=>P.key===" "&&d(A=>!A),onClick:()=>d(!f),children:[g&&h.jsx("span",{children:g.label}),!g&&l&&h.jsx("span",{className:"text-gray-500",children:l})]}),h.jsxs(Be,{children:[c&&h.jsx(Fe,{}),!!a&&h.jsx(Se,{Icon:Et,onClick:()=>o(null)}),h.jsx(Se,{Icon:Zt})]}),h.jsx(C,{open:f,children:h.jsxs(it,{className:"gap-0 !p-0",style:{maxHeight:u},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:b,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:P=>x(P.target.value)}),h.jsx(Ds,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[y!==""&&h.jsxs(h.Fragment,{children:[m.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(ea,{className:"h-6 w-6 text-gray-900"})}),m.map(P=>{const A=P.value===a;return h.jsx(At,{onClick:()=>{!P.disabled&&o&&(o(P.value),d(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})]}),y===""&&h.jsx(h.Fragment,{children:i.map(P=>{const A=P.value===a;return h.jsx(At,{onClick:()=>{!P.disabled&&o&&(o(P.value),d(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})})]})]})})]}),h.jsx(he,{children:s}),h.jsx(me,{children:c})]})},Em=(e,t)=>{const[n,s]=T.useState(e);return T.useEffect(()=>{const i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Am=e=>{const{className:t,label:n,description:s,onChange:i,fetchOptionsByQuery:o,fetchOptionByValue:r,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:f}=e,[d,m]=T.useState(!1),p=S.useRef(null),[y,x]=T.useState(""),[v,b]=T.useState([]),[g,E]=T.useState(null),C=S.useRef(null),[P,A]=T.useState(!1),[R,N]=T.useState(!1);fn(d,()=>m(!1));const I=Em(y,a);T.useEffect(()=>{(async()=>{A(!0);const K=await o(I);b(K),A(!1)})()},[I,o]),T.useEffect(()=>{if(l==null){E(null);return}const O=v?.find(K=>K.value===l);O?E(O):(async()=>{N(!0);const ve=await r(l);E(ve),N(!1)})()},[r,v,l]),T.useEffect(()=>{d&&C.current?.focus()},[d]);const{anchorRef:U,Popover:ne}=st({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return h.jsxs("div",{className:k("flex flex-col",t),children:[h.jsx(Le,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[h.jsxs("div",{ref:p,role:"button",tabIndex:0,className:k("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",f&&"border-red-600 ring-red-600/20 !pr-10",d&&"ring-4"),onKeyDown:O=>O.key===" "&&m(K=>!K),onClick:()=>m(!d),children:[!R&&g&&h.jsx("span",{children:g.label}),!R&&!g&&u&&h.jsx("span",{children:u}),R&&h.jsx(qt,{className:"h-4 w-4 text-gray-600"})]}),h.jsxs(Be,{children:[f&&h.jsx(Fe,{}),!!l&&h.jsx(Se,{Icon:Et,onClick:()=>i(null)}),h.jsx(Se,{Icon:Zt})]}),h.jsx(ne,{open:d,children:h.jsxs(it,{className:"gap-0 !p-0",style:{maxHeight:c},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:C,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:O=>x(O.target.value)}),h.jsx(Ds,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!P&&v.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(ea,{className:"h-6 w-6 text-gray-900"})}),P&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(qt,{className:"h-6 w-6 text-gray-900"})}),!P&&h.jsx(h.Fragment,{children:v.map(O=>{const K=O.value===l;return h.jsx(At,{onClick:()=>{!O.disabled&&i&&(i(O.value),m(!1))},selected:K,disabled:O.disabled,children:O.label},String(O.value))})})]})]})})]}),h.jsx(he,{children:s}),h.jsx(me,{children:f})]})},Rm=S.forwardRef((e,t)=>{const{className:n,children:s,...i}=e;return h.jsx("div",{ref:t,className:k("flex flex-col gap-6 border border-gray-200 rounded-2xl bg-white shadow-sm px-6 py-6",n),...i,children:s})}),jm=e=>{const{className:t,vertical:n=!1,...s}=e;return h.jsx("div",{className:k(n?"w-px h-full bg-gray-200":"w-full h-px bg-gray-200",t),...s})},Mm=e=>{const{children:t,content:n,className:s,placement:i="top",minWidth:o=100,maxWidth:r=200}=e,[a,l]=T.useState(!1),{anchorRef:u,Popover:c}=st({placement:i,minWidth:o,maxWidth:r});return h.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,h.jsx(c,{open:a,children:h.jsx(it,{children:n})})]})},Dm=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=e;return fn(!!i&&t,n||(()=>{})),h.jsx(ss,{children:t&&h.jsxs(Ia,{children:[h.jsx(Pt.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:h.jsx(Fa,{className:"bg-gray-400/30 backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),h.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:h.jsxs(Pt.div,{className:k("flex flex-col bg-white rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",r),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&h.jsx(Zo,{Icon:Et,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},$a={red:"bg-red-100 text-red-700 ring-red-200",orange:"bg-orange-100 text-orange-700 ring-orange-200",amber:"bg-amber-100 text-amber-700 ring-amber-200",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200",lime:"bg-lime-100 text-lime-700 ring-lime-200",green:"bg-green-100 text-green-700 ring-green-200",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200",teal:"bg-teal-100 text-teal-700 ring-teal-200",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200",sky:"bg-sky-100 text-sky-700 ring-sky-200",blue:"bg-blue-100 text-blue-700 ring-blue-200",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200",violet:"bg-violet-100 text-violet-700 ring-violet-200",purple:"bg-purple-100 text-purple-700 ring-purple-200",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200",pink:"bg-pink-100 text-pink-700 ring-pink-200",rose:"bg-rose-100 text-rose-700 ring-rose-200",slate:"bg-slate-100 text-slate-700 ring-slate-200",gray:"bg-gray-100 text-gray-700 ring-gray-200",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200",stone:"bg-stone-100 text-stone-700 ring-stone-200",white:"bg-white text-gray-900 ring-stone-200",black:"bg-black text-white ring-stone-200"},Ys=S.forwardRef((e,t)=>{const{className:n,children:s,onClick:i,showCloseIcon:o,Icon:r,color:a="gray"}=e,l=k("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",$a[a],n);return i?h.jsx("div",{ref:t,children:h.jsxs("button",{className:k("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:i,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&h.jsx(Et,{className:"h-4 w-4 shrink-0"})]})}):h.jsxs("div",{className:l,ref:t,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),Wa=e=>{const{className:t,tabs:n}=e;return h.jsx("div",{className:k("h-12 bg-gray-100 p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto",t),children:n.map((s,i)=>{const o=k("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 hover:bg-gray-200 active:bg-gray-300/80 transition-all duration-150 select-none focus:outline-none focus:ring-0",s.active&&"bg-white shadow-sm !border-gray-300");return s.href?h.jsxs("a",{href:s.href,className:o,children:[s.Icon&&h.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i):h.jsxs("button",{className:o,onClick:s.onClick,children:[s.Icon&&h.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i)})})},Ua=T.createContext(void 0),km=()=>({dismiss:T.useContext(Ua)||(()=>{})}),Vm="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 hover:bg-gray-100 active:bg-gray-200 rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent text-gray-900 bg-transparent ring-gray-900/10",rt=S.forwardRef((e,t)=>{const{className:n,children:s,Icon:i,onClick:o,dismissOnClick:r=!0,...a}=e,{dismiss:l}=km(),u=c=>{o&&o(c),r&&l()};return h.jsxs("button",{ref:t,className:k(Vm,n),onClick:u,...a,children:[i&&h.jsx(i,{className:"h-5 w-5"}),s]})}),Nm=e=>{const{label:t,children:n}=e;return h.jsxs("div",{className:"flex flex-col dropdown-button-group",children:[t&&h.jsx("div",{className:"mb-2 text-sm text-gray-500 font-medium px-1",children:t}),n]})},Hs=e=>{const{trigger:t,children:n,placement:s="bottom-end",minWidth:i=200,className:o}=e,[r,a]=T.useState(!1),{Popover:l,anchorRef:u}=st({placement:s,onOutsideClick:()=>a(!1),minWidth:i});return h.jsxs(h.Fragment,{children:[h.jsx("div",{ref:u,className:o,onClick:()=>a(!r),children:t}),h.jsx(l,{open:r,children:h.jsx(it,{padding:"sm",children:h.jsx(Ua.Provider,{value:()=>a(!1),children:n})})})]})};function Im(e){const{onDelta:t,onDragStart:n,onDragEnd:s,disabled:i=!1,primaryButtonOnly:o=!0,preventScrollOnMove:r=!0}=e,[a,l]=S.useState(!1),u=S.useRef(0),c=S.useRef(0),f=S.useRef(0),d=S.useRef(null),m=S.useRef(null),p=S.useCallback(g=>{if(!a)return;const E={clientX:g??c.current,startX:u.current,totalDeltaX:f.current,target:d.current};l(!1),window.removeEventListener("pointermove",x,{capture:!0}),window.removeEventListener("pointerup",v,{capture:!0}),window.removeEventListener("pointercancel",v,{capture:!0}),window.removeEventListener("keydown",y,!0),m.current!=null&&(cancelAnimationFrame(m.current),m.current=null),s?.(E),d.current=null,f.current=0},[a,s]),y=S.useCallback(g=>{g.key==="Escape"&&(g.preventDefault(),p())},[p]),x=S.useCallback(g=>{if(!a)return;const E=()=>{const C=g.clientX,P=C-c.current;if(P!==0){c.current=C,f.current+=P;const A={clientX:C,startX:u.current,totalDeltaX:f.current,target:d.current};r&&g.preventDefault(),t(P,A)}m.current=null};m.current==null&&(m.current=requestAnimationFrame(E))},[a,t,r]),v=S.useCallback(g=>{p(g.clientX)},[p]),b=S.useCallback(g=>{if(i||o&&g.button!==0)return;g.target.setPointerCapture?.(g.pointerId),u.current=g.clientX,c.current=g.clientX,f.current=0,d.current=g.target,l(!0);const E={clientX:g.clientX,startX:g.clientX,totalDeltaX:0,target:g.target};n?.(E),window.addEventListener("pointermove",x,{passive:!r,capture:!0}),window.addEventListener("pointerup",v,{capture:!0}),window.addEventListener("pointercancel",v,{capture:!0}),window.addEventListener("keydown",y,!0)},[i,n,y,x,v,o,r]);return S.useEffect(()=>()=>{a&&p()},[a]),{isDragging:a,bind:{onPointerDown:b,role:"separator",style:{touchAction:"none",cursor:"col-resize",userSelect:"none"}}}}const Om=e=>{const{column:t}=e,n=t?.defaultWidth??250,{bind:s}=Im({onDelta:i=>console.log(i),onDragStart:()=>{},onDragEnd:()=>{}});return h.jsxs("div",{style:{width:n,height:44},className:"flex flex-row items-stretch select-none",children:[h.jsx("div",{className:"flex-1 content-center px-4 relative cursor-pointer bg-gray-50 hover:bg-gray-100 active:bg-gray-200 transition-colors duration-100",children:t.header}),h.jsx("div",{...s,className:"cursor-ew-resize group py-4 bg-gray-50 w-[8px]",children:h.jsx("div",{className:"w-0.5 h-full mx-auto bg-gray-200 group-hover:bg-gray-300 group-active:bg-blue-600 pointer-events-none"})})]})},Lm=e=>{const{columns:t,rows:n,className:s}=e,i=S.useRef(null),o=r=>{i.current&&i.current.scrollTo({left:r.currentTarget.scrollLeft})};return h.jsxs("div",{className:s,children:[h.jsx("div",{className:"relative h-[45px] w-full overflow-hidden",ref:i,children:h.jsx("div",{className:"absolute",children:h.jsx("div",{className:"font-medium text-gray-800 flex flex-row border-b border-b-gray-200",children:t.map(r=>h.jsx(Om,{column:r},r.id))})})}),h.jsx("div",{className:"relative overflow-scroll min-w-full min-h-full",onScroll:o,children:h.jsx("div",{className:"absolute",children:h.jsx("div",{className:"flex flex-col",children:n.map(r=>h.jsx("div",{className:"flex flex-row border-b border-b-gray-200 hover:bg-gray-50 bg-white transition-all duration-100",children:t.map(a=>h.jsx("div",{className:"flex-1 content-center px-4",style:{height:44,width:250},children:a.renderCell(r)},a.id))},JSON.stringify(r)))})})})]})},Fm=()=>h.jsx("div",{}),Bm=[{id:1,email:"sarah.jennings@example.com",firstname:"Sarah",lastname:"Jennings",status:"active"},{id:2,email:"liam.patel@outlook.com",firstname:"Liam",lastname:"Patel",status:"inactive"},{id:3,email:"emily.wong@gmail.com",firstname:"Emily",lastname:"Wong",status:"active"},{id:4,email:"noah.thompson@yahoo.com",firstname:"Noah",lastname:"Thompson",status:"active"},{id:5,email:"isabella.martin@protonmail.com",firstname:"Isabella",lastname:"Martin",status:"active"},{id:6,email:"ethan.ross@company.io",firstname:"Ethan",lastname:"Ross",status:"inactive"},{id:7,email:"olivia.nguyen@example.org",firstname:"Olivia",lastname:"Nguyen",status:"active"},{id:8,email:"lucas.henderson@gmail.com",firstname:"Lucas",lastname:"Henderson",status:"inactive"},{id:9,email:"mia.johnson@workmail.com",firstname:"Mia",lastname:"Johnson",status:"active"},{id:10,email:"jackson.rivera@outlook.com",firstname:"Jackson",lastname:"Rivera",status:"active"},{id:11,email:"ava.sanders@example.com",firstname:"Ava",lastname:"Sanders",status:"active"},{id:12,email:"logan.bennett@company.io",firstname:"Logan",lastname:"Bennett",status:"inactive"}],_m=[{id:"id",header:"ID",renderCell:e=>e.id},{id:"email",header:"Email",renderCell:e=>h.jsx(Ys,{Icon:Bd,onClick:()=>{},children:e.email})},{id:"firstname",header:"First Name",renderCell:e=>e.firstname},{id:"lastname",header:"Last Name",renderCell:e=>e.lastname},{id:"status",header:"Status",renderCell:()=>h.jsx(Wm,{})}],$m=()=>h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[h.jsx(ks,{Icon:Ds,placeholder:"Search..."}),h.jsx(Ms,{Icon:ta}),h.jsx(qo,{Icon:Qo,children:"New"}),h.jsxs(Hs,{trigger:h.jsx(Ms,{Icon:ta}),children:[h.jsx(rt,{dismissOnClick:!1,Icon:Qo,children:"Add new"}),h.jsx(rt,{Icon:Ld,children:"Remove"})]}),h.jsx(Wa,{tabs:[{label:"Tab 1",Icon:Jo,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:Jo,active:!1,onClick:()=>{}}]})]}),h.jsx(_a,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),h.jsx(Lm,{className:"h-[300px] w-[300px]",columns:_m,rows:Bm}),h.jsx(Fm,{})]}),Wm=()=>h.jsx(h.Fragment,{children:h.jsxs(Hs,{placement:"bottom-end",className:"inline-block",trigger:h.jsx(Ys,{onClick:()=>{},children:"Test"}),children:[h.jsx(rt,{children:"Option 1"}),h.jsx(rt,{children:"Option 2"}),h.jsx(rt,{children:"Option 3"})]})});M.Badge=Ys,M.BadgeColor=$a,M.Button=qo,M.ButtonIconRound=Zo,M.ButtonIconSquare=Ms,M.Divider=jm,M.DropdownButton=rt,M.DropdownButtonGroup=Nm,M.DropdownMenu=Hs,M.DropdownPanel=it,M.Input=ks,M.InputCheck=zd,M.InputDescription=he,M.InputError=me,M.InputErrorIcon=Fe,M.InputIconButton=Se,M.InputIconButtonTray=Be,M.InputLabel=Le,M.InputPassword=_d,M.InputRadio=Wd,M.InputSelect=_a,M.InputSelectNative=Kd,M.InputSelectOption=At,M.InputSelectSearchable=Pm,M.InputSelectSearchableAsync=Am,M.InputTextArea=$d,M.InputToggle=Ud,M.Modal=Dm,M.Panel=Rm,M.PopoverBase=Ba,M.Spinner=qt,M.TabButtons=Wa,M.Test=$m,M.Tooltip=Mm,M.usePopover=st,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
|
|
143
|
+
*/var ah=["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])"],_s=ah.join(","),ra=typeof Element>"u",Dt=ra?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!ra&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},on=function e(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),o=i===""||i==="true",r=o||n&&t&&e(t.parentNode);return r},lh=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},ch=function(t,n,s){if(on(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(_s));return n&&Dt.call(t,_s)&&i.unshift(t),i=i.filter(s),i},uh=function e(t,n,s){for(var i=[],o=Array.from(t);o.length;){var r=o.shift();if(!on(r,!1))if(r.tagName==="SLOT"){var a=r.assignedElements(),l=a.length?a:r.children,u=e(l,!0,s);s.flatten?i.push.apply(i,u):i.push({scopeParent:r,candidates:u})}else{var c=Dt.call(r,_s);c&&s.filter(r)&&(n||!t.includes(r))&&i.push(r);var f=r.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(r),d=!on(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&d){var m=e(f===!0?r.children:f.children,!0,s);s.flatten?i.push.apply(i,m):i.push({scopeParent:r,candidates:m})}else o.unshift.apply(o,r.children)}}return i},oa=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},aa=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lh(t))&&!oa(t)?0:t.tabIndex},fh=function(t,n){var s=aa(t);return s<0&&n&&!oa(t)?0:s},dh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},la=function(t){return t.tagName==="INPUT"},hh=function(t){return la(t)&&t.type==="hidden"},mh=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},ph=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},gh=function(t){if(!t.name)return!0;var n=t.form||rn(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(r){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",r.message),!1}var o=ph(i,t.form);return!o||o===t},yh=function(t){return la(t)&&t.type==="radio"},vh=function(t){return yh(t)&&!gh(t)},xh=function(t){var n,s=t&&rn(t),i=(n=s)===null||n===void 0?void 0:n.host,o=!1;if(s&&s!==t){var r,a,l;for(o=!!((r=i)!==null&&r!==void 0&&(a=r.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,f;s=rn(i),i=(u=s)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return o},ca=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},bh=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=Dt.call(t,"details>summary:first-of-type"),r=o?t.parentElement:t;if(Dt.call(r,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,u=rn(t);if(l&&!l.shadowRoot&&i(l)===!0)return ca(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(xh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return ca(t);return!1},wh=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return Dt.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Th=function(t,n){return!(n.disabled||on(n)||hh(n)||bh(n,t)||mh(n)||wh(n))},ua=function(t,n){return!(vh(n)||aa(n)<0||!Th(t,n))},Sh=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ch=function e(t){var n=[],s=[];return t.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=fh(a,r),u=r?e(i.candidates):a;l===0?r?n.push.apply(n,u):n.push(a):s.push({documentOrder:o,tabIndex:l,item:i,isScope:r,content:u})}),s.sort(dh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},fa=function(t,n){n=n||{};var s;return n.getShadowRoot?s=uh([t],n.includeContainer,{filter:ua.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Sh}):s=ch(t,n.includeContainer,ua.bind(null,n)),Ch(s)};function Ph(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Eh(){return/apple/i.test(navigator.vendor)}function Ah(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Rh(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ns(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function $s(e){return e?.ownerDocument||document}var jh=typeof document<"u",Mh=function(){},je=jh?T.useLayoutEffect:Mh;const Dh={...S}.useInsertionEffect||(e=>e());function kh(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Dh(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return t.current==null?void 0:t.current(...s)},[])}const da=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ha(e,t){const n=fa(e,da()),s=n.length;if(s===0)return;const i=Ah($s(e)),o=n.indexOf(i),r=o===-1?t===1?0:s-1:o+t;return n[r]}function Vh(e){return ha($s(e).body,1)||e}function Nh(e){return ha($s(e).body,-1)||e}function Ws(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Rh(n,s)}function Ih(e){fa(e,da()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ma(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function pa(e,t,n){let{reference:s,floating:i}=e;const o=Bs(t),r=ih(t),a=nh(r),l=Fs(t),u=o==="y",c=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:s.y-i.height};break;case"bottom":m={x:c,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:f};break;case"left":m={x:s.x-i.width,y:f};break;default:m={x:s.x,y:s.y}}switch(ia(t)){case"start":m[r]-=d*(n&&u?-1:1);break;case"end":m[r]+=d*(n&&u?-1:1);break}return m}const Oh=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=pa(u,s,l),d=s,m={},p=0;for(let y=0;y<a.length;y++){const{name:x,fn:v}=a[y],{x:b,y:g,data:E,reset:C}=await v({x:c,y:f,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:t}});c=b??c,f=g??f,m={...m,[x]:{...m[x],...E}},C&&p<=50&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:f}=pa(u,d,l)),y=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:m}};async function Lh(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:o,rects:r,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=sa(t,e),p=oh(m),x=a[d?f==="floating"?"reference":"floating":f],v=sn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),b=f==="floating"?{x:s,y:i,width:r.floating.width,height:r.floating.height}:r.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(g))?await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1}:{x:1,y:1},C=sn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:g,strategy:l}):b);return{top:(v.top-C.top+p.top)/E.y,bottom:(C.bottom-v.bottom+p.bottom)/E.y,left:(v.left-C.left+p.left)/E.x,right:(C.right-v.right+p.right)/E.x}}const Fh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:o,platform:r,elements:a}=t,{apply:l=()=>{},...u}=sa(e,t),c=await Lh(t,u),f=Fs(i),d=ia(i),m=Bs(i)==="y",{width:p,height:y}=o.floating;let x,v;f==="top"||f==="bottom"?(x=f,v=d===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,x=d==="end"?"top":"bottom");const b=y-c.top-c.bottom,g=p-c.left-c.right,E=Mt(y-c[x],b),C=Mt(p-c[v],g),P=!t.middlewareData.shift;let A=E,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=g),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(A=b),P&&!d){const I=oe(c.left,0),U=oe(c.right,0),ne=oe(c.top,0),O=oe(c.bottom,0);m?R=p-2*(I!==0||U!==0?I+U:oe(c.left,c.right)):A=y-2*(ne!==0||O!==0?ne+O:oe(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:A});const N=await r.getDimensions(a.floating);return p!==N.width||y!==N.height?{reset:{rects:!0}}:{}}}};function ga(e){const t=ce(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=ge(e),o=i?e.offsetWidth:n,r=i?e.offsetHeight:s,a=tn(n)!==o||tn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function Us(e){return H(e)?e:e.contextElement}function nt(e){const t=Us(e);if(!ge(t))return ye(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:o}=ga(t);let r=(o?tn(n.width):n.width)/s,a=(o?tn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Bh=ye(0);function ya(e){const t=te(e);return!Os()||!t.visualViewport?Bh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _h(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==te(e)?!1:t}function _e(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Us(e);let r=ye(1);t&&(s?H(s)&&(r=nt(s)):r=nt(e));const a=_h(o,n,s)?ya(o):ye(0);let l=(i.left+a.x)/r.x,u=(i.top+a.y)/r.y,c=i.width/r.x,f=i.height/r.y;if(o){const d=te(o),m=s&&H(s)?te(s):s;let p=d,y=Ls(p);for(;y&&s&&m!==p;){const x=nt(y),v=y.getBoundingClientRect(),b=ce(y),g=v.left+(y.clientLeft+parseFloat(b.paddingLeft))*x.x,E=v.top+(y.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=g,u+=E,p=te(y),y=Ls(p)}}return sn({width:c,height:f,x:l,y:u})}function an(e,t){const n=en(e).scrollLeft;return t?t.left+n:_e(pe(e)).left+n}function va(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-an(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function $h(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const o=i==="fixed",r=pe(s),a=t?Qt(t.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ye(1);const c=ye(0),f=ge(s);if((f||!f&&!o)&&((et(s)!=="body"||Rt(r))&&(l=en(s)),ge(s))){const m=_e(s);u=nt(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const d=r&&!f&&!o?va(r,l):ye(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function Wh(e){return Array.from(e.getClientRects())}function Uh(e){const t=pe(e),n=en(e),s=e.ownerDocument.body,i=oe(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=oe(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+an(e);const a=-n.scrollTop;return ce(s).direction==="rtl"&&(r+=oe(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const xa=25;function zh(e,t){const n=te(e),s=pe(e),i=n.visualViewport;let o=s.clientWidth,r=s.clientHeight,a=0,l=0;if(i){o=i.width,r=i.height;const c=Os();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=an(s);if(u<=0){const c=s.ownerDocument,f=c.body,d=getComputedStyle(f),m=c.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-m);p<=xa&&(o-=p)}else u<=xa&&(o+=u);return{width:o,height:r,x:a,y:l}}const Kh=new Set(["absolute","fixed"]);function Xh(e,t){const n=_e(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,o=ge(e)?nt(e):ye(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=s*o.y;return{width:r,height:a,x:l,y:u}}function ba(e,t,n){let s;if(t==="viewport")s=zh(e,n);else if(t==="document")s=Uh(pe(e));else if(H(t))s=Xh(t,n);else{const i=ya(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sn(s)}function wa(e,t){const n=Re(e);return n===t||!H(n)||tt(n)?!1:ce(n).position==="fixed"||wa(n,t)}function Yh(e,t){const n=t.get(e);if(n)return n;let s=jt(e,[],!1).filter(a=>H(a)&&et(a)!=="body"),i=null;const o=ce(e).position==="fixed";let r=o?Re(e):e;for(;H(r)&&!tt(r);){const a=ce(r),l=Is(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Kh.has(i.position)||Rt(r)&&!l&&wa(e,r))?s=s.filter(c=>c!==r):i=a,r=Re(r)}return t.set(e,s),s}function Hh(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const r=[...n==="clippingAncestors"?Qt(t)?[]:Yh(t,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const f=ba(t,c,i);return u.top=oe(f.top,u.top),u.right=Mt(f.right,u.right),u.bottom=Mt(f.bottom,u.bottom),u.left=oe(f.left,u.left),u},ba(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gh(e){const{width:t,height:n}=ga(e);return{width:t,height:n}}function qh(e,t,n){const s=ge(t),i=pe(t),o=n==="fixed",r=_e(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ye(0);function u(){l.x=an(i)}if(s||!s&&!o)if((et(t)!=="body"||Rt(i))&&(a=en(t)),s){const m=_e(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else i&&u();o&&!s&&i&&u();const c=i&&!s&&!o?va(i,a):ye(0),f=r.left+a.scrollLeft-l.x-c.x,d=r.top+a.scrollTop-l.y-c.y;return{x:f,y:d,width:r.width,height:r.height}}function zs(e){return ce(e).position==="static"}function Ta(e,t){if(!ge(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pe(e)===n&&(n=n.ownerDocument.body),n}function Sa(e,t){const n=te(e);if(Qt(e))return n;if(!ge(e)){let i=Re(e);for(;i&&!tt(i);){if(H(i)&&!zs(i))return i;i=Re(i)}return n}let s=Ta(e,t);for(;s&&Hd(s)&&zs(s);)s=Ta(s,t);return s&&tt(s)&&zs(s)&&!Is(s)?n:s||Qd(e)||n}const Zh=async function(e){const t=this.getOffsetParent||Sa,n=this.getDimensions,s=await n(e.floating);return{reference:qh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Jh(e){return ce(e).direction==="rtl"}const Qh={convertOffsetParentRelativeRectToViewportRelativeRect:$h,getDocumentElement:pe,getClippingRect:Hh,getOffsetParent:Sa,getElementRects:Zh,getClientRects:Wh,getDimensions:Gh,getScale:nt,isElement:H,isRTL:Jh};function Ca(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function em(e,t){let n=null,s;const i=pe(e);function o(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:c,top:f,width:d,height:m}=u;if(a||t(),!d||!m)return;const p=nn(f),y=nn(i.clientWidth-(c+d)),x=nn(i.clientHeight-(f+m)),v=nn(c),g={rootMargin:-p+"px "+-y+"px "+-x+"px "+-v+"px",threshold:oe(0,Mt(1,l))||1};let E=!0;function C(P){const A=P[0].intersectionRatio;if(A!==l){if(!E)return r();A?r(!1,A):s=setTimeout(()=>{r(!1,1e-7)},1e3)}A===1&&!Ca(u,e.getBoundingClientRect())&&r(),E=!1}try{n=new IntersectionObserver(C,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,g)}n.observe(e)}return r(!0),o}function tm(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,u=Us(e),c=i||o?[...u?jt(u):[],...jt(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const f=u&&a?em(u,n):null;let d=-1,m=null;r&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let p,y=l?_e(e):null;l&&x();function x(){const v=_e(e);y&&!Ca(y,v)&&n(),y=v,p=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const nm=Fh,sm=(e,t,n)=>{const s=new Map,i={platform:Qh,...n},o={...i.platform,_c:s};return Oh(e,t,{...i,platform:o})};var im=typeof document<"u",rm=function(){},ln=im?T.useLayoutEffect:rm;function cn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!cn(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const o=i[s];if(!(o==="_owner"&&e.$$typeof)&&!cn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ea(e,t){const n=Pa(e);return Math.round(t*n)/n}function Ks(e){const t=S.useRef(e);return ln(()=>{t.current=e}),t}function om(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:o,floating:r}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,f]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=S.useState(s);cn(d,s)||m(s);const[p,y]=S.useState(null),[x,v]=S.useState(null),b=S.useCallback(V=>{V!==P.current&&(P.current=V,y(V))},[]),g=S.useCallback(V=>{V!==A.current&&(A.current=V,v(V))},[]),E=o||p,C=r||x,P=S.useRef(null),A=S.useRef(null),R=S.useRef(c),N=l!=null,I=Ks(l),U=Ks(i),ne=Ks(u),O=S.useCallback(()=>{if(!P.current||!A.current)return;const V={placement:t,strategy:n,middleware:d};U.current&&(V.platform=U.current),sm(P.current,A.current,V).then(J=>{const w={...J,isPositioned:ne.current!==!1};K.current&&!cn(R.current,w)&&(R.current=w,Qs.flushSync(()=>{f(w)}))})},[d,t,n,U,ne]);ln(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(V=>({...V,isPositioned:!1})))},[u]);const K=S.useRef(!1);ln(()=>(K.current=!0,()=>{K.current=!1}),[]),ln(()=>{if(E&&(P.current=E),C&&(A.current=C),E&&C){if(I.current)return I.current(E,C,O);O()}},[E,C,O,I,N]);const ve=S.useMemo(()=>({reference:P,floating:A,setReference:b,setFloating:g}),[b,g]),ue=S.useMemo(()=>({reference:E,floating:C}),[E,C]),_=S.useMemo(()=>{const V={position:n,left:0,top:0};if(!ue.floating)return V;const J=Ea(ue.floating,c.x),w=Ea(ue.floating,c.y);return a?{...V,transform:"translate("+J+"px, "+w+"px)",...Pa(ue.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:w}},[n,a,ue.floating,c.x,c.y]);return S.useMemo(()=>({...c,update:O,refs:ve,elements:ue,floatingStyles:_}),[c,O,ve,ue,_])}const am=(e,t)=>({...nm(e),options:[e,t]}),lm={...S};let Aa=!1,cm=0;const Ra=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cm++;function um(){const[e,t]=S.useState(()=>Aa?Ra():void 0);return je(()=>{e==null&&t(Ra())},[]),S.useEffect(()=>{Aa=!0},[]),e}const ja=lm.useId||um;let Xs;process.env.NODE_ENV!=="production"&&(Xs=new Set);function fm(){for(var e,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const i="Floating UI: "+n.join(" ");if(!((e=Xs)!=null&&e.has(i))){var o;(o=Xs)==null||o.add(i),console.error(i)}}function dm(){const e=new Map;return{emit(t,n){var s;(s=e.get(t))==null||s.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var s;(s=e.get(t))==null||s.delete(n)}}}const hm=S.createContext(null),mm=S.createContext(null),pm=()=>{var e;return((e=S.useContext(hm))==null?void 0:e.id)||null},gm=()=>S.useContext(mm);function Ma(e){return"data-floating-ui-"+e}const Da={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},ka=S.forwardRef(function(t,n){const[s,i]=S.useState();je(()=>{Eh()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[Ma("focus-guard")]:"",style:Da};return h.jsx("span",{...t,...o})}),Va=S.createContext(null),Na=Ma("portal");function ym(e){e===void 0&&(e={});const{id:t,root:n}=e,s=ja(),i=vm(),[o,r]=S.useState(null),a=S.useRef(null);return je(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),je(()=>{if(!s||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=s,u.setAttribute(Na,""),l.appendChild(u),a.current=u,r(u)},[t,s]),je(()=>{if(n===null||!s||a.current)return;let l=n||i?.portalNode;l&&!Vs(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=s,c.setAttribute(Na,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[t,n,s,i]),o}function Ia(e){const{children:t,id:n,root:s,preserveTabOrder:i=!0}=e,o=ym({id:n,root:s}),[r,a]=S.useState(null),l=S.useRef(null),u=S.useRef(null),c=S.useRef(null),f=S.useRef(null),d=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return S.useEffect(()=>{if(!o||!i||d)return;function y(x){o&&Ws(x)&&(x.type==="focusin"?ma:Ih)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,i,d]),S.useEffect(()=>{o&&(m||ma(o))},[m,o]),h.jsxs(Va.Provider,{value:S.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&h.jsx(ka,{"data-type":"outside",ref:l,onFocus:y=>{if(Ws(y,o)){var x;(x=c.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Nh(v);b?.focus()}}}),p&&o&&h.jsx("span",{"aria-owns":o.id,style:Da}),o&&Qs.createPortal(t,o),p&&o&&h.jsx(ka,{"data-type":"outside",ref:u,onFocus:y=>{if(Ws(y,o)){var x;(x=f.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Vh(v);b?.focus(),r?.closeOnFocusOut&&r?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const vm=()=>S.useContext(Va);let un=0;const Oa="--floating-ui-scrollbar-width";function xm(){const e=Ph(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,r=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Oa,o+"px"),o&&(n[i]=o+"px"),t){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,f=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(f))+"px",left:-(r-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[i]:""}),n.removeProperty(Oa),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let La=()=>{};const Fa=S.forwardRef(function(t,n){const{lockScroll:s=!1,...i}=t;return je(()=>{if(s)return un++,un===1&&(La=xm()),()=>{un--,un===0&&La()}},[s]),h.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function bm(e){const{open:t=!1,onOpenChange:n,elements:s}=e,i=ja(),o=S.useRef({}),[r]=S.useState(()=>dm()),a=pm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!H(m)&&fm("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=S.useState(s.reference),c=kh((m,p,y)=>{o.current.openEvent=m?p:void 0,r.emit("openchange",{open:m,event:p,reason:y,nested:a}),n?.(m,p,y)}),f=S.useMemo(()=>({setPositionReference:u}),[]),d=S.useMemo(()=>({reference:l||s.reference||null,floating:s.floating||null,domReference:s.reference}),[l,s.reference,s.floating]);return S.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:d,events:r,floatingId:i,refs:f}),[t,c,d,r,i,f])}function wm(e){e===void 0&&(e={});const{nodeId:t}=e,n=bm({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||n,i=s.elements,[o,r]=S.useState(null),[a,l]=S.useState(null),c=i?.domReference||o,f=S.useRef(null),d=gm();je(()=>{c&&(f.current=c)},[c]);const m=om({...e,elements:{...i,...a&&{reference:a}}}),p=S.useCallback(g=>{const E=H(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),getClientRects:()=>g.getClientRects(),contextElement:g}:g;l(E),m.refs.setReference(E)},[m.refs]),y=S.useCallback(g=>{(H(g)||g===null)&&(f.current=g,r(g)),(H(m.refs.reference.current)||m.refs.reference.current===null||g!==null&&!H(g))&&m.refs.setReference(g)},[m.refs]),x=S.useMemo(()=>({...m.refs,setReference:y,setPositionReference:p,domReference:f}),[m.refs,y,p]),v=S.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),b=S.useMemo(()=>({...m,...s,refs:x,elements:v,nodeId:t}),[m,x,v,t,s]);return je(()=>{s.dataRef.current.floatingContext=b;const g=d?.nodesRef.current.find(E=>E.id===t);g&&(g.context=b)}),S.useMemo(()=>({...m,context:b,refs:x,elements:v}),[m,x,v,b])}const Tm={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},Ba=S.memo(({open:e,children:t,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>h.jsx(Ia,{children:h.jsx(ss,{children:e&&h.jsxs(h.Fragment,{children:[s&&h.jsx(Fa,{onClick:s}),h.jsx("div",{ref:o,style:i,className:"z-50",children:h.jsx(Pt.div,{className:n,style:{transformOrigin:Tm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),st=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=e,r=S.useMemo(()=>[am({apply({rects:f,elements:d}){s&&(d.floating.style.width=`${f.reference.width}px`),i&&(d.floating.style.minWidth=`${i}px`),o&&(d.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=wm({placement:t,middleware:r,whileElementsMounted:tm}),u=S.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t};const c=S.useMemo(()=>{const f=d=>{const{floatingStyles:m,setFloating:p,onOutsideClick:y,placement:x}=u.current,{className:v,open:b,children:g}=d;return h.jsx(Ba,{open:b,className:v,onOutsideClick:y,floatingStyles:m,setFloating:p,placement:x,children:g})};return S.memo(f)},[]);return{anchorRef:a.setReference,Popover:c}},Sm="flex flex-col bg-white border mt-1 border-gray-200 rounded-xl shadow-lg overflow-y-auto relative space-y-1",Cm={sm:"p-2",md:"p-3",lg:"p-4"},it=e=>{const{className:t,children:n,padding:s="md",...i}=e;return h.jsx("div",{className:k(Sm,Cm[s],t),...i,children:n})},fn=(e,t)=>{T.useEffect(()=>{if(!e)return;const n=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])},_a=e=>{const{className:t,label:n,description:s,options:i,onChange:o,value:r,placeholder:a,maxHeight:l=300,error:u}=e,[c,f]=T.useState(!1),d=S.useRef(null),m=i?.find(x=>x.value===r);fn(c,()=>f(!1)),T.useEffect(()=>{c&&d.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:y}=st({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return h.jsxs("div",{className:k("flex flex-col",t),children:[h.jsx(Le,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[h.jsxs("div",{ref:d,role:"button",tabIndex:0,className:k("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",u&&"border-red-600 ring-red-600/20 !pr-10",c&&"ring-4"),onKeyDown:x=>x.key===" "&&f(v=>!v),onClick:()=>f(!c),children:[m&&h.jsx("span",{children:m.label}),!m&&a&&h.jsx("span",{className:"text-gray-500",children:a})]}),h.jsxs(Be,{children:[u&&h.jsx(Fe,{}),!!r&&h.jsx(Se,{Icon:Et,onClick:()=>o(null)}),h.jsx(Se,{Icon:Zt})]}),h.jsx(y,{open:c,children:h.jsx(it,{className:"!p-0",style:{maxHeight:l},children:h.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const v=x.value===r;return h.jsx(At,{onClick:()=>{!x.disabled&&o&&(o(x.value),f(!1))},selected:v,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),h.jsx(he,{children:s}),h.jsx(me,{children:u})]})},Pm=e=>{const{className:t,label:n,description:s,options:i,onChange:o,onSearch:r,value:a,placeholder:l,maxHeight:u=300,error:c}=e,[f,d]=T.useState(!1),[m,p]=T.useState(i),[y,x]=T.useState(""),v=S.useRef(null),b=S.useRef(null),g=i?.find(P=>P.value===a);fn(f,()=>d(!1)),T.useEffect(()=>{p(r(y))},[y,i,r]),T.useEffect(()=>{f&&b.current?.focus()},[f]);const{anchorRef:E,Popover:C}=st({placement:"bottom",fullWidth:!0,onOutsideClick:()=>d(!1)});return h.jsxs("div",{className:k("flex flex-col",t),children:[h.jsx(Le,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[h.jsxs("div",{ref:v,role:"button",tabIndex:0,className:k("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",c&&"border-red-600 ring-red-600/20 !pr-10",f&&"ring-4"),onKeyDown:P=>P.key===" "&&d(A=>!A),onClick:()=>d(!f),children:[g&&h.jsx("span",{children:g.label}),!g&&l&&h.jsx("span",{className:"text-gray-500",children:l})]}),h.jsxs(Be,{children:[c&&h.jsx(Fe,{}),!!a&&h.jsx(Se,{Icon:Et,onClick:()=>o(null)}),h.jsx(Se,{Icon:Zt})]}),h.jsx(C,{open:f,children:h.jsxs(it,{className:"gap-0 !p-0",style:{maxHeight:u},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:b,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:P=>x(P.target.value)}),h.jsx(Ds,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[y!==""&&h.jsxs(h.Fragment,{children:[m.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(ea,{className:"h-6 w-6 text-gray-900"})}),m.map(P=>{const A=P.value===a;return h.jsx(At,{onClick:()=>{!P.disabled&&o&&(o(P.value),d(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})]}),y===""&&h.jsx(h.Fragment,{children:i.map(P=>{const A=P.value===a;return h.jsx(At,{onClick:()=>{!P.disabled&&o&&(o(P.value),d(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})})]})]})})]}),h.jsx(he,{children:s}),h.jsx(me,{children:c})]})},Em=(e,t)=>{const[n,s]=T.useState(e);return T.useEffect(()=>{const i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Am=e=>{const{className:t,label:n,description:s,onChange:i,fetchOptionsByQuery:o,fetchOptionByValue:r,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:f}=e,[d,m]=T.useState(!1),p=S.useRef(null),[y,x]=T.useState(""),[v,b]=T.useState([]),[g,E]=T.useState(null),C=S.useRef(null),[P,A]=T.useState(!1),[R,N]=T.useState(!1);fn(d,()=>m(!1));const I=Em(y,a);T.useEffect(()=>{(async()=>{A(!0);const K=await o(I);b(K),A(!1)})()},[I,o]),T.useEffect(()=>{if(l==null){E(null);return}const O=v?.find(K=>K.value===l);O?E(O):(async()=>{N(!0);const ve=await r(l);E(ve),N(!1)})()},[r,v,l]),T.useEffect(()=>{d&&C.current?.focus()},[d]);const{anchorRef:U,Popover:ne}=st({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return h.jsxs("div",{className:k("flex flex-col",t),children:[h.jsx(Le,{children:n}),h.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[h.jsxs("div",{ref:p,role:"button",tabIndex:0,className:k("flex flex-row items-center h-12 pl-4 pr-10 border border-gray-200 text-gray-900 placeholder:text-gray-400 bg-white transition-all duration-150 rounded-xl shadow-sm ring-0 ring-gray-900/10 focus:ring-4 focus:outline-none select-none",f&&"border-red-600 ring-red-600/20 !pr-10",d&&"ring-4"),onKeyDown:O=>O.key===" "&&m(K=>!K),onClick:()=>m(!d),children:[!R&&g&&h.jsx("span",{children:g.label}),!R&&!g&&u&&h.jsx("span",{children:u}),R&&h.jsx(qt,{className:"h-4 w-4 text-gray-600"})]}),h.jsxs(Be,{children:[f&&h.jsx(Fe,{}),!!l&&h.jsx(Se,{Icon:Et,onClick:()=>i(null)}),h.jsx(Se,{Icon:Zt})]}),h.jsx(ne,{open:d,children:h.jsxs(it,{className:"gap-0 !p-0",style:{maxHeight:c},children:[h.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[h.jsx("input",{ref:C,type:"text",placeholder:"Search",value:y,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-gray-400",onChange:O=>x(O.target.value)}),h.jsx(Ds,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),h.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!P&&v.length===0&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(ea,{className:"h-6 w-6 text-gray-900"})}),P&&h.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:h.jsx(qt,{className:"h-6 w-6 text-gray-900"})}),!P&&h.jsx(h.Fragment,{children:v.map(O=>{const K=O.value===l;return h.jsx(At,{onClick:()=>{!O.disabled&&i&&(i(O.value),m(!1))},selected:K,disabled:O.disabled,children:O.label},String(O.value))})})]})]})})]}),h.jsx(he,{children:s}),h.jsx(me,{children:f})]})},Rm=S.forwardRef((e,t)=>{const{className:n,children:s,...i}=e;return h.jsx("div",{ref:t,className:k("flex flex-col gap-6 border border-gray-200 rounded-2xl bg-white shadow-sm px-6 py-6",n),...i,children:s})}),jm=e=>{const{className:t,vertical:n=!1,...s}=e;return h.jsx("div",{className:k(n?"w-px h-full bg-gray-200":"w-full h-px bg-gray-200",t),...s})},Mm=e=>{const{children:t,content:n,className:s,placement:i="top",minWidth:o=100,maxWidth:r=200}=e,[a,l]=T.useState(!1),{anchorRef:u,Popover:c}=st({placement:i,minWidth:o,maxWidth:r});return h.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,h.jsx(c,{open:a,children:h.jsx(it,{children:n})})]})},Dm=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=e;return fn(!!i&&t,n||(()=>{})),h.jsx(ss,{children:t&&h.jsxs(Ia,{children:[h.jsx(Pt.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:h.jsx(Fa,{className:"bg-gray-400/30 backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),h.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:h.jsxs(Pt.div,{className:k("flex flex-col bg-white rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",r),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&h.jsx(Zo,{Icon:Et,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},$a={red:"bg-red-100 text-red-700 ring-red-200",orange:"bg-orange-100 text-orange-700 ring-orange-200",amber:"bg-amber-100 text-amber-700 ring-amber-200",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200",lime:"bg-lime-100 text-lime-700 ring-lime-200",green:"bg-green-100 text-green-700 ring-green-200",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200",teal:"bg-teal-100 text-teal-700 ring-teal-200",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200",sky:"bg-sky-100 text-sky-700 ring-sky-200",blue:"bg-blue-100 text-blue-700 ring-blue-200",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200",violet:"bg-violet-100 text-violet-700 ring-violet-200",purple:"bg-purple-100 text-purple-700 ring-purple-200",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200",pink:"bg-pink-100 text-pink-700 ring-pink-200",rose:"bg-rose-100 text-rose-700 ring-rose-200",slate:"bg-slate-100 text-slate-700 ring-slate-200",gray:"bg-gray-100 text-gray-700 ring-gray-200",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200",stone:"bg-stone-100 text-stone-700 ring-stone-200",white:"bg-white text-gray-900 ring-stone-200",black:"bg-black text-white ring-stone-200"},Ys=S.forwardRef((e,t)=>{const{className:n,children:s,onClick:i,showCloseIcon:o,Icon:r,color:a="gray"}=e,l=k("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",$a[a],n);return i?h.jsx("div",{ref:t,children:h.jsxs("button",{className:k("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:i,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&h.jsx(Et,{className:"h-4 w-4 shrink-0"})]})}):h.jsxs("div",{className:l,ref:t,children:[r&&h.jsx(r,{className:"h-4 w-4 shrink-0"}),h.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),Wa=e=>{const{className:t,tabs:n}=e;return h.jsx("div",{className:k("h-12 bg-gray-100 p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto",t),children:n.map((s,i)=>{const o=k("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 hover:bg-gray-200 active:bg-gray-300/80 transition-all duration-150 select-none focus:outline-none focus:ring-0",s.active&&"bg-white shadow-sm !border-gray-300");return s.href?h.jsxs("a",{href:s.href,className:o,children:[s.Icon&&h.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i):h.jsxs("button",{className:o,onClick:s.onClick,children:[s.Icon&&h.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i)})})},Ua=T.createContext(void 0),km=()=>({dismiss:T.useContext(Ua)||(()=>{})}),Vm="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 hover:bg-gray-100 active:bg-gray-200 rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent text-gray-900 bg-transparent ring-gray-900/10",rt=S.forwardRef((e,t)=>{const{className:n,children:s,Icon:i,onClick:o,dismissOnClick:r=!0,...a}=e,{dismiss:l}=km(),u=c=>{o&&o(c),r&&l()};return h.jsxs("button",{ref:t,className:k(Vm,n),onClick:u,...a,children:[i&&h.jsx(i,{className:"h-5 w-5"}),s]})}),Nm=e=>{const{label:t,children:n}=e;return h.jsxs("div",{className:"flex flex-col dropdown-button-group",children:[t&&h.jsx("div",{className:"mb-2 text-sm text-gray-500 font-semibold px-1",children:t}),n]})},Hs=e=>{const{trigger:t,children:n,placement:s="bottom-end",minWidth:i=200,className:o}=e,[r,a]=T.useState(!1),{Popover:l,anchorRef:u}=st({placement:s,onOutsideClick:()=>a(!1),minWidth:i});return h.jsxs(h.Fragment,{children:[h.jsx("div",{ref:u,className:o,onClick:()=>a(!r),children:t}),h.jsx(l,{open:r,children:h.jsx(it,{padding:"sm",children:h.jsx(Ua.Provider,{value:()=>a(!1),children:n})})})]})};function Im(e){const{onDelta:t,onDragStart:n,onDragEnd:s,disabled:i=!1,primaryButtonOnly:o=!0,preventScrollOnMove:r=!0}=e,[a,l]=S.useState(!1),u=S.useRef(0),c=S.useRef(0),f=S.useRef(0),d=S.useRef(null),m=S.useRef(null),p=S.useCallback(g=>{if(!a)return;const E={clientX:g??c.current,startX:u.current,totalDeltaX:f.current,target:d.current};l(!1),window.removeEventListener("pointermove",x,{capture:!0}),window.removeEventListener("pointerup",v,{capture:!0}),window.removeEventListener("pointercancel",v,{capture:!0}),window.removeEventListener("keydown",y,!0),m.current!=null&&(cancelAnimationFrame(m.current),m.current=null),s?.(E),d.current=null,f.current=0},[a,s]),y=S.useCallback(g=>{g.key==="Escape"&&(g.preventDefault(),p())},[p]),x=S.useCallback(g=>{if(!a)return;const E=()=>{const C=g.clientX,P=C-c.current;if(P!==0){c.current=C,f.current+=P;const A={clientX:C,startX:u.current,totalDeltaX:f.current,target:d.current};r&&g.preventDefault(),t(P,A)}m.current=null};m.current==null&&(m.current=requestAnimationFrame(E))},[a,t,r]),v=S.useCallback(g=>{p(g.clientX)},[p]),b=S.useCallback(g=>{if(i||o&&g.button!==0)return;g.target.setPointerCapture?.(g.pointerId),u.current=g.clientX,c.current=g.clientX,f.current=0,d.current=g.target,l(!0);const E={clientX:g.clientX,startX:g.clientX,totalDeltaX:0,target:g.target};n?.(E),window.addEventListener("pointermove",x,{passive:!r,capture:!0}),window.addEventListener("pointerup",v,{capture:!0}),window.addEventListener("pointercancel",v,{capture:!0}),window.addEventListener("keydown",y,!0)},[i,n,y,x,v,o,r]);return S.useEffect(()=>()=>{a&&p()},[a]),{isDragging:a,bind:{onPointerDown:b,role:"separator",style:{touchAction:"none",cursor:"col-resize",userSelect:"none"}}}}const Om=e=>{const{column:t}=e,n=t?.defaultWidth??250,{bind:s}=Im({onDelta:i=>console.log(i),onDragStart:()=>{},onDragEnd:()=>{}});return h.jsxs("div",{style:{width:n,height:44},className:"flex flex-row items-stretch select-none",children:[h.jsx("div",{className:"flex-1 content-center px-4 relative cursor-pointer bg-gray-50 hover:bg-gray-100 active:bg-gray-200 transition-colors duration-100",children:t.header}),h.jsx("div",{...s,className:"cursor-ew-resize group py-4 bg-gray-50 w-[8px]",children:h.jsx("div",{className:"w-0.5 h-full mx-auto bg-gray-200 group-hover:bg-gray-300 group-active:bg-blue-600 pointer-events-none"})})]})},Lm=e=>{const{columns:t,rows:n,className:s}=e,i=S.useRef(null),o=r=>{i.current&&i.current.scrollTo({left:r.currentTarget.scrollLeft})};return h.jsxs("div",{className:s,children:[h.jsx("div",{className:"relative h-[45px] w-full overflow-hidden",ref:i,children:h.jsx("div",{className:"absolute",children:h.jsx("div",{className:"font-medium text-gray-800 flex flex-row border-b border-b-gray-200",children:t.map(r=>h.jsx(Om,{column:r},r.id))})})}),h.jsx("div",{className:"relative overflow-scroll min-w-full min-h-full",onScroll:o,children:h.jsx("div",{className:"absolute",children:h.jsx("div",{className:"flex flex-col",children:n.map(r=>h.jsx("div",{className:"flex flex-row border-b border-b-gray-200 hover:bg-gray-50 bg-white transition-all duration-100",children:t.map(a=>h.jsx("div",{className:"flex-1 content-center px-4",style:{height:44,width:250},children:a.renderCell(r)},a.id))},JSON.stringify(r)))})})})]})},Fm=()=>h.jsx("div",{}),Bm=[{id:1,email:"sarah.jennings@example.com",firstname:"Sarah",lastname:"Jennings",status:"active"},{id:2,email:"liam.patel@outlook.com",firstname:"Liam",lastname:"Patel",status:"inactive"},{id:3,email:"emily.wong@gmail.com",firstname:"Emily",lastname:"Wong",status:"active"},{id:4,email:"noah.thompson@yahoo.com",firstname:"Noah",lastname:"Thompson",status:"active"},{id:5,email:"isabella.martin@protonmail.com",firstname:"Isabella",lastname:"Martin",status:"active"},{id:6,email:"ethan.ross@company.io",firstname:"Ethan",lastname:"Ross",status:"inactive"},{id:7,email:"olivia.nguyen@example.org",firstname:"Olivia",lastname:"Nguyen",status:"active"},{id:8,email:"lucas.henderson@gmail.com",firstname:"Lucas",lastname:"Henderson",status:"inactive"},{id:9,email:"mia.johnson@workmail.com",firstname:"Mia",lastname:"Johnson",status:"active"},{id:10,email:"jackson.rivera@outlook.com",firstname:"Jackson",lastname:"Rivera",status:"active"},{id:11,email:"ava.sanders@example.com",firstname:"Ava",lastname:"Sanders",status:"active"},{id:12,email:"logan.bennett@company.io",firstname:"Logan",lastname:"Bennett",status:"inactive"}],_m=[{id:"id",header:"ID",renderCell:e=>e.id},{id:"email",header:"Email",renderCell:e=>h.jsx(Ys,{Icon:Bd,onClick:()=>{},children:e.email})},{id:"firstname",header:"First Name",renderCell:e=>e.firstname},{id:"lastname",header:"Last Name",renderCell:e=>e.lastname},{id:"status",header:"Status",renderCell:()=>h.jsx(Wm,{})}],$m=()=>h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[h.jsx(ks,{Icon:Ds,placeholder:"Search..."}),h.jsx(Ms,{Icon:ta}),h.jsx(qo,{Icon:Qo,children:"New"}),h.jsxs(Hs,{trigger:h.jsx(Ms,{Icon:ta}),children:[h.jsx(rt,{dismissOnClick:!1,Icon:Qo,children:"Add new"}),h.jsx(rt,{Icon:Ld,children:"Remove"})]}),h.jsx(Wa,{tabs:[{label:"Tab 1",Icon:Jo,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:Jo,active:!1,onClick:()=>{}}]})]}),h.jsx(_a,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),h.jsx(Lm,{className:"h-[300px] w-[300px]",columns:_m,rows:Bm}),h.jsx(Fm,{})]}),Wm=()=>h.jsx(h.Fragment,{children:h.jsxs(Hs,{placement:"bottom-end",className:"inline-block",trigger:h.jsx(Ys,{onClick:()=>{},children:"Test"}),children:[h.jsx(rt,{children:"Option 1"}),h.jsx(rt,{children:"Option 2"}),h.jsx(rt,{children:"Option 3"})]})});M.Badge=Ys,M.BadgeColor=$a,M.Button=qo,M.ButtonIconRound=Zo,M.ButtonIconSquare=Ms,M.Divider=jm,M.DropdownButton=rt,M.DropdownButtonGroup=Nm,M.DropdownMenu=Hs,M.DropdownPanel=it,M.Input=ks,M.InputCheck=zd,M.InputDescription=he,M.InputError=me,M.InputErrorIcon=Fe,M.InputIconButton=Se,M.InputIconButtonTray=Be,M.InputLabel=Le,M.InputPassword=_d,M.InputRadio=Wd,M.InputSelect=_a,M.InputSelectNative=Kd,M.InputSelectOption=At,M.InputSelectSearchable=Pm,M.InputSelectSearchableAsync=Am,M.InputTextArea=$d,M.InputToggle=Ud,M.Modal=Dm,M.Panel=Rm,M.PopoverBase=Ba,M.Spinner=qt,M.TabButtons=Wa,M.Test=$m,M.Tooltip=Mm,M.usePopover=st,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
|
|
144
144
|
//# sourceMappingURL=index.umd.cjs.map
|