@matthiaskrijgsman/mat-ui 0.0.10 → 0.0.11
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/dist/style.css +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)=>d.jsx("option",{value:a.value,disabled:a.disabled,children:a.label},l))}),d.jsxs($e,{children:[o&&d.jsx(_e,{}),d.jsx(Pe,{Icon:Jt})]})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:o})]})},Rt=e=>{const{children:t,onClick:n,selected:s,disabled:i=!1}=e;return d.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:[d.jsx("div",{className:"flex-1",children:t}),s&&!i&&d.jsx("div",{className:"shrink-0",children:d.jsx(Od,{className:"h-5 w-5"})})]})};function Qt(){return typeof window<"u"}function nt(e){return Vs(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ge(e){var t;return(t=(Vs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vs(e){return Qt()?e instanceof Node||e instanceof ne(e).Node:!1}function Y(e){return Qt()?e instanceof Element||e instanceof ne(e).Element:!1}function ye(e){return Qt()?e instanceof HTMLElement||e instanceof ne(e).HTMLElement:!1}function Is(e){return!Qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}const Hd=new Set(["inline","contents"]);function jt(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=ue(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!Hd.has(i)}const Yd=new Set(["table","td","th"]);function Gd(e){return Yd.has(nt(e))}const qd=[":popover-open",":modal"];function en(e){return qd.some(t=>{try{return e.matches(t)}catch{return!1}})}const Zd=["transform","translate","scale","rotate","perspective"],Jd=["transform","translate","scale","rotate","perspective","filter"],Qd=["paint","layout","strict","content"];function Os(e){const t=Ls(),n=Y(e)?ue(e):e;return Zd.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)||Jd.some(s=>(n.willChange||"").includes(s))||Qd.some(s=>(n.contain||"").includes(s))}function eh(e){let t=De(e);for(;ye(t)&&!st(t);){if(Os(t))return t;if(en(t))return null;t=De(t)}return null}function Ls(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const th=new Set(["html","body","#document"]);function st(e){return th.has(nt(e))}function ue(e){return ne(e).getComputedStyle(e)}function tn(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Is(e)&&e.host||ge(e);return Is(t)?t.host:t}function ia(e){const t=De(e);return st(t)?e.ownerDocument?e.ownerDocument.body:e.body:ye(t)&&jt(t)?t:ia(t)}function Dt(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ia(e),o=i===((s=e.ownerDocument)==null?void 0:s.body),r=ne(i);if(o){const a=Fs(r);return t.concat(r,r.visualViewport||[],jt(i)?i:[],a&&n?Dt(a):[])}return t.concat(i,Dt(i,[],n))}function Fs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mt=Math.min,ae=Math.max,nn=Math.round,sn=Math.floor,ve=e=>({x:e,y:e});function ra(e,t){return typeof e=="function"?e(t):e}function Bs(e){return e.split("-")[0]}function oa(e){return e.split("-")[1]}function nh(e){return e==="x"?"y":"x"}function sh(e){return e==="y"?"height":"width"}const ih=new Set(["top","bottom"]);function _s(e){return ih.has(Bs(e))?"y":"x"}function rh(e){return nh(_s(e))}function oh(e){return{top:0,right:0,bottom:0,left:0,...e}}function ah(e){return typeof e!="number"?oh(e):{top:e,right:e,bottom:e,left:e}}function rn(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 lh=["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=lh.join(","),aa=typeof Element>"u",kt=aa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,on=!aa&&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},an=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},ch=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},uh=function(t,n,s){if(an(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll($s));return n&&kt.call(t,$s)&&i.unshift(t),i=i.filter(s),i},fh=function e(t,n,s){for(var i=[],o=Array.from(t);o.length;){var r=o.shift();if(!an(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=kt.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),h=!an(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&h){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},la=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ca=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ch(t))&&!la(t)?0:t.tabIndex},dh=function(t,n){var s=ca(t);return s<0&&n&&!la(t)?0:s},hh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ua=function(t){return t.tagName==="INPUT"},mh=function(t){return ua(t)&&t.type==="hidden"},ph=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},gh=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},yh=function(t){if(!t.name)return!0;var n=t.form||on(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=gh(i,t.form);return!o||o===t},vh=function(t){return ua(t)&&t.type==="radio"},xh=function(t){return vh(t)&&!yh(t)},bh=function(t){var n,s=t&&on(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=on(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},fa=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},wh=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=kt.call(t,"details>summary:first-of-type"),r=o?t.parentElement:t;if(kt.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=on(t);if(l&&!l.shadowRoot&&i(l)===!0)return fa(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(bh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return fa(t);return!1},Th=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 kt.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Sh=function(t,n){return!(n.disabled||an(n)||mh(n)||wh(n,t)||ph(n)||Th(n))},da=function(t,n){return!(xh(n)||ca(n)<0||!Sh(t,n))},Ch=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function e(t){var n=[],s=[];return t.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=dh(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(hh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ha=function(t,n){n=n||{};var s;return n.getShadowRoot?s=fh([t],n.includeContainer,{filter:da.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ch}):s=uh(t,n.includeContainer,da.bind(null,n)),Ph(s)};function Eh(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ah(){return/apple/i.test(navigator.vendor)}function Rh(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 jh(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Is(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ws(e){return e?.ownerDocument||document}var Dh=typeof document<"u",Mh=function(){},Me=Dh?T.useLayoutEffect:Mh;const kh={...S}.useInsertionEffect||(e=>e());function Nh(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return kh(()=>{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 ma=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pa(e,t){const n=ha(e,ma()),s=n.length;if(s===0)return;const i=Rh(Ws(e)),o=n.indexOf(i),r=o===-1?t===1?0:s-1:o+t;return n[r]}function Vh(e){return pa(Ws(e).body,1)||e}function Ih(e){return pa(Ws(e).body,-1)||e}function Us(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!jh(n,s)}function Oh(e){ha(e,ma()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ga(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 ya(e,t,n){let{reference:s,floating:i}=e;const o=_s(t),r=rh(t),a=sh(r),l=Bs(t),u=o==="y",c=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,h=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(oa(t)){case"start":m[r]-=h*(n&&u?-1:1);break;case"end":m[r]+=h*(n&&u?-1:1);break}return m}const Lh=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}=ya(u,s,l),h=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:h,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&&(h=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:f}=ya(u,h,l)),y=-1)}return{x:c,y:f,placement:h,strategy:i,middlewareData:m}};async function Fh(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:h=!1,padding:m=0}=ra(t,e),p=ah(m),x=a[h?f==="floating"?"reference":"floating":f],v=rn(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=rn(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 Bh=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}=ra(e,t),c=await Fh(t,u),f=Bs(i),h=oa(i),m=_s(i)==="y",{width:p,height:y}=o.floating;let x,v;f==="top"||f==="bottom"?(x=f,v=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,x=h==="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&&!h){const I=ae(c.left,0),U=ae(c.right,0),se=ae(c.top,0),O=ae(c.bottom,0);m?R=p-2*(I!==0||U!==0?I+U:ae(c.left,c.right)):A=y-2*(se!==0||O!==0?se+O:ae(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:A});const V=await r.getDimensions(a.floating);return p!==V.width||y!==V.height?{reset:{rects:!0}}:{}}}};function va(e){const t=ue(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=ye(e),o=i?e.offsetWidth:n,r=i?e.offsetHeight:s,a=nn(n)!==o||nn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function zs(e){return Y(e)?e:e.contextElement}function it(e){const t=zs(e);if(!ye(t))return ve(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:o}=va(t);let r=(o?nn(n.width):n.width)/s,a=(o?nn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const _h=ve(0);function xa(e){const t=ne(e);return!Ls()||!t.visualViewport?_h:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $h(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function We(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=zs(e);let r=ve(1);t&&(s?Y(s)&&(r=it(s)):r=it(e));const a=$h(o,n,s)?xa(o):ve(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 h=ne(o),m=s&&Y(s)?ne(s):s;let p=h,y=Fs(p);for(;y&&s&&m!==p;){const x=it(y),v=y.getBoundingClientRect(),b=ue(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=ne(y),y=Fs(p)}}return rn({width:c,height:f,x:l,y:u})}function ln(e,t){const n=tn(e).scrollLeft;return t?t.left+n:We(ge(e)).left+n}function ba(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-ln(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function Wh(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const o=i==="fixed",r=ge(s),a=t?en(t.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ve(1);const c=ve(0),f=ye(s);if((f||!f&&!o)&&((nt(s)!=="body"||jt(r))&&(l=tn(s)),ye(s))){const m=We(s);u=it(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const h=r&&!f&&!o?ba(r,l):ve(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Uh(e){return Array.from(e.getClientRects())}function zh(e){const t=ge(e),n=tn(e),s=e.ownerDocument.body,i=ae(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=ae(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+ln(e);const a=-n.scrollTop;return ue(s).direction==="rtl"&&(r+=ae(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const wa=25;function Kh(e,t){const n=ne(e),s=ge(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=Ls();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ln(s);if(u<=0){const c=s.ownerDocument,f=c.body,h=getComputedStyle(f),m=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-m);p<=wa&&(o-=p)}else u<=wa&&(o+=u);return{width:o,height:r,x:a,y:l}}const Xh=new Set(["absolute","fixed"]);function Hh(e,t){const n=We(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,o=ye(e)?it(e):ve(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 Ta(e,t,n){let s;if(t==="viewport")s=Kh(e,n);else if(t==="document")s=zh(ge(e));else if(Y(t))s=Hh(t,n);else{const i=xa(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return rn(s)}function Sa(e,t){const n=De(e);return n===t||!Y(n)||st(n)?!1:ue(n).position==="fixed"||Sa(n,t)}function Yh(e,t){const n=t.get(e);if(n)return n;let s=Dt(e,[],!1).filter(a=>Y(a)&&nt(a)!=="body"),i=null;const o=ue(e).position==="fixed";let r=o?De(e):e;for(;Y(r)&&!st(r);){const a=ue(r),l=Os(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Xh.has(i.position)||jt(r)&&!l&&Sa(e,r))?s=s.filter(c=>c!==r):i=a,r=De(r)}return t.set(e,s),s}function Gh(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const r=[...n==="clippingAncestors"?en(t)?[]:Yh(t,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const f=Ta(t,c,i);return u.top=ae(f.top,u.top),u.right=Mt(f.right,u.right),u.bottom=Mt(f.bottom,u.bottom),u.left=ae(f.left,u.left),u},Ta(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qh(e){const{width:t,height:n}=va(e);return{width:t,height:n}}function Zh(e,t,n){const s=ye(t),i=ge(t),o=n==="fixed",r=We(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function u(){l.x=ln(i)}if(s||!s&&!o)if((nt(t)!=="body"||jt(i))&&(a=tn(t)),s){const m=We(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?ba(i,a):ve(0),f=r.left+a.scrollLeft-l.x-c.x,h=r.top+a.scrollTop-l.y-c.y;return{x:f,y:h,width:r.width,height:r.height}}function Ks(e){return ue(e).position==="static"}function Ca(e,t){if(!ye(e)||ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ge(e)===n&&(n=n.ownerDocument.body),n}function Pa(e,t){const n=ne(e);if(en(e))return n;if(!ye(e)){let i=De(e);for(;i&&!st(i);){if(Y(i)&&!Ks(i))return i;i=De(i)}return n}let s=Ca(e,t);for(;s&&Gd(s)&&Ks(s);)s=Ca(s,t);return s&&st(s)&&Ks(s)&&!Os(s)?n:s||eh(e)||n}const Jh=async function(e){const t=this.getOffsetParent||Pa,n=this.getDimensions,s=await n(e.floating);return{reference:Zh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Qh(e){return ue(e).direction==="rtl"}const em={convertOffsetParentRelativeRectToViewportRelativeRect:Wh,getDocumentElement:ge,getClippingRect:Gh,getOffsetParent:Pa,getElementRects:Jh,getClientRects:Uh,getDimensions:qh,getScale:it,isElement:Y,isRTL:Qh};function Ea(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tm(e,t){let n=null,s;const i=ge(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:h,height:m}=u;if(a||t(),!h||!m)return;const p=sn(f),y=sn(i.clientWidth-(c+h)),x=sn(i.clientHeight-(f+m)),v=sn(c),g={rootMargin:-p+"px "+-y+"px "+-x+"px "+-v+"px",threshold:ae(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&&!Ea(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 nm(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=zs(e),c=i||o?[...u?Dt(u):[],...Dt(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const f=u&&a?tm(u,n):null;let h=-1,m=null;r&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let p,y=l?We(e):null;l&&x();function x(){const v=We(e);y&&!Ea(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 sm=Bh,im=(e,t,n)=>{const s=new Map,i={platform:em,...n},o={...i.platform,_c:s};return Lh(e,t,{...i,platform:o})};var rm=typeof document<"u",om=function(){},cn=rm?T.useLayoutEffect:om;function un(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(!un(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)&&!un(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ra(e,t){const n=Aa(e);return Math.round(t*n)/n}function Xs(e){const t=S.useRef(e);return cn(()=>{t.current=e}),t}function am(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}),[h,m]=S.useState(s);un(h,s)||m(s);const[p,y]=S.useState(null),[x,v]=S.useState(null),b=S.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),g=S.useCallback(N=>{N!==A.current&&(A.current=N,v(N))},[]),E=o||p,C=r||x,P=S.useRef(null),A=S.useRef(null),R=S.useRef(c),V=l!=null,I=Xs(l),U=Xs(i),se=Xs(u),O=S.useCallback(()=>{if(!P.current||!A.current)return;const N={placement:t,strategy:n,middleware:h};U.current&&(N.platform=U.current),im(P.current,A.current,N).then(J=>{const w={...J,isPositioned:se.current!==!1};K.current&&!un(R.current,w)&&(R.current=w,ti.flushSync(()=>{f(w)}))})},[h,t,n,U,se]);cn(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const K=S.useRef(!1);cn(()=>(K.current=!0,()=>{K.current=!1}),[]),cn(()=>{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,V]);const xe=S.useMemo(()=>({reference:P,floating:A,setReference:b,setFloating:g}),[b,g]),fe=S.useMemo(()=>({reference:E,floating:C}),[E,C]),_=S.useMemo(()=>{const N={position:n,left:0,top:0};if(!fe.floating)return N;const J=Ra(fe.floating,c.x),w=Ra(fe.floating,c.y);return a?{...N,transform:"translate("+J+"px, "+w+"px)",...Aa(fe.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:w}},[n,a,fe.floating,c.x,c.y]);return S.useMemo(()=>({...c,update:O,refs:xe,elements:fe,floatingStyles:_}),[c,O,xe,fe,_])}const lm=(e,t)=>({...sm(e),options:[e,t]}),cm={...S};let ja=!1,um=0;const Da=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+um++;function fm(){const[e,t]=S.useState(()=>ja?Da():void 0);return Me(()=>{e==null&&t(Da())},[]),S.useEffect(()=>{ja=!0},[]),e}const Ma=cm.useId||fm;let Hs;process.env.NODE_ENV!=="production"&&(Hs=new Set);function dm(){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=Hs)!=null&&e.has(i))){var o;(o=Hs)==null||o.add(i),console.error(i)}}function hm(){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 mm=S.createContext(null),pm=S.createContext(null),gm=()=>{var e;return((e=S.useContext(mm))==null?void 0:e.id)||null},ym=()=>S.useContext(pm);function ka(e){return"data-floating-ui-"+e}const Na={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},Va=S.forwardRef(function(t,n){const[s,i]=S.useState();Me(()=>{Ah()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[ka("focus-guard")]:"",style:Na};return d.jsx("span",{...t,...o})}),Ia=S.createContext(null),Oa=ka("portal");function vm(e){e===void 0&&(e={});const{id:t,root:n}=e,s=Ma(),i=xm(),[o,r]=S.useState(null),a=S.useRef(null);return Me(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),Me(()=>{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(Oa,""),l.appendChild(u),a.current=u,r(u)},[t,s]),Me(()=>{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(Oa,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[t,n,s,i]),o}function La(e){const{children:t,id:n,root:s,preserveTabOrder:i=!0}=e,o=vm({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),h=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return S.useEffect(()=>{if(!o||!i||h)return;function y(x){o&&Us(x)&&(x.type==="focusin"?ga:Oh)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,i,h]),S.useEffect(()=>{o&&(m||ga(o))},[m,o]),d.jsxs(Ia.Provider,{value:S.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&d.jsx(Va,{"data-type":"outside",ref:l,onFocus:y=>{if(Us(y,o)){var x;(x=c.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Ih(v);b?.focus()}}}),p&&o&&d.jsx("span",{"aria-owns":o.id,style:Na}),o&&ti.createPortal(t,o),p&&o&&d.jsx(Va,{"data-type":"outside",ref:u,onFocus:y=>{if(Us(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 xm=()=>S.useContext(Ia);let fn=0;const Fa="--floating-ui-scrollbar-width";function bm(){const e=Eh(),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(Fa,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(Fa),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let Ba=()=>{};const _a=S.forwardRef(function(t,n){const{lockScroll:s=!1,...i}=t;return Me(()=>{if(s)return fn++,fn===1&&(Ba=bm()),()=>{fn--,fn===0&&Ba()}},[s]),d.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function wm(e){const{open:t=!1,onOpenChange:n,elements:s}=e,i=Ma(),o=S.useRef({}),[r]=S.useState(()=>hm()),a=gm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!Y(m)&&dm("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=Nh((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}),[]),h=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:h,events:r,floatingId:i,refs:f}),[t,c,h,r,i,f])}function Tm(e){e===void 0&&(e={});const{nodeId:t}=e,n=wm({...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),h=ym();Me(()=>{c&&(f.current=c)},[c]);const m=am({...e,elements:{...i,...a&&{reference:a}}}),p=S.useCallback(g=>{const E=Y(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),getClientRects:()=>g.getClientRects(),contextElement:g}:g;l(E),m.refs.setReference(E)},[m.refs]),y=S.useCallback(g=>{(Y(g)||g===null)&&(f.current=g,r(g)),(Y(m.refs.reference.current)||m.refs.reference.current===null||g!==null&&!Y(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 Me(()=>{s.dataRef.current.floatingContext=b;const g=h?.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 Sm={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"},$a=S.memo(({open:e,children:t,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>d.jsx(La,{children:d.jsx(is,{children:e&&d.jsxs(d.Fragment,{children:[s&&d.jsx(_a,{onClick:s}),d.jsx("div",{ref:o,style:i,className:"z-50",children:d.jsx(Et.div,{className:n,style:{transformOrigin:Sm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),rt=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=e,r=S.useMemo(()=>[lm({apply({rects:f,elements:h}){s&&(h.floating.style.width=`${f.reference.width}px`),i&&(h.floating.style.minWidth=`${i}px`),o&&(h.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=Tm({placement:t,middleware:r,whileElementsMounted:nm}),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=h=>{const{floatingStyles:m,setFloating:p,onOutsideClick:y,placement:x}=u.current,{className:v,open:b,children:g}=h;return d.jsx($a,{open:b,className:v,onOutsideClick:y,floatingStyles:m,setFloating:p,placement:x,children:g})};return S.memo(f)},[]);return{anchorRef:a.setReference,Popover:c}},Cm="flex flex-col bg-white border mt-1 border-gray-200 rounded-xl shadow-lg overflow-y-auto relative space-y-1",Pm={sm:"p-2",md:"p-3",lg:"p-4"},ot=e=>{const{className:t,children:n,padding:s="md",...i}=e;return d.jsx("div",{className:k(Cm,Pm[s],t),...i,children:n})},dn=(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])},Wa=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),h=S.useRef(null),m=i?.find(x=>x.value===r);dn(c,()=>f(!1)),T.useEffect(()=>{c&&h.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:y}=rt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return d.jsxs("div",{className:k("flex flex-col",t),children:[d.jsx(Be,{children:n}),d.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[d.jsxs("div",{ref:h,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&&d.jsx("span",{children:m.label}),!m&&a&&d.jsx("span",{className:"text-gray-500",children:a})]}),d.jsxs($e,{children:[u&&d.jsx(_e,{}),!!r&&d.jsx(Pe,{Icon:At,onClick:()=>o(null)}),d.jsx(Pe,{Icon:Jt})]}),d.jsx(y,{open:c,children:d.jsx(ot,{className:"!p-0",style:{maxHeight:l},children:d.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const v=x.value===r;return d.jsx(Rt,{onClick:()=>{!x.disabled&&o&&(o(x.value),f(!1))},selected:v,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:u})]})},Em=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,h]=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);dn(f,()=>h(!1)),T.useEffect(()=>{p(r(y))},[y,i,r]),T.useEffect(()=>{f&&b.current?.focus()},[f]);const{anchorRef:E,Popover:C}=rt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>h(!1)});return d.jsxs("div",{className:k("flex flex-col",t),children:[d.jsx(Be,{children:n}),d.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[d.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===" "&&h(A=>!A),onClick:()=>h(!f),children:[g&&d.jsx("span",{children:g.label}),!g&&l&&d.jsx("span",{className:"text-gray-500",children:l})]}),d.jsxs($e,{children:[c&&d.jsx(_e,{}),!!a&&d.jsx(Pe,{Icon:At,onClick:()=>o(null)}),d.jsx(Pe,{Icon:Jt})]}),d.jsx(C,{open:f,children:d.jsxs(ot,{className:"gap-0 !p-0",style:{maxHeight:u},children:[d.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[d.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)}),d.jsx(ks,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),d.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[y!==""&&d.jsxs(d.Fragment,{children:[m.length===0&&d.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:d.jsx(na,{className:"h-6 w-6 text-gray-900"})}),m.map(P=>{const A=P.value===a;return d.jsx(Rt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})]}),y===""&&d.jsx(d.Fragment,{children:i.map(P=>{const A=P.value===a;return d.jsx(Rt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})})]})]})})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:c})]})},Am=(e,t)=>{const[n,s]=T.useState(e);return T.useEffect(()=>{const i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Rm=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,[h,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,V]=T.useState(!1);dn(h,()=>m(!1));const I=Am(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()=>{V(!0);const xe=await r(l);E(xe),V(!1)})()},[r,v,l]),T.useEffect(()=>{h&&C.current?.focus()},[h]);const{anchorRef:U,Popover:se}=rt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return d.jsxs("div",{className:k("flex flex-col",t),children:[d.jsx(Be,{children:n}),d.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[d.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",h&&"ring-4"),onKeyDown:O=>O.key===" "&&m(K=>!K),onClick:()=>m(!h),children:[!R&&g&&d.jsx("span",{children:g.label}),!R&&!g&&u&&d.jsx("span",{children:u}),R&&d.jsx(Zt,{className:"h-4 w-4 text-gray-600"})]}),d.jsxs($e,{children:[f&&d.jsx(_e,{}),!!l&&d.jsx(Pe,{Icon:At,onClick:()=>i(null)}),d.jsx(Pe,{Icon:Jt})]}),d.jsx(se,{open:h,children:d.jsxs(ot,{className:"gap-0 !p-0",style:{maxHeight:c},children:[d.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[d.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)}),d.jsx(ks,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),d.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!P&&v.length===0&&d.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:d.jsx(na,{className:"h-6 w-6 text-gray-900"})}),P&&d.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:d.jsx(Zt,{className:"h-6 w-6 text-gray-900"})}),!P&&d.jsx(d.Fragment,{children:v.map(O=>{const K=O.value===l;return d.jsx(Rt,{onClick:()=>{!O.disabled&&i&&(i(O.value),m(!1))},selected:K,disabled:O.disabled,children:O.label},String(O.value))})})]})]})})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:f})]})},jm=S.forwardRef((e,t)=>{const{className:n,children:s,...i}=e;return d.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})}),Dm=e=>{const{className:t,vertical:n=!1,...s}=e;return d.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}=rt({placement:i,minWidth:o,maxWidth:r});return d.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,d.jsx(c,{open:a,children:d.jsx(ot,{children:n})})]})},km=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=e;return dn(!!i&&t,n||(()=>{})),d.jsx(is,{children:t&&d.jsxs(La,{children:[d.jsx(Et.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:d.jsx(_a,{className:"bg-gray-400/30 backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),d.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:d.jsxs(Et.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&&d.jsx(Qo,{Icon:At,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Ua={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",Ua[a],n);return i?d.jsx("div",{ref:t,children:d.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&&d.jsx(r,{className:"h-4 w-4 shrink-0"}),d.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&d.jsx(At,{className:"h-4 w-4 shrink-0"})]})}):d.jsxs("div",{className:l,ref:t,children:[r&&d.jsx(r,{className:"h-4 w-4 shrink-0"}),d.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),za=e=>{const{className:t,tabs:n}=e;return d.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?d.jsxs("a",{href:s.href,className:o,children:[s.Icon&&d.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i):d.jsxs("button",{className:o,onClick:s.onClick,children:[s.Icon&&d.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i)})})},Ka=T.createContext(void 0),Nm=()=>({dismiss:T.useContext(Ka)||(()=>{})}),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",ee=S.forwardRef((e,t)=>{const{className:n,children:s,Icon:i,onClick:o,dismissOnClick:r=!0,...a}=e,{dismiss:l}=Nm(),u=c=>{o&&o(c),r&&l()};return d.jsxs("button",{ref:t,className:k(Vm,n),onClick:u,...a,children:[i&&d.jsx(i,{className:"h-5 w-5"}),s]})}),Gs=e=>{const{label:t,children:n,className:s}=e;return d.jsxs("div",{className:k("flex flex-col dropdown-button-group",s),children:[t&&d.jsx("div",{className:"mb-2 text-sm text-gray-500 font-semibold px-1",children:t}),n]})},qs=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}=rt({placement:s,onOutsideClick:()=>a(!1),minWidth:i});return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:u,className:o,onClick:()=>a(!r),children:t}),d.jsx(l,{open:r,children:d.jsx(ot,{padding:"sm",children:d.jsx(Ka.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),h=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:h.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),h.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:h.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,h.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 d.jsxs("div",{style:{width:n,height:44},className:"flex flex-row items-stretch select-none",children:[d.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}),d.jsx("div",{...s,className:"cursor-ew-resize group py-4 bg-gray-50 w-[8px]",children:d.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 d.jsxs("div",{className:s,children:[d.jsx("div",{className:"relative h-[45px] w-full overflow-hidden",ref:i,children:d.jsx("div",{className:"absolute",children:d.jsx("div",{className:"font-medium text-gray-800 flex flex-row border-b border-b-gray-200",children:t.map(r=>d.jsx(Om,{column:r},r.id))})})}),d.jsx("div",{className:"relative overflow-scroll min-w-full min-h-full",onScroll:o,children:d.jsx("div",{className:"absolute",children:d.jsx("div",{className:"flex flex-col",children:n.map(r=>d.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=>d.jsx("div",{className:"flex-1 content-center px-4",style:{height:44,width:250},children:a.renderCell(r)},a.id))},JSON.stringify(r)))})})})]})},Fm=()=>d.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=>d.jsx(Ys,{Icon:_d,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:()=>d.jsx(Wm,{})}],$m=()=>d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[d.jsx(Ns,{Icon:ks,placeholder:"Search..."}),d.jsx(Ms,{Icon:sa}),d.jsx(Jo,{Icon:ta,children:"New"}),d.jsxs(qs,{trigger:d.jsx(Ms,{Icon:sa}),children:[d.jsx(ee,{dismissOnClick:!1,Icon:ta,children:"Add new"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsxs(Gs,{label:"Test",className:"mt-2",children:[d.jsx(ee,{Icon:Ce,children:"Utrechtse Horeca Groep / Restaurant Dengh"}),d.jsx(ee,{Icon:Ce,children:"Utrechtse Horeca Groep / Restaurant Dengh"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"})]}),d.jsxs(Gs,{label:"Test",className:"mt-2",children:[d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"})]})]}),d.jsx(za,{tabs:[{label:"Tab 1",Icon:ea,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:ea,active:!1,onClick:()=>{}}]})]}),d.jsx(Wa,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),d.jsx(Lm,{className:"h-[300px] w-[300px]",columns:_m,rows:Bm}),d.jsx(Fm,{})]}),Wm=()=>d.jsx(d.Fragment,{children:d.jsxs(qs,{placement:"bottom-end",className:"inline-block",trigger:d.jsx(Ys,{onClick:()=>{},children:"Test"}),children:[d.jsx(ee,{children:"Option 1"}),d.jsx(ee,{children:"Option 2"}),d.jsx(ee,{children:"Option 3"})]})});D.Badge=Ys,D.BadgeColor=Ua,D.Button=Jo,D.ButtonIconRound=Qo,D.ButtonIconSquare=Ms,D.Divider=Dm,D.DropdownButton=ee,D.DropdownButtonGroup=Gs,D.DropdownMenu=qs,D.DropdownPanel=ot,D.Input=Ns,D.InputCheck=Kd,D.InputDescription=me,D.InputError=pe,D.InputErrorIcon=_e,D.InputIconButton=Pe,D.InputIconButtonTray=$e,D.InputLabel=Be,D.InputPassword=$d,D.InputRadio=Ud,D.InputSelect=Wa,D.InputSelectNative=Xd,D.InputSelectOption=Rt,D.InputSelectSearchable=Em,D.InputSelectSearchableAsync=Rm,D.InputTextArea=Wd,D.InputToggle=zd,D.Modal=km,D.Panel=jm,D.PopoverBase=$a,D.Spinner=Zt,D.TabButtons=za,D.Test=$m,D.Tooltip=Mm,D.usePopover=rt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
143
|
+
*/var lh=["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=lh.join(","),aa=typeof Element>"u",kt=aa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,on=!aa&&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},an=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},ch=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},uh=function(t,n,s){if(an(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll($s));return n&&kt.call(t,$s)&&i.unshift(t),i=i.filter(s),i},fh=function e(t,n,s){for(var i=[],o=Array.from(t);o.length;){var r=o.shift();if(!an(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=kt.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),h=!an(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(r));if(f&&h){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},la=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ca=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ch(t))&&!la(t)?0:t.tabIndex},dh=function(t,n){var s=ca(t);return s<0&&n&&!la(t)?0:s},hh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ua=function(t){return t.tagName==="INPUT"},mh=function(t){return ua(t)&&t.type==="hidden"},ph=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},gh=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},yh=function(t){if(!t.name)return!0;var n=t.form||on(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=gh(i,t.form);return!o||o===t},vh=function(t){return ua(t)&&t.type==="radio"},xh=function(t){return vh(t)&&!yh(t)},bh=function(t){var n,s=t&&on(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=on(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},fa=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},wh=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=kt.call(t,"details>summary:first-of-type"),r=o?t.parentElement:t;if(kt.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=on(t);if(l&&!l.shadowRoot&&i(l)===!0)return fa(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(bh(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return fa(t);return!1},Th=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 kt.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Sh=function(t,n){return!(n.disabled||an(n)||mh(n)||wh(n,t)||ph(n)||Th(n))},da=function(t,n){return!(xh(n)||ca(n)<0||!Sh(t,n))},Ch=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function e(t){var n=[],s=[];return t.forEach(function(i,o){var r=!!i.scopeParent,a=r?i.scopeParent:i,l=dh(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(hh).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},ha=function(t,n){n=n||{};var s;return n.getShadowRoot?s=fh([t],n.includeContainer,{filter:da.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ch}):s=uh(t,n.includeContainer,da.bind(null,n)),Ph(s)};function Eh(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ah(){return/apple/i.test(navigator.vendor)}function Rh(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 jh(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Is(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ws(e){return e?.ownerDocument||document}var Dh=typeof document<"u",Mh=function(){},Me=Dh?T.useLayoutEffect:Mh;const kh={...S}.useInsertionEffect||(e=>e());function Nh(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return kh(()=>{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 ma=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pa(e,t){const n=ha(e,ma()),s=n.length;if(s===0)return;const i=Rh(Ws(e)),o=n.indexOf(i),r=o===-1?t===1?0:s-1:o+t;return n[r]}function Vh(e){return pa(Ws(e).body,1)||e}function Ih(e){return pa(Ws(e).body,-1)||e}function Us(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!jh(n,s)}function Oh(e){ha(e,ma()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ga(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 ya(e,t,n){let{reference:s,floating:i}=e;const o=_s(t),r=rh(t),a=sh(r),l=Bs(t),u=o==="y",c=s.x+s.width/2-i.width/2,f=s.y+s.height/2-i.height/2,h=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(oa(t)){case"start":m[r]-=h*(n&&u?-1:1);break;case"end":m[r]+=h*(n&&u?-1:1);break}return m}const Lh=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}=ya(u,s,l),h=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:h,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&&(h=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:f}=ya(u,h,l)),y=-1)}return{x:c,y:f,placement:h,strategy:i,middlewareData:m}};async function Fh(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:h=!1,padding:m=0}=ra(t,e),p=ah(m),x=a[h?f==="floating"?"reference":"floating":f],v=rn(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=rn(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 Bh=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}=ra(e,t),c=await Fh(t,u),f=Bs(i),h=oa(i),m=_s(i)==="y",{width:p,height:y}=o.floating;let x,v;f==="top"||f==="bottom"?(x=f,v=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,x=h==="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&&!h){const I=ae(c.left,0),U=ae(c.right,0),se=ae(c.top,0),O=ae(c.bottom,0);m?R=p-2*(I!==0||U!==0?I+U:ae(c.left,c.right)):A=y-2*(se!==0||O!==0?se+O:ae(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:A});const V=await r.getDimensions(a.floating);return p!==V.width||y!==V.height?{reset:{rects:!0}}:{}}}};function va(e){const t=ue(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=ye(e),o=i?e.offsetWidth:n,r=i?e.offsetHeight:s,a=nn(n)!==o||nn(s)!==r;return a&&(n=o,s=r),{width:n,height:s,$:a}}function zs(e){return Y(e)?e:e.contextElement}function it(e){const t=zs(e);if(!ye(t))return ve(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:o}=va(t);let r=(o?nn(n.width):n.width)/s,a=(o?nn(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const _h=ve(0);function xa(e){const t=ne(e);return!Ls()||!t.visualViewport?_h:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $h(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function We(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=zs(e);let r=ve(1);t&&(s?Y(s)&&(r=it(s)):r=it(e));const a=$h(o,n,s)?xa(o):ve(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 h=ne(o),m=s&&Y(s)?ne(s):s;let p=h,y=Fs(p);for(;y&&s&&m!==p;){const x=it(y),v=y.getBoundingClientRect(),b=ue(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=ne(y),y=Fs(p)}}return rn({width:c,height:f,x:l,y:u})}function ln(e,t){const n=tn(e).scrollLeft;return t?t.left+n:We(ge(e)).left+n}function ba(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-ln(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function Wh(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const o=i==="fixed",r=ge(s),a=t?en(t.floating):!1;if(s===r||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=ve(1);const c=ve(0),f=ye(s);if((f||!f&&!o)&&((nt(s)!=="body"||jt(r))&&(l=tn(s)),ye(s))){const m=We(s);u=it(s),c.x=m.x+s.clientLeft,c.y=m.y+s.clientTop}const h=r&&!f&&!o?ba(r,l):ve(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Uh(e){return Array.from(e.getClientRects())}function zh(e){const t=ge(e),n=tn(e),s=e.ownerDocument.body,i=ae(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),o=ae(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let r=-n.scrollLeft+ln(e);const a=-n.scrollTop;return ue(s).direction==="rtl"&&(r+=ae(t.clientWidth,s.clientWidth)-i),{width:i,height:o,x:r,y:a}}const wa=25;function Kh(e,t){const n=ne(e),s=ge(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=Ls();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ln(s);if(u<=0){const c=s.ownerDocument,f=c.body,h=getComputedStyle(f),m=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(s.clientWidth-f.clientWidth-m);p<=wa&&(o-=p)}else u<=wa&&(o+=u);return{width:o,height:r,x:a,y:l}}const Xh=new Set(["absolute","fixed"]);function Hh(e,t){const n=We(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,o=ye(e)?it(e):ve(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 Ta(e,t,n){let s;if(t==="viewport")s=Kh(e,n);else if(t==="document")s=zh(ge(e));else if(Y(t))s=Hh(t,n);else{const i=xa(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return rn(s)}function Sa(e,t){const n=De(e);return n===t||!Y(n)||st(n)?!1:ue(n).position==="fixed"||Sa(n,t)}function Yh(e,t){const n=t.get(e);if(n)return n;let s=Dt(e,[],!1).filter(a=>Y(a)&&nt(a)!=="body"),i=null;const o=ue(e).position==="fixed";let r=o?De(e):e;for(;Y(r)&&!st(r);){const a=ue(r),l=Os(r);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Xh.has(i.position)||jt(r)&&!l&&Sa(e,r))?s=s.filter(c=>c!==r):i=a,r=De(r)}return t.set(e,s),s}function Gh(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const r=[...n==="clippingAncestors"?en(t)?[]:Yh(t,this._c):[].concat(n),s],a=r[0],l=r.reduce((u,c)=>{const f=Ta(t,c,i);return u.top=ae(f.top,u.top),u.right=Mt(f.right,u.right),u.bottom=Mt(f.bottom,u.bottom),u.left=ae(f.left,u.left),u},Ta(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qh(e){const{width:t,height:n}=va(e);return{width:t,height:n}}function Zh(e,t,n){const s=ye(t),i=ge(t),o=n==="fixed",r=We(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function u(){l.x=ln(i)}if(s||!s&&!o)if((nt(t)!=="body"||jt(i))&&(a=tn(t)),s){const m=We(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?ba(i,a):ve(0),f=r.left+a.scrollLeft-l.x-c.x,h=r.top+a.scrollTop-l.y-c.y;return{x:f,y:h,width:r.width,height:r.height}}function Ks(e){return ue(e).position==="static"}function Ca(e,t){if(!ye(e)||ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ge(e)===n&&(n=n.ownerDocument.body),n}function Pa(e,t){const n=ne(e);if(en(e))return n;if(!ye(e)){let i=De(e);for(;i&&!st(i);){if(Y(i)&&!Ks(i))return i;i=De(i)}return n}let s=Ca(e,t);for(;s&&Gd(s)&&Ks(s);)s=Ca(s,t);return s&&st(s)&&Ks(s)&&!Os(s)?n:s||eh(e)||n}const Jh=async function(e){const t=this.getOffsetParent||Pa,n=this.getDimensions,s=await n(e.floating);return{reference:Zh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Qh(e){return ue(e).direction==="rtl"}const em={convertOffsetParentRelativeRectToViewportRelativeRect:Wh,getDocumentElement:ge,getClippingRect:Gh,getOffsetParent:Pa,getElementRects:Jh,getClientRects:Uh,getDimensions:qh,getScale:it,isElement:Y,isRTL:Qh};function Ea(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tm(e,t){let n=null,s;const i=ge(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:h,height:m}=u;if(a||t(),!h||!m)return;const p=sn(f),y=sn(i.clientWidth-(c+h)),x=sn(i.clientHeight-(f+m)),v=sn(c),g={rootMargin:-p+"px "+-y+"px "+-x+"px "+-v+"px",threshold:ae(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&&!Ea(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 nm(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=zs(e),c=i||o?[...u?Dt(u):[],...Dt(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const f=u&&a?tm(u,n):null;let h=-1,m=null;r&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let p,y=l?We(e):null;l&&x();function x(){const v=We(e);y&&!Ea(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 sm=Bh,im=(e,t,n)=>{const s=new Map,i={platform:em,...n},o={...i.platform,_c:s};return Lh(e,t,{...i,platform:o})};var rm=typeof document<"u",om=function(){},cn=rm?T.useLayoutEffect:om;function un(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(!un(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)&&!un(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Aa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ra(e,t){const n=Aa(e);return Math.round(t*n)/n}function Xs(e){const t=S.useRef(e);return cn(()=>{t.current=e}),t}function am(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}),[h,m]=S.useState(s);un(h,s)||m(s);const[p,y]=S.useState(null),[x,v]=S.useState(null),b=S.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),g=S.useCallback(N=>{N!==A.current&&(A.current=N,v(N))},[]),E=o||p,C=r||x,P=S.useRef(null),A=S.useRef(null),R=S.useRef(c),V=l!=null,I=Xs(l),U=Xs(i),se=Xs(u),O=S.useCallback(()=>{if(!P.current||!A.current)return;const N={placement:t,strategy:n,middleware:h};U.current&&(N.platform=U.current),im(P.current,A.current,N).then(J=>{const w={...J,isPositioned:se.current!==!1};K.current&&!un(R.current,w)&&(R.current=w,ti.flushSync(()=>{f(w)}))})},[h,t,n,U,se]);cn(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[u]);const K=S.useRef(!1);cn(()=>(K.current=!0,()=>{K.current=!1}),[]),cn(()=>{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,V]);const xe=S.useMemo(()=>({reference:P,floating:A,setReference:b,setFloating:g}),[b,g]),fe=S.useMemo(()=>({reference:E,floating:C}),[E,C]),_=S.useMemo(()=>{const N={position:n,left:0,top:0};if(!fe.floating)return N;const J=Ra(fe.floating,c.x),w=Ra(fe.floating,c.y);return a?{...N,transform:"translate("+J+"px, "+w+"px)",...Aa(fe.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:w}},[n,a,fe.floating,c.x,c.y]);return S.useMemo(()=>({...c,update:O,refs:xe,elements:fe,floatingStyles:_}),[c,O,xe,fe,_])}const lm=(e,t)=>({...sm(e),options:[e,t]}),cm={...S};let ja=!1,um=0;const Da=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+um++;function fm(){const[e,t]=S.useState(()=>ja?Da():void 0);return Me(()=>{e==null&&t(Da())},[]),S.useEffect(()=>{ja=!0},[]),e}const Ma=cm.useId||fm;let Hs;process.env.NODE_ENV!=="production"&&(Hs=new Set);function dm(){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=Hs)!=null&&e.has(i))){var o;(o=Hs)==null||o.add(i),console.error(i)}}function hm(){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 mm=S.createContext(null),pm=S.createContext(null),gm=()=>{var e;return((e=S.useContext(mm))==null?void 0:e.id)||null},ym=()=>S.useContext(pm);function ka(e){return"data-floating-ui-"+e}const Na={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},Va=S.forwardRef(function(t,n){const[s,i]=S.useState();Me(()=>{Ah()&&i("button")},[]);const o={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[ka("focus-guard")]:"",style:Na};return d.jsx("span",{...t,...o})}),Ia=S.createContext(null),Oa=ka("portal");function vm(e){e===void 0&&(e={});const{id:t,root:n}=e,s=Ma(),i=xm(),[o,r]=S.useState(null),a=S.useRef(null);return Me(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),Me(()=>{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(Oa,""),l.appendChild(u),a.current=u,r(u)},[t,s]),Me(()=>{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(Oa,""),l=u||l,l.appendChild(c),a.current=c,r(c)},[t,n,s,i]),o}function La(e){const{children:t,id:n,root:s,preserveTabOrder:i=!0}=e,o=vm({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),h=r?.modal,m=r?.open,p=!!r&&!r.modal&&r.open&&i&&!!(s||o);return S.useEffect(()=>{if(!o||!i||h)return;function y(x){o&&Us(x)&&(x.type==="focusin"?ga:Oh)(o)}return o.addEventListener("focusin",y,!0),o.addEventListener("focusout",y,!0),()=>{o.removeEventListener("focusin",y,!0),o.removeEventListener("focusout",y,!0)}},[o,i,h]),S.useEffect(()=>{o&&(m||ga(o))},[m,o]),d.jsxs(Ia.Provider,{value:S.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[p&&o&&d.jsx(Va,{"data-type":"outside",ref:l,onFocus:y=>{if(Us(y,o)){var x;(x=c.current)==null||x.focus()}else{const v=r?r.domReference:null,b=Ih(v);b?.focus()}}}),p&&o&&d.jsx("span",{"aria-owns":o.id,style:Na}),o&&ti.createPortal(t,o),p&&o&&d.jsx(Va,{"data-type":"outside",ref:u,onFocus:y=>{if(Us(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 xm=()=>S.useContext(Ia);let fn=0;const Fa="--floating-ui-scrollbar-width";function bm(){const e=Eh(),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(Fa,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(Fa),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(r,a))}}let Ba=()=>{};const _a=S.forwardRef(function(t,n){const{lockScroll:s=!1,...i}=t;return Me(()=>{if(s)return fn++,fn===1&&(Ba=bm()),()=>{fn--,fn===0&&Ba()}},[s]),d.jsx("div",{ref:n,...i,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}})});function wm(e){const{open:t=!1,onOpenChange:n,elements:s}=e,i=Ma(),o=S.useRef({}),[r]=S.useState(()=>hm()),a=gm()!=null;if(process.env.NODE_ENV!=="production"){const m=s.reference;m&&!Y(m)&&dm("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=Nh((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}),[]),h=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:h,events:r,floatingId:i,refs:f}),[t,c,h,r,i,f])}function Tm(e){e===void 0&&(e={});const{nodeId:t}=e,n=wm({...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),h=ym();Me(()=>{c&&(f.current=c)},[c]);const m=am({...e,elements:{...i,...a&&{reference:a}}}),p=S.useCallback(g=>{const E=Y(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),getClientRects:()=>g.getClientRects(),contextElement:g}:g;l(E),m.refs.setReference(E)},[m.refs]),y=S.useCallback(g=>{(Y(g)||g===null)&&(f.current=g,r(g)),(Y(m.refs.reference.current)||m.refs.reference.current===null||g!==null&&!Y(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 Me(()=>{s.dataRef.current.floatingContext=b;const g=h?.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 Sm={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"},$a=S.memo(({open:e,children:t,className:n,onOutsideClick:s,floatingStyles:i,setFloating:o,placement:r})=>d.jsx(La,{children:d.jsx(is,{children:e&&d.jsxs(d.Fragment,{children:[s&&d.jsx(_a,{onClick:s}),d.jsx("div",{ref:o,style:i,className:"z-50",children:d.jsx(Et.div,{className:n,style:{transformOrigin:Sm[r]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),rt=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:s,minWidth:i,maxWidth:o}=e,r=S.useMemo(()=>[lm({apply({rects:f,elements:h}){s&&(h.floating.style.width=`${f.reference.width}px`),i&&(h.floating.style.minWidth=`${i}px`),o&&(h.floating.style.maxWidth=`${o}px`)}})],[s,o,i]),{refs:a,floatingStyles:l}=Tm({placement:t,middleware:r,whileElementsMounted:nm}),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=h=>{const{floatingStyles:m,setFloating:p,onOutsideClick:y,placement:x}=u.current,{className:v,open:b,children:g}=h;return d.jsx($a,{open:b,className:v,onOutsideClick:y,floatingStyles:m,setFloating:p,placement:x,children:g})};return S.memo(f)},[]);return{anchorRef:a.setReference,Popover:c}},Cm="flex flex-col bg-white border mt-1 border-gray-200 rounded-xl shadow-lg overflow-y-auto relative space-y-1",Pm={sm:"p-2",md:"p-3",lg:"p-4"},ot=e=>{const{className:t,children:n,padding:s="md",...i}=e;return d.jsx("div",{className:k(Cm,Pm[s],t),...i,children:n})},dn=(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])},Wa=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),h=S.useRef(null),m=i?.find(x=>x.value===r);dn(c,()=>f(!1)),T.useEffect(()=>{c&&h.current?.focus({preventScroll:!0})},[c]);const{anchorRef:p,Popover:y}=rt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return d.jsxs("div",{className:k("flex flex-col",t),children:[d.jsx(Be,{children:n}),d.jsxs("div",{className:"relative flex w-full flex-col",ref:p,children:[d.jsxs("div",{ref:h,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&&d.jsx("span",{children:m.label}),!m&&a&&d.jsx("span",{className:"text-gray-500",children:a})]}),d.jsxs($e,{children:[u&&d.jsx(_e,{}),!!r&&d.jsx(Pe,{Icon:At,onClick:()=>o(null)}),d.jsx(Pe,{Icon:Jt})]}),d.jsx(y,{open:c,children:d.jsx(ot,{className:"!p-0",style:{maxHeight:l},children:d.jsx("div",{className:"flex flex-col p-2 gap-1",children:i.map(x=>{const v=x.value===r;return d.jsx(Rt,{onClick:()=>{!x.disabled&&o&&(o(x.value),f(!1))},selected:v,disabled:x.disabled,children:x.label},String(x.value))})})})})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:u})]})},Em=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,h]=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);dn(f,()=>h(!1)),T.useEffect(()=>{p(r(y))},[y,i,r]),T.useEffect(()=>{f&&b.current?.focus()},[f]);const{anchorRef:E,Popover:C}=rt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>h(!1)});return d.jsxs("div",{className:k("flex flex-col",t),children:[d.jsx(Be,{children:n}),d.jsxs("div",{className:"relative flex w-full flex-col",ref:E,children:[d.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===" "&&h(A=>!A),onClick:()=>h(!f),children:[g&&d.jsx("span",{children:g.label}),!g&&l&&d.jsx("span",{className:"text-gray-500",children:l})]}),d.jsxs($e,{children:[c&&d.jsx(_e,{}),!!a&&d.jsx(Pe,{Icon:At,onClick:()=>o(null)}),d.jsx(Pe,{Icon:Jt})]}),d.jsx(C,{open:f,children:d.jsxs(ot,{className:"gap-0 !p-0",style:{maxHeight:u},children:[d.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[d.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)}),d.jsx(ks,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),d.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[y!==""&&d.jsxs(d.Fragment,{children:[m.length===0&&d.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:d.jsx(na,{className:"h-6 w-6 text-gray-900"})}),m.map(P=>{const A=P.value===a;return d.jsx(Rt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})]}),y===""&&d.jsx(d.Fragment,{children:i.map(P=>{const A=P.value===a;return d.jsx(Rt,{onClick:()=>{!P.disabled&&o&&(o(P.value),h(!1))},selected:A,disabled:P.disabled,children:P.label},String(P.value))})})]})]})})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:c})]})},Am=(e,t)=>{const[n,s]=T.useState(e);return T.useEffect(()=>{const i=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Rm=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,[h,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,V]=T.useState(!1);dn(h,()=>m(!1));const I=Am(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()=>{V(!0);const xe=await r(l);E(xe),V(!1)})()},[r,v,l]),T.useEffect(()=>{h&&C.current?.focus()},[h]);const{anchorRef:U,Popover:se}=rt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return d.jsxs("div",{className:k("flex flex-col",t),children:[d.jsx(Be,{children:n}),d.jsxs("div",{className:"relative flex w-full flex-col",ref:U,children:[d.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",h&&"ring-4"),onKeyDown:O=>O.key===" "&&m(K=>!K),onClick:()=>m(!h),children:[!R&&g&&d.jsx("span",{children:g.label}),!R&&!g&&u&&d.jsx("span",{children:u}),R&&d.jsx(Zt,{className:"h-4 w-4 text-gray-600"})]}),d.jsxs($e,{children:[f&&d.jsx(_e,{}),!!l&&d.jsx(Pe,{Icon:At,onClick:()=>i(null)}),d.jsx(Pe,{Icon:Jt})]}),d.jsx(se,{open:h,children:d.jsxs(ot,{className:"gap-0 !p-0",style:{maxHeight:c},children:[d.jsxs("div",{className:"sticky top-0 border-b border-b-gray-200 py-1 bg-white/50 backdrop-blur-sm",children:[d.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)}),d.jsx(ks,{className:"absolute text-gray-500 left-4 top-4 h-4 w-4"})]}),d.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!P&&v.length===0&&d.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:d.jsx(na,{className:"h-6 w-6 text-gray-900"})}),P&&d.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:d.jsx(Zt,{className:"h-6 w-6 text-gray-900"})}),!P&&d.jsx(d.Fragment,{children:v.map(O=>{const K=O.value===l;return d.jsx(Rt,{onClick:()=>{!O.disabled&&i&&(i(O.value),m(!1))},selected:K,disabled:O.disabled,children:O.label},String(O.value))})})]})]})})]}),d.jsx(me,{children:s}),d.jsx(pe,{children:f})]})},jm=S.forwardRef((e,t)=>{const{className:n,children:s,...i}=e;return d.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})}),Dm=e=>{const{className:t,vertical:n=!1,...s}=e;return d.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}=rt({placement:i,minWidth:o,maxWidth:r});return d.jsxs("span",{ref:u,className:s,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,d.jsx(c,{open:a,children:d.jsx(ot,{children:n})})]})},km=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:s,enableDismissOnEscKey:i,enableDismissButton:o,className:r,children:a,maxWidth:l=600}=e;return dn(!!i&&t,n||(()=>{})),d.jsx(is,{children:t&&d.jsxs(La,{children:[d.jsx(Et.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:d.jsx(_a,{className:"bg-gray-400/30 backdrop-blur-[1px] z-10",onClick:s?n:void 0,lockScroll:!0})}),d.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:d.jsxs(Et.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&&d.jsx(Qo,{Icon:At,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Ua={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",Ua[a],n);return i?d.jsx("div",{ref:t,children:d.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&&d.jsx(r,{className:"h-4 w-4 shrink-0"}),d.jsx("div",{className:"break-all line-clamp-1 text-left",children:s}),o&&d.jsx(At,{className:"h-4 w-4 shrink-0"})]})}):d.jsxs("div",{className:l,ref:t,children:[r&&d.jsx(r,{className:"h-4 w-4 shrink-0"}),d.jsx("div",{className:"break-all line-clamp-1 text-left",children:s})]})}),za=e=>{const{className:t,tabs:n}=e;return d.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?d.jsxs("a",{href:s.href,className:o,children:[s.Icon&&d.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i):d.jsxs("button",{className:o,onClick:s.onClick,children:[s.Icon&&d.jsx(s.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),s.label]},i)})})},Ka=T.createContext(void 0),Nm=()=>({dismiss:T.useContext(Ka)||(()=>{})}),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",ee=S.forwardRef((e,t)=>{const{className:n,children:s,Icon:i,onClick:o,dismissOnClick:r=!0,...a}=e,{dismiss:l}=Nm(),u=c=>{o&&o(c),r&&l()};return d.jsxs("button",{ref:t,className:k(Vm,n),onClick:u,...a,children:[i&&d.jsx(i,{className:"h-5 w-5"}),s]})}),Gs=e=>{const{label:t,children:n,className:s}=e;return d.jsxs("div",{className:k("flex flex-col dropdown-button-group",s),children:[t&&d.jsx("div",{className:"mb-2 text-sm text-gray-500 font-semibold px-3",children:t}),n]})},qs=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}=rt({placement:s,onOutsideClick:()=>a(!1),minWidth:i});return d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:u,className:o,onClick:()=>a(!r),children:t}),d.jsx(l,{open:r,children:d.jsx(ot,{padding:"sm",children:d.jsx(Ka.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),h=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:h.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),h.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:h.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,h.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 d.jsxs("div",{style:{width:n,height:44},className:"flex flex-row items-stretch select-none",children:[d.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}),d.jsx("div",{...s,className:"cursor-ew-resize group py-4 bg-gray-50 w-[8px]",children:d.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 d.jsxs("div",{className:s,children:[d.jsx("div",{className:"relative h-[45px] w-full overflow-hidden",ref:i,children:d.jsx("div",{className:"absolute",children:d.jsx("div",{className:"font-medium text-gray-800 flex flex-row border-b border-b-gray-200",children:t.map(r=>d.jsx(Om,{column:r},r.id))})})}),d.jsx("div",{className:"relative overflow-scroll min-w-full min-h-full",onScroll:o,children:d.jsx("div",{className:"absolute",children:d.jsx("div",{className:"flex flex-col",children:n.map(r=>d.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=>d.jsx("div",{className:"flex-1 content-center px-4",style:{height:44,width:250},children:a.renderCell(r)},a.id))},JSON.stringify(r)))})})})]})},Fm=()=>d.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=>d.jsx(Ys,{Icon:_d,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:()=>d.jsx(Wm,{})}],$m=()=>d.jsxs("div",{className:"flex flex-col gap-6",children:[d.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[d.jsx(Ns,{Icon:ks,placeholder:"Search..."}),d.jsx(Ms,{Icon:sa}),d.jsx(Jo,{Icon:ta,children:"New"}),d.jsxs(qs,{trigger:d.jsx(Ms,{Icon:sa}),children:[d.jsx(ee,{dismissOnClick:!1,Icon:ta,children:"Add new"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsxs(Gs,{label:"Test",className:"mt-2",children:[d.jsx(ee,{Icon:Ce,children:"Utrechtse Horeca Groep / Restaurant Dengh"}),d.jsx(ee,{Icon:Ce,children:"Utrechtse Horeca Groep / Restaurant Dengh"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"})]}),d.jsxs(Gs,{label:"Test",className:"mt-2",children:[d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"}),d.jsx(ee,{Icon:Ce,children:"Remove"})]})]}),d.jsx(za,{tabs:[{label:"Tab 1",Icon:ea,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:ea,active:!1,onClick:()=>{}}]})]}),d.jsx(Wa,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),d.jsx(Lm,{className:"h-[300px] w-[300px]",columns:_m,rows:Bm}),d.jsx(Fm,{})]}),Wm=()=>d.jsx(d.Fragment,{children:d.jsxs(qs,{placement:"bottom-end",className:"inline-block",trigger:d.jsx(Ys,{onClick:()=>{},children:"Test"}),children:[d.jsx(ee,{children:"Option 1"}),d.jsx(ee,{children:"Option 2"}),d.jsx(ee,{children:"Option 3"})]})});D.Badge=Ys,D.BadgeColor=Ua,D.Button=Jo,D.ButtonIconRound=Qo,D.ButtonIconSquare=Ms,D.Divider=Dm,D.DropdownButton=ee,D.DropdownButtonGroup=Gs,D.DropdownMenu=qs,D.DropdownPanel=ot,D.Input=Ns,D.InputCheck=Kd,D.InputDescription=me,D.InputError=pe,D.InputErrorIcon=_e,D.InputIconButton=Pe,D.InputIconButtonTray=$e,D.InputLabel=Be,D.InputPassword=$d,D.InputRadio=Ud,D.InputSelect=Wa,D.InputSelectNative=Xd,D.InputSelectOption=Rt,D.InputSelectSearchable=Em,D.InputSelectSearchableAsync=Rm,D.InputTextArea=Wd,D.InputToggle=zd,D.Modal=km,D.Panel=jm,D.PopoverBase=$a,D.Spinner=Zt,D.TabButtons=za,D.Test=$m,D.Tooltip=Mm,D.usePopover=rt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
144
144
|
//# sourceMappingURL=index.umd.cjs.map
|