From dbab125f62c05a596dccdff92d794977b1053be7 Mon Sep 17 00:00:00 2001 From: JoshBot-Debug Date: Sun, 10 Mar 2024 12:08:18 +0530 Subject: [PATCH] fixed seo --- build/index.esm.js | 4 +- build/index.js | 2 +- package.json | 2 +- src/index.tsx | 6 +- src/lib/BaseDatatable.tsx | 3 + src/lib/features/OmitColumn.tsx | 2 + src/lib/features/useEditableCell.tsx | 258 +++++++++++++++--------- src/lib/features/useOperationFilter.tsx | 1 + src/lib/features/usePagination.tsx | 12 +- src/lib/features/useSelectable.tsx | 4 + src/lib/features/useSetFilter.tsx | 120 ++++++----- src/lib/useDatatable.tsx | 1 + 12 files changed, 256 insertions(+), 159 deletions(-) diff --git a/build/index.esm.js b/build/index.esm.js index cb1327e..967279c 100644 --- a/build/index.esm.js +++ b/build/index.esm.js @@ -1,4 +1,4 @@ -import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o,useState as i,useId as a}from"react";import*as l from"react-dom";var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]1?t-1:0),r=1;r=1&&u>=0&&l[c]!==s[u];)u--;for(;c>=1&&u>=0;c--,u--)if(l[c]!==s[u]){if(1!==c||1!==u)do{if(c--,--u<0||l[c]!==s[u]){var f="\n"+l[c].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),"function"==typeof e&&V.set(e,f),f}}while(c>=1&&u>=0);break}}}finally{B=!1,z.current=o,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:R}),info:D({},e,{value:C}),warn:D({},e,{value:P}),error:D({},e,{value:F}),group:D({},e,{value:A}),groupCollapsed:D({},e,{value:T}),groupEnd:D({},e,{value:L})})}M<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var d=e?e.displayName||e.name:"",p=d?W(d):"";return"function"==typeof e&&V.set(e,p),p}function q(e,t,n){if(null==e)return"";if("function"==typeof e)return H(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return W(e);switch(e){case u:return W("Suspense");case f:return W("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return H(e.render,!1);case d:return q(e.type,t,n);case p:var o=e,i=o._payload,a=o._init;try{return q(a(i),t,n)}catch(e){}}return""}V=new $;var U=Object.prototype.hasOwnProperty,K={},G=y.ReactDebugCurrentFrame;function Y(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var J=Array.isArray;function X(e){return J(e)}function Z(e){return""+e}function Q(e){if(function(e){try{return Z(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),Z(e)}var ee,te,ne,re=y.ReactCurrentOwner,oe={key:!0,ref:!0,__self:!0,__source:!0};ne={};var ie=function(e,t,r,o,i,a,l){var s={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function ae(e,t,n,r,o){var i,a={},l=null,s=null;for(i in void 0!==n&&(Q(n),l=""+n),function(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Q(t.key),l=""+t.key),function(e){if(U.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&re.current&&t&&re.current.stateNode!==t){var n=E(re.current.type);ne[n]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(re.current.type),e.ref),ne[n]=!0)}}(t,o)),t)U.call(t,i)&&!oe.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var c=e.defaultProps;for(i in c)void 0===a[i]&&(a[i]=c[i])}if(l||s){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){ee||(ee=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,u),s&&function(e,t){var n=function(){te||(te=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,u)}return ie(e,l,s,o,r,re.current,a)}var le,se=y.ReactCurrentOwner,ce=y.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);ce.setExtraStackFrame(n)}else ce.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function de(){if(se.current){var e=E(se.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}le=!1;var pe={};function me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=de();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!pe[n]){pe[n]=!0;var r="";e&&e._owner&&e._owner!==se.current&&(r=" It was passed a child from "+E(e._owner.type)+"."),ue(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ue(null)}}}function he(e,t){if("object"==typeof e)if(X(e))for(var n=0;n",O=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,O)}var P=ae(e,t,r,v,g);if(null==P)return P;if(y){var F=t.children;if(void 0!==F)if(h)if(X(F)){for(var A=0;A({x:e,y:e}),k={left:"right",right:"left",bottom:"top",top:"bottom"},N={start:"end",end:"start"};function O(e,t,n){return x(e,b(t,n))}function E(e,t){return"function"==typeof e?e(t):e}function R(e){return e.split("-")[0]}function C(e){return e.split("-")[1]}function P(e){return"x"===e?"y":"x"}function F(e){return"y"===e?"height":"width"}function A(e){return["top","bottom"].includes(R(e))?"y":"x"}function T(e){return P(A(e))}function L(e){return e.replace(/start|end/g,(e=>N[e]))}function D(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}function M(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function I(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function _(e,t,n){let{reference:r,floating:o}=e;const i=A(t),a=T(t),l=F(a),s=R(t),c="y"===i,u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(s){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(C(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function z(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=E(t,e),m=M(p),h=l[d?"floating"===f?"reference":"floating":f],v=I(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g="floating"===f?{...a.floating,x:r,y:o}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:s}):g);return{top:(v.top-x.top+m.top)/b.y,bottom:(x.bottom-v.bottom+m.bottom)/b.y,left:(v.left-x.left+m.left)/b.x,right:(x.right-v.right+m.right)/b.x}}const W=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l}=t,{element:s,padding:c=0}=E(e,t)||{};if(null==s)return{};const u=M(c),f={x:n,y:r},d=T(o),p=F(d),m=await a.getDimensions(s),h="y"===d,v=h?"top":"left",g=h?"bottom":"right",y=h?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[d]-f[d]-i.floating[p],w=f[d]-i.reference[d],j=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s));let S=j?j[y]:0;S&&await(null==a.isElement?void 0:a.isElement(j))||(S=l.floating[y]||i.floating[p]);const k=x/2-w/2,N=S/2-m[p]/2-1,R=b(u[v],N),P=b(u[g],N),A=R,L=S-m[p]-P,D=S/2-m[p]/2+k,I=O(A,D,L),_=null!=C(o)&&D!=I&&i.reference[p]/2-(De+"-"+o)),t&&(i=i.concat(i.map(L)))),i}(a,m,p,y));const x=[a,...b],w=await z(t,h),j=[];let S=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&j.push(w[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=C(e),o=T(e),i=F(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=D(a)),[a,D(a)]}(r,i,y);j.push(w[e[0]],w[e[1]])}if(S=[...S,{placement:r,overflows:j}],!j.every((e=>e<=0))){var k,N;const e=((null==(k=o.flip)?void 0:k.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(N=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(d){case"bestFit":{var O;const e=null==(O=S.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const B=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=R(n),l=C(n),s="y"===A(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f=E(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),s?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},$=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=E(e,t),c={x:n,y:r},u=await z(t,s),f=A(R(o)),d=P(f);let p=c[d],m=c[f];if(i){const e="y"===d?"bottom":"right";p=O(p+u["y"===d?"top":"left"],p,p-u[e])}if(a){const e="y"===f?"bottom":"right";m=O(m+u["y"===f?"top":"left"],m,m-u[e])}const h=l.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}};function H(e){return K(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function U(e){var t;return null==(t=(K(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function K(e){return e instanceof Node||e instanceof q(e).Node}function G(e){return e instanceof Element||e instanceof q(e).Element}function Y(e){return e instanceof HTMLElement||e instanceof q(e).HTMLElement}function J(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof q(e).ShadowRoot)}function X(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Z(e){return["table","td","th"].includes(H(e))}function Q(e){const t=ee(),n=ne(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ee(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function te(e){return["html","body","#document"].includes(H(e))}function ne(e){return q(e).getComputedStyle(e)}function re(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function oe(e){if("html"===H(e))return e;const t=e.assignedSlot||e.parentNode||J(e)&&e.host||U(e);return J(t)?t.host:t}function ie(e){const t=oe(e);return te(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&X(t)?t:ie(t)}function ae(e,t){var n;void 0===t&&(t=[]);const r=ie(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=q(r);return o?t.concat(i,i.visualViewport||[],X(r)?r:[]):t.concat(r,ae(r))}function le(e){const t=ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Y(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=w(n)!==i||w(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function se(e){return G(e)?e:e.contextElement}function ce(e){const t=se(e);if(!Y(t))return S(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=le(t);let a=(i?w(n.width):n.width)/r,l=(i?w(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const ue=S(0);function fe(e){const t=q(e);return ee()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ue}function de(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=se(e);let a=S(1);t&&(r?G(r)&&(a=ce(r)):a=ce(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==q(e))&&t}(i,n,r)?fe(i):S(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const e=q(i),t=r&&G(r)?q(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ce(n),t=n.getBoundingClientRect(),r=ne(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,f*=e.y,s+=o,c+=i,n=q(n).frameElement}}return I({width:u,height:f,x:s,y:c})}function pe(e){return de(U(e)).left+re(e).scrollLeft}function me(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=q(e),r=U(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=ee();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=U(e),n=re(e),r=e.ownerDocument.body,o=x(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=x(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pe(e);const l=-n.scrollTop;return"rtl"===ne(r).direction&&(a+=x(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}(U(e));else if(G(t))r=function(e,t){const n=de(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Y(e)?ce(e):S(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=fe(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return I(r)}function he(e,t){const n=oe(e);return!(n===t||!G(n)||te(n))&&("fixed"===ne(n).position||he(n,t))}function ve(e,t,n){const r=Y(t),o=U(t),i="fixed"===n,a=de(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=S(0);if(r||!r&&!i)if(("body"!==H(t)||X(o))&&(l=re(t)),r){const e=de(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=pe(o));return{x:a.left+l.scrollLeft-s.x,y:a.top+l.scrollTop-s.y,width:a.width,height:a.height}}function ge(e,t){return Y(e)&&"fixed"!==ne(e).position?t?t(e):e.offsetParent:null}function ye(e,t){const n=q(e);if(!Y(e))return n;let r=ge(e,t);for(;r&&Z(r)&&"static"===ne(r).position;)r=ge(r,t);return r&&("html"===H(r)||"body"===H(r)&&"static"===ne(r).position&&!Q(r))?n:r||function(e){let t=oe(e);for(;Y(t)&&!te(t);){if(Q(t))return t;t=oe(t)}return null}(e)||n}const be={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Y(n),i=U(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},l=S(1);const s=S(0);if((o||!o&&"fixed"!==r)&&(("body"!==H(n)||X(i))&&(a=re(n)),Y(n))){const e=de(n);l=ce(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+s.x,y:t.y*l.y-a.scrollTop*l.y+s.y}},getDocumentElement:U,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ae(e).filter((e=>G(e)&&"body"!==H(e))),o=null;const i="fixed"===ne(e).position;let a=i?oe(e):e;for(;G(a)&&!te(a);){const t=ne(a),n=Q(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||X(a)&&!n&&he(e,a))?r=r.filter((e=>e!==a)):o=t,a=oe(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],l=i.reduce(((e,n)=>{const r=me(t,n,o);return e.top=x(r.top,e.top),e.right=b(r.right,e.right),e.bottom=b(r.bottom,e.bottom),e.left=x(r.left,e.left),e}),me(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ye,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ye,i=this.getDimensions;return{reference:ve(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return le(e)},getScale:ce,isElement:G,isRTL:function(e){return"rtl"===ne(e).direction}};function xe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=se(e),u=o||i?[...c?ae(c):[],...ae(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&l?function(e,t){let n,r=null;const o=U(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(l||t(),!f||!d)return;const p={rootMargin:-j(u)+"px "+-j(o.clientWidth-(c+f))+"px "+-j(o.clientHeight-(u+d))+"px "+-j(c)+"px",threshold:x(0,b(1,s))||1};let m=!0;function h(e){const t=e[0].intersectionRatio;if(t!==s){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}m=!1}try{r=new IntersectionObserver(h,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,p)}r.observe(e)}(!0),i}(c,n):null;let d,p=-1,m=null;a&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{m&&m.observe(t)}))),n()})),c&&!s&&m.observe(c),m.observe(t));let h=s?de(e):null;return s&&function t(){const r=de(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),m&&m.disconnect(),m=null,s&&cancelAnimationFrame(d)}}const we=(e,t,n)=>{const r=new Map,o={platform:be,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=_(c,r,s),d=r,p={},m=0;for(let n=0;n({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?W({element:n.current,padding:r}).fn(t):{}:n?W({element:n,padding:r}).fn(t):{};var o}});var Se="undefined"!=typeof document?n:r;function ke(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!ke(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!ke(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ne(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oe(e,t){const n=Ne(e);return Math.round(t*n)/n}function Ee(t){const n=e.useRef(t);return Se((()=>{n.current=t})),n}var Re=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ce=new WeakMap,Pe=new WeakMap,Fe={},Ae=0,Te=function(e){return e&&(e.host||Te(e.parentNode))},Le=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Te(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var i=Fe[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))u(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(Ce.get(e)||0)+1,c=(i.get(e)||0)+1;Ce.set(e,s),i.set(e,c),a.push(e),1===s&&o&&Pe.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return u(t),l.clear(),Ae++,function(){a.forEach((function(e){var t=Ce.get(e)-1,o=i.get(e)-1;Ce.set(e,t),i.set(e,o),t||(Pe.has(e)||e.removeAttribute(r),Pe.delete(e)),o||e.removeAttribute(n)})),--Ae||(Ce=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,Fe={})}},De=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Re(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Le(r,o,n,"aria-hidden")):function(){return null}},Me=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||Re(e);return r?Le(e,r,n,"inert"):function(){return null}},Ie=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},_e=function(e,t,n){return void 0===n&&(n="data-suppressed"),(Ie()?Me:De)(e,t,n)},ze=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),We="undefined"==typeof Element,Ve=We?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Be=!We&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},$e=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},He=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!$e(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),s=e(l.length?l:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{Ve.call(a,ze)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!$e(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&u){var f=e(!0===c?a.children:c.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return o},qe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ue=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!qe(e)?0:e.tabIndex},Ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ge=function(e){return"INPUT"===e.tagName},Ye=function(e){return function(e){return Ge(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Be(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(Ve.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Je(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,l=Be(e);if(a&&!a.shadowRoot&&!0===r(a))return Je(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,r,o,i=e&&Be(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&a;){var s,c,u;l=!(null===(c=a=null===(s=i=Be(a))||void 0===s?void 0:s.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ze=function(e,t){return!(t.disabled||$e(t)||function(e){return Ge(e)&&"hidden"===e.type}(t)||Xe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},tt=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=Ue(e);return n<0&&t&&!qe(e)?0:n}(a,i),s=i?e(t.candidates):a;0===l?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:s})})),r.sort(Ke).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},nt=function(e,t){var n;return n=(t=t||{}).getShadowRoot?He([e],t.includeContainer,{filter:Qe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:et}):function(e,t,n){if($e(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ze));return t&&Ve.call(e,ze)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Qe.bind(null,t)),tt(n)};function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+at++;const st=e["useId".toString()]||function(){const[t,n]=e.useState((()=>it?lt():void 0));return ot((()=>{null==t&&n(lt())}),[]),e.useEffect((()=>{it||(it=!0)}),[]),t},ct=e.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:a=14,height:l=7,tipRadius:s=0,strokeWidth:c=0,staticOffset:u,stroke:f,d:d,style:{transform:p,...m}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=st();if(!o)return null;c*=2;const g=c/2,y=a/2*(s/-8+1),b=l/2*s/4,[x,w]=r.split("-"),j=be.isRTL(o),S=!!d,k="top"===x||"bottom"===x,N=u&&"end"===w?"bottom":"top";let O=u&&"end"===w?"right":"left";u&&j&&(O="end"===w?"left":"right");const E=null!=(null==i?void 0:i.x)?u||i.x:"",R=null!=(null==i?void 0:i.y)?u||i.y:"",C=d||"M0,0 H"+a+" L"+(a-y)+","+(l-b)+" Q"+a/2+","+l+" "+y+","+(l-b)+" Z",P={top:S?"rotate(180deg)":"",left:S?"rotate(90deg)":"rotate(-90deg)",bottom:S?"":"rotate(180deg)",right:S?"rotate(-90deg)":"rotate(90deg)"}[x];return e.createElement("svg",rt({},h,{"aria-hidden":!0,ref:n,width:S?a:a+c,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:E,[N]:R,[x]:k||S?"100%":"calc(100% - "+c/2+"px)",transform:""+P+(null!=p?p:""),...m}}),c>0&&e.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:c+(d?0:1),d:C}),e.createElement("path",{stroke:c&&!d?h.fill:"none",d:C}),e.createElement("clipPath",{id:v},e.createElement("rect",{x:-g,y:g*(S?-1:1),width:a+c,height:a})))}));const ut=e.createContext(null),ft=e.createContext(null),dt=()=>{var t;return(null==(t=e.useContext(ut))?void 0:t.id)||null},pt=()=>e.useContext(ft);function mt(e){return(null==e?void 0:e.ownerDocument)||document}function ht(e){return mt(e).defaultView||window}function vt(e){return!!e&&(e instanceof Element||e instanceof ht(e).Element)}function gt(e){return!!e&&(e instanceof HTMLElement||e instanceof ht(e).HTMLElement)}function yt(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function bt(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function xt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function wt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof ht(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function jt(e){return"data-floating-ui-"+e}function St(e){const t=o(e);return ot((()=>{t.current=e})),t}function kt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let Nt=0;function Ot(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Nt);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Nt=requestAnimationFrame(i)}function Et(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function Rt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ct="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Pt(e){return gt(e)&&e.matches(Ct)}function Ft(e){e.preventDefault(),e.stopPropagation()}const At=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Tt(e,t){const n=nt(e,At());"prev"===t&&n.reverse();const r=n.indexOf(kt(mt(e)));return n.slice(r+1)[0]}function Lt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!wt(n,r)}const Dt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Mt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const It=e.forwardRef((function(t,n){const[r,o]=e.useState();ot((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Mt),()=>{document.removeEventListener("keydown",Mt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[jt("focus-guard")]:"",style:Dt};return e.createElement("span",rt({},t,i))})),_t=e.createContext(null),zt=()=>e.useContext(_t),Wt=e.forwardRef((function(t,n){return e.createElement("button",rt({},t,{type:"button",ref:n,tabIndex:-1,style:Dt}))}));function Vt(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:a=!0,initialFocus:l=0,returnFocus:s=!0,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=t,{open:d,refs:p,nodeId:m,onOpenChange:h,events:v,dataRef:g,elements:{domReference:y,floating:b}}=n,x=!Ie()||a,w=St(i),j=St(l),S=St(s),k=pt(),N=zt(),O="number"==typeof l&&l<0,E=e.useRef(null),R=e.useRef(null),C=e.useRef(!1),P=e.useRef(null),F=e.useRef(!1),A=null!=N,T=y&&"combobox"===y.getAttribute("role")&&Pt(y),L=e.useCallback((function(e){return void 0===e&&(e=b),e?nt(e,At()):[]}),[b]),D=e.useCallback((e=>{const t=L(e);return w.current.map((e=>y&&"reference"===e?y:b&&"floating"===e?b:t)).filter(Boolean).flat()}),[y,b,w,L]);function M(t){return!o&&u&&c?e.createElement(Wt,{ref:"start"===t?E:R,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}e.useEffect((()=>{if(o||!c)return;function e(e){if("Tab"===e.key){wt(b,kt(mt(b)))&&0===L().length&&!T&&Ft(e);const t=D(),n=Rt(e);"reference"===w.current[0]&&n===y&&(Ft(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===w.current[1]&&n===b&&e.shiftKey&&(Ft(e),Ot(t[0]))}}const t=mt(b);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,y,b,c,w,p,T,L,D]),e.useEffect((()=>{if(!o&&f)return b&>(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),!c&&b.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),!c&&b.removeEventListener("focusout",t)}):void 0;function e(){F.current=!0,setTimeout((()=>{F.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(wt(y,t)||wt(b,t)||wt(t,b)||wt(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(jt("focus-guard"))||k&&(Et(k.nodesRef.current,m).find((e=>{var n,r;return wt(null==(n=e.context)?void 0:n.elements.floating,t)||wt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!F.current&&t!==P.current&&(C.current=!0,h(!1,e))}))}}),[o,y,b,c,m,k,N,h,f]),e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+jt("portal")+"]"))||[]);if(b&&c){const e=[b,...t,E.current,R.current].filter((e=>null!=e)),n=(x?De:_e)(w.current.includes("reference")||T?e.concat(y||[]):e,void 0,jt("inert"));return()=>{n()}}}),[o,y,b,c,w,N,T,x]),ot((()=>{if(o||!b)return;const e=kt(mt(b));queueMicrotask((()=>{const t=D(b),n=j.current,r=("number"==typeof n?t[n]:n.current)||b,o=wt(b,e);O||o||!d||Ot(r,{preventScroll:r===b})}))}),[o,d,b,O,D,j]),ot((()=>{if(o||!b)return;let e=!1;const t=mt(b),n=kt(t),r=g.current;function i(t){if("escapeKey"===t.type&&p.domReference.current&&(P.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(C.current=!1,e=n.preventScroll):C.current=!n}return P.current=n,v.on("dismiss",i),()=>{v.off("dismiss",i);const n=kt(t);(wt(b,n)||k&&Et(k.nodesRef.current,m).some((e=>{var t;return wt(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&p.domReference.current&&(P.current=p.domReference.current),S.current&>(P.current)&&!C.current&&Ot(P.current,{cancelPrevious:!1,preventScroll:e})}}),[o,b,S,g,p,v,k,m]),ot((()=>{if(!o&&N)return N.setFocusManagerState({...n,modal:c,closeOnFocusOut:f,open:d}),()=>{N.setFocusManagerState(null)}}),[o,N,c,d,f,n]),ot((()=>{if(!o&&b&&"function"==typeof MutationObserver){const e=()=>{const e=b.getAttribute("tabindex");w.current.includes("floating")||kt(mt(b))!==p.domReference.current&&0===L().length?"0"!==e&&b.setAttribute("tabindex","0"):"-1"!==e&&b.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[o,b,p,w,L]);const I=!o&&x&&!T&&(A||c);return e.createElement(e.Fragment,null,I&&e.createElement(It,{"data-type":"inside",ref:null==N?void 0:N.beforeInsideRef,onFocus:e=>{if(c){const e=D();Ot("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(C.current=!1,Lt(e,N.portalNode)){const e=Tt(document.body,"next")||y;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!T&&M("start"),r,M("end"),I&&e.createElement(It,{"data-type":"inside",ref:null==N?void 0:N.afterInsideRef,onFocus:e=>{if(c)Ot(D()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(f&&(C.current=!0),Lt(e,N.portalNode)){const e=Tt(document.body,"prev")||y;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}}))}function Bt(e){return gt(e.target)&&"BUTTON"===e.target.tagName}function $t(e){return Pt(e)}function Ht(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,elements:{domReference:a}}=t,{enabled:l=!0,event:s="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=n,d=e.useRef(),p=e.useRef(!1);return e.useMemo((()=>l?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(xt(d.current,!0)&&u||"click"!==s&&(!r||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent)):o(!1,e.nativeEvent)))},onClick(e){"mousedown"===s&&d.current?d.current=void 0:xt(d.current,!0)&&u||(!r||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent):o(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Bt(e)||(" "!==e.key||$t(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&o(!r||!c,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Bt(e)||$t(a)||" "===e.key&&p.current&&(p.current=!1,o(!r||!c,e.nativeEvent))}}}:{}),[l,i,s,u,f,a,c,r,o])}const qt=e["useInsertionEffect".toString()]||(e=>e());function Ut(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return qt((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Xt(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:a,elements:{reference:l,domReference:s,floating:c},dataRef:u}=t,{enabled:f=!0,escapeKey:d=!0,outsidePress:p=!0,outsidePressEvent:m="pointerdown",referencePress:h=!1,referencePressEvent:v="pointerdown",ancestorScroll:g=!1,bubbles:y}=n,b=pt(),x=null!=dt(),w=Ut("function"==typeof p?p:()=>!1),j="function"==typeof p?w:p,S=e.useRef(!1),{escapeKeyBubbles:k,outsidePressBubbles:N}=Jt(y),O=Ut((e=>{if(!r||!f||!d||"Escape"!==e.key)return;const t=b?Et(b.nodesRef.current,a):[];if(!k&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),E=Ut((e=>{const t=S.current;if(S.current=!1,t)return;if("function"==typeof j&&!j(e))return;const n=Rt(e);if(gt(n)&&c){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===ht(c).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=b&&Et(b.nodesRef.current,a).some((t=>{var n;return Kt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Kt(e,c)||Kt(e,s)||r)return;const l=b?Et(b.nodesRef.current,a):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:yt(e)||bt(e)}}),o(!1,e)}));return e.useEffect((()=>{if(!r||!f)return;function e(e){o(!1,e)}u.current.__escapeKeyBubbles=k,u.current.__outsidePressBubbles=N;const t=mt(c);d&&t.addEventListener("keydown",O),j&&t.addEventListener(m,E);let n=[];return g&&(vt(s)&&(n=ae(s)),vt(c)&&(n=n.concat(ae(c))),!vt(l)&&l&&l.contextElement&&(n=n.concat(ae(l.contextElement)))),n=n.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),n.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{d&&t.removeEventListener("keydown",O),j&&t.removeEventListener(m,E),n.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,c,s,l,d,j,m,r,o,g,f,k,N,O,E]),e.useEffect((()=>{S.current=!1}),[j,m]),e.useMemo((()=>f?{reference:{onKeyDown:O,[Gt[v]]:e=>{h&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:O,[Yt[m]]:()=>{S.current=!0}}}:{}),[f,i,h,m,v,o,O])}function Zt(t){var n;void 0===t&&(t={});const{open:r=!1,onOpenChange:o,nodeId:i}=t,[a,s]=e.useState(null),c=(null==(n=t.elements)?void 0:n.reference)||a,u=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:u,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);ke(m,o)||h(o);const[v,g]=e.useState(null),[y,b]=e.useState(null),x=e.useCallback((e=>{e!=k.current&&(k.current=e,g(e))}),[g]),w=e.useCallback((e=>{e!==N.current&&(N.current=e,b(e))}),[b]),j=a||v,S=s||y,k=e.useRef(null),N=e.useRef(null),O=e.useRef(d),E=Ee(u),R=Ee(i),C=e.useCallback((()=>{if(!k.current||!N.current)return;const e={placement:n,strategy:r,middleware:m};R.current&&(e.platform=R.current),we(k.current,N.current,e).then((e=>{const t={...e,isPositioned:!0};P.current&&!ke(O.current,t)&&(O.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,R]);Se((()=>{!1===f&&O.current.isPositioned&&(O.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const P=e.useRef(!1);Se((()=>(P.current=!0,()=>{P.current=!1})),[]),Se((()=>{if(j&&(k.current=j),S&&(N.current=S),j&&S){if(E.current)return E.current(j,S,C);C()}}),[j,S,C,E]);const F=e.useMemo((()=>({reference:k,floating:N,setReference:x,setFloating:w})),[x,w]),A=e.useMemo((()=>({reference:j,floating:S})),[j,S]),T=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!A.floating)return e;const t=Oe(A.floating,d.x),n=Oe(A.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Ne(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,A.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:C,refs:F,elements:A,floatingStyles:T})),[d,C,F,A,T])}(t),f=pt(),d=Ut(((e,t)=>{e&&(m.current.openEvent=t),null==o||o(e,t)})),p=e.useRef(null),m=e.useRef({}),h=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],v=st(),g=e.useCallback((e=>{const t=vt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u.refs.setReference(t)}),[u.refs]),y=e.useCallback((e=>{(vt(e)||null===e)&&(p.current=e,s(e)),(vt(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!vt(e))&&u.refs.setReference(e)}),[u.refs]),b=e.useMemo((()=>({...u.refs,setReference:y,setPositionReference:g,domReference:p})),[u.refs,y,g]),x=e.useMemo((()=>({...u.elements,domReference:c})),[u.elements,c]),w=e.useMemo((()=>({...u,refs:b,elements:x,dataRef:m,nodeId:i,floatingId:v,events:h,open:r,onOpenChange:d})),[u,i,v,h,r,d,b,x]);return ot((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=w)})),e.useMemo((()=>({...u,context:w,refs:b,elements:x})),[u,b,x,w])}function Qt(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function en(t){void 0===t&&(t=[]);const n=t,r=e.useCallback((e=>Qt(e,t,"reference")),n),o=e.useCallback((e=>Qt(e,t,"floating")),n),i=e.useCallback((e=>Qt(e,t,"item")),t.map((e=>null==e?void 0:e.item)));return e.useMemo((()=>({getReferenceProps:r,getFloatingProps:o,getItemProps:i})),[r,o,i])}function tn(t,n){void 0===n&&(n={});const{open:r,floatingId:o}=t,{enabled:i=!0,role:a="dialog"}=n,l=st();return e.useMemo((()=>{const e={id:o,role:a};return i?"tooltip"===a?{reference:{"aria-describedby":r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l}},floating:{...e,..."menu"===a&&{"aria-labelledby":l}}}:{}}),[i,a,r,o,l])}var nn=function(e){return e.map((function(e){var t,n,r,o,i,a,l;return s({field:null!==(t=e.field)&&void 0!==t?t:"",columnName:null!==(n=e.columnName)&&void 0!==n?n:rn(null!==(r=String(e.field))&&void 0!==r?r:""),sortable:null===(o=e.sortable)||void 0===o||o,datatype:null!==(i=e.datatype)&&void 0!==i?i:"string",omit:null!==(a=e.omit)&&void 0!==a&&a,filterable:null===(l=e.filterable)||void 0===l||l},e)}))},rn=function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replaceAll("_"," ").toLowerCase()};function on(e){var t=e.data,r=e.isFetching,a=e.columns,l=e.onColumnClick,c=e.RowOptionMenu,u=e.AppsPanel,f=e.renderSort,d=e.renderFilter,p=e.Footer,m=e.hideSelect,h=e.SelectHeader,v=e.SelectCell,g=e.NoData,b=e.onRowClick,x=e.showOptionsOnRowClick,w=e.minColumnSize,j=e.columnNameFontSize,S=e.renderCell,k=e.renderHeaderPanel,N=m?0:50,O=50,E=function(e){var t=e.columns,r=e.isFetching,a=e.extraWidth,l=e.minColumnSize,s=e.columnNameFontSize,c=o(null),u=i(0),f=u[0],d=u[1],p=t.reduce((function(e,t){return t.width&&!t.omit?{width:e.width+t.width,columns:e.columns+1}:e}),{width:0,columns:0}),m=t.reduce((function(e,t){return t.omit?e:e+1}),0),h=t.reduceRight((function(e,t){return null===e?null:t.omit?e:t.width?e||t.field:null}),!1);return n((function(){if(c.current){var e=c.current;d(e.clientWidth);var t=new ResizeObserver((function(){return d((function(t){return t>0&&r?t:e.clientWidth}))}));return t.observe(e),function(){t.disconnect()}}}),[c.current,r,t]),{containerRef:c,getWidth:function(e){var t=e.columnName.length*((null!=s?s:16)/2),n=Math.pow(e.columnName.length,1.1)-e.columnName.length,r=l||(s?t+1-(n<3?0:n)+40+16+16:150);return h===e.field&&e.width?Math.max((f-(a+p.width-e.width))/Math.max(m-p.columns-1,1),r):e.width?e.width:Math.max((f-(a+p.width))/Math.max(m-p.columns,1),r)}}}({columns:a,isFetching:r,extraWidth:N+O,minColumnSize:w,columnNameFontSize:j});return y.jsxs("div",s({className:"myers-datatable"},{children:[k&&k(a,t),y.jsxs("div",s({ref:E.containerRef,className:"table-scroll-container"},{children:[y.jsxs("div",s({className:"table-header-row table-row"},{children:[y.jsx("div",s({className:"table-cell table-header-cell apps-button-header-cell",style:{width:O,minWidth:O,maxWidth:O}},{children:u&&y.jsx(gn,s({Icon:pn,mainAxisOffset:20,crossAxisOffset:10,placement:"bottom-end",className:"app-panel-button"},{children:u}))})),!m&&!!h&&y.jsx(un,s({className:"select-header-cell",column:{field:"_selectable",datatype:"string",columnName:"",sortable:!1,omit:!1,filterable:!1},width:N},{children:y.jsx(h,{})})),a.map((function(e){return y.jsx(un,s({column:e,onClick:l,className:"".concat(e.sortable?"sortable-table-header":""," ").concat(e.omit?"hide":""),width:E.getWidth(e)},{children:y.jsxs("div",s({className:"column-header-options"},{children:[e.sortable&&f&&f(e),e.filterable&&d&&d(e,an)]}))}),String(e.field))}))]})),t.map((function(e,t){return y.jsx(yn,s({crossAxisOffset:0,placement:"right-start",PopUp:c?y.jsx(c,{row:e,rowIndex:t}):null,useCursorOffset:!!x},{children:function(n){return y.jsxs("div",s({className:"table-row ".concat(b||x?"table-row-clickable":""),onClick:function(t){b&&b(e,t),x&&n.onClick(t)}},{children:[r&&y.jsx("div",s({className:"spinner-container"},{children:y.jsxs("div",s({className:"spinner-wrapper"},{children:[y.jsx("div",{className:"spinner"}),y.jsx("span",s({className:"spinner-loading-text"},{children:"Loading"}))]}))})),y.jsx("div",s({className:"table-cell",style:{width:O,minWidth:O,maxWidth:O}},{children:c&&y.jsx("button",s({},n,{onClick:function(e){e.stopPropagation(),n.onClick(e)}},{children:y.jsx(mn,{})}))})),!m&&!!v&&y.jsx("div",s({className:"table-cell",style:{width:N,minWidth:N,maxWidth:N}},{children:y.jsx(v,{index:t,row:e})})),a.map((function(t,n){return y.jsx(ln,{column:t,row:e,width:E.getWidth(t),renderCell:S},n)}))]}))}}),t)})),0===t.length&&!r&&(g||y.jsx(bn,{}))]})),p]}))}function an(e){var t=e.children,n=e.hasFilter;return y.jsx("div",s({className:"filter-options-button"},{children:y.jsx(gn,s({Icon:n?vn:hn,mainAxisOffset:20,crossAxisOffset:0,placement:"bottom-end"},{children:t}))}))}var ln=function(e){var t=e.column,n=e.row,r=e.width,o=e.renderCell,i=void 0!==n[t.field]?String(n[t.field]):void 0,a={width:r,minWidth:r,maxWidth:r};return t.renderCell?y.jsx("div",s({className:"table-cell ".concat(t.omit?"hide":""),title:i,style:a},{children:o?o(t,n,t.renderCell(n[t.field],t,n)):t.renderCell(n[t.field],t,n)})):"paragraph"===t.datatype?y.jsx(cn,{column:t,row:n,title:i,text:n[t.field],style:a,renderCell:o}):y.jsx("div",s({className:"table-cell ".concat(t.omit?"hide":""),title:i,style:a},{children:o?o(t,n,sn(n[t.field],t)):sn(n[t.field],t)}))},sn=function(e,t){if(null==e)return y.jsx("span",{className:"text-wrapper"});if("name"===t.datatype)return y.jsx("span",s({className:"cell-datatype-name text-wrapper"},{children:e}));if("link"===t.datatype)return y.jsx("a",s({className:"text-wrapper",href:e,target:"_blank",rel:"noreferrer"},{children:new URL(e).hostname}));if("email"===t.datatype)return y.jsx("a",s({className:"text-wrapper",href:"mailto:".concat(e),target:"_blank",rel:"noreferrer"},{children:e}));if("date"===t.datatype)return y.jsx("span",s({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric"}):""}));if("datetime"===t.datatype)return y.jsx("span",s({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}));if("boolean"===t.datatype)return y.jsx(y.Fragment,{children:JSON.parse(e)?y.jsx(fn,{}):y.jsx(dn,{})});if("phone"===t.datatype){var n={code:!1,number:e},r=e.split(" ");r.length>1&&(n.code=r[0],n.number=r[1]);var o=n.number.slice(0,3)+"-"+n.number.slice(3,6)+"-"+n.number.slice(6);return n.code?y.jsx("span",s({className:"text-wrapper"},{children:"".concat(n.code," ").concat(o)})):y.jsx("span",s({className:"text-wrapper"},{children:o}))}return"image"===t.datatype?y.jsx("a",s({href:e,target:"_blank",rel:"noreferrer"},{children:y.jsx("img",{alt:"row",className:"cell-datatype-image",src:e})})):y.jsx("span",s({className:"text-wrapper"},{children:e}))},cn=function(e){var t=e.text,n=e.title,r=e.column,o=e.row,a=e.style,l=e.renderCell,c=i(!1),u=c[0],f=c[1];return y.jsx("div",s({className:"table-cell cell-datatype-paragraph ".concat(r.omit?"hide":""," ").concat(u?"cell-datatype-paragraph-open":"cell-datatype-paragraph-closed"),title:n,onClick:function(e){e.stopPropagation(),f((function(e){return!e}))},style:a},{children:l?l(r,o,y.jsx("span",s({className:"text-wrapper"},{children:t}))):y.jsx("span",s({className:"text-wrapper"},{children:t}))}))},un=function(e){var t=e.column,n=e.children,r=e.className,o=void 0===r?"":r,i=e.onClick,a=e.width;return y.jsx("div",s({className:"table-cell table-header-cell ".concat(o),onClick:function(){return i&&i(t)},title:t.columnName,style:{width:a,minWidth:a,maxWidth:a}},{children:y.jsxs("div",s({className:"table-header-children-container"},{children:[!!t.columnName&&y.jsx("span",s({className:"table-header-column-name"},{children:t.columnName})),n]}))}),t.columnName)};function fn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-true-svg"},{children:y.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})}))}function dn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-false-svg"},{children:y.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 11-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 01-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0122.62-22.62L256 233.37l52.69-52.68a16 16 0 0122.62 22.62L278.63 256z"})}))}function pn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-apps"},{children:y.jsx("path",{d:"M104 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 464a56 56 0 1156-56 56.06 56.06 0 01-56 56z"})}))}function mn(){return y.jsxs("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"options-svg io-ellipsis"},{children:[y.jsx("circle",{cx:"256",cy:"256",r:"48"}),y.jsx("circle",{cx:"256",cy:"416",r:"48"}),y.jsx("circle",{cx:"256",cy:"96",r:"48"})]}))}function hn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-menu"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"48",d:"M88 152h336M88 256h336M88 360h336"})}))}function vn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-funnel"},{children:y.jsx("path",{d:"M296 464a23.88 23.88 0 01-7.55-1.23L208.3 436.1a23.92 23.92 0 01-16.3-22.78V294.11a.44.44 0 00-.09-.13L23.26 97.54A30 30 0 0146.05 48H466a30 30 0 0122.79 49.54L320.09 294a.77.77 0 00-.09.13V440a23.93 23.93 0 01-24 24z"})}))}function gn(e){var t=e.Icon,n=e.children,r=e.mainAxisOffset,a=e.crossAxisOffset,l=e.placement,c=e.className,u=o(null),f=i(!1),d=f[0],p=Zt({open:d,onOpenChange:f[1],whileElementsMounted:xe,placement:l,middleware:[je({element:u,padding:16}),B({mainAxis:r,crossAxis:a}),V(),$()]}),m=p.refs,h=p.floatingStyles,v=p.context,g=en([Ht(v),Xt(v),tn(v)]),b=g.getReferenceProps,x=g.getFloatingProps,w=b();return y.jsxs(y.Fragment,{children:[y.jsx("button",s({type:"button",ref:m.setReference},w,{className:"icon-button ".concat(null!=c?c:""),onClick:function(e){e.stopPropagation(),w.onClick(e)}},{children:y.jsx(t,{})})),d&&y.jsx(Vt,s({context:v,modal:!1},{children:y.jsxs("div",s({ref:m.setFloating,style:h,className:"popup-floating-container"},x(),{children:[y.jsx(ct,{ref:u,context:v,className:"popup-floating-arrow"}),y.jsx("div",s({className:"popup-container"},{children:n}))]}))}))]})}function yn(e){var t=e.children,n=e.PopUp,r=e.crossAxisOffset,a=e.placement,l=e.className,c=e.useCursorOffset,u=o(null),f=i(!1),d=f[0],p=f[1],m=i(c?0:10),h=m[0],v=m[1],g=Zt({open:d,onOpenChange:p,placement:a,middleware:[je({element:u,padding:16}),B({mainAxis:h,crossAxis:r}),V()]}),b=g.refs,x=g.floatingStyles,w=g.context,j=en([Ht(w),Xt(w),tn(w)]),S=j.getReferenceProps,k=j.getFloatingProps,N=S(),O=s(s({type:"button",ref:b.setReference},N),{className:"icon-button ".concat(null!=l?l:""),onClick:function(e){if(e.stopPropagation(),c){var t=e.nativeEvent.clientX-e.currentTarget.getBoundingClientRect().left;v(t)}N.onClick(e)}});return y.jsxs(y.Fragment,{children:[t(O),d&&y.jsx(Vt,s({context:w,modal:!1},{children:y.jsxs("div",s({ref:b.setFloating,style:x},k(),{className:"popup-floating-container"},{children:[y.jsx(ct,{ref:u,context:w,className:"popup-floating-arrow"}),y.jsx("div",s({className:"popup-container"},{children:n}))]}))}))]})}function bn(){return y.jsx("p",s({className:"no-items-to-display"},{children:"No items to display."}))}function xn(e){var t=e.onChange,n=e.initialSortOrder,o=void 0===n?{}:n,a=i(!1),l=a[0],c=a[1],u=i(o),f=u[0],d=u[1];r((function(){var e=function(e){return c(e.shiftKey)};return window.addEventListener("keyup",e),window.addEventListener("keydown",e),function(){window.removeEventListener("keyup",e),window.removeEventListener("keydown",e)}}),[]),r((function(){t(f)}),[]);return{sortOrder:f,Sort:wn,onSort:l?function(e){var n,r=s({},f),o=Object.entries(r).reduce((function(t,n){var r=n[0],o=n[1];return r===e.field||o.orderIndex>t?t:o.orderIndex+1}),1);r[e.field]={sortDirection:"asc"===(null===(n=f[e.field])||void 0===n?void 0:n.sortDirection)?"desc":"asc",orderIndex:o},d(r),t(r)}:function(e){var n,r={};r[e.field]={sortDirection:"asc"===(null===(n=f[e.field])||void 0===n?void 0:n.sortDirection)?"desc":"asc",orderIndex:1},d(r),t(r)},reset:function(e){var t=null!=e?e:o;return c(!1),d(t),t}}}var wn=function(e){var t=e.column,n=e.sortDirection,r=e.orderIndex,o=e.isMultiSort;return t.sortable?y.jsxs("div",s({className:"sortable-caret-container"},{children:[void 0===r?null:o&&r,r&&y.jsx(y.Fragment,{children:"asc"===n?y.jsx(Sn,{}):y.jsx(jn,{})})]})):null},jn=function(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:y.jsx("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"})}))},Sn=function(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:y.jsx("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"})}))};function kn(e){var t=e.onChange,n=e.initialPage,o=e.defaultPage,a=e.numberOfRows,l=e.count,c=i(null!=n?n:o),u=c[0],f=c[1],d=Math.ceil(l/u.currentRowsPerPage),p=function(e){return f((function(n){var r=e(n);return t(r),r}))};r((function(){t(u)}),[]);return{page:u,count:l,numberOfRows:a,Pagination:Nn,firstPage:function(){return p((function(e){return s(s({},e),{currentPage:1})}))},lastPage:function(){return p((function(e){return s(s({},e),{currentPage:d})}))},nextPage:function(){return p((function(e){return s(s({},e),{currentPage:Math.min(e.currentPage+1,d)})}))},previousPage:function(){return p((function(e){return s(s({},e),{currentPage:Math.max(e.currentPage-1,1)})}))},goToPage:function(e){},onChangeRowsPerPage:function(e){return p((function(t){return s(s({},t),{currentRowsPerPage:e})}))},reset:function(e,t){var r,i=t?o:null!==(r=null!=e?e:n)&&void 0!==r?r:o;return f(i),i}}}var Nn=function(e){var t=e.page,n=e.count,r=e.numberOfRows,o=e.firstPage,i=e.lastPage,l=e.nextPage,c=e.previousPage;e.goToPage;var u=e.onChangeRowsPerPage,f=t.currentPage,d=t.currentRowsPerPage,p=t.rowsPerPage,m=a(),h=f*d-d;return y.jsxs("div",s({className:"pagination-container"},{children:[y.jsxs("div",s({className:"pagination-rpp-container"},{children:[y.jsx("label",s({htmlFor:"rows-per-page-".concat(m)},{children:"Rows per page:"})),y.jsx("select",s({id:"rows-per-page-".concat(m),value:d,onChange:function(e){return u(Number(e.target.value))},className:"pagination-select-input"},{children:p.map((function(e){return y.jsx("option",s({value:e},{children:e}),"rows-per-page-".concat(e))}))})),0===n&&y.jsx("span",{children:"0-0 of 0"}),n>0&&y.jsxs("span",{children:[h+1,"-",r+h," of ",n]})]})),y.jsxs("div",s({className:"pagination-icon-button-container"},{children:[y.jsx(On,{onClick:o,SVG:En}),y.jsx(On,{onClick:c,SVG:Cn}),y.jsx(On,{onClick:l,SVG:Pn}),y.jsx(On,{onClick:i,SVG:Rn})]}))]}))},On=function(e){var t=e.onClick,n=e.SVG;return y.jsx("button",s({onClick:t,className:"pagination-icon-button",type:"button"},{children:y.jsx(n,{})}))},En=function(){return y.jsxs("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),y.jsx("path",{fill:"none",d:"M24 24H0V0h24v24z"})]}))},Rn=function(){return y.jsxs("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),y.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"})]}))},Cn=function(){return y.jsxs("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))},Pn=function(){return y.jsxs("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))};function Fn(e){var t=e.numberOfRows,n=e.onChange,o=i(!1),a=o[0],l=o[1],s=i([]),c=s[0],u=s[1],f=i([]),p=f[0],m=f[1],h=function(e){l(e);var n=e?new Array(t).fill(0).flatMap((function(e,t){return p.includes(t)?[]:t})):[];u(n)};r((function(){n({isAllSelected:a,selectedRows:c})}),[a,c]);return{Header:An,Row:Tn,selectAll:h,selectedRows:c,onSelectRow:function(e,t){u((function(n){return e?d(d([],n,!0),[t],!1):n.filter((function(e){return e!==t}))})),a&&l(!1)},isAllSelected:a,onDisableRow:function(e,t){m((function(n){var r=n.findIndex((function(e){return e===t})),o=d([],n,!0);return r>-1&&!e?(o.splice(r,1),o):-1===r&&e?(o.push(t),o):n}))},reset:function(){return h(!1),!1}}}function An(e){var t=e.selectAll,n=e.isAllSelected;return y.jsx("input",{className:"select-header-checkbox",type:"checkbox",checked:n,onChange:function(e){return t(e.target.checked)}})}function Tn(e){var t=e.index,n=e.disabled,r=e.checked,o=e.onChange;return y.jsx("input",{checked:r,onClick:function(e){return e.stopPropagation()},onChange:function(e){return o(e.target.checked,t)},disabled:n,type:"checkbox"})}function Ln(e){var t=e.columns,n=e.setColumns,r=a(),o=!!t.find((function(e){return e.omit}));return y.jsxs("div",s({className:"omit-column-container"},{children:[y.jsx("span",s({className:"omit-column-title"},{children:"Columns"})),y.jsxs("div",s({className:"omit-column-list"},{children:[y.jsxs("div",s({className:"omit-column-list-item-container"},{children:[y.jsx("input",{type:"checkbox",id:"omit-column-list-item-".concat(r,"-all"),checked:!o,onChange:function(){return n((function(e){return e.map((function(e){return s(s({},e),{omit:!o})}))}))}}),y.jsx("label",s({htmlFor:"omit-column-list-item-".concat(r,"-all"),className:"omit-column-label"},{children:"(Select All)"}))]})),t.map((function(e){return y.jsxs("div",s({className:"omit-column-list-item-container"},{children:[y.jsx("input",{id:"omit-column-list-item-".concat(r,"-").concat(String(e.field)),type:"checkbox",checked:!e.omit,onChange:function(t){return function(e){n((function(t){for(var n=d([],t,!0),r=0;rn[r])return 1*i}return 0})):e}(c,a),d=function(e,t){if(!t)return e;var n=t.currentPage,r=t.currentRowsPerPage,o=(n-1)*r,i=o+r;return e.slice(o,i)}(u,n);s(u.length),f(d)}}),[o,e,t]),o?{data:t,count:n,numberOfRows:t.length}:{data:u,count:l,numberOfRows:u.length}}function Wn(e,t){var n,r;for(var o in t){var i=t[o],a=i.operation,l=i.value,s=i.and,c=i.or;if(!Vn(e[o],a,l))return!(!c||!Wn(e,(n={},n[o]=c,n)));if(s&&!Wn(e,(r={},r[o]=s,r)))return!1}return!0}function Vn(e,t,n){if(void 0===n)return!1;var r=function(e,t){var n=typeof e;if("number"===n)t=Number(t);else if("boolean"===n)t="true"===t||"false"===t?"true"===t:Boolean(t);else if("string"===n){var r=Number(e),o=Number(t);isNaN(r)||isNaN(o)||(e=r,t=o);var i=Date.parse(e),a=Date.parse(t);isNaN(i)||isNaN(a)||(e=new Date(i),t=new Date(a))}return[e,t]}(e,n),o=r[0],i=r[1];return"Not blank"===t?!(null==o||""===o):"Is blank"===t?null==o||""===o:"Equal"===t?o===i:"Not equal"===t?o!==i:"Greater than or equal"===t?o>=i:"Less than or equal"===t?o<=i:"Greater than"===t?o>i:"Less than"===t?o0;var n=x(e);return void 0!==y[n]&&void 0!==y[n][t]},onChange:function(e,t,n){var r=x(e);b((function(e){var o,i=s({},e),a=i[r];return i[r]=s(s({},a||{}),((o={})[t]=n,o)),i}))},dirtyValue:function(e,t){var n=x(e);if(void 0!==y[n]&&void 0!==y[n][t])return y[n][t]},save:function(e,n){return u(t,void 0,void 0,(function(){var t,i,a,c,u,m,h;return f(this,(function(f){switch(f.label){case 0:if(!o)return[2];if(p({}),t=!1,l){for(i=Object.values(y),a=JSON.parse(JSON.stringify(d)),c=l.__allRows__,u=function(o){var s=i[o],u=x(s),f=n.find((function(e){return e[r]===u}));for(var d in s)if(Object.prototype.hasOwnProperty.call(s,d)){var p=l[d],m={fieldValidatorError:null,allFieldValidatorError:null};p&&(m.fieldValidatorError=p(s[d],d,y[u],e,f)),c&&(m.allFieldValidatorError=c(s[d],d,y[u],e,f)),(m.fieldValidatorError||m.allFieldValidatorError)&&(a[u]||(a[u]={}),a[u][d]={value:s[d],error:m.fieldValidatorError&&m.allFieldValidatorError?"".concat(m.fieldValidatorError," \n").concat(m.allFieldValidatorError):m.fieldValidatorError?m.fieldValidatorError:m.allFieldValidatorError},t=!0)}for(var d in f)if(Object.prototype.hasOwnProperty.call(f,d)&&c&&(!a[u]||!a[u][d])){var h=c(f[d],d,y[u],e,f);h&&(a[u]||(a[u]={}),a[u][d]={error:h,value:f[d]},t=!0)}},m=0;m1},String(e.field))},onColumnClick:function(e){return e.sortable&&l.onSort(e)},RowOptionMenu:p,hideSelect:!h,SelectHeader:function(){return y.jsx(N,{selectAll:E.selectAll,isAllSelected:E.isAllSelected})},SelectCell:function(e){var t=e.row,n=e.index,o=!h||h(t);return r((function(){u.onDisableRow(!o,n)}),[o]),y.jsx(O,{index:n,disabled:!o,checked:E.selectedRows.includes(n),onChange:E.onSelectRow})},NoData:v,onRowClick:g,showOptionsOnRowClick:b,minColumnSize:x,columnNameFontSize:w,renderCell:function(e,t,n){if(!D.isEditable)return y.jsx(y.Fragment,{children:n});var r=D.isDirty(t,e.field),o=D.dirtyValue(t,e.field);return"boolean"==typeof e.editable&&!1===e.editable||"function"==typeof e.editable&&!1===e.editable(t[e.field],e,t)?n:y.jsx(Xn,s({className:"edit-row-cell"},{children:function(i){return y.jsxs(y.Fragment,{children:[r?y.jsx(L,{value:void 0===o?t[e.field]:o,onChange:function(n){return D.onChange(t,e.field,n)},inputType:Yn[e.datatype],setOptions:e.setOptions,error:D.getValidationError(t,e.field)}):n,y.jsx("button",s({type:"button",className:"edit-row-button ".concat(i?"edit-row-button-hover":""),onClick:function(n){n.stopPropagation(),D.onEdit(t,e.field,r)}},{children:r?y.jsx(Qn,{}):y.jsx(Zn,{})}))]})}}))},renderHeaderPanel:function(e,t){return D.isDirty()&&D.isEditable?y.jsx("div",s({className:"table-header-panel"},{children:y.jsxs("div",s({className:"table-header-panel-row"},{children:[y.jsxs("button",s({disabled:D.isSaving,className:"table-header-panel-button ".concat(D.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:function(){return D.save(e,t)}},{children:[y.jsx(er,{}),"Save"]})),"|",y.jsxs("button",s({disabled:D.isSaving,className:"table-header-panel-button ".concat(D.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:D.cancel},{children:[y.jsx(Qn,{}),"Cancel"]})),D.submitError&&y.jsx("span",s({title:D.submitError,className:"save-error-message"},{children:D.submitError}))]}))})):null},Footer:S?y.jsx(S,s({},k)):null,AppsPanel:y.jsxs(y.Fragment,{children:[!m&&y.jsx(Ln,{columns:I,setColumns:_}),!!m&&y.jsx(m,{OmitColumns:y.jsx(Ln,{columns:I,setColumns:_})})]})})}function Xn(e){var t=i(!1),n=t[0],r=t[1];return y.jsx("span",s({className:e.className,onMouseOver:function(){return r(!0)},onMouseLeave:function(){return r(!1)}},{children:e.children(n)}))}function Zn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-pencil"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"44",d:"M358.62 129.28L86.49 402.08 70 442l39.92-16.49 272.8-272.13-24.1-24.1zM413.07 74.84l-11.79 11.78 24.1 24.1 11.79-11.79a16.51 16.51 0 000-23.34l-.75-.75a16.51 16.51 0 00-23.35 0z"})}))}function Qn(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-close-outline"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}))}function er(){return y.jsx("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-checkmark-outline"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128L192 384l-96-96"})}))}export{on as BaseDatatable,Ln as OmitColumn,zn as useClientSide,qn as useDatatable,kn as usePagination,Fn as useSelectable,xn as useSortable}; + */"production"===process.env.NODE_ENV?m.exports=function(){if(p)return h;p=1;var e=t,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var l,c={},s=null,u=null;for(l in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,l)&&!a.hasOwnProperty(l)&&(c[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===c[l]&&(c[l]=t[l]);return{$$typeof:n,type:e,key:s,ref:u,props:c,_owner:i.current}}return h.Fragment=r,h.jsx=l,h.jsxs=l,h}():m.exports=(v||(v=1,"production"!==process.env.NODE_ENV&&function(){var e=t,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator",y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=1&&u>=0&&l[s]!==c[u];)u--;for(;s>=1&&u>=0;s--,u--)if(l[s]!==c[u]){if(1!==s||1!==u)do{if(s--,--u<0||l[s]!==c[u]){var f="\n"+l[s].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),"function"==typeof e&&V.set(e,f),f}}while(s>=1&&u>=0);break}}}finally{B=!1,z.current=o,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:R}),info:D({},e,{value:C}),warn:D({},e,{value:P}),error:D({},e,{value:F}),group:D({},e,{value:A}),groupCollapsed:D({},e,{value:T}),groupEnd:D({},e,{value:L})})}M<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var d=e?e.displayName||e.name:"",p=d?W(d):"";return"function"==typeof e&&V.set(e,p),p}function q(e,t,n){if(null==e)return"";if("function"==typeof e)return H(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return W(e);switch(e){case u:return W("Suspense");case f:return W("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return H(e.render,!1);case d:return q(e.type,t,n);case p:var o=e,i=o._payload,a=o._init;try{return q(a(i),t,n)}catch(e){}}return""}V=new $;var U=Object.prototype.hasOwnProperty,K={},G=y.ReactDebugCurrentFrame;function Y(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var J=Array.isArray;function X(e){return J(e)}function Z(e){return""+e}function Q(e){if(function(e){try{return Z(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),Z(e)}var ee,te,ne,re=y.ReactCurrentOwner,oe={key:!0,ref:!0,__self:!0,__source:!0};ne={};var ie=function(e,t,r,o,i,a,l){var c={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ae(e,t,n,r,o){var i,a={},l=null,c=null;for(i in void 0!==n&&(Q(n),l=""+n),function(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Q(t.key),l=""+t.key),function(e){if(U.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&re.current&&t&&re.current.stateNode!==t){var n=E(re.current.type);ne[n]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(re.current.type),e.ref),ne[n]=!0)}}(t,o)),t)U.call(t,i)&&!oe.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var s=e.defaultProps;for(i in s)void 0===a[i]&&(a[i]=s[i])}if(l||c){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){ee||(ee=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,u),c&&function(e,t){var n=function(){te||(te=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,u)}return ie(e,l,c,o,r,re.current,a)}var le,ce=y.ReactCurrentOwner,se=y.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);se.setExtraStackFrame(n)}else se.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function de(){if(ce.current){var e=E(ce.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}le=!1;var pe={};function me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=de();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!pe[n]){pe[n]=!0;var r="";e&&e._owner&&e._owner!==ce.current&&(r=" It was passed a child from "+E(e._owner.type)+"."),ue(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ue(null)}}}function he(e,t){if("object"==typeof e)if(X(e))for(var n=0;n",O=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,O)}var P=ae(e,t,r,v,g);if(null==P)return P;if(y){var F=t.children;if(void 0!==F)if(h)if(X(F)){for(var A=0;A({x:e,y:e}),S={left:"right",right:"left",bottom:"top",top:"bottom"},N={start:"end",end:"start"};function O(e,t,n){return x(e,b(t,n))}function E(e,t){return"function"==typeof e?e(t):e}function R(e){return e.split("-")[0]}function C(e){return e.split("-")[1]}function P(e){return"x"===e?"y":"x"}function F(e){return"y"===e?"height":"width"}function A(e){return["top","bottom"].includes(R(e))?"y":"x"}function T(e){return P(A(e))}function L(e){return e.replace(/start|end/g,(e=>N[e]))}function D(e){return e.replace(/left|right|bottom|top/g,(e=>S[e]))}function M(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function I(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function _(e,t,n){let{reference:r,floating:o}=e;const i=A(t),a=T(t),l=F(a),c=R(t),s="y"===i,u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(C(t)){case"start":p[a]-=d*(n&&s?-1:1);break;case"end":p[a]+=d*(n&&s?-1:1)}return p}async function z(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=E(t,e),m=M(p),h=l[d?"floating"===f?"reference":"floating":f],v=I(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:u,strategy:c})),g="floating"===f?{...a.floating,x:r,y:o}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:c}):g);return{top:(v.top-x.top+m.top)/b.y,bottom:(x.bottom-v.bottom+m.bottom)/b.y,left:(v.left-x.left+m.left)/b.x,right:(x.right-v.right+m.right)/b.x}}const W=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l}=t,{element:c,padding:s=0}=E(e,t)||{};if(null==c)return{};const u=M(s),f={x:n,y:r},d=T(o),p=F(d),m=await a.getDimensions(c),h="y"===d,v=h?"top":"left",g=h?"bottom":"right",y=h?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[d]-f[d]-i.floating[p],w=f[d]-i.reference[d],j=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let k=j?j[y]:0;k&&await(null==a.isElement?void 0:a.isElement(j))||(k=l.floating[y]||i.floating[p]);const S=x/2-w/2,N=k/2-m[p]/2-1,R=b(u[v],N),P=b(u[g],N),A=R,L=k-m[p]-P,D=k/2-m[p]/2+S,I=O(A,D,L),_=null!=C(o)&&D!=I&&i.reference[p]/2-(De+"-"+o)),t&&(i=i.concat(i.map(L)))),i}(a,m,p,y));const x=[a,...b],w=await z(t,h),j=[];let k=(null==(n=o.flip)?void 0:n.overflows)||[];if(s&&j.push(w[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=C(e),o=T(e),i=F(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=D(a)),[a,D(a)]}(r,i,y);j.push(w[e[0]],w[e[1]])}if(k=[...k,{placement:r,overflows:j}],!j.every((e=>e<=0))){var S,N;const e=((null==(S=o.flip)?void 0:S.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n=null==(N=k.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(d){case"bestFit":{var O;const e=null==(O=k.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const B=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=R(n),l=C(n),c="y"===A(n),s=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,f=E(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),c?{x:p*u,y:d*s}:{x:d*s,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},$=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=E(e,t),s={x:n,y:r},u=await z(t,c),f=A(R(o)),d=P(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=O(p+u["y"===d?"top":"left"],p,p-u[e])}if(a){const e="y"===f?"bottom":"right";m=O(m+u["y"===f?"top":"left"],m,m-u[e])}const h=l.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}};function H(e){return K(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function U(e){var t;return null==(t=(K(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function K(e){return e instanceof Node||e instanceof q(e).Node}function G(e){return e instanceof Element||e instanceof q(e).Element}function Y(e){return e instanceof HTMLElement||e instanceof q(e).HTMLElement}function J(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof q(e).ShadowRoot)}function X(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Z(e){return["table","td","th"].includes(H(e))}function Q(e){const t=ee(),n=ne(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ee(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function te(e){return["html","body","#document"].includes(H(e))}function ne(e){return q(e).getComputedStyle(e)}function re(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function oe(e){if("html"===H(e))return e;const t=e.assignedSlot||e.parentNode||J(e)&&e.host||U(e);return J(t)?t.host:t}function ie(e){const t=oe(e);return te(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&X(t)?t:ie(t)}function ae(e,t){var n;void 0===t&&(t=[]);const r=ie(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=q(r);return o?t.concat(i,i.visualViewport||[],X(r)?r:[]):t.concat(r,ae(r))}function le(e){const t=ne(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Y(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=w(n)!==i||w(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function ce(e){return G(e)?e:e.contextElement}function se(e){const t=ce(e);if(!Y(t))return k(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=le(t);let a=(i?w(n.width):n.width)/r,l=(i?w(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const ue=k(0);function fe(e){const t=q(e);return ee()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ue}function de(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ce(e);let a=k(1);t&&(r?G(r)&&(a=se(r)):a=se(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==q(e))&&t}(i,n,r)?fe(i):k(0);let c=(o.left+l.x)/a.x,s=(o.top+l.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const e=q(i),t=r&&G(r)?q(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=se(n),t=n.getBoundingClientRect(),r=ne(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,u*=e.x,f*=e.y,c+=o,s+=i,n=q(n).frameElement}}return I({width:u,height:f,x:c,y:s})}function pe(e){return de(U(e)).left+re(e).scrollLeft}function me(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=q(e),r=U(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const e=ee();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}(e,n);else if("document"===t)r=function(e){const t=U(e),n=re(e),r=e.ownerDocument.body,o=x(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=x(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pe(e);const l=-n.scrollTop;return"rtl"===ne(r).direction&&(a+=x(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}(U(e));else if(G(t))r=function(e,t){const n=de(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Y(e)?se(e):k(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=fe(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return I(r)}function he(e,t){const n=oe(e);return!(n===t||!G(n)||te(n))&&("fixed"===ne(n).position||he(n,t))}function ve(e,t,n){const r=Y(t),o=U(t),i="fixed"===n,a=de(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=k(0);if(r||!r&&!i)if(("body"!==H(t)||X(o))&&(l=re(t)),r){const e=de(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=pe(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function ge(e,t){return Y(e)&&"fixed"!==ne(e).position?t?t(e):e.offsetParent:null}function ye(e,t){const n=q(e);if(!Y(e))return n;let r=ge(e,t);for(;r&&Z(r)&&"static"===ne(r).position;)r=ge(r,t);return r&&("html"===H(r)||"body"===H(r)&&"static"===ne(r).position&&!Q(r))?n:r||function(e){let t=oe(e);for(;Y(t)&&!te(t);){if(Q(t))return t;t=oe(t)}return null}(e)||n}const be={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Y(n),i=U(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},l=k(1);const c=k(0);if((o||!o&&"fixed"!==r)&&(("body"!==H(n)||X(i))&&(a=re(n)),Y(n))){const e=de(n);l=se(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}},getDocumentElement:U,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=ae(e).filter((e=>G(e)&&"body"!==H(e))),o=null;const i="fixed"===ne(e).position;let a=i?oe(e):e;for(;G(a)&&!te(a);){const t=ne(a),n=Q(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||X(a)&&!n&&he(e,a))?r=r.filter((e=>e!==a)):o=t,a=oe(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],l=i.reduce(((e,n)=>{const r=me(t,n,o);return e.top=x(r.top,e.top),e.right=b(r.right,e.right),e.bottom=b(r.bottom,e.bottom),e.left=x(r.left,e.left),e}),me(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ye,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ye,i=this.getDimensions;return{reference:ve(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return le(e)},getScale:se,isElement:G,isRTL:function(e){return"rtl"===ne(e).direction}};function xe(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,s=ce(e),u=o||i?[...s?ae(s):[],...ae(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=s&&l?function(e,t){let n,r=null;const o=U(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const{left:s,top:u,width:f,height:d}=e.getBoundingClientRect();if(l||t(),!f||!d)return;const p={rootMargin:-j(u)+"px "+-j(o.clientWidth-(s+f))+"px "+-j(o.clientHeight-(u+d))+"px "+-j(s)+"px",threshold:x(0,b(1,c))||1};let m=!0;function h(e){const t=e[0].intersectionRatio;if(t!==c){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}m=!1}try{r=new IntersectionObserver(h,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,p)}r.observe(e)}(!0),i}(s,n):null;let d,p=-1,m=null;a&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===s&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{m&&m.observe(t)}))),n()})),s&&!c&&m.observe(s),m.observe(t));let h=c?de(e):null;return c&&function t(){const r=de(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(d)}}const we=(e,t,n)=>{const r=new Map,o={platform:be,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let s=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=_(s,r,c),d=r,p={},m=0;for(let n=0;n({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?W({element:n.current,padding:r}).fn(t):{}:n?W({element:n,padding:r}).fn(t):{};var o}});var ke="undefined"!=typeof document?n:r;function Se(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Se(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Se(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ne(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oe(e,t){const n=Ne(e);return Math.round(t*n)/n}function Ee(t){const n=e.useRef(t);return ke((()=>{n.current=t})),n}var Re=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ce=new WeakMap,Pe=new WeakMap,Fe={},Ae=0,Te=function(e){return e&&(e.host||Te(e.parentNode))},Le=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Te(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var i=Fe[n],a=[],l=new Set,c=new Set(o),s=function(e){e&&!l.has(e)&&(l.add(e),s(e.parentNode))};o.forEach(s);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))u(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,c=(Ce.get(e)||0)+1,s=(i.get(e)||0)+1;Ce.set(e,c),i.set(e,s),a.push(e),1===c&&o&&Pe.set(e,!0),1===s&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return u(t),l.clear(),Ae++,function(){a.forEach((function(e){var t=Ce.get(e)-1,o=i.get(e)-1;Ce.set(e,t),i.set(e,o),t||(Pe.has(e)||e.removeAttribute(r),Pe.delete(e)),o||e.removeAttribute(n)})),--Ae||(Ce=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,Fe={})}},De=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Re(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Le(r,o,n,"aria-hidden")):function(){return null}},Me=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||Re(e);return r?Le(e,r,n,"inert"):function(){return null}},Ie=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},_e=function(e,t,n){return void 0===n&&(n="data-suppressed"),(Ie()?Me:De)(e,t,n)},ze=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),We="undefined"==typeof Element,Ve=We?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Be=!We&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},$e=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},He=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!$e(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{Ve.call(a,ze)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var s=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!$e(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(s&&u){var f=e(!0===s?a.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return o},qe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ue=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!qe(e)?0:e.tabIndex},Ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ge=function(e){return"INPUT"===e.tagName},Ye=function(e){return function(e){return Ge(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Be(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(Ve.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Je(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,l=Be(e);if(a&&!a.shadowRoot&&!0===r(a))return Je(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,r,o,i=e&&Be(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&a;){var c,s,u;l=!(null===(s=a=null===(c=i=Be(a))||void 0===c?void 0:c.host)||void 0===s||null===(u=s.ownerDocument)||void 0===u||!u.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ze=function(e,t){return!(t.disabled||$e(t)||function(e){return Ge(e)&&"hidden"===e.type}(t)||Xe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},tt=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=Ue(e);return n<0&&t&&!qe(e)?0:n}(a,i),c=i?e(t.candidates):a;0===l?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:c})})),r.sort(Ke).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},nt=function(e,t){var n;return n=(t=t||{}).getShadowRoot?He([e],t.includeContainer,{filter:Qe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:et}):function(e,t,n){if($e(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ze));return t&&Ve.call(e,ze)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Qe.bind(null,t)),tt(n)};function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+at++;const ct=e["useId".toString()]||function(){const[t,n]=e.useState((()=>it?lt():void 0));return ot((()=>{null==t&&n(lt())}),[]),e.useEffect((()=>{it||(it=!0)}),[]),t},st=e.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:s=0,staticOffset:u,stroke:f,d:d,style:{transform:p,...m}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=ct();if(!o)return null;s*=2;const g=s/2,y=a/2*(c/-8+1),b=l/2*c/4,[x,w]=r.split("-"),j=be.isRTL(o),k=!!d,S="top"===x||"bottom"===x,N=u&&"end"===w?"bottom":"top";let O=u&&"end"===w?"right":"left";u&&j&&(O="end"===w?"left":"right");const E=null!=(null==i?void 0:i.x)?u||i.x:"",R=null!=(null==i?void 0:i.y)?u||i.y:"",C=d||"M0,0 H"+a+" L"+(a-y)+","+(l-b)+" Q"+a/2+","+l+" "+y+","+(l-b)+" Z",P={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return e.createElement("svg",rt({},h,{"aria-hidden":!0,ref:n,width:k?a:a+s,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:E,[N]:R,[x]:S||k?"100%":"calc(100% - "+s/2+"px)",transform:""+P+(null!=p?p:""),...m}}),s>0&&e.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:s+(d?0:1),d:C}),e.createElement("path",{stroke:s&&!d?h.fill:"none",d:C}),e.createElement("clipPath",{id:v},e.createElement("rect",{x:-g,y:g*(k?-1:1),width:a+s,height:a})))}));const ut=e.createContext(null),ft=e.createContext(null),dt=()=>{var t;return(null==(t=e.useContext(ut))?void 0:t.id)||null},pt=()=>e.useContext(ft);function mt(e){return(null==e?void 0:e.ownerDocument)||document}function ht(e){return mt(e).defaultView||window}function vt(e){return!!e&&(e instanceof Element||e instanceof ht(e).Element)}function gt(e){return!!e&&(e instanceof HTMLElement||e instanceof ht(e).HTMLElement)}function yt(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function bt(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function xt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function wt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof ht(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function jt(e){return"data-floating-ui-"+e}function kt(e){const t=o(e);return ot((()=>{t.current=e})),t}function St(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let Nt=0;function Ot(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Nt);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Nt=requestAnimationFrame(i)}function Et(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function Rt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ct="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Pt(e){return gt(e)&&e.matches(Ct)}function Ft(e){e.preventDefault(),e.stopPropagation()}const At=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Tt(e,t){const n=nt(e,At());"prev"===t&&n.reverse();const r=n.indexOf(St(mt(e)));return n.slice(r+1)[0]}function Lt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!wt(n,r)}const Dt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Mt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const It=e.forwardRef((function(t,n){const[r,o]=e.useState();ot((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Mt),()=>{document.removeEventListener("keydown",Mt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[jt("focus-guard")]:"",style:Dt};return e.createElement("span",rt({},t,i))})),_t=e.createContext(null),zt=()=>e.useContext(_t),Wt=e.forwardRef((function(t,n){return e.createElement("button",rt({},t,{type:"button",ref:n,tabIndex:-1,style:Dt}))}));function Vt(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:a=!0,initialFocus:l=0,returnFocus:c=!0,modal:s=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=t,{open:d,refs:p,nodeId:m,onOpenChange:h,events:v,dataRef:g,elements:{domReference:y,floating:b}}=n,x=!Ie()||a,w=kt(i),j=kt(l),k=kt(c),S=pt(),N=zt(),O="number"==typeof l&&l<0,E=e.useRef(null),R=e.useRef(null),C=e.useRef(!1),P=e.useRef(null),F=e.useRef(!1),A=null!=N,T=y&&"combobox"===y.getAttribute("role")&&Pt(y),L=e.useCallback((function(e){return void 0===e&&(e=b),e?nt(e,At()):[]}),[b]),D=e.useCallback((e=>{const t=L(e);return w.current.map((e=>y&&"reference"===e?y:b&&"floating"===e?b:t)).filter(Boolean).flat()}),[y,b,w,L]);function M(t){return!o&&u&&s?e.createElement(Wt,{ref:"start"===t?E:R,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}e.useEffect((()=>{if(o||!s)return;function e(e){if("Tab"===e.key){wt(b,St(mt(b)))&&0===L().length&&!T&&Ft(e);const t=D(),n=Rt(e);"reference"===w.current[0]&&n===y&&(Ft(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===w.current[1]&&n===b&&e.shiftKey&&(Ft(e),Ot(t[0]))}}const t=mt(b);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,y,b,s,w,p,T,L,D]),e.useEffect((()=>{if(!o&&f)return b&>(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),!s&&b.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),!s&&b.removeEventListener("focusout",t)}):void 0;function e(){F.current=!0,setTimeout((()=>{F.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(wt(y,t)||wt(b,t)||wt(t,b)||wt(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(jt("focus-guard"))||S&&(Et(S.nodesRef.current,m).find((e=>{var n,r;return wt(null==(n=e.context)?void 0:n.elements.floating,t)||wt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(S.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!F.current&&t!==P.current&&(C.current=!0,h(!1,e))}))}}),[o,y,b,s,m,S,N,h,f]),e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+jt("portal")+"]"))||[]);if(b&&s){const e=[b,...t,E.current,R.current].filter((e=>null!=e)),n=(x?De:_e)(w.current.includes("reference")||T?e.concat(y||[]):e,void 0,jt("inert"));return()=>{n()}}}),[o,y,b,s,w,N,T,x]),ot((()=>{if(o||!b)return;const e=St(mt(b));queueMicrotask((()=>{const t=D(b),n=j.current,r=("number"==typeof n?t[n]:n.current)||b,o=wt(b,e);O||o||!d||Ot(r,{preventScroll:r===b})}))}),[o,d,b,O,D,j]),ot((()=>{if(o||!b)return;let e=!1;const t=mt(b),n=St(t),r=g.current;function i(t){if("escapeKey"===t.type&&p.domReference.current&&(P.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(C.current=!1,e=n.preventScroll):C.current=!n}return P.current=n,v.on("dismiss",i),()=>{v.off("dismiss",i);const n=St(t);(wt(b,n)||S&&Et(S.nodesRef.current,m).some((e=>{var t;return wt(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&p.domReference.current&&(P.current=p.domReference.current),k.current&>(P.current)&&!C.current&&Ot(P.current,{cancelPrevious:!1,preventScroll:e})}}),[o,b,k,g,p,v,S,m]),ot((()=>{if(!o&&N)return N.setFocusManagerState({...n,modal:s,closeOnFocusOut:f,open:d}),()=>{N.setFocusManagerState(null)}}),[o,N,s,d,f,n]),ot((()=>{if(!o&&b&&"function"==typeof MutationObserver){const e=()=>{const e=b.getAttribute("tabindex");w.current.includes("floating")||St(mt(b))!==p.domReference.current&&0===L().length?"0"!==e&&b.setAttribute("tabindex","0"):"-1"!==e&&b.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[o,b,p,w,L]);const I=!o&&x&&!T&&(A||s);return e.createElement(e.Fragment,null,I&&e.createElement(It,{"data-type":"inside",ref:null==N?void 0:N.beforeInsideRef,onFocus:e=>{if(s){const e=D();Ot("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(C.current=!1,Lt(e,N.portalNode)){const e=Tt(document.body,"next")||y;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!T&&M("start"),r,M("end"),I&&e.createElement(It,{"data-type":"inside",ref:null==N?void 0:N.afterInsideRef,onFocus:e=>{if(s)Ot(D()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(f&&(C.current=!0),Lt(e,N.portalNode)){const e=Tt(document.body,"prev")||y;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}}))}function Bt(e){return gt(e.target)&&"BUTTON"===e.target.tagName}function $t(e){return Pt(e)}function Ht(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,elements:{domReference:a}}=t,{enabled:l=!0,event:c="click",toggle:s=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=n,d=e.useRef(),p=e.useRef(!1);return e.useMemo((()=>l?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(xt(d.current,!0)&&u||"click"!==c&&(!r||!s||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent)):o(!1,e.nativeEvent)))},onClick(e){"mousedown"===c&&d.current?d.current=void 0:xt(d.current,!0)&&u||(!r||!s||i.current.openEvent&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent):o(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Bt(e)||(" "!==e.key||$t(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&o(!r||!s,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||Bt(e)||$t(a)||" "===e.key&&p.current&&(p.current=!1,o(!r||!s,e.nativeEvent))}}}:{}),[l,i,c,u,f,a,s,r,o])}const qt=e["useInsertionEffect".toString()]||(e=>e());function Ut(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return qt((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Xt(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,nodeId:a,elements:{reference:l,domReference:c,floating:s},dataRef:u}=t,{enabled:f=!0,escapeKey:d=!0,outsidePress:p=!0,outsidePressEvent:m="pointerdown",referencePress:h=!1,referencePressEvent:v="pointerdown",ancestorScroll:g=!1,bubbles:y}=n,b=pt(),x=null!=dt(),w=Ut("function"==typeof p?p:()=>!1),j="function"==typeof p?w:p,k=e.useRef(!1),{escapeKeyBubbles:S,outsidePressBubbles:N}=Jt(y),O=Ut((e=>{if(!r||!f||!d||"Escape"!==e.key)return;const t=b?Et(b.nodesRef.current,a):[];if(!S&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),E=Ut((e=>{const t=k.current;if(k.current=!1,t)return;if("function"==typeof j&&!j(e))return;const n=Rt(e);if(gt(n)&&s){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===ht(s).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=b&&Et(b.nodesRef.current,a).some((t=>{var n;return Kt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Kt(e,s)||Kt(e,c)||r)return;const l=b?Et(b.nodesRef.current,a):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:yt(e)||bt(e)}}),o(!1,e)}));return e.useEffect((()=>{if(!r||!f)return;function e(e){o(!1,e)}u.current.__escapeKeyBubbles=S,u.current.__outsidePressBubbles=N;const t=mt(s);d&&t.addEventListener("keydown",O),j&&t.addEventListener(m,E);let n=[];return g&&(vt(c)&&(n=ae(c)),vt(s)&&(n=n.concat(ae(s))),!vt(l)&&l&&l.contextElement&&(n=n.concat(ae(l.contextElement)))),n=n.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),n.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{d&&t.removeEventListener("keydown",O),j&&t.removeEventListener(m,E),n.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,s,c,l,d,j,m,r,o,g,f,S,N,O,E]),e.useEffect((()=>{k.current=!1}),[j,m]),e.useMemo((()=>f?{reference:{onKeyDown:O,[Gt[v]]:e=>{h&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:O,[Yt[m]]:()=>{k.current=!0}}}:{}),[f,i,h,m,v,o,O])}function Zt(t){var n;void 0===t&&(t={});const{open:r=!1,onOpenChange:o,nodeId:i}=t,[a,c]=e.useState(null),s=(null==(n=t.elements)?void 0:n.reference)||a,u=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:c}={},transform:s=!0,whileElementsMounted:u,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Se(m,o)||h(o);const[v,g]=e.useState(null),[y,b]=e.useState(null),x=e.useCallback((e=>{e!=S.current&&(S.current=e,g(e))}),[g]),w=e.useCallback((e=>{e!==N.current&&(N.current=e,b(e))}),[b]),j=a||v,k=c||y,S=e.useRef(null),N=e.useRef(null),O=e.useRef(d),E=Ee(u),R=Ee(i),C=e.useCallback((()=>{if(!S.current||!N.current)return;const e={placement:n,strategy:r,middleware:m};R.current&&(e.platform=R.current),we(S.current,N.current,e).then((e=>{const t={...e,isPositioned:!0};P.current&&!Se(O.current,t)&&(O.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,R]);ke((()=>{!1===f&&O.current.isPositioned&&(O.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const P=e.useRef(!1);ke((()=>(P.current=!0,()=>{P.current=!1})),[]),ke((()=>{if(j&&(S.current=j),k&&(N.current=k),j&&k){if(E.current)return E.current(j,k,C);C()}}),[j,k,C,E]);const F=e.useMemo((()=>({reference:S,floating:N,setReference:x,setFloating:w})),[x,w]),A=e.useMemo((()=>({reference:j,floating:k})),[j,k]),T=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!A.floating)return e;const t=Oe(A.floating,d.x),n=Oe(A.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Ne(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,A.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:C,refs:F,elements:A,floatingStyles:T})),[d,C,F,A,T])}(t),f=pt(),d=Ut(((e,t)=>{e&&(m.current.openEvent=t),null==o||o(e,t)})),p=e.useRef(null),m=e.useRef({}),h=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],v=ct(),g=e.useCallback((e=>{const t=vt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u.refs.setReference(t)}),[u.refs]),y=e.useCallback((e=>{(vt(e)||null===e)&&(p.current=e,c(e)),(vt(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!vt(e))&&u.refs.setReference(e)}),[u.refs]),b=e.useMemo((()=>({...u.refs,setReference:y,setPositionReference:g,domReference:p})),[u.refs,y,g]),x=e.useMemo((()=>({...u.elements,domReference:s})),[u.elements,s]),w=e.useMemo((()=>({...u,refs:b,elements:x,dataRef:m,nodeId:i,floatingId:v,events:h,open:r,onOpenChange:d})),[u,i,v,h,r,d,b,x]);return ot((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===i));e&&(e.context=w)})),e.useMemo((()=>({...u,context:w,refs:b,elements:x})),[u,b,x,w])}function Qt(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function en(t){void 0===t&&(t=[]);const n=t,r=e.useCallback((e=>Qt(e,t,"reference")),n),o=e.useCallback((e=>Qt(e,t,"floating")),n),i=e.useCallback((e=>Qt(e,t,"item")),t.map((e=>null==e?void 0:e.item)));return e.useMemo((()=>({getReferenceProps:r,getFloatingProps:o,getItemProps:i})),[r,o,i])}function tn(t,n){void 0===n&&(n={});const{open:r,floatingId:o}=t,{enabled:i=!0,role:a="dialog"}=n,l=ct();return e.useMemo((()=>{const e={id:o,role:a};return i?"tooltip"===a?{reference:{"aria-describedby":r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l}},floating:{...e,..."menu"===a&&{"aria-labelledby":l}}}:{}}),[i,a,r,o,l])}var nn=function(e){return e.map((function(e){var t,n,r,o,i,a,l;return c({field:null!==(t=e.field)&&void 0!==t?t:"",columnName:null!==(n=e.columnName)&&void 0!==n?n:rn(null!==(r=String(e.field))&&void 0!==r?r:""),sortable:null===(o=e.sortable)||void 0===o||o,datatype:null!==(i=e.datatype)&&void 0!==i?i:"string",omit:null!==(a=e.omit)&&void 0!==a&&a,filterable:null===(l=e.filterable)||void 0===l||l},e)}))},rn=function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replaceAll("_"," ").toLowerCase()};function on(e){var t=e.data,r=e.isFetching,a=e.columns,l=e.onColumnClick,s=e.RowOptionMenu,u=e.AppsPanel,f=e.renderSort,d=e.renderFilter,p=e.Footer,m=e.hideSelect,h=e.SelectHeader,v=e.SelectCell,g=e.NoData,b=e.onRowClick,x=e.showOptionsOnRowClick,w=e.minColumnSize,j=e.columnNameFontSize,k=e.renderCell,S=e.renderHeaderPanel,N=m?0:50,O=50,E=function(e){var t=e.columns,r=e.isFetching,a=e.extraWidth,l=e.minColumnSize,c=e.columnNameFontSize,s=o(null),u=i(0),f=u[0],d=u[1],p=t.reduce((function(e,t){return t.width&&!t.omit?{width:e.width+t.width,columns:e.columns+1}:e}),{width:0,columns:0}),m=t.reduce((function(e,t){return t.omit?e:e+1}),0),h=t.reduceRight((function(e,t){return null===e?null:t.omit?e:t.width?e||t.field:null}),!1);return n((function(){if(s.current){var e=s.current;d(e.clientWidth);var t=new ResizeObserver((function(){return d((function(t){return t>0&&r?t:e.clientWidth}))}));return t.observe(e),function(){t.disconnect()}}}),[s.current,r,t]),{containerRef:s,getWidth:function(e){var t=e.columnName.length*((null!=c?c:16)/2),n=Math.pow(e.columnName.length,1.1)-e.columnName.length,r=l||(c?t+1-(n<3?0:n)+40+16+16:150);return h===e.field&&e.width?Math.max((f-(a+p.width-e.width))/Math.max(m-p.columns-1,1),r):e.width?e.width:Math.max((f-(a+p.width))/Math.max(m-p.columns,1),r)}}}({columns:a,isFetching:r,extraWidth:N+O,minColumnSize:w,columnNameFontSize:j});return y.jsxs("div",c({className:"myers-datatable"},{children:[S&&S(a,t),y.jsxs("div",c({ref:E.containerRef,className:"table-scroll-container"},{children:[y.jsxs("div",c({className:"table-header-row table-row"},{children:[y.jsx("div",c({className:"table-cell table-header-cell apps-button-header-cell",style:{width:O,minWidth:O,maxWidth:O}},{children:u&&y.jsx(gn,c({Icon:pn,mainAxisOffset:20,crossAxisOffset:10,placement:"bottom-end",className:"app-panel-button"},{children:u}))})),!m&&!!h&&y.jsx(un,c({className:"select-header-cell",column:{field:"_selectable",datatype:"string",columnName:"",sortable:!1,omit:!1,filterable:!1},width:N},{children:y.jsx(h,{})})),a.map((function(e){return y.jsx(un,c({column:e,onClick:l,className:"".concat(e.sortable?"sortable-table-header":""," ").concat(e.omit?"hide":""),width:E.getWidth(e)},{children:y.jsxs("div",c({className:"column-header-options"},{children:[e.sortable&&f&&f(e),e.filterable&&d&&d(e,an)]}))}),String(e.field))}))]})),t.map((function(e,t){return y.jsx(yn,c({crossAxisOffset:0,placement:"right-start",PopUp:s?y.jsx(s,{row:e,rowIndex:t}):null,useCursorOffset:!!x},{children:function(n){return y.jsxs("div",c({className:"table-row ".concat(b||x?"table-row-clickable":""),onClick:function(t){b&&b(e,t),x&&n.onClick(t)}},{children:[r&&y.jsx("div",c({className:"spinner-container"},{children:y.jsxs("div",c({className:"spinner-wrapper"},{children:[y.jsx("div",{className:"spinner"}),y.jsx("span",c({className:"spinner-loading-text"},{children:"Loading"}))]}))})),y.jsx("div",c({className:"table-cell",style:{width:O,minWidth:O,maxWidth:O}},{children:s&&y.jsx("button",c({type:"button","aria-label":"row options"},n,{onClick:function(e){e.stopPropagation(),n.onClick(e)}},{children:y.jsx(mn,{})}))})),!m&&!!v&&y.jsx("div",c({className:"table-cell",style:{width:N,minWidth:N,maxWidth:N}},{children:y.jsx(v,{index:t,row:e})})),a.map((function(t,n){return y.jsx(ln,{column:t,row:e,width:E.getWidth(t),renderCell:k},n)}))]}))}}),t)})),0===t.length&&!r&&(g||y.jsx(bn,{}))]})),p]}))}function an(e){var t=e.children,n=e.hasFilter;return y.jsx("div",c({className:"filter-options-button"},{children:y.jsx(gn,c({Icon:n?vn:hn,mainAxisOffset:20,crossAxisOffset:0,placement:"bottom-end"},{children:t}))}))}var ln=function(e){var t=e.column,n=e.row,r=e.width,o=e.renderCell,i=void 0!==n[t.field]?String(n[t.field]):void 0,a={width:r,minWidth:r,maxWidth:r};return t.renderCell?y.jsx("div",c({className:"table-cell ".concat(t.omit?"hide":""),title:i,style:a},{children:o?o(t,n,t.renderCell(n[t.field],t,n)):t.renderCell(n[t.field],t,n)})):"paragraph"===t.datatype?y.jsx(sn,{column:t,row:n,title:i,text:n[t.field],style:a,renderCell:o}):y.jsx("div",c({className:"table-cell ".concat(t.omit?"hide":""),title:i,style:a},{children:o?o(t,n,cn(n[t.field],t)):cn(n[t.field],t)}))},cn=function(e,t){if(null==e)return y.jsx("span",{className:"text-wrapper"});if("name"===t.datatype)return y.jsx("span",c({className:"cell-datatype-name text-wrapper"},{children:e}));if("link"===t.datatype)return y.jsx("a",c({className:"text-wrapper",href:e,target:"_blank",rel:"noreferrer"},{children:new URL(e).hostname}));if("email"===t.datatype)return y.jsx("a",c({className:"text-wrapper",href:"mailto:".concat(e),target:"_blank",rel:"noreferrer"},{children:e}));if("date"===t.datatype)return y.jsx("span",c({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric"}):""}));if("datetime"===t.datatype)return y.jsx("span",c({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}));if("boolean"===t.datatype)return y.jsx(y.Fragment,{children:JSON.parse(e)?y.jsx(fn,{}):y.jsx(dn,{})});if("phone"===t.datatype){var n={code:!1,number:e},r=e.split(" ");r.length>1&&(n.code=r[0],n.number=r[1]);var o=n.number.slice(0,3)+"-"+n.number.slice(3,6)+"-"+n.number.slice(6);return n.code?y.jsx("span",c({className:"text-wrapper"},{children:"".concat(n.code," ").concat(o)})):y.jsx("span",c({className:"text-wrapper"},{children:o}))}return"image"===t.datatype?y.jsx("a",c({href:e,target:"_blank",rel:"noreferrer"},{children:y.jsx("img",{alt:"row",className:"cell-datatype-image",src:e})})):y.jsx("span",c({className:"text-wrapper"},{children:e}))},sn=function(e){var t=e.text,n=e.title,r=e.column,o=e.row,a=e.style,l=e.renderCell,s=i(!1),u=s[0],f=s[1];return y.jsx("div",c({className:"table-cell cell-datatype-paragraph ".concat(r.omit?"hide":""," ").concat(u?"cell-datatype-paragraph-open":"cell-datatype-paragraph-closed"),title:n,onClick:function(e){e.stopPropagation(),f((function(e){return!e}))},style:a},{children:l?l(r,o,y.jsx("span",c({className:"text-wrapper"},{children:t}))):y.jsx("span",c({className:"text-wrapper"},{children:t}))}))},un=function(e){var t=e.column,n=e.children,r=e.className,o=void 0===r?"":r,i=e.onClick,a=e.width;return y.jsx("div",c({className:"table-cell table-header-cell ".concat(o),onClick:function(){return i&&i(t)},title:t.columnName,style:{width:a,minWidth:a,maxWidth:a}},{children:y.jsxs("div",c({className:"table-header-children-container"},{children:[!!t.columnName&&y.jsx("span",c({className:"table-header-column-name"},{children:t.columnName})),n]}))}),t.columnName)};function fn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-true-svg"},{children:y.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})}))}function dn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-false-svg"},{children:y.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 11-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 01-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0122.62-22.62L256 233.37l52.69-52.68a16 16 0 0122.62 22.62L278.63 256z"})}))}function pn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-apps"},{children:y.jsx("path",{d:"M104 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 464a56 56 0 1156-56 56.06 56.06 0 01-56 56z"})}))}function mn(){return y.jsxs("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"options-svg io-ellipsis"},{children:[y.jsx("circle",{cx:"256",cy:"256",r:"48"}),y.jsx("circle",{cx:"256",cy:"416",r:"48"}),y.jsx("circle",{cx:"256",cy:"96",r:"48"})]}))}function hn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-menu"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"48",d:"M88 152h336M88 256h336M88 360h336"})}))}function vn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-funnel"},{children:y.jsx("path",{d:"M296 464a23.88 23.88 0 01-7.55-1.23L208.3 436.1a23.92 23.92 0 01-16.3-22.78V294.11a.44.44 0 00-.09-.13L23.26 97.54A30 30 0 0146.05 48H466a30 30 0 0122.79 49.54L320.09 294a.77.77 0 00-.09.13V440a23.93 23.93 0 01-24 24z"})}))}function gn(e){var t=e.Icon,n=e.children,r=e.mainAxisOffset,a=e.crossAxisOffset,l=e.placement,s=e.className,u=o(null),f=i(!1),d=f[0],p=Zt({open:d,onOpenChange:f[1],whileElementsMounted:xe,placement:l,middleware:[je({element:u,padding:16}),B({mainAxis:r,crossAxis:a}),V(),$()]}),m=p.refs,h=p.floatingStyles,v=p.context,g=en([Ht(v),Xt(v),tn(v)]),b=g.getReferenceProps,x=g.getFloatingProps,w=b();return y.jsxs(y.Fragment,{children:[y.jsx("button",c({"aria-label":"table options",type:"button",ref:m.setReference},w,{className:"icon-button ".concat(null!=s?s:""),onClick:function(e){e.stopPropagation(),w.onClick(e)}},{children:y.jsx(t,{})})),d&&y.jsx(Vt,c({context:v,modal:!1},{children:y.jsxs("div",c({ref:m.setFloating,style:h,className:"popup-floating-container"},x(),{children:[y.jsx(st,{ref:u,context:v,className:"popup-floating-arrow"}),y.jsx("div",c({className:"popup-container"},{children:n}))]}))}))]})}function yn(e){var t=e.children,n=e.PopUp,r=e.crossAxisOffset,a=e.placement,l=e.className,s=e.useCursorOffset,u=o(null),f=i(!1),d=f[0],p=f[1],m=i(s?0:10),h=m[0],v=m[1],g=Zt({open:d,onOpenChange:p,placement:a,middleware:[je({element:u,padding:16}),B({mainAxis:h,crossAxis:r}),V()]}),b=g.refs,x=g.floatingStyles,w=g.context,j=en([Ht(w),Xt(w),tn(w)]),k=j.getReferenceProps,S=j.getFloatingProps,N=k(),O=c(c({type:"button",ref:b.setReference},N),{className:"icon-button ".concat(null!=l?l:""),onClick:function(e){if(e.stopPropagation(),s){var t=e.nativeEvent.clientX-e.currentTarget.getBoundingClientRect().left;v(t)}N.onClick(e)}});return y.jsxs(y.Fragment,{children:[t(O),d&&y.jsx(Vt,c({context:w,modal:!1},{children:y.jsxs("div",c({ref:b.setFloating,style:x},S(),{className:"popup-floating-container"},{children:[y.jsx(st,{ref:u,context:w,className:"popup-floating-arrow"}),y.jsx("div",c({className:"popup-container"},{children:n}))]}))}))]})}function bn(){return y.jsx("p",c({className:"no-items-to-display"},{children:"No items to display."}))}function xn(e){var t=e.onChange,n=e.initialSortOrder,o=void 0===n?{}:n,a=i(!1),l=a[0],s=a[1],u=i(o),f=u[0],d=u[1];r((function(){var e=function(e){return s(e.shiftKey)};return window.addEventListener("keyup",e),window.addEventListener("keydown",e),function(){window.removeEventListener("keyup",e),window.removeEventListener("keydown",e)}}),[]),r((function(){t(f)}),[]);return{sortOrder:f,Sort:wn,onSort:l?function(e){var n,r=c({},f),o=Object.entries(r).reduce((function(t,n){var r=n[0],o=n[1];return r===e.field||o.orderIndex>t?t:o.orderIndex+1}),1);r[e.field]={sortDirection:"asc"===(null===(n=f[e.field])||void 0===n?void 0:n.sortDirection)?"desc":"asc",orderIndex:o},d(r),t(r)}:function(e){var n,r={};r[e.field]={sortDirection:"asc"===(null===(n=f[e.field])||void 0===n?void 0:n.sortDirection)?"desc":"asc",orderIndex:1},d(r),t(r)},reset:function(e){var t=null!=e?e:o;return s(!1),d(t),t}}}var wn=function(e){var t=e.column,n=e.sortDirection,r=e.orderIndex,o=e.isMultiSort;return t.sortable?y.jsxs("div",c({className:"sortable-caret-container"},{children:[void 0===r?null:o&&r,r&&y.jsx(y.Fragment,{children:"asc"===n?y.jsx(kn,{}):y.jsx(jn,{})})]})):null},jn=function(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:y.jsx("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"})}))},kn=function(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:y.jsx("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"})}))};function Sn(e){var t=e.onChange,n=e.initialPage,o=e.defaultPage,a=e.numberOfRows,l=e.count,s=i(null!=n?n:o),u=s[0],f=s[1],d=Math.ceil(l/u.currentRowsPerPage),p=function(e){return f((function(n){var r=e(n);return t(r),r}))};r((function(){t(u)}),[]);return{page:u,count:l,numberOfRows:a,Pagination:Nn,firstPage:function(){return p((function(e){return c(c({},e),{currentPage:1})}))},lastPage:function(){return p((function(e){return c(c({},e),{currentPage:d})}))},nextPage:function(){return p((function(e){return c(c({},e),{currentPage:Math.min(e.currentPage+1,d)})}))},previousPage:function(){return p((function(e){return c(c({},e),{currentPage:Math.max(e.currentPage-1,1)})}))},goToPage:function(e){},onChangeRowsPerPage:function(e){return p((function(t){return c(c({},t),{currentRowsPerPage:e})}))},reset:function(e,t){var r,i=t?o:null!==(r=null!=e?e:n)&&void 0!==r?r:o;return f(i),i}}}var Nn=function(e){var t=e.page,n=e.count,r=e.numberOfRows,o=e.firstPage,i=e.lastPage,l=e.nextPage,s=e.previousPage;e.goToPage;var u=e.onChangeRowsPerPage,f=t.currentPage,d=t.currentRowsPerPage,p=t.rowsPerPage,m=a(),h=f*d-d;return y.jsxs("div",c({className:"pagination-container"},{children:[y.jsxs("div",c({className:"pagination-rpp-container"},{children:[y.jsx("label",c({htmlFor:"rows-per-page-".concat(m)},{children:"Rows per page:"})),y.jsx("select",c({id:"rows-per-page-".concat(m),value:d,onChange:function(e){return u(Number(e.target.value))},className:"pagination-select-input"},{children:p.map((function(e){return y.jsx("option",c({value:e},{children:e}),"rows-per-page-".concat(e))}))})),0===n&&y.jsx("span",{children:"0-0 of 0"}),n>0&&y.jsxs("span",{children:[h+1,"-",r+h," of ",n]})]})),y.jsxs("div",c({className:"pagination-icon-button-container"},{children:[y.jsx(On,{"aria-label":"first page",onClick:o,SVG:En}),y.jsx(On,{"aria-label":"previous page",onClick:s,SVG:Cn}),y.jsx(On,{"aria-label":"next page",onClick:l,SVG:Pn}),y.jsx(On,{"aria-label":"last page",onClick:i,SVG:Rn})]}))]}))},On=function(e){var t=e.onClick,n=e.SVG;return y.jsx("button",c({"aria-label":e["aria-label"],onClick:t,className:"pagination-icon-button",type:"button"},{children:y.jsx(n,{})}))},En=function(){return y.jsxs("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),y.jsx("path",{fill:"none",d:"M24 24H0V0h24v24z"})]}))},Rn=function(){return y.jsxs("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),y.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"})]}))},Cn=function(){return y.jsxs("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))},Pn=function(){return y.jsxs("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[y.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))};function Fn(e){var t=e.numberOfRows,n=e.onChange,o=i(!1),a=o[0],l=o[1],c=i([]),s=c[0],u=c[1],f=i([]),p=f[0],m=f[1],h=function(e){l(e);var n=e?new Array(t).fill(0).flatMap((function(e,t){return p.includes(t)?[]:t})):[];u(n)};r((function(){n({isAllSelected:a,selectedRows:s})}),[a,s]);return{Header:An,Row:Tn,selectAll:h,selectedRows:s,onSelectRow:function(e,t){u((function(n){return e?d(d([],n,!0),[t],!1):n.filter((function(e){return e!==t}))})),a&&l(!1)},isAllSelected:a,onDisableRow:function(e,t){m((function(n){var r=n.findIndex((function(e){return e===t})),o=d([],n,!0);return r>-1&&!e?(o.splice(r,1),o):-1===r&&e?(o.push(t),o):n}))},reset:function(){return h(!1),!1}}}function An(e){var t=e.selectAll,n=e.isAllSelected;return y.jsx("input",{name:"check-uncheck all","aria-label":"check-uncheck all",className:"select-header-checkbox",type:"checkbox",checked:n,onChange:function(e){return t(e.target.checked)}})}function Tn(e){var t=e.index,n=e.disabled,r=e.checked,o=e.onChange;return y.jsx("input",{name:"check-uncheck row","aria-label":"check-uncheck row",checked:r,onClick:function(e){return e.stopPropagation()},onChange:function(e){return o(e.target.checked,t)},disabled:n,type:"checkbox"})}function Ln(e){var t=e.columns,n=e.setColumns,r=a(),o=!!t.find((function(e){return e.omit}));return y.jsxs("div",c({className:"omit-column-container"},{children:[y.jsx("span",c({className:"omit-column-title"},{children:"Columns"})),y.jsxs("div",c({className:"omit-column-list"},{children:[y.jsxs("div",c({className:"omit-column-list-item-container"},{children:[y.jsx("input",{name:"check-uncheck all",type:"checkbox",id:"omit-column-list-item-".concat(r,"-all"),checked:!o,onChange:function(){return n((function(e){return e.map((function(e){return c(c({},e),{omit:!o})}))}))}}),y.jsx("label",c({htmlFor:"omit-column-list-item-".concat(r,"-all"),className:"omit-column-label"},{children:"(Select All)"}))]})),t.map((function(e){return y.jsxs("div",c({className:"omit-column-list-item-container"},{children:[y.jsx("input",{name:"check-uncheck",id:"omit-column-list-item-".concat(r,"-").concat(String(e.field)),type:"checkbox",checked:!e.omit,onChange:function(t){return function(e){n((function(t){for(var n=d([],t,!0),r=0;rn[r])return 1*i}return 0})):e}(s,a),d=function(e,t){if(!t)return e;var n=t.currentPage,r=t.currentRowsPerPage,o=(n-1)*r,i=o+r;return e.slice(o,i)}(u,n);c(u.length),f(d)}}),[o,e,t]),o?{data:t,count:n,numberOfRows:t.length}:{data:u,count:l,numberOfRows:u.length}}function Wn(e,t){var n,r;for(var o in t){var i=t[o],a=i.operation,l=i.value,c=i.and,s=i.or;if(!Vn(e[o],a,l))return!(!s||!Wn(e,(n={},n[o]=s,n)));if(c&&!Wn(e,(r={},r[o]=c,r)))return!1}return!0}function Vn(e,t,n){if(void 0===n)return!1;var r=function(e,t){var n=typeof e;if("number"===n)t=Number(t);else if("boolean"===n)t="true"===t||"false"===t?"true"===t:Boolean(t);else if("string"===n){var r=Number(e),o=Number(t);isNaN(r)||isNaN(o)||(e=r,t=o);var i=Date.parse(e),a=Date.parse(t);isNaN(i)||isNaN(a)||(e=new Date(i),t=new Date(a))}return[e,t]}(e,n),o=r[0],i=r[1];return"Not blank"===t?!(null==o||""===o):"Is blank"===t?null==o||""===o:"Equal"===t?o===i:"Not equal"===t?o!==i:"Greater than or equal"===t?o>=i:"Less than or equal"===t?o<=i:"Greater than"===t?o>i:"Less than"===t?o0;var n=x(e);return void 0!==y[n]&&void 0!==y[n][t]},onChange:function(e,t,n){var r=x(e);b((function(e){var o,i=c({},e),a=i[r];return i[r]=c(c({},a||{}),((o={})[t]=n,o)),i}))},dirtyValue:function(e,t){var n=x(e);if(void 0!==y[n]&&void 0!==y[n][t])return y[n][t]},save:function(e,n){return u(t,void 0,void 0,(function(){var t,i,a,s,u,m,h;return f(this,(function(f){switch(f.label){case 0:if(!o)return[2];if(p({}),t=!1,l){for(i=Object.values(y),a=JSON.parse(JSON.stringify(d)),s=l.__allRows__,u=function(o){var c=i[o],u=x(c),f=n.find((function(e){return e[r]===u}));for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var p=l[d],m={fieldValidatorError:null,allFieldValidatorError:null};p&&(m.fieldValidatorError=p(c[d],d,y[u],e,f)),s&&(m.allFieldValidatorError=s(c[d],d,y[u],e,f)),(m.fieldValidatorError||m.allFieldValidatorError)&&(a[u]||(a[u]={}),a[u][d]={value:c[d],error:m.fieldValidatorError&&m.allFieldValidatorError?"".concat(m.fieldValidatorError," \n").concat(m.allFieldValidatorError):m.fieldValidatorError?m.fieldValidatorError:m.allFieldValidatorError},t=!0)}for(var d in f)if(Object.prototype.hasOwnProperty.call(f,d)&&s&&(!a[u]||!a[u][d])){var h=s(f[d],d,y[u],e,f);h&&(a[u]||(a[u]={}),a[u][d]={error:h,value:f[d]},t=!0)}},m=0;m1},String(e.field))},onColumnClick:function(e){return e.sortable&&l.onSort(e)},RowOptionMenu:p,hideSelect:!h,SelectHeader:function(){return y.jsx(N,{selectAll:E.selectAll,isAllSelected:E.isAllSelected})},SelectCell:function(e){var t=e.row,n=e.index,o=!h||h(t);return r((function(){u.onDisableRow(!o,n)}),[o]),y.jsx(O,{index:n,disabled:!o,checked:E.selectedRows.includes(n),onChange:E.onSelectRow})},NoData:v,onRowClick:g,showOptionsOnRowClick:b,minColumnSize:x,columnNameFontSize:w,renderCell:function(e,t,n){if(!D.isEditable)return y.jsx(y.Fragment,{children:n});var r=D.isDirty(t,e.field),o=D.dirtyValue(t,e.field);return"boolean"==typeof e.editable&&!1===e.editable||"function"==typeof e.editable&&!1===e.editable(t[e.field],e,t)?n:y.jsx(Xn,c({className:"edit-row-cell"},{children:function(i){return y.jsxs(y.Fragment,{children:[r?y.jsx(L,{value:void 0===o?t[e.field]:o,onChange:function(n){return D.onChange(t,e.field,n)},inputType:Yn[e.datatype],setOptions:e.setOptions,error:D.getValidationError(t,e.field)}):n,y.jsx("button",c({"aria-label":"edit",type:"button",className:"edit-row-button ".concat(i?"edit-row-button-hover":""),onClick:function(n){n.stopPropagation(),D.onEdit(t,e.field,r)}},{children:r?y.jsx(Qn,{}):y.jsx(Zn,{})}))]})}}))},renderHeaderPanel:function(e,t){return D.isDirty()&&D.isEditable?y.jsx("div",c({className:"table-header-panel"},{children:y.jsxs("div",c({className:"table-header-panel-row"},{children:[y.jsxs("button",c({disabled:D.isSaving,className:"table-header-panel-button ".concat(D.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:function(){return D.save(e,t)}},{children:[y.jsx(er,{}),"Save"]})),"|",y.jsxs("button",c({disabled:D.isSaving,className:"table-header-panel-button ".concat(D.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:D.cancel},{children:[y.jsx(Qn,{}),"Cancel"]})),D.submitError&&y.jsx("span",c({title:D.submitError,className:"save-error-message"},{children:D.submitError}))]}))})):null},Footer:k?y.jsx(k,c({},S)):null,AppsPanel:y.jsxs(y.Fragment,{children:[!m&&y.jsx(Ln,{columns:I,setColumns:_}),!!m&&y.jsx(m,{OmitColumns:y.jsx(Ln,{columns:I,setColumns:_})})]})})}function Xn(e){var t=i(!1),n=t[0],r=t[1];return y.jsx("span",c({className:e.className,onMouseOver:function(){return r(!0)},onMouseLeave:function(){return r(!1)}},{children:e.children(n)}))}function Zn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-pencil"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"44",d:"M358.62 129.28L86.49 402.08 70 442l39.92-16.49 272.8-272.13-24.1-24.1zM413.07 74.84l-11.79 11.78 24.1 24.1 11.79-11.79a16.51 16.51 0 000-23.34l-.75-.75a16.51 16.51 0 00-23.35 0z"})}))}function Qn(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-close-outline"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}))}function er(){return y.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-checkmark-outline"},{children:y.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128L192 384l-96-96"})}))}export{on as BaseDatatable,Ln as OmitColumn,zn as useClientSide,qn as useDatatable,Sn as usePagination,Fn as useSelectable,xn as useSortable}; diff --git a/build/index.js b/build/index.js index 18c8695..10a32b6 100644 --- a/build/index.js +++ b/build/index.js @@ -7,4 +7,4 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */"production"===process.env.NODE_ENV?f.exports=function(){if(u)return d;u=1;var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var l,s={},c=null,u=null;for(l in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,l)&&!a.hasOwnProperty(l)&&(s[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===s[l]&&(s[l]=t[l]);return{$$typeof:n,type:e,key:c,ref:u,props:s,_owner:i.current}}return d.Fragment=r,d.jsx=l,d.jsxs=l,d}():f.exports=(p||(p=1,"production"!==process.env.NODE_ENV&&function(){var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),v=Symbol.iterator,g="@@iterator",y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=1&&u>=0&&l[c]!==s[u];)u--;for(;c>=1&&u>=0;c--,u--)if(l[c]!==s[u]){if(1!==c||1!==u)do{if(c--,--u<0||l[c]!==s[u]){var f="\n"+l[c].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),"function"==typeof e&&B.set(e,f),f}}while(c>=1&&u>=0);break}}}finally{V=!1,z.current=o,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:R}),info:D({},e,{value:C}),warn:D({},e,{value:P}),error:D({},e,{value:F}),group:D({},e,{value:A}),groupCollapsed:D({},e,{value:T}),groupEnd:D({},e,{value:L})})}M<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var d=e?e.displayName||e.name:"",p=d?W(d):"";return"function"==typeof e&&B.set(e,p),p}function q(e,t,n){if(null==e)return"";if("function"==typeof e)return H(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return W(e);switch(e){case u:return W("Suspense");case f:return W("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return H(e.render,!1);case d:return q(e.type,t,n);case p:var o=e,i=o._payload,a=o._init;try{return q(a(i),t,n)}catch(e){}}return""}B=new $;var U=Object.prototype.hasOwnProperty,K={},G=y.ReactDebugCurrentFrame;function Y(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var J=Array.isArray;function X(e){return J(e)}function Z(e){return""+e}function Q(e){if(function(e){try{return Z(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),Z(e)}var ee,te,ne,re=y.ReactCurrentOwner,oe={key:!0,ref:!0,__self:!0,__source:!0};ne={};var ie=function(e,t,r,o,i,a,l){var s={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function ae(e,t,n,r,o){var i,a={},l=null,s=null;for(i in void 0!==n&&(Q(n),l=""+n),function(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Q(t.key),l=""+t.key),function(e){if(U.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&re.current&&t&&re.current.stateNode!==t){var n=O(re.current.type);ne[n]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',O(re.current.type),e.ref),ne[n]=!0)}}(t,o)),t)U.call(t,i)&&!oe.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var c=e.defaultProps;for(i in c)void 0===a[i]&&(a[i]=c[i])}if(l||s){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){ee||(ee=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,u),s&&function(e,t){var n=function(){te||(te=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,u)}return ie(e,l,s,o,r,re.current,a)}var le,se=y.ReactCurrentOwner,ce=y.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);ce.setExtraStackFrame(n)}else ce.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function de(){if(se.current){var e=O(se.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}le=!1;var pe={};function me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=de();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!pe[n]){pe[n]=!0;var r="";e&&e._owner&&e._owner!==se.current&&(r=" It was passed a child from "+O(e._owner.type)+"."),ue(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ue(null)}}}function he(e,t){if("object"==typeof e)if(X(e))for(var n=0;n",N=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,N)}var P=ae(e,t,r,v,g);if(null==P)return P;if(y){var F=t.children;if(void 0!==F)if(m)if(X(F)){for(var A=0;A({x:e,y:e}),w={left:"right",right:"left",bottom:"top",top:"bottom"},S={start:"end",end:"start"};function j(e,t,n){return g(e,v(t,n))}function k(e,t){return"function"==typeof e?e(t):e}function E(e){return e.split("-")[0]}function N(e){return e.split("-")[1]}function O(e){return"x"===e?"y":"x"}function R(e){return"y"===e?"height":"width"}function C(e){return["top","bottom"].includes(E(e))?"y":"x"}function P(e){return O(C(e))}function F(e){return e.replace(/start|end/g,(e=>S[e]))}function A(e){return e.replace(/left|right|bottom|top/g,(e=>w[e]))}function T(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function L(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function D(e,t,n){let{reference:r,floating:o}=e;const i=C(t),a=P(t),l=R(a),s=E(t),c="y"===i,u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(s){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(N(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function M(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=k(t,e),m=T(p),h=l[d?"floating"===f?"reference":"floating":f],v=L(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g="floating"===f?{...a.floating,x:r,y:o}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:s}):g);return{top:(v.top-x.top+m.top)/b.y,bottom:(x.bottom-v.bottom+m.bottom)/b.y,left:(v.left-x.left+m.left)/b.x,right:(x.right-v.right+m.right)/b.x}}const I=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l}=t,{element:s,padding:c=0}=k(e,t)||{};if(null==s)return{};const u=T(c),f={x:n,y:r},d=P(o),p=R(d),m=await a.getDimensions(s),h="y"===d,g=h?"top":"left",y=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[d]-f[d]-i.floating[p],w=f[d]-i.reference[d],S=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s));let E=S?S[b]:0;E&&await(null==a.isElement?void 0:a.isElement(S))||(E=l.floating[b]||i.floating[p]);const O=x/2-w/2,C=E/2-m[p]/2-1,F=v(u[g],C),A=v(u[y],C),L=F,D=E-m[p]-A,M=E/2-m[p]/2+O,I=j(L,M,D),_=null!=N(o)&&M!=I&&i.reference[p]/2-(Me+"-"+o)),t&&(i=i.concat(i.map(F)))),i}(a,m,p,y));const x=[a,...b],w=await M(t,h),S=[];let j=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&S.push(w[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=N(e),o=P(e),i=R(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=A(a)),[a,A(a)]}(r,i,y);S.push(w[e[0]],w[e[1]])}if(j=[...j,{placement:r,overflows:S}],!S.every((e=>e<=0))){var O,C;const e=((null==(O=o.flip)?void 0:O.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(C=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(d){case"bestFit":{var T;const e=null==(T=j.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const z=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=E(n),l=N(n),s="y"===C(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f=k(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),s?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},W=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=k(e,t),c={x:n,y:r},u=await M(t,s),f=C(E(o)),d=O(f);let p=c[d],m=c[f];if(i){const e="y"===d?"bottom":"right";p=j(p+u["y"===d?"top":"left"],p,p-u[e])}if(a){const e="y"===f?"bottom":"right";m=j(m+u["y"===f?"top":"left"],m,m-u[e])}const h=l.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}};function B(e){return H(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $(e){var t;return null==(t=(H(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function H(e){return e instanceof Node||e instanceof V(e).Node}function q(e){return e instanceof Element||e instanceof V(e).Element}function U(e){return e instanceof HTMLElement||e instanceof V(e).HTMLElement}function K(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof V(e).ShadowRoot)}function G(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Y(e){return["table","td","th"].includes(B(e))}function J(e){const t=X(),n=Q(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function X(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Z(e){return["html","body","#document"].includes(B(e))}function Q(e){return V(e).getComputedStyle(e)}function ee(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function te(e){if("html"===B(e))return e;const t=e.assignedSlot||e.parentNode||K(e)&&e.host||$(e);return K(t)?t.host:t}function ne(e){const t=te(e);return Z(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&G(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=V(r);return o?t.concat(i,i.visualViewport||[],G(r)?r:[]):t.concat(r,re(r))}function oe(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=U(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=y(n)!==i||y(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function ie(e){return q(e)?e:e.contextElement}function ae(e){const t=ie(e);if(!U(t))return x(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=oe(t);let a=(i?y(n.width):n.width)/r,l=(i?y(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const le=x(0);function se(e){const t=V(e);return X()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:le}function ce(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ie(e);let a=x(1);t&&(r?q(r)&&(a=ae(r)):a=ae(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==V(e))&&t}(i,n,r)?se(i):x(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const e=V(i),t=r&&q(r)?V(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ae(n),t=n.getBoundingClientRect(),r=Q(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,f*=e.y,s+=o,c+=i,n=V(n).frameElement}}return L({width:u,height:f,x:s,y:c})}function ue(e){return ce($(e)).left+ee(e).scrollLeft}function fe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=V(e),r=$(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=X();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=$(e),n=ee(e),r=e.ownerDocument.body,o=g(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=g(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ue(e);const l=-n.scrollTop;return"rtl"===Q(r).direction&&(a+=g(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}($(e));else if(q(t))r=function(e,t){const n=ce(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=U(e)?ae(e):x(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=se(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return L(r)}function de(e,t){const n=te(e);return!(n===t||!q(n)||Z(n))&&("fixed"===Q(n).position||de(n,t))}function pe(e,t,n){const r=U(t),o=$(t),i="fixed"===n,a=ce(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=x(0);if(r||!r&&!i)if(("body"!==B(t)||G(o))&&(l=ee(t)),r){const e=ce(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ue(o));return{x:a.left+l.scrollLeft-s.x,y:a.top+l.scrollTop-s.y,width:a.width,height:a.height}}function me(e,t){return U(e)&&"fixed"!==Q(e).position?t?t(e):e.offsetParent:null}function he(e,t){const n=V(e);if(!U(e))return n;let r=me(e,t);for(;r&&Y(r)&&"static"===Q(r).position;)r=me(r,t);return r&&("html"===B(r)||"body"===B(r)&&"static"===Q(r).position&&!J(r))?n:r||function(e){let t=te(e);for(;U(t)&&!Z(t);){if(J(t))return t;t=te(t)}return null}(e)||n}const ve={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=U(n),i=$(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},l=x(1);const s=x(0);if((o||!o&&"fixed"!==r)&&(("body"!==B(n)||G(i))&&(a=ee(n)),U(n))){const e=ce(n);l=ae(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+s.x,y:t.y*l.y-a.scrollTop*l.y+s.y}},getDocumentElement:$,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=re(e).filter((e=>q(e)&&"body"!==B(e))),o=null;const i="fixed"===Q(e).position;let a=i?te(e):e;for(;q(a)&&!Z(a);){const t=Q(a),n=J(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||G(a)&&!n&&de(e,a))?r=r.filter((e=>e!==a)):o=t,a=te(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],l=i.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=g(r.top,e.top),e.right=v(r.right,e.right),e.bottom=v(r.bottom,e.bottom),e.left=g(r.left,e.left),e}),fe(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:he,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||he,i=this.getDimensions;return{reference:pe(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return oe(e)},getScale:ae,isElement:q,isRTL:function(e){return"rtl"===Q(e).direction}};function ge(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ie(e),u=o||i?[...c?re(c):[],...re(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&l?function(e,t){let n,r=null;const o=$(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(l||t(),!f||!d)return;const p={rootMargin:-b(u)+"px "+-b(o.clientWidth-(c+f))+"px "+-b(o.clientHeight-(u+d))+"px "+-b(c)+"px",threshold:g(0,v(1,s))||1};let m=!0;function h(e){const t=e[0].intersectionRatio;if(t!==s){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}m=!1}try{r=new IntersectionObserver(h,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,p)}r.observe(e)}(!0),i}(c,n):null;let d,p=-1,m=null;a&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{m&&m.observe(t)}))),n()})),c&&!s&&m.observe(c),m.observe(t));let h=s?ce(e):null;return s&&function t(){const r=ce(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),m&&m.disconnect(),m=null,s&&cancelAnimationFrame(d)}}const ye=(e,t,n)=>{const r=new Map,o={platform:ve,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=D(c,r,s),d=r,p={},m=0;for(let n=0;n({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?I({element:n.current,padding:r}).fn(t):{}:n?I({element:n,padding:r}).fn(t):{};var o}});var xe="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function we(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!we(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!we(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Se(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function je(e,t){const n=Se(e);return Math.round(t*n)/n}function ke(e){const t=r.useRef(e);return xe((()=>{t.current=e})),t}var Ee=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ne=new WeakMap,Oe=new WeakMap,Re={},Ce=0,Pe=function(e){return e&&(e.host||Pe(e.parentNode))},Fe=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Pe(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Re[n]||(Re[n]=new WeakMap);var i=Re[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))u(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(Ne.get(e)||0)+1,c=(i.get(e)||0)+1;Ne.set(e,s),i.set(e,c),a.push(e),1===s&&o&&Oe.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return u(t),l.clear(),Ce++,function(){a.forEach((function(e){var t=Ne.get(e)-1,o=i.get(e)-1;Ne.set(e,t),i.set(e,o),t||(Oe.has(e)||e.removeAttribute(r),Oe.delete(e)),o||e.removeAttribute(n)})),--Ce||(Ne=new WeakMap,Ne=new WeakMap,Oe=new WeakMap,Re={})}},Ae=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Ee(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Fe(r,o,n,"aria-hidden")):function(){return null}},Te=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||Ee(e);return r?Fe(e,r,n,"inert"):function(){return null}},Le=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},De=function(e,t,n){return void 0===n&&(n="data-suppressed"),(Le()?Te:Ae)(e,t,n)},Me=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Ie="undefined"==typeof Element,_e=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ze=!Ie&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},We=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Be=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!We(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),s=e(l.length?l:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{_e.call(a,Me)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!We(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&u){var f=e(!0===c?a.children:c.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return o},Ve=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},$e=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ve(e)?0:e.tabIndex},He=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},qe=function(e){return"INPUT"===e.tagName},Ue=function(e){return function(e){return qe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ze(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(_e.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,l=ze(e);if(a&&!a.shadowRoot&&!0===r(a))return Ke(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,r,o,i=e&&ze(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&a;){var s,c,u;l=!(null===(c=a=null===(s=i=ze(a))||void 0===s?void 0:s.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ye=function(e,t){return!(t.disabled||We(t)||function(e){return qe(e)&&"hidden"===e.type}(t)||Ge(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},Ze=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=$e(e);return n<0&&t&&!Ve(e)?0:n}(a,i),s=i?e(t.candidates):a;0===l?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:s})})),r.sort(He).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Qe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Be([e],t.includeContainer,{filter:Je.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Xe}):function(e,t,n){if(We(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Me));return t&&_e.call(e,Me)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Je.bind(null,t)),Ze(n)};function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+rt++;const it=r["useId".toString()]||function(){const[e,t]=r.useState((()=>nt?ot():void 0));return tt((()=>{null==e&&t(ot())}),[]),r.useEffect((()=>{nt||(nt=!0)}),[]),e},at=r.forwardRef((function(e,t){let{context:{placement:n,elements:{floating:o},middlewareData:{arrow:i}},width:a=14,height:l=7,tipRadius:s=0,strokeWidth:c=0,staticOffset:u,stroke:f,d:d,style:{transform:p,...m}={},...h}=e;"production"!==process.env.NODE_ENV&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=it();if(!o)return null;c*=2;const g=c/2,y=a/2*(s/-8+1),b=l/2*s/4,[x,w]=n.split("-"),S=ve.isRTL(o),j=!!d,k="top"===x||"bottom"===x,E=u&&"end"===w?"bottom":"top";let N=u&&"end"===w?"right":"left";u&&S&&(N="end"===w?"left":"right");const O=null!=(null==i?void 0:i.x)?u||i.x:"",R=null!=(null==i?void 0:i.y)?u||i.y:"",C=d||"M0,0 H"+a+" L"+(a-y)+","+(l-b)+" Q"+a/2+","+l+" "+y+","+(l-b)+" Z",P={top:j?"rotate(180deg)":"",left:j?"rotate(90deg)":"rotate(-90deg)",bottom:j?"":"rotate(180deg)",right:j?"rotate(-90deg)":"rotate(90deg)"}[x];return r.createElement("svg",et({},h,{"aria-hidden":!0,ref:t,width:j?a:a+c,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[N]:O,[E]:R,[x]:k||j?"100%":"calc(100% - "+c/2+"px)",transform:""+P+(null!=p?p:""),...m}}),c>0&&r.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:c+(d?0:1),d:C}),r.createElement("path",{stroke:c&&!d?h.fill:"none",d:C}),r.createElement("clipPath",{id:v},r.createElement("rect",{x:-g,y:g*(j?-1:1),width:a+c,height:a})))}));const lt=r.createContext(null),st=r.createContext(null),ct=()=>{var e;return(null==(e=r.useContext(lt))?void 0:e.id)||null},ut=()=>r.useContext(st);function ft(e){return(null==e?void 0:e.ownerDocument)||document}function dt(e){return ft(e).defaultView||window}function pt(e){return!!e&&(e instanceof Element||e instanceof dt(e).Element)}function mt(e){return!!e&&(e instanceof HTMLElement||e instanceof dt(e).HTMLElement)}function ht(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function vt(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function gt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof dt(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function bt(e){return"data-floating-ui-"+e}function xt(t){const n=e.useRef(t);return tt((()=>{n.current=t})),n}function wt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let St=0;function jt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(St);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():St=requestAnimationFrame(i)}function kt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function Et(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Nt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ot(e){return mt(e)&&e.matches(Nt)}function Rt(e){e.preventDefault(),e.stopPropagation()}const Ct=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Pt(e,t){const n=Qe(e,Ct());"prev"===t&&n.reverse();const r=n.indexOf(wt(ft(e)));return n.slice(r+1)[0]}function Ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!yt(n,r)}const At={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Tt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Lt=r.forwardRef((function(e,t){const[n,o]=r.useState();tt((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Tt),()=>{document.removeEventListener("keydown",Tt)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[bt("focus-guard")]:"",style:At};return r.createElement("span",et({},e,i))})),Dt=r.createContext(null),Mt=()=>r.useContext(Dt),It=r.forwardRef((function(e,t){return r.createElement("button",et({},e,{type:"button",ref:t,tabIndex:-1,style:At}))}));function _t(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:a=!0,initialFocus:l=0,returnFocus:s=!0,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:p,nodeId:m,onOpenChange:h,events:v,dataRef:g,elements:{domReference:y,floating:b}}=t,x=!Le()||a,w=xt(i),S=xt(l),j=xt(s),k=ut(),E=Mt(),N="number"==typeof l&&l<0,O=r.useRef(null),R=r.useRef(null),C=r.useRef(!1),P=r.useRef(null),F=r.useRef(!1),A=null!=E,T=y&&"combobox"===y.getAttribute("role")&&Ot(y),L=r.useCallback((function(e){return void 0===e&&(e=b),e?Qe(e,Ct()):[]}),[b]),D=r.useCallback((e=>{const t=L(e);return w.current.map((e=>y&&"reference"===e?y:b&&"floating"===e?b:t)).filter(Boolean).flat()}),[y,b,w,L]);function M(e){return!o&&u&&c?r.createElement(It,{ref:"start"===e?O:R,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}r.useEffect((()=>{if(o||!c)return;function e(e){if("Tab"===e.key){yt(b,wt(ft(b)))&&0===L().length&&!T&&Rt(e);const t=D(),n=Et(e);"reference"===w.current[0]&&n===y&&(Rt(e),e.shiftKey?jt(t[t.length-1]):jt(t[1])),"floating"===w.current[1]&&n===b&&e.shiftKey&&(Rt(e),jt(t[0]))}}const t=ft(b);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,y,b,c,w,p,T,L,D]),r.useEffect((()=>{if(!o&&f)return b&&mt(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),!c&&b.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),!c&&b.removeEventListener("focusout",t)}):void 0;function e(){F.current=!0,setTimeout((()=>{F.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(yt(y,t)||yt(b,t)||yt(t,b)||yt(null==E?void 0:E.portalNode,t)||null!=t&&t.hasAttribute(bt("focus-guard"))||k&&(kt(k.nodesRef.current,m).find((e=>{var n,r;return yt(null==(n=e.context)?void 0:n.elements.floating,t)||yt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!F.current&&t!==P.current&&(C.current=!0,h(!1,e))}))}}),[o,y,b,c,m,k,E,h,f]),r.useEffect((()=>{var e;if(o)return;const t=Array.from((null==E||null==(e=E.portalNode)?void 0:e.querySelectorAll("["+bt("portal")+"]"))||[]);if(b&&c){const e=[b,...t,O.current,R.current].filter((e=>null!=e)),n=(x?Ae:De)(w.current.includes("reference")||T?e.concat(y||[]):e,void 0,bt("inert"));return()=>{n()}}}),[o,y,b,c,w,E,T,x]),tt((()=>{if(o||!b)return;const e=wt(ft(b));queueMicrotask((()=>{const t=D(b),n=S.current,r=("number"==typeof n?t[n]:n.current)||b,o=yt(b,e);N||o||!d||jt(r,{preventScroll:r===b})}))}),[o,d,b,N,D,S]),tt((()=>{if(o||!b)return;let e=!1;const t=ft(b),n=wt(t),r=g.current;function i(t){if("escapeKey"===t.type&&p.domReference.current&&(P.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(C.current=!1,e=n.preventScroll):C.current=!n}return P.current=n,v.on("dismiss",i),()=>{v.off("dismiss",i);const n=wt(t);(yt(b,n)||k&&kt(k.nodesRef.current,m).some((e=>{var t;return yt(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&p.domReference.current&&(P.current=p.domReference.current),j.current&&mt(P.current)&&!C.current&&jt(P.current,{cancelPrevious:!1,preventScroll:e})}}),[o,b,j,g,p,v,k,m]),tt((()=>{if(!o&&E)return E.setFocusManagerState({...t,modal:c,closeOnFocusOut:f,open:d}),()=>{E.setFocusManagerState(null)}}),[o,E,c,d,f,t]),tt((()=>{if(!o&&b&&"function"==typeof MutationObserver){const e=()=>{const e=b.getAttribute("tabindex");w.current.includes("floating")||wt(ft(b))!==p.domReference.current&&0===L().length?"0"!==e&&b.setAttribute("tabindex","0"):"-1"!==e&&b.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[o,b,p,w,L]);const I=!o&&x&&!T&&(A||c);return r.createElement(r.Fragment,null,I&&r.createElement(Lt,{"data-type":"inside",ref:null==E?void 0:E.beforeInsideRef,onFocus:e=>{if(c){const e=D();jt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=E&&E.preserveTabOrder&&E.portalNode)if(C.current=!1,Ft(e,E.portalNode)){const e=Pt(document.body,"next")||y;null==e||e.focus()}else{var t;null==(t=E.beforeOutsideRef.current)||t.focus()}}}),!T&&M("start"),n,M("end"),I&&r.createElement(Lt,{"data-type":"inside",ref:null==E?void 0:E.afterInsideRef,onFocus:e=>{if(c)jt(D()[0]);else if(null!=E&&E.preserveTabOrder&&E.portalNode)if(f&&(C.current=!0),Ft(e,E.portalNode)){const e=Pt(document.body,"prev")||y;null==e||e.focus()}else{var t;null==(t=E.afterOutsideRef.current)||t.focus()}}}))}function zt(e){return mt(e.target)&&"BUTTON"===e.target.tagName}function Wt(e){return Ot(e)}function Bt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:a}}=e,{enabled:l=!0,event:s="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,d=r.useRef(),p=r.useRef(!1);return r.useMemo((()=>l?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(gt(d.current,!0)&&u||"click"!==s&&(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent)):o(!1,e.nativeEvent)))},onClick(e){"mousedown"===s&&d.current?d.current=void 0:gt(d.current,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent):o(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||zt(e)||(" "!==e.key||Wt(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&o(!n||!c,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||zt(e)||Wt(a)||" "===e.key&&p.current&&(p.current=!1,o(!n||!c,e.nativeEvent))}}}:{}),[l,i,s,u,f,a,c,n,o])}const Vt=r["useInsertionEffect".toString()]||(e=>e());function $t(e){const t=r.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Vt((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Gt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,events:i,nodeId:a,elements:{reference:l,domReference:s,floating:c},dataRef:u}=e,{enabled:f=!0,escapeKey:d=!0,outsidePress:p=!0,outsidePressEvent:m="pointerdown",referencePress:h=!1,referencePressEvent:v="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,b=ut(),x=null!=ct(),w=$t("function"==typeof p?p:()=>!1),S="function"==typeof p?w:p,j=r.useRef(!1),{escapeKeyBubbles:k,outsidePressBubbles:E}=Kt(y),N=$t((e=>{if(!n||!f||!d||"Escape"!==e.key)return;const t=b?kt(b.nodesRef.current,a):[];if(!k&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),O=$t((e=>{const t=j.current;if(j.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=Et(e);if(mt(n)&&c){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===dt(c).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=b&&kt(b.nodesRef.current,a).some((t=>{var n;return Ht(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ht(e,c)||Ht(e,s)||r)return;const l=b?kt(b.nodesRef.current,a):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:ht(e)||vt(e)}}),o(!1,e)}));return r.useEffect((()=>{if(!n||!f)return;function e(e){o(!1,e)}u.current.__escapeKeyBubbles=k,u.current.__outsidePressBubbles=E;const t=ft(c);d&&t.addEventListener("keydown",N),S&&t.addEventListener(m,O);let r=[];return g&&(pt(s)&&(r=re(s)),pt(c)&&(r=r.concat(re(c))),!pt(l)&&l&&l.contextElement&&(r=r.concat(re(l.contextElement)))),r=r.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),r.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{d&&t.removeEventListener("keydown",N),S&&t.removeEventListener(m,O),r.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,c,s,l,d,S,m,n,o,g,f,k,E,N,O]),r.useEffect((()=>{j.current=!1}),[S,m]),r.useMemo((()=>f?{reference:{onKeyDown:N,[qt[v]]:e=>{h&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[Ut[m]]:()=>{j.current=!0}}}:{}),[f,i,h,m,v,o,N])}function Yt(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:i,nodeId:a}=e,[l,s]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||l,u=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:l,floating:s}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[d,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=r.useState(i);we(m,i)||h(i);const[v,g]=r.useState(null),[y,b]=r.useState(null),x=r.useCallback((e=>{e!=k.current&&(k.current=e,g(e))}),[g]),w=r.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[b]),S=l||v,j=s||y,k=r.useRef(null),E=r.useRef(null),N=r.useRef(d),O=ke(u),R=ke(a),C=r.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:m};R.current&&(e.platform=R.current),ye(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};P.current&&!we(N.current,t)&&(N.current=t,o.flushSync((()=>{p(t)})))}))}),[m,t,n,R]);xe((()=>{!1===f&&N.current.isPositioned&&(N.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const P=r.useRef(!1);xe((()=>(P.current=!0,()=>{P.current=!1})),[]),xe((()=>{if(S&&(k.current=S),j&&(E.current=j),S&&j){if(O.current)return O.current(S,j,C);C()}}),[S,j,C,O]);const F=r.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),A=r.useMemo((()=>({reference:S,floating:j})),[S,j]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=je(A.floating,d.x),r=je(A.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Se(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,A.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:C,refs:F,elements:A,floatingStyles:T})),[d,C,F,A,T])}(e),f=ut(),d=$t(((e,t)=>{e&&(m.current.openEvent=t),null==i||i(e,t)})),p=r.useRef(null),m=r.useRef({}),h=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],v=it(),g=r.useCallback((e=>{const t=pt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u.refs.setReference(t)}),[u.refs]),y=r.useCallback((e=>{(pt(e)||null===e)&&(p.current=e,s(e)),(pt(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!pt(e))&&u.refs.setReference(e)}),[u.refs]),b=r.useMemo((()=>({...u.refs,setReference:y,setPositionReference:g,domReference:p})),[u.refs,y,g]),x=r.useMemo((()=>({...u.elements,domReference:c})),[u.elements,c]),w=r.useMemo((()=>({...u,refs:b,elements:x,dataRef:m,nodeId:a,floatingId:v,events:h,open:n,onOpenChange:d})),[u,a,v,h,n,d,b,x]);return tt((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===a));e&&(e.context=w)})),r.useMemo((()=>({...u,context:w,refs:b,elements:x})),[u,b,x,w])}function Jt(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function Xt(e){void 0===e&&(e=[]);const t=e,n=r.useCallback((t=>Jt(t,e,"reference")),t),o=r.useCallback((t=>Jt(t,e,"floating")),t),i=r.useCallback((t=>Jt(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return r.useMemo((()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i})),[n,o,i])}function Zt(e,t){void 0===t&&(t={});const{open:n,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=it();return r.useMemo((()=>{const e={id:o,role:a};return i?"tooltip"===a?{reference:{"aria-describedby":n?o:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":n?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l}},floating:{...e,..."menu"===a&&{"aria-labelledby":l}}}:{}}),[i,a,n,o,l])}var Qt=function(e){return e.map((function(e){var t,n,r,o,a,l,s;return i({field:null!==(t=e.field)&&void 0!==t?t:"",columnName:null!==(n=e.columnName)&&void 0!==n?n:en(null!==(r=String(e.field))&&void 0!==r?r:""),sortable:null===(o=e.sortable)||void 0===o||o,datatype:null!==(a=e.datatype)&&void 0!==a?a:"string",omit:null!==(l=e.omit)&&void 0!==l&&l,filterable:null===(s=e.filterable)||void 0===s||s},e)}))},en=function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replaceAll("_"," ").toLowerCase()};function tn(t){var n=t.data,r=t.isFetching,o=t.columns,a=t.onColumnClick,l=t.RowOptionMenu,s=t.AppsPanel,c=t.renderSort,u=t.renderFilter,f=t.Footer,d=t.hideSelect,p=t.SelectHeader,m=t.SelectCell,v=t.NoData,g=t.onRowClick,y=t.showOptionsOnRowClick,b=t.minColumnSize,x=t.columnNameFontSize,w=t.renderCell,S=t.renderHeaderPanel,j=d?0:50,k=50,E=function(t){var n=t.columns,r=t.isFetching,o=t.extraWidth,i=t.minColumnSize,a=t.columnNameFontSize,l=e.useRef(null),s=e.useState(0),c=s[0],u=s[1],f=n.reduce((function(e,t){return t.width&&!t.omit?{width:e.width+t.width,columns:e.columns+1}:e}),{width:0,columns:0}),d=n.reduce((function(e,t){return t.omit?e:e+1}),0),p=n.reduceRight((function(e,t){return null===e?null:t.omit?e:t.width?e||t.field:null}),!1);return e.useLayoutEffect((function(){if(l.current){var e=l.current;u(e.clientWidth);var t=new ResizeObserver((function(){return u((function(t){return t>0&&r?t:e.clientWidth}))}));return t.observe(e),function(){t.disconnect()}}}),[l.current,r,n]),{containerRef:l,getWidth:function(e){var t=e.columnName.length*((null!=a?a:16)/2),n=Math.pow(e.columnName.length,1.1)-e.columnName.length,r=i||(a?t+1-(n<3?0:n)+40+16+16:150);return p===e.field&&e.width?Math.max((c-(o+f.width-e.width))/Math.max(d-f.columns-1,1),r):e.width?e.width:Math.max((c-(o+f.width))/Math.max(d-f.columns,1),r)}}}({columns:o,isFetching:r,extraWidth:j+k,minColumnSize:b,columnNameFontSize:x});return h.jsxs("div",i({className:"myers-datatable"},{children:[S&&S(o,n),h.jsxs("div",i({ref:E.containerRef,className:"table-scroll-container"},{children:[h.jsxs("div",i({className:"table-header-row table-row"},{children:[h.jsx("div",i({className:"table-cell table-header-cell apps-button-header-cell",style:{width:k,minWidth:k,maxWidth:k}},{children:s&&h.jsx(mn,i({Icon:un,mainAxisOffset:20,crossAxisOffset:10,placement:"bottom-end",className:"app-panel-button"},{children:s}))})),!d&&!!p&&h.jsx(ln,i({className:"select-header-cell",column:{field:"_selectable",datatype:"string",columnName:"",sortable:!1,omit:!1,filterable:!1},width:j},{children:h.jsx(p,{})})),o.map((function(e){return h.jsx(ln,i({column:e,onClick:a,className:"".concat(e.sortable?"sortable-table-header":""," ").concat(e.omit?"hide":""),width:E.getWidth(e)},{children:h.jsxs("div",i({className:"column-header-options"},{children:[e.sortable&&c&&c(e),e.filterable&&u&&u(e,nn)]}))}),String(e.field))}))]})),n.map((function(e,t){return h.jsx(hn,i({crossAxisOffset:0,placement:"right-start",PopUp:l?h.jsx(l,{row:e,rowIndex:t}):null,useCursorOffset:!!y},{children:function(n){return h.jsxs("div",i({className:"table-row ".concat(g||y?"table-row-clickable":""),onClick:function(t){g&&g(e,t),y&&n.onClick(t)}},{children:[r&&h.jsx("div",i({className:"spinner-container"},{children:h.jsxs("div",i({className:"spinner-wrapper"},{children:[h.jsx("div",{className:"spinner"}),h.jsx("span",i({className:"spinner-loading-text"},{children:"Loading"}))]}))})),h.jsx("div",i({className:"table-cell",style:{width:k,minWidth:k,maxWidth:k}},{children:l&&h.jsx("button",i({},n,{onClick:function(e){e.stopPropagation(),n.onClick(e)}},{children:h.jsx(fn,{})}))})),!d&&!!m&&h.jsx("div",i({className:"table-cell",style:{width:j,minWidth:j,maxWidth:j}},{children:h.jsx(m,{index:t,row:e})})),o.map((function(t,n){return h.jsx(rn,{column:t,row:e,width:E.getWidth(t),renderCell:w},n)}))]}))}}),t)})),0===n.length&&!r&&(v||h.jsx(vn,{}))]})),f]}))}function nn(e){var t=e.children,n=e.hasFilter;return h.jsx("div",i({className:"filter-options-button"},{children:h.jsx(mn,i({Icon:n?pn:dn,mainAxisOffset:20,crossAxisOffset:0,placement:"bottom-end"},{children:t}))}))}var rn=function(e){var t=e.column,n=e.row,r=e.width,o=e.renderCell,a=void 0!==n[t.field]?String(n[t.field]):void 0,l={width:r,minWidth:r,maxWidth:r};return t.renderCell?h.jsx("div",i({className:"table-cell ".concat(t.omit?"hide":""),title:a,style:l},{children:o?o(t,n,t.renderCell(n[t.field],t,n)):t.renderCell(n[t.field],t,n)})):"paragraph"===t.datatype?h.jsx(an,{column:t,row:n,title:a,text:n[t.field],style:l,renderCell:o}):h.jsx("div",i({className:"table-cell ".concat(t.omit?"hide":""),title:a,style:l},{children:o?o(t,n,on(n[t.field],t)):on(n[t.field],t)}))},on=function(e,t){if(null==e)return h.jsx("span",{className:"text-wrapper"});if("name"===t.datatype)return h.jsx("span",i({className:"cell-datatype-name text-wrapper"},{children:e}));if("link"===t.datatype)return h.jsx("a",i({className:"text-wrapper",href:e,target:"_blank",rel:"noreferrer"},{children:new URL(e).hostname}));if("email"===t.datatype)return h.jsx("a",i({className:"text-wrapper",href:"mailto:".concat(e),target:"_blank",rel:"noreferrer"},{children:e}));if("date"===t.datatype)return h.jsx("span",i({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric"}):""}));if("datetime"===t.datatype)return h.jsx("span",i({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}));if("boolean"===t.datatype)return h.jsx(h.Fragment,{children:JSON.parse(e)?h.jsx(sn,{}):h.jsx(cn,{})});if("phone"===t.datatype){var n={code:!1,number:e},r=e.split(" ");r.length>1&&(n.code=r[0],n.number=r[1]);var o=n.number.slice(0,3)+"-"+n.number.slice(3,6)+"-"+n.number.slice(6);return n.code?h.jsx("span",i({className:"text-wrapper"},{children:"".concat(n.code," ").concat(o)})):h.jsx("span",i({className:"text-wrapper"},{children:o}))}return"image"===t.datatype?h.jsx("a",i({href:e,target:"_blank",rel:"noreferrer"},{children:h.jsx("img",{alt:"row",className:"cell-datatype-image",src:e})})):h.jsx("span",i({className:"text-wrapper"},{children:e}))},an=function(t){var n=t.text,r=t.title,o=t.column,a=t.row,l=t.style,s=t.renderCell,c=e.useState(!1),u=c[0],f=c[1];return h.jsx("div",i({className:"table-cell cell-datatype-paragraph ".concat(o.omit?"hide":""," ").concat(u?"cell-datatype-paragraph-open":"cell-datatype-paragraph-closed"),title:r,onClick:function(e){e.stopPropagation(),f((function(e){return!e}))},style:l},{children:s?s(o,a,h.jsx("span",i({className:"text-wrapper"},{children:n}))):h.jsx("span",i({className:"text-wrapper"},{children:n}))}))},ln=function(e){var t=e.column,n=e.children,r=e.className,o=void 0===r?"":r,a=e.onClick,l=e.width;return h.jsx("div",i({className:"table-cell table-header-cell ".concat(o),onClick:function(){return a&&a(t)},title:t.columnName,style:{width:l,minWidth:l,maxWidth:l}},{children:h.jsxs("div",i({className:"table-header-children-container"},{children:[!!t.columnName&&h.jsx("span",i({className:"table-header-column-name"},{children:t.columnName})),n]}))}),t.columnName)};function sn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-true-svg"},{children:h.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})}))}function cn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-false-svg"},{children:h.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 11-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 01-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0122.62-22.62L256 233.37l52.69-52.68a16 16 0 0122.62 22.62L278.63 256z"})}))}function un(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-apps"},{children:h.jsx("path",{d:"M104 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 464a56 56 0 1156-56 56.06 56.06 0 01-56 56z"})}))}function fn(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"options-svg io-ellipsis"},{children:[h.jsx("circle",{cx:"256",cy:"256",r:"48"}),h.jsx("circle",{cx:"256",cy:"416",r:"48"}),h.jsx("circle",{cx:"256",cy:"96",r:"48"})]}))}function dn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-menu"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"48",d:"M88 152h336M88 256h336M88 360h336"})}))}function pn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-funnel"},{children:h.jsx("path",{d:"M296 464a23.88 23.88 0 01-7.55-1.23L208.3 436.1a23.92 23.92 0 01-16.3-22.78V294.11a.44.44 0 00-.09-.13L23.26 97.54A30 30 0 0146.05 48H466a30 30 0 0122.79 49.54L320.09 294a.77.77 0 00-.09.13V440a23.93 23.93 0 01-24 24z"})}))}function mn(t){var n=t.Icon,r=t.children,o=t.mainAxisOffset,a=t.crossAxisOffset,l=t.placement,s=t.className,c=e.useRef(null),u=e.useState(!1),f=u[0],d=Yt({open:f,onOpenChange:u[1],whileElementsMounted:ge,placement:l,middleware:[be({element:c,padding:16}),z({mainAxis:o,crossAxis:a}),_(),W()]}),p=d.refs,m=d.floatingStyles,v=d.context,g=Xt([Bt(v),Gt(v),Zt(v)]),y=g.getReferenceProps,b=g.getFloatingProps,x=y();return h.jsxs(h.Fragment,{children:[h.jsx("button",i({type:"button",ref:p.setReference},x,{className:"icon-button ".concat(null!=s?s:""),onClick:function(e){e.stopPropagation(),x.onClick(e)}},{children:h.jsx(n,{})})),f&&h.jsx(_t,i({context:v,modal:!1},{children:h.jsxs("div",i({ref:p.setFloating,style:m,className:"popup-floating-container"},b(),{children:[h.jsx(at,{ref:c,context:v,className:"popup-floating-arrow"}),h.jsx("div",i({className:"popup-container"},{children:r}))]}))}))]})}function hn(t){var n=t.children,r=t.PopUp,o=t.crossAxisOffset,a=t.placement,l=t.className,s=t.useCursorOffset,c=e.useRef(null),u=e.useState(!1),f=u[0],d=u[1],p=e.useState(s?0:10),m=p[0],v=p[1],g=Yt({open:f,onOpenChange:d,placement:a,middleware:[be({element:c,padding:16}),z({mainAxis:m,crossAxis:o}),_()]}),y=g.refs,b=g.floatingStyles,x=g.context,w=Xt([Bt(x),Gt(x),Zt(x)]),S=w.getReferenceProps,j=w.getFloatingProps,k=S(),E=i(i({type:"button",ref:y.setReference},k),{className:"icon-button ".concat(null!=l?l:""),onClick:function(e){if(e.stopPropagation(),s){var t=e.nativeEvent.clientX-e.currentTarget.getBoundingClientRect().left;v(t)}k.onClick(e)}});return h.jsxs(h.Fragment,{children:[n(E),f&&h.jsx(_t,i({context:x,modal:!1},{children:h.jsxs("div",i({ref:y.setFloating,style:b},j(),{className:"popup-floating-container"},{children:[h.jsx(at,{ref:c,context:x,className:"popup-floating-arrow"}),h.jsx("div",i({className:"popup-container"},{children:r}))]}))}))]})}function vn(){return h.jsx("p",i({className:"no-items-to-display"},{children:"No items to display."}))}function gn(t){var n=t.onChange,r=t.initialSortOrder,o=void 0===r?{}:r,a=e.useState(!1),l=a[0],s=a[1],c=e.useState(o),u=c[0],f=c[1];e.useEffect((function(){var e=function(e){return s(e.shiftKey)};return window.addEventListener("keyup",e),window.addEventListener("keydown",e),function(){window.removeEventListener("keyup",e),window.removeEventListener("keydown",e)}}),[]),e.useEffect((function(){n(u)}),[]);return{sortOrder:u,Sort:yn,onSort:l?function(e){var t,r=i({},u),o=Object.entries(r).reduce((function(t,n){var r=n[0],o=n[1];return r===e.field||o.orderIndex>t?t:o.orderIndex+1}),1);r[e.field]={sortDirection:"asc"===(null===(t=u[e.field])||void 0===t?void 0:t.sortDirection)?"desc":"asc",orderIndex:o},f(r),n(r)}:function(e){var t,r={};r[e.field]={sortDirection:"asc"===(null===(t=u[e.field])||void 0===t?void 0:t.sortDirection)?"desc":"asc",orderIndex:1},f(r),n(r)},reset:function(e){var t=null!=e?e:o;return s(!1),f(t),t}}}var yn=function(e){var t=e.column,n=e.sortDirection,r=e.orderIndex,o=e.isMultiSort;return t.sortable?h.jsxs("div",i({className:"sortable-caret-container"},{children:[void 0===r?null:o&&r,r&&h.jsx(h.Fragment,{children:"asc"===n?h.jsx(xn,{}):h.jsx(bn,{})})]})):null},bn=function(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:h.jsx("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"})}))},xn=function(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:h.jsx("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"})}))};function wn(t){var n=t.onChange,r=t.initialPage,o=t.defaultPage,a=t.numberOfRows,l=t.count,s=e.useState(null!=r?r:o),c=s[0],u=s[1],f=Math.ceil(l/c.currentRowsPerPage),d=function(e){return u((function(t){var r=e(t);return n(r),r}))};e.useEffect((function(){n(c)}),[]);return{page:c,count:l,numberOfRows:a,Pagination:Sn,firstPage:function(){return d((function(e){return i(i({},e),{currentPage:1})}))},lastPage:function(){return d((function(e){return i(i({},e),{currentPage:f})}))},nextPage:function(){return d((function(e){return i(i({},e),{currentPage:Math.min(e.currentPage+1,f)})}))},previousPage:function(){return d((function(e){return i(i({},e),{currentPage:Math.max(e.currentPage-1,1)})}))},goToPage:function(e){},onChangeRowsPerPage:function(e){return d((function(t){return i(i({},t),{currentRowsPerPage:e})}))},reset:function(e,t){var n,i=t?o:null!==(n=null!=e?e:r)&&void 0!==n?n:o;return u(i),i}}}var Sn=function(t){var n=t.page,r=t.count,o=t.numberOfRows,a=t.firstPage,l=t.lastPage,s=t.nextPage,c=t.previousPage;t.goToPage;var u=t.onChangeRowsPerPage,f=n.currentPage,d=n.currentRowsPerPage,p=n.rowsPerPage,m=e.useId(),v=f*d-d;return h.jsxs("div",i({className:"pagination-container"},{children:[h.jsxs("div",i({className:"pagination-rpp-container"},{children:[h.jsx("label",i({htmlFor:"rows-per-page-".concat(m)},{children:"Rows per page:"})),h.jsx("select",i({id:"rows-per-page-".concat(m),value:d,onChange:function(e){return u(Number(e.target.value))},className:"pagination-select-input"},{children:p.map((function(e){return h.jsx("option",i({value:e},{children:e}),"rows-per-page-".concat(e))}))})),0===r&&h.jsx("span",{children:"0-0 of 0"}),r>0&&h.jsxs("span",{children:[v+1,"-",o+v," of ",r]})]})),h.jsxs("div",i({className:"pagination-icon-button-container"},{children:[h.jsx(jn,{onClick:a,SVG:kn}),h.jsx(jn,{onClick:c,SVG:Nn}),h.jsx(jn,{onClick:s,SVG:On}),h.jsx(jn,{onClick:l,SVG:En})]}))]}))},jn=function(e){var t=e.onClick,n=e.SVG;return h.jsx("button",i({onClick:t,className:"pagination-icon-button",type:"button"},{children:h.jsx(n,{})}))},kn=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),h.jsx("path",{fill:"none",d:"M24 24H0V0h24v24z"})]}))},En=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),h.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"})]}))},Nn=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))},On=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))};function Rn(t){var n=t.numberOfRows,r=t.onChange,o=e.useState(!1),i=o[0],a=o[1],l=e.useState([]),s=l[0],u=l[1],f=e.useState([]),d=f[0],p=f[1],m=function(e){a(e);var t=e?new Array(n).fill(0).flatMap((function(e,t){return d.includes(t)?[]:t})):[];u(t)};e.useEffect((function(){r({isAllSelected:i,selectedRows:s})}),[i,s]);return{Header:Cn,Row:Pn,selectAll:m,selectedRows:s,onSelectRow:function(e,t){u((function(n){return e?c(c([],n,!0),[t],!1):n.filter((function(e){return e!==t}))})),i&&a(!1)},isAllSelected:i,onDisableRow:function(e,t){p((function(n){var r=n.findIndex((function(e){return e===t})),o=c([],n,!0);return r>-1&&!e?(o.splice(r,1),o):-1===r&&e?(o.push(t),o):n}))},reset:function(){return m(!1),!1}}}function Cn(e){var t=e.selectAll,n=e.isAllSelected;return h.jsx("input",{className:"select-header-checkbox",type:"checkbox",checked:n,onChange:function(e){return t(e.target.checked)}})}function Pn(e){var t=e.index,n=e.disabled,r=e.checked,o=e.onChange;return h.jsx("input",{checked:r,onClick:function(e){return e.stopPropagation()},onChange:function(e){return o(e.target.checked,t)},disabled:n,type:"checkbox"})}function Fn(t){var n=t.columns,r=t.setColumns,o=e.useId(),a=!!n.find((function(e){return e.omit}));return h.jsxs("div",i({className:"omit-column-container"},{children:[h.jsx("span",i({className:"omit-column-title"},{children:"Columns"})),h.jsxs("div",i({className:"omit-column-list"},{children:[h.jsxs("div",i({className:"omit-column-list-item-container"},{children:[h.jsx("input",{type:"checkbox",id:"omit-column-list-item-".concat(o,"-all"),checked:!a,onChange:function(){return r((function(e){return e.map((function(e){return i(i({},e),{omit:!a})}))}))}}),h.jsx("label",i({htmlFor:"omit-column-list-item-".concat(o,"-all"),className:"omit-column-label"},{children:"(Select All)"}))]})),n.map((function(e){return h.jsxs("div",i({className:"omit-column-list-item-container"},{children:[h.jsx("input",{id:"omit-column-list-item-".concat(o,"-").concat(String(e.field)),type:"checkbox",checked:!e.omit,onChange:function(t){return function(e){r((function(t){for(var n=c([],t,!0),r=0;rn[r])return 1*i}return 0})):e}(c,a),d=function(e,t){if(!t)return e;var n=t.currentPage,r=t.currentRowsPerPage,o=(n-1)*r,i=o+r;return e.slice(o,i)}(f,e);l(f.length),u(d)}}),[o,t,n]),o?{data:n,count:r,numberOfRows:n.length}:{data:c,count:a,numberOfRows:c.length}}function In(e,t){var n,r;for(var o in t){var i=t[o],a=i.operation,l=i.value,s=i.and,c=i.or;if(!_n(e[o],a,l))return!(!c||!In(e,(n={},n[o]=c,n)));if(s&&!In(e,(r={},r[o]=s,r)))return!1}return!0}function _n(e,t,n){if(void 0===n)return!1;var r=function(e,t){var n=typeof e;if("number"===n)t=Number(t);else if("boolean"===n)t="true"===t||"false"===t?"true"===t:Boolean(t);else if("string"===n){var r=Number(e),o=Number(t);isNaN(r)||isNaN(o)||(e=r,t=o);var i=Date.parse(e),a=Date.parse(t);isNaN(i)||isNaN(a)||(e=new Date(i),t=new Date(a))}return[e,t]}(e,n),o=r[0],i=r[1];return"Not blank"===t?!(null==o||""===o):"Is blank"===t?null==o||""===o:"Equal"===t?o===i:"Not equal"===t?o!==i:"Greater than or equal"===t?o>=i:"Less than or equal"===t?o<=i:"Greater than"===t?o>i:"Less than"===t?o1},String(e.field))},onColumnClick:function(e){return e.sortable&&s.onSort(e)},RowOptionMenu:d,hideSelect:!m,SelectHeader:function(){return h.jsx(k,{selectAll:N.selectAll,isAllSelected:N.isAllSelected})},SelectCell:function(t){var n=t.row,r=t.index,o=!m||m(n);return e.useEffect((function(){c.onDisableRow(!o,r)}),[o]),h.jsx(E,{index:r,disabled:!o,checked:N.selectedRows.includes(r),onChange:N.onSelectRow})},NoData:v,onRowClick:g,showOptionsOnRowClick:y,minColumnSize:b,columnNameFontSize:x,renderCell:function(e,t,n){if(!L.isEditable)return h.jsx(h.Fragment,{children:n});var r=L.isDirty(t,e.field),o=L.dirtyValue(t,e.field);return"boolean"==typeof e.editable&&!1===e.editable||"function"==typeof e.editable&&!1===e.editable(t[e.field],e,t)?n:h.jsx(Kn,i({className:"edit-row-cell"},{children:function(a){return h.jsxs(h.Fragment,{children:[r?h.jsx(T,{value:void 0===o?t[e.field]:o,onChange:function(n){return L.onChange(t,e.field,n)},inputType:qn[e.datatype],setOptions:e.setOptions,error:L.getValidationError(t,e.field)}):n,h.jsx("button",i({type:"button",className:"edit-row-button ".concat(a?"edit-row-button-hover":""),onClick:function(n){n.stopPropagation(),L.onEdit(t,e.field,r)}},{children:r?h.jsx(Yn,{}):h.jsx(Gn,{})}))]})}}))},renderHeaderPanel:function(e,t){return L.isDirty()&&L.isEditable?h.jsx("div",i({className:"table-header-panel"},{children:h.jsxs("div",i({className:"table-header-panel-row"},{children:[h.jsxs("button",i({disabled:L.isSaving,className:"table-header-panel-button ".concat(L.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:function(){return L.save(e,t)}},{children:[h.jsx(Jn,{}),"Save"]})),"|",h.jsxs("button",i({disabled:L.isSaving,className:"table-header-panel-button ".concat(L.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:L.cancel},{children:[h.jsx(Yn,{}),"Cancel"]})),L.submitError&&h.jsx("span",i({title:L.submitError,className:"save-error-message"},{children:L.submitError}))]}))})):null},Footer:S?h.jsx(S,i({},j)):null,AppsPanel:h.jsxs(h.Fragment,{children:[!p&&h.jsx(Fn,{columns:M,setColumns:I}),!!p&&h.jsx(p,{OmitColumns:h.jsx(Fn,{columns:M,setColumns:I})})]})})}function Kn(t){var n=e.useState(!1),r=n[0],o=n[1];return h.jsx("span",i({className:t.className,onMouseOver:function(){return o(!0)},onMouseLeave:function(){return o(!1)}},{children:t.children(r)}))}function Gn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-pencil"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"44",d:"M358.62 129.28L86.49 402.08 70 442l39.92-16.49 272.8-272.13-24.1-24.1zM413.07 74.84l-11.79 11.78 24.1 24.1 11.79-11.79a16.51 16.51 0 000-23.34l-.75-.75a16.51 16.51 0 00-23.35 0z"})}))}function Yn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-close-outline"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}))}function Jn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-checkmark-outline"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128L192 384l-96-96"})}))}exports.BaseDatatable=tn,exports.OmitColumn=Fn,exports.useClientSide=Mn,exports.useDatatable=function(t){var n=t.columns,r=t.onFilter,o=t.initialSortOrder,a=t.initialPage,c=void 0===a?Bn:a,u=t.initialOperationFilter,f=t.onSubmitChanges,d=t.submitError,p=t.validateChanges,m=t.uniqueRowIdentifier,h=function(e){return e.reduce((function(e,t){var n;return t.setOptions?i(i({},e),((n={})[t.field]={include:t.setOptions,isAll:!0},n)):e}),{})}(n),v=function(e,t){var n,r,o,i,a,l,s,c={};if(!t||0===Object.keys(t).length)return e;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var f=t[u];(null==f?void 0:f.include)?(c[u]||(c[u]={}),c[u].include=f.isAll?null===(n=e[u])||void 0===n?void 0:n.include:f.include,c[u].isAll=null!==(r=f.isAll)&&void 0!==r?r:f.include.length===(null===(i=null===(o=e[u])||void 0===o?void 0:o.include)||void 0===i?void 0:i.length)):(c[u]||(c[u]={}),c[u].isAll=!0,c[u].include=null!==(s=null!==(l=null===(a=e[u])||void 0===a?void 0:a.include)&&void 0!==l?l:f.include)&&void 0!==s?s:[])}return c}(h,t.initialSetFilter),g={sortOrder:null!=o?o:{},page:null!=c?c:{},operationFilter:null!=u?u:{},setFilter:null!=v?v:{}},y=e.useState(g),b=y[0],x=y[1],w=Mn(b,t.data,t.count,t.serverSide),S=w.data,j=w.count,k=w.numberOfRows,E=gn({initialSortOrder:o,onChange:function(e){return x((function(t){return i(i({},t),{sortOrder:e})}))}}),N=wn({initialPage:c,count:j,numberOfRows:k,defaultPage:Bn,onChange:function(e){return x((function(t){return i(i({},t),{page:e})}))}}),O=Rn({numberOfRows:k,onChange:function(e){return x((function(t){return i(i({},t),{select:e})}))}}),R=function(t){var n=t.onChange,r=t.initialSetFilter,o=t.defaultSetFilter,a=e.useState(r),l=a[0],s=a[1];return{SetFilter:An,setFilter:l,onSetFilter:function(e){var t=i({},l);for(var r in e)t[r]=e[r];s(t),n(t)},reset:function(e,t){var n=t?o:null!=e?e:r;return s(n),n}}}({initialSetFilter:v,defaultSetFilter:h,onChange:function(e){return x((function(t){return i(i({},t),{setFilter:e})}))}}),C=function(t){var n=t.onChange,r=t.initialOperationFilter,o=e.useState(null!=r?r:{}),a=o[0],l=o[1];return{OperationFilter:Dn,operationFilter:a,onSetOperationFilter:function(e){var t=i({},a);for(var r in e){var o=i({},e[r]);o.operation?Ln(o.value,o.operation)?delete t[r]:(o.and&&Ln(o.and.value,o.and.operation)&&delete o.and,o.or&&Ln(o.or.value,o.or.operation)&&delete o.or,t[r]=o):delete t[r]}l(t),n(t)},reset:function(e){var t,n=null!==(t=null!=e?e:r)&&void 0!==t?t:{};return l(n),n}}}({initialOperationFilter:u,onChange:function(e){return x((function(t){return i(i({},t),{operationFilter:e})}))}}),P=function(t){var n=this,r=t.uniqueRowIdentifier,o=void 0===r?"id":r,a=t.onSubmitChanges,c=t.submitError,u=t.validateChanges,f=e.useState({}),d=f[0],p=f[1],m=e.useState(!1),h=m[0],v=m[1],g=e.useState({}),y=g[0],b=g[1],x=function(e){var t=e[o];if(!t)throw new Error("Field 'id' was not found in a row, all rows must contain an 'id' or you must specify the 'uniqueRowIdentifier' prop. This error came while trying to edit a row.");return t},w=function(){b({}),p({}),v(!1)};return{isEditable:!!a,submitError:c,isSaving:h,getValidationError:function(e,t){var n=x(e);return d[n]&&d[n][t]?d[n][t].error:null},EditableCell:zn,onEdit:function(e,t,n){var r,a=x(e),l=JSON.parse(JSON.stringify(y)),s=JSON.parse(JSON.stringify(d));if(n)return s[a]&&(delete s[a][t],1===Object.keys(s[a]).length&&delete s[a]),l[a]&&(delete l[a][t],1===Object.keys(l[a]).length&&delete l[a]),p(s),void b(l);var c=l[a];l[a]=i(i({},c||{}),((r={})[t]=e[t],r[o]=a,r)),b(l)},isDirty:function(e,t){if(!e||!t)return Object.entries(y).length>0;var n=x(e);return void 0!==y[n]&&void 0!==y[n][t]},onChange:function(e,t,n){var r=x(e);b((function(e){var o,a=i({},e),l=a[r];return a[r]=i(i({},l||{}),((o={})[t]=n,o)),a}))},dirtyValue:function(e,t){var n=x(e);if(void 0!==y[n]&&void 0!==y[n][t])return y[n][t]},save:function(e,t){return l(n,void 0,void 0,(function(){var n,r,l,c,f,m,h;return s(this,(function(s){switch(s.label){case 0:if(!a)return[2];if(p({}),n=!1,u){for(r=Object.values(y),l=JSON.parse(JSON.stringify(d)),c=u.__allRows__,f=function(i){var a=r[i],s=x(a),f=t.find((function(e){return e[o]===s}));for(var d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var p=u[d],m={fieldValidatorError:null,allFieldValidatorError:null};p&&(m.fieldValidatorError=p(a[d],d,y[s],e,f)),c&&(m.allFieldValidatorError=c(a[d],d,y[s],e,f)),(m.fieldValidatorError||m.allFieldValidatorError)&&(l[s]||(l[s]={}),l[s][d]={value:a[d],error:m.fieldValidatorError&&m.allFieldValidatorError?"".concat(m.fieldValidatorError," \n").concat(m.allFieldValidatorError):m.fieldValidatorError?m.fieldValidatorError:m.allFieldValidatorError},n=!0)}for(var d in f)if(Object.prototype.hasOwnProperty.call(f,d)&&c&&(!l[s]||!l[s][d])){var h=c(f[d],d,y[s],e,f);h&&(l[s]||(l[s]={}),l[s][d]={error:h,value:f[d]},n=!0)}},m=0;m1?t-1:0),r=1;r=1&&u>=0&&l[c]!==s[u];)u--;for(;c>=1&&u>=0;c--,u--)if(l[c]!==s[u]){if(1!==c||1!==u)do{if(c--,--u<0||l[c]!==s[u]){var f="\n"+l[c].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),"function"==typeof e&&B.set(e,f),f}}while(c>=1&&u>=0);break}}}finally{V=!1,z.current=o,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:R}),info:D({},e,{value:C}),warn:D({},e,{value:P}),error:D({},e,{value:F}),group:D({},e,{value:A}),groupCollapsed:D({},e,{value:T}),groupEnd:D({},e,{value:L})})}M<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var d=e?e.displayName||e.name:"",p=d?W(d):"";return"function"==typeof e&&B.set(e,p),p}function q(e,t,n){if(null==e)return"";if("function"==typeof e)return H(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return W(e);switch(e){case u:return W("Suspense");case f:return W("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return H(e.render,!1);case d:return q(e.type,t,n);case p:var o=e,i=o._payload,a=o._init;try{return q(a(i),t,n)}catch(e){}}return""}B=new $;var U=Object.prototype.hasOwnProperty,K={},G=y.ReactDebugCurrentFrame;function Y(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var J=Array.isArray;function X(e){return J(e)}function Z(e){return""+e}function Q(e){if(function(e){try{return Z(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),Z(e)}var ee,te,ne,re=y.ReactCurrentOwner,oe={key:!0,ref:!0,__self:!0,__source:!0};ne={};var ie=function(e,t,r,o,i,a,l){var s={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function ae(e,t,n,r,o){var i,a={},l=null,s=null;for(i in void 0!==n&&(Q(n),l=""+n),function(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Q(t.key),l=""+t.key),function(e){if(U.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&re.current&&t&&re.current.stateNode!==t){var n=O(re.current.type);ne[n]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',O(re.current.type),e.ref),ne[n]=!0)}}(t,o)),t)U.call(t,i)&&!oe.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var c=e.defaultProps;for(i in c)void 0===a[i]&&(a[i]=c[i])}if(l||s){var u="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){ee||(ee=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,u),s&&function(e,t){var n=function(){te||(te=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,u)}return ie(e,l,s,o,r,re.current,a)}var le,se=y.ReactCurrentOwner,ce=y.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,n=q(e.type,e._source,t?t.type:null);ce.setExtraStackFrame(n)}else ce.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function de(){if(se.current){var e=O(se.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}le=!1;var pe={};function me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=de();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!pe[n]){pe[n]=!0;var r="";e&&e._owner&&e._owner!==se.current&&(r=" It was passed a child from "+O(e._owner.type)+"."),ue(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ue(null)}}}function he(e,t){if("object"==typeof e)if(X(e))for(var n=0;n",N=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,N)}var P=ae(e,t,r,v,g);if(null==P)return P;if(y){var F=t.children;if(void 0!==F)if(m)if(X(F)){for(var A=0;A({x:e,y:e}),w={left:"right",right:"left",bottom:"top",top:"bottom"},S={start:"end",end:"start"};function j(e,t,n){return g(e,v(t,n))}function k(e,t){return"function"==typeof e?e(t):e}function E(e){return e.split("-")[0]}function N(e){return e.split("-")[1]}function O(e){return"x"===e?"y":"x"}function R(e){return"y"===e?"height":"width"}function C(e){return["top","bottom"].includes(E(e))?"y":"x"}function P(e){return O(C(e))}function F(e){return e.replace(/start|end/g,(e=>S[e]))}function A(e){return e.replace(/left|right|bottom|top/g,(e=>w[e]))}function T(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function L(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function D(e,t,n){let{reference:r,floating:o}=e;const i=C(t),a=P(t),l=R(a),s=E(t),c="y"===i,u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(s){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(N(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function M(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=k(t,e),m=T(p),h=l[d?"floating"===f?"reference":"floating":f],v=L(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g="floating"===f?{...a.floating,x:r,y:o}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:y,strategy:s}):g);return{top:(v.top-x.top+m.top)/b.y,bottom:(x.bottom-v.bottom+m.bottom)/b.y,left:(v.left-x.left+m.left)/b.x,right:(x.right-v.right+m.right)/b.x}}const I=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l}=t,{element:s,padding:c=0}=k(e,t)||{};if(null==s)return{};const u=T(c),f={x:n,y:r},d=P(o),p=R(d),m=await a.getDimensions(s),h="y"===d,g=h?"top":"left",y=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[d]-f[d]-i.floating[p],w=f[d]-i.reference[d],S=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s));let E=S?S[b]:0;E&&await(null==a.isElement?void 0:a.isElement(S))||(E=l.floating[b]||i.floating[p]);const O=x/2-w/2,C=E/2-m[p]/2-1,F=v(u[g],C),A=v(u[y],C),L=F,D=E-m[p]-A,M=E/2-m[p]/2+O,I=j(L,M,D),_=null!=N(o)&&M!=I&&i.reference[p]/2-(Me+"-"+o)),t&&(i=i.concat(i.map(F)))),i}(a,m,p,y));const x=[a,...b],w=await M(t,h),S=[];let j=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&S.push(w[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=N(e),o=P(e),i=R(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=A(a)),[a,A(a)]}(r,i,y);S.push(w[e[0]],w[e[1]])}if(j=[...j,{placement:r,overflows:S}],!S.every((e=>e<=0))){var O,C;const e=((null==(O=o.flip)?void 0:O.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(C=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(d){case"bestFit":{var T;const e=null==(T=j.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const z=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=E(n),l=N(n),s="y"===C(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f=k(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),s?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},W=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=k(e,t),c={x:n,y:r},u=await M(t,s),f=C(E(o)),d=O(f);let p=c[d],m=c[f];if(i){const e="y"===d?"bottom":"right";p=j(p+u["y"===d?"top":"left"],p,p-u[e])}if(a){const e="y"===f?"bottom":"right";m=j(m+u["y"===f?"top":"left"],m,m-u[e])}const h=l.fn({...t,[d]:p,[f]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}};function B(e){return H(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $(e){var t;return null==(t=(H(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function H(e){return e instanceof Node||e instanceof V(e).Node}function q(e){return e instanceof Element||e instanceof V(e).Element}function U(e){return e instanceof HTMLElement||e instanceof V(e).HTMLElement}function K(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof V(e).ShadowRoot)}function G(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Y(e){return["table","td","th"].includes(B(e))}function J(e){const t=X(),n=Q(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function X(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Z(e){return["html","body","#document"].includes(B(e))}function Q(e){return V(e).getComputedStyle(e)}function ee(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function te(e){if("html"===B(e))return e;const t=e.assignedSlot||e.parentNode||K(e)&&e.host||$(e);return K(t)?t.host:t}function ne(e){const t=te(e);return Z(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&G(t)?t:ne(t)}function re(e,t){var n;void 0===t&&(t=[]);const r=ne(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=V(r);return o?t.concat(i,i.visualViewport||[],G(r)?r:[]):t.concat(r,re(r))}function oe(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=U(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=y(n)!==i||y(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function ie(e){return q(e)?e:e.contextElement}function ae(e){const t=ie(e);if(!U(t))return x(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=oe(t);let a=(i?y(n.width):n.width)/r,l=(i?y(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const le=x(0);function se(e){const t=V(e);return X()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:le}function ce(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ie(e);let a=x(1);t&&(r?q(r)&&(a=ae(r)):a=ae(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==V(e))&&t}(i,n,r)?se(i):x(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const e=V(i),t=r&&q(r)?V(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ae(n),t=n.getBoundingClientRect(),r=Q(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,f*=e.y,s+=o,c+=i,n=V(n).frameElement}}return L({width:u,height:f,x:s,y:c})}function ue(e){return ce($(e)).left+ee(e).scrollLeft}function fe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=V(e),r=$(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=X();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=$(e),n=ee(e),r=e.ownerDocument.body,o=g(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=g(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ue(e);const l=-n.scrollTop;return"rtl"===Q(r).direction&&(a+=g(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}($(e));else if(q(t))r=function(e,t){const n=ce(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=U(e)?ae(e):x(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=se(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return L(r)}function de(e,t){const n=te(e);return!(n===t||!q(n)||Z(n))&&("fixed"===Q(n).position||de(n,t))}function pe(e,t,n){const r=U(t),o=$(t),i="fixed"===n,a=ce(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=x(0);if(r||!r&&!i)if(("body"!==B(t)||G(o))&&(l=ee(t)),r){const e=ce(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ue(o));return{x:a.left+l.scrollLeft-s.x,y:a.top+l.scrollTop-s.y,width:a.width,height:a.height}}function me(e,t){return U(e)&&"fixed"!==Q(e).position?t?t(e):e.offsetParent:null}function he(e,t){const n=V(e);if(!U(e))return n;let r=me(e,t);for(;r&&Y(r)&&"static"===Q(r).position;)r=me(r,t);return r&&("html"===B(r)||"body"===B(r)&&"static"===Q(r).position&&!J(r))?n:r||function(e){let t=te(e);for(;U(t)&&!Z(t);){if(J(t))return t;t=te(t)}return null}(e)||n}const ve={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=U(n),i=$(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},l=x(1);const s=x(0);if((o||!o&&"fixed"!==r)&&(("body"!==B(n)||G(i))&&(a=ee(n)),U(n))){const e=ce(n);l=ae(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+s.x,y:t.y*l.y-a.scrollTop*l.y+s.y}},getDocumentElement:$,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=re(e).filter((e=>q(e)&&"body"!==B(e))),o=null;const i="fixed"===Q(e).position;let a=i?te(e):e;for(;q(a)&&!Z(a);){const t=Q(a),n=J(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||G(a)&&!n&&de(e,a))?r=r.filter((e=>e!==a)):o=t,a=te(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],l=i.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=g(r.top,e.top),e.right=v(r.right,e.right),e.bottom=v(r.bottom,e.bottom),e.left=g(r.left,e.left),e}),fe(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:he,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||he,i=this.getDimensions;return{reference:pe(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return oe(e)},getScale:ae,isElement:q,isRTL:function(e){return"rtl"===Q(e).direction}};function ge(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ie(e),u=o||i?[...c?re(c):[],...re(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&l?function(e,t){let n,r=null;const o=$(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(l||t(),!f||!d)return;const p={rootMargin:-b(u)+"px "+-b(o.clientWidth-(c+f))+"px "+-b(o.clientHeight-(u+d))+"px "+-b(c)+"px",threshold:g(0,v(1,s))||1};let m=!0;function h(e){const t=e[0].intersectionRatio;if(t!==s){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}m=!1}try{r=new IntersectionObserver(h,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,p)}r.observe(e)}(!0),i}(c,n):null;let d,p=-1,m=null;a&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{m&&m.observe(t)}))),n()})),c&&!s&&m.observe(c),m.observe(t));let h=s?ce(e):null;return s&&function t(){const r=ce(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),m&&m.disconnect(),m=null,s&&cancelAnimationFrame(d)}}const ye=(e,t,n)=>{const r=new Map,o={platform:ve,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=D(c,r,s),d=r,p={},m=0;for(let n=0;n({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?I({element:n.current,padding:r}).fn(t):{}:n?I({element:n,padding:r}).fn(t):{};var o}});var xe="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function we(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!we(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!we(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Se(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function je(e,t){const n=Se(e);return Math.round(t*n)/n}function ke(e){const t=r.useRef(e);return xe((()=>{t.current=e})),t}var Ee=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ne=new WeakMap,Oe=new WeakMap,Re={},Ce=0,Pe=function(e){return e&&(e.host||Pe(e.parentNode))},Fe=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Pe(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Re[n]||(Re[n]=new WeakMap);var i=Re[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))u(e);else{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(Ne.get(e)||0)+1,c=(i.get(e)||0)+1;Ne.set(e,s),i.set(e,c),a.push(e),1===s&&o&&Oe.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}}))};return u(t),l.clear(),Ce++,function(){a.forEach((function(e){var t=Ne.get(e)-1,o=i.get(e)-1;Ne.set(e,t),i.set(e,o),t||(Oe.has(e)||e.removeAttribute(r),Oe.delete(e)),o||e.removeAttribute(n)})),--Ce||(Ne=new WeakMap,Ne=new WeakMap,Oe=new WeakMap,Re={})}},Ae=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Ee(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Fe(r,o,n,"aria-hidden")):function(){return null}},Te=function(e,t,n){void 0===n&&(n="data-inert-ed");var r=t||Ee(e);return r?Fe(e,r,n,"inert"):function(){return null}},Le=function(){return"undefined"!=typeof HTMLElement&&HTMLElement.prototype.hasOwnProperty("inert")},De=function(e,t,n){return void 0===n&&(n="data-suppressed"),(Le()?Te:Ae)(e,t,n)},Me=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Ie="undefined"==typeof Element,_e=Ie?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ze=!Ie&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},We=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Be=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!We(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),s=e(l.length?l:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{_e.call(a,Me)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var c=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!We(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(c&&u){var f=e(!0===c?a.children:c.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return o},Ve=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},$e=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ve(e)?0:e.tabIndex},He=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},qe=function(e){return"INPUT"===e.tagName},Ue=function(e){return function(e){return qe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ze(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(_e.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,l=ze(e);if(a&&!a.shadowRoot&&!0===r(a))return Ke(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,r,o,i=e&&ze(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&a;){var s,c,u;l=!(null===(c=a=null===(s=i=ze(a))||void 0===s?void 0:s.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ye=function(e,t){return!(t.disabled||We(t)||function(e){return qe(e)&&"hidden"===e.type}(t)||Ge(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},Ze=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=$e(e);return n<0&&t&&!Ve(e)?0:n}(a,i),s=i?e(t.candidates):a;0===l?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:s})})),r.sort(He).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Qe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Be([e],t.includeContainer,{filter:Je.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Xe}):function(e,t,n){if(We(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Me));return t&&_e.call(e,Me)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Je.bind(null,t)),Ze(n)};function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+rt++;const it=r["useId".toString()]||function(){const[e,t]=r.useState((()=>nt?ot():void 0));return tt((()=>{null==e&&t(ot())}),[]),r.useEffect((()=>{nt||(nt=!0)}),[]),e},at=r.forwardRef((function(e,t){let{context:{placement:n,elements:{floating:o},middlewareData:{arrow:i}},width:a=14,height:l=7,tipRadius:s=0,strokeWidth:c=0,staticOffset:u,stroke:f,d:d,style:{transform:p,...m}={},...h}=e;"production"!==process.env.NODE_ENV&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=it();if(!o)return null;c*=2;const g=c/2,y=a/2*(s/-8+1),b=l/2*s/4,[x,w]=n.split("-"),S=ve.isRTL(o),j=!!d,k="top"===x||"bottom"===x,E=u&&"end"===w?"bottom":"top";let N=u&&"end"===w?"right":"left";u&&S&&(N="end"===w?"left":"right");const O=null!=(null==i?void 0:i.x)?u||i.x:"",R=null!=(null==i?void 0:i.y)?u||i.y:"",C=d||"M0,0 H"+a+" L"+(a-y)+","+(l-b)+" Q"+a/2+","+l+" "+y+","+(l-b)+" Z",P={top:j?"rotate(180deg)":"",left:j?"rotate(90deg)":"rotate(-90deg)",bottom:j?"":"rotate(180deg)",right:j?"rotate(-90deg)":"rotate(90deg)"}[x];return r.createElement("svg",et({},h,{"aria-hidden":!0,ref:t,width:j?a:a+c,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[N]:O,[E]:R,[x]:k||j?"100%":"calc(100% - "+c/2+"px)",transform:""+P+(null!=p?p:""),...m}}),c>0&&r.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:c+(d?0:1),d:C}),r.createElement("path",{stroke:c&&!d?h.fill:"none",d:C}),r.createElement("clipPath",{id:v},r.createElement("rect",{x:-g,y:g*(j?-1:1),width:a+c,height:a})))}));const lt=r.createContext(null),st=r.createContext(null),ct=()=>{var e;return(null==(e=r.useContext(lt))?void 0:e.id)||null},ut=()=>r.useContext(st);function ft(e){return(null==e?void 0:e.ownerDocument)||document}function dt(e){return ft(e).defaultView||window}function pt(e){return!!e&&(e instanceof Element||e instanceof dt(e).Element)}function mt(e){return!!e&&(e instanceof HTMLElement||e instanceof dt(e).HTMLElement)}function ht(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function vt(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function gt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yt(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(r=n,"undefined"!=typeof ShadowRoot&&(r instanceof dt(r).ShadowRoot||r instanceof ShadowRoot))){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}var r;return!1}function bt(e){return"data-floating-ui-"+e}function xt(t){const n=e.useRef(t);return tt((()=>{n.current=t})),n}function wt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}let St=0;function jt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(St);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():St=requestAnimationFrame(i)}function kt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}function Et(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Nt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ot(e){return mt(e)&&e.matches(Nt)}function Rt(e){e.preventDefault(),e.stopPropagation()}const Ct=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Pt(e,t){const n=Qe(e,Ct());"prev"===t&&n.reverse();const r=n.indexOf(wt(ft(e)));return n.slice(r+1)[0]}function Ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!yt(n,r)}const At={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Tt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Lt=r.forwardRef((function(e,t){const[n,o]=r.useState();tt((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Tt),()=>{document.removeEventListener("keydown",Tt)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[bt("focus-guard")]:"",style:At};return r.createElement("span",et({},e,i))})),Dt=r.createContext(null),Mt=()=>r.useContext(Dt),It=r.forwardRef((function(e,t){return r.createElement("button",et({},e,{type:"button",ref:t,tabIndex:-1,style:At}))}));function _t(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:a=!0,initialFocus:l=0,returnFocus:s=!0,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:p,nodeId:m,onOpenChange:h,events:v,dataRef:g,elements:{domReference:y,floating:b}}=t,x=!Le()||a,w=xt(i),S=xt(l),j=xt(s),k=ut(),E=Mt(),N="number"==typeof l&&l<0,O=r.useRef(null),R=r.useRef(null),C=r.useRef(!1),P=r.useRef(null),F=r.useRef(!1),A=null!=E,T=y&&"combobox"===y.getAttribute("role")&&Ot(y),L=r.useCallback((function(e){return void 0===e&&(e=b),e?Qe(e,Ct()):[]}),[b]),D=r.useCallback((e=>{const t=L(e);return w.current.map((e=>y&&"reference"===e?y:b&&"floating"===e?b:t)).filter(Boolean).flat()}),[y,b,w,L]);function M(e){return!o&&u&&c?r.createElement(It,{ref:"start"===e?O:R,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}r.useEffect((()=>{if(o||!c)return;function e(e){if("Tab"===e.key){yt(b,wt(ft(b)))&&0===L().length&&!T&&Rt(e);const t=D(),n=Et(e);"reference"===w.current[0]&&n===y&&(Rt(e),e.shiftKey?jt(t[t.length-1]):jt(t[1])),"floating"===w.current[1]&&n===b&&e.shiftKey&&(Rt(e),jt(t[0]))}}const t=ft(b);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,y,b,c,w,p,T,L,D]),r.useEffect((()=>{if(!o&&f)return b&&mt(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),!c&&b.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),!c&&b.removeEventListener("focusout",t)}):void 0;function e(){F.current=!0,setTimeout((()=>{F.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(yt(y,t)||yt(b,t)||yt(t,b)||yt(null==E?void 0:E.portalNode,t)||null!=t&&t.hasAttribute(bt("focus-guard"))||k&&(kt(k.nodesRef.current,m).find((e=>{var n,r;return yt(null==(n=e.context)?void 0:n.elements.floating,t)||yt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!F.current&&t!==P.current&&(C.current=!0,h(!1,e))}))}}),[o,y,b,c,m,k,E,h,f]),r.useEffect((()=>{var e;if(o)return;const t=Array.from((null==E||null==(e=E.portalNode)?void 0:e.querySelectorAll("["+bt("portal")+"]"))||[]);if(b&&c){const e=[b,...t,O.current,R.current].filter((e=>null!=e)),n=(x?Ae:De)(w.current.includes("reference")||T?e.concat(y||[]):e,void 0,bt("inert"));return()=>{n()}}}),[o,y,b,c,w,E,T,x]),tt((()=>{if(o||!b)return;const e=wt(ft(b));queueMicrotask((()=>{const t=D(b),n=S.current,r=("number"==typeof n?t[n]:n.current)||b,o=yt(b,e);N||o||!d||jt(r,{preventScroll:r===b})}))}),[o,d,b,N,D,S]),tt((()=>{if(o||!b)return;let e=!1;const t=ft(b),n=wt(t),r=g.current;function i(t){if("escapeKey"===t.type&&p.domReference.current&&(P.current=p.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(C.current=!1,e=n.preventScroll):C.current=!n}return P.current=n,v.on("dismiss",i),()=>{v.off("dismiss",i);const n=wt(t);(yt(b,n)||k&&kt(k.nodesRef.current,m).some((e=>{var t;return yt(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&p.domReference.current&&(P.current=p.domReference.current),j.current&&mt(P.current)&&!C.current&&jt(P.current,{cancelPrevious:!1,preventScroll:e})}}),[o,b,j,g,p,v,k,m]),tt((()=>{if(!o&&E)return E.setFocusManagerState({...t,modal:c,closeOnFocusOut:f,open:d}),()=>{E.setFocusManagerState(null)}}),[o,E,c,d,f,t]),tt((()=>{if(!o&&b&&"function"==typeof MutationObserver){const e=()=>{const e=b.getAttribute("tabindex");w.current.includes("floating")||wt(ft(b))!==p.domReference.current&&0===L().length?"0"!==e&&b.setAttribute("tabindex","0"):"-1"!==e&&b.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[o,b,p,w,L]);const I=!o&&x&&!T&&(A||c);return r.createElement(r.Fragment,null,I&&r.createElement(Lt,{"data-type":"inside",ref:null==E?void 0:E.beforeInsideRef,onFocus:e=>{if(c){const e=D();jt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=E&&E.preserveTabOrder&&E.portalNode)if(C.current=!1,Ft(e,E.portalNode)){const e=Pt(document.body,"next")||y;null==e||e.focus()}else{var t;null==(t=E.beforeOutsideRef.current)||t.focus()}}}),!T&&M("start"),n,M("end"),I&&r.createElement(Lt,{"data-type":"inside",ref:null==E?void 0:E.afterInsideRef,onFocus:e=>{if(c)jt(D()[0]);else if(null!=E&&E.preserveTabOrder&&E.portalNode)if(f&&(C.current=!0),Ft(e,E.portalNode)){const e=Pt(document.body,"prev")||y;null==e||e.focus()}else{var t;null==(t=E.afterOutsideRef.current)||t.focus()}}}))}function zt(e){return mt(e.target)&&"BUTTON"===e.target.tagName}function Wt(e){return Ot(e)}function Bt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:a}}=e,{enabled:l=!0,event:s="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,d=r.useRef(),p=r.useRef(!1);return r.useMemo((()=>l?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(gt(d.current,!0)&&u||"click"!==s&&(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent)):o(!1,e.nativeEvent)))},onClick(e){"mousedown"===s&&d.current?d.current=void 0:gt(d.current,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent):o(!1,e.nativeEvent))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||zt(e)||(" "!==e.key||Wt(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&o(!n||!c,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!f||zt(e)||Wt(a)||" "===e.key&&p.current&&(p.current=!1,o(!n||!c,e.nativeEvent))}}}:{}),[l,i,s,u,f,a,c,n,o])}const Vt=r["useInsertionEffect".toString()]||(e=>e());function $t(e){const t=r.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Vt((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Gt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,events:i,nodeId:a,elements:{reference:l,domReference:s,floating:c},dataRef:u}=e,{enabled:f=!0,escapeKey:d=!0,outsidePress:p=!0,outsidePressEvent:m="pointerdown",referencePress:h=!1,referencePressEvent:v="pointerdown",ancestorScroll:g=!1,bubbles:y}=t,b=ut(),x=null!=ct(),w=$t("function"==typeof p?p:()=>!1),S="function"==typeof p?w:p,j=r.useRef(!1),{escapeKeyBubbles:k,outsidePressBubbles:E}=Kt(y),N=$t((e=>{if(!n||!f||!d||"Escape"!==e.key)return;const t=b?kt(b.nodesRef.current,a):[];if(!k&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),O=$t((e=>{const t=j.current;if(j.current=!1,t)return;if("function"==typeof S&&!S(e))return;const n=Et(e);if(mt(n)&&c){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r){"rtl"===dt(c).getComputedStyle(n).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth)}if(o||t&&e.offsetY>n.clientHeight)return}const r=b&&kt(b.nodesRef.current,a).some((t=>{var n;return Ht(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ht(e,c)||Ht(e,s)||r)return;const l=b?kt(b.nodesRef.current,a):[];if(l.length>0){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:ht(e)||vt(e)}}),o(!1,e)}));return r.useEffect((()=>{if(!n||!f)return;function e(e){o(!1,e)}u.current.__escapeKeyBubbles=k,u.current.__outsidePressBubbles=E;const t=ft(c);d&&t.addEventListener("keydown",N),S&&t.addEventListener(m,O);let r=[];return g&&(pt(s)&&(r=re(s)),pt(c)&&(r=r.concat(re(c))),!pt(l)&&l&&l.contextElement&&(r=r.concat(re(l.contextElement)))),r=r.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),r.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{d&&t.removeEventListener("keydown",N),S&&t.removeEventListener(m,O),r.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,c,s,l,d,S,m,n,o,g,f,k,E,N,O]),r.useEffect((()=>{j.current=!1}),[S,m]),r.useMemo((()=>f?{reference:{onKeyDown:N,[qt[v]]:e=>{h&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:N,[Ut[m]]:()=>{j.current=!0}}}:{}),[f,i,h,m,v,o,N])}function Yt(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:i,nodeId:a}=e,[l,s]=r.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||l,u=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:l,floating:s}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[d,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=r.useState(i);we(m,i)||h(i);const[v,g]=r.useState(null),[y,b]=r.useState(null),x=r.useCallback((e=>{e!=k.current&&(k.current=e,g(e))}),[g]),w=r.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[b]),S=l||v,j=s||y,k=r.useRef(null),E=r.useRef(null),N=r.useRef(d),O=ke(u),R=ke(a),C=r.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:m};R.current&&(e.platform=R.current),ye(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!0};P.current&&!we(N.current,t)&&(N.current=t,o.flushSync((()=>{p(t)})))}))}),[m,t,n,R]);xe((()=>{!1===f&&N.current.isPositioned&&(N.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const P=r.useRef(!1);xe((()=>(P.current=!0,()=>{P.current=!1})),[]),xe((()=>{if(S&&(k.current=S),j&&(E.current=j),S&&j){if(O.current)return O.current(S,j,C);C()}}),[S,j,C,O]);const F=r.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),A=r.useMemo((()=>({reference:S,floating:j})),[S,j]),T=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=je(A.floating,d.x),r=je(A.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Se(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,A.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:C,refs:F,elements:A,floatingStyles:T})),[d,C,F,A,T])}(e),f=ut(),d=$t(((e,t)=>{e&&(m.current.openEvent=t),null==i||i(e,t)})),p=r.useRef(null),m=r.useRef({}),h=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],v=it(),g=r.useCallback((e=>{const t=pt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u.refs.setReference(t)}),[u.refs]),y=r.useCallback((e=>{(pt(e)||null===e)&&(p.current=e,s(e)),(pt(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!pt(e))&&u.refs.setReference(e)}),[u.refs]),b=r.useMemo((()=>({...u.refs,setReference:y,setPositionReference:g,domReference:p})),[u.refs,y,g]),x=r.useMemo((()=>({...u.elements,domReference:c})),[u.elements,c]),w=r.useMemo((()=>({...u,refs:b,elements:x,dataRef:m,nodeId:a,floatingId:v,events:h,open:n,onOpenChange:d})),[u,a,v,h,n,d,b,x]);return tt((()=>{const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===a));e&&(e.context=w)})),r.useMemo((()=>({...u,context:w,refs:b,elements:x})),[u,b,x,w])}function Jt(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function Xt(e){void 0===e&&(e=[]);const t=e,n=r.useCallback((t=>Jt(t,e,"reference")),t),o=r.useCallback((t=>Jt(t,e,"floating")),t),i=r.useCallback((t=>Jt(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return r.useMemo((()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i})),[n,o,i])}function Zt(e,t){void 0===t&&(t={});const{open:n,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=it();return r.useMemo((()=>{const e={id:o,role:a};return i?"tooltip"===a?{reference:{"aria-describedby":n?o:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":n?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l}},floating:{...e,..."menu"===a&&{"aria-labelledby":l}}}:{}}),[i,a,n,o,l])}var Qt=function(e){return e.map((function(e){var t,n,r,o,a,l,s;return i({field:null!==(t=e.field)&&void 0!==t?t:"",columnName:null!==(n=e.columnName)&&void 0!==n?n:en(null!==(r=String(e.field))&&void 0!==r?r:""),sortable:null===(o=e.sortable)||void 0===o||o,datatype:null!==(a=e.datatype)&&void 0!==a?a:"string",omit:null!==(l=e.omit)&&void 0!==l&&l,filterable:null===(s=e.filterable)||void 0===s||s},e)}))},en=function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replaceAll("_"," ").toLowerCase()};function tn(t){var n=t.data,r=t.isFetching,o=t.columns,a=t.onColumnClick,l=t.RowOptionMenu,s=t.AppsPanel,c=t.renderSort,u=t.renderFilter,f=t.Footer,d=t.hideSelect,p=t.SelectHeader,m=t.SelectCell,v=t.NoData,g=t.onRowClick,y=t.showOptionsOnRowClick,b=t.minColumnSize,x=t.columnNameFontSize,w=t.renderCell,S=t.renderHeaderPanel,j=d?0:50,k=50,E=function(t){var n=t.columns,r=t.isFetching,o=t.extraWidth,i=t.minColumnSize,a=t.columnNameFontSize,l=e.useRef(null),s=e.useState(0),c=s[0],u=s[1],f=n.reduce((function(e,t){return t.width&&!t.omit?{width:e.width+t.width,columns:e.columns+1}:e}),{width:0,columns:0}),d=n.reduce((function(e,t){return t.omit?e:e+1}),0),p=n.reduceRight((function(e,t){return null===e?null:t.omit?e:t.width?e||t.field:null}),!1);return e.useLayoutEffect((function(){if(l.current){var e=l.current;u(e.clientWidth);var t=new ResizeObserver((function(){return u((function(t){return t>0&&r?t:e.clientWidth}))}));return t.observe(e),function(){t.disconnect()}}}),[l.current,r,n]),{containerRef:l,getWidth:function(e){var t=e.columnName.length*((null!=a?a:16)/2),n=Math.pow(e.columnName.length,1.1)-e.columnName.length,r=i||(a?t+1-(n<3?0:n)+40+16+16:150);return p===e.field&&e.width?Math.max((c-(o+f.width-e.width))/Math.max(d-f.columns-1,1),r):e.width?e.width:Math.max((c-(o+f.width))/Math.max(d-f.columns,1),r)}}}({columns:o,isFetching:r,extraWidth:j+k,minColumnSize:b,columnNameFontSize:x});return h.jsxs("div",i({className:"myers-datatable"},{children:[S&&S(o,n),h.jsxs("div",i({ref:E.containerRef,className:"table-scroll-container"},{children:[h.jsxs("div",i({className:"table-header-row table-row"},{children:[h.jsx("div",i({className:"table-cell table-header-cell apps-button-header-cell",style:{width:k,minWidth:k,maxWidth:k}},{children:s&&h.jsx(mn,i({Icon:un,mainAxisOffset:20,crossAxisOffset:10,placement:"bottom-end",className:"app-panel-button"},{children:s}))})),!d&&!!p&&h.jsx(ln,i({className:"select-header-cell",column:{field:"_selectable",datatype:"string",columnName:"",sortable:!1,omit:!1,filterable:!1},width:j},{children:h.jsx(p,{})})),o.map((function(e){return h.jsx(ln,i({column:e,onClick:a,className:"".concat(e.sortable?"sortable-table-header":""," ").concat(e.omit?"hide":""),width:E.getWidth(e)},{children:h.jsxs("div",i({className:"column-header-options"},{children:[e.sortable&&c&&c(e),e.filterable&&u&&u(e,nn)]}))}),String(e.field))}))]})),n.map((function(e,t){return h.jsx(hn,i({crossAxisOffset:0,placement:"right-start",PopUp:l?h.jsx(l,{row:e,rowIndex:t}):null,useCursorOffset:!!y},{children:function(n){return h.jsxs("div",i({className:"table-row ".concat(g||y?"table-row-clickable":""),onClick:function(t){g&&g(e,t),y&&n.onClick(t)}},{children:[r&&h.jsx("div",i({className:"spinner-container"},{children:h.jsxs("div",i({className:"spinner-wrapper"},{children:[h.jsx("div",{className:"spinner"}),h.jsx("span",i({className:"spinner-loading-text"},{children:"Loading"}))]}))})),h.jsx("div",i({className:"table-cell",style:{width:k,minWidth:k,maxWidth:k}},{children:l&&h.jsx("button",i({type:"button","aria-label":"row options"},n,{onClick:function(e){e.stopPropagation(),n.onClick(e)}},{children:h.jsx(fn,{})}))})),!d&&!!m&&h.jsx("div",i({className:"table-cell",style:{width:j,minWidth:j,maxWidth:j}},{children:h.jsx(m,{index:t,row:e})})),o.map((function(t,n){return h.jsx(rn,{column:t,row:e,width:E.getWidth(t),renderCell:w},n)}))]}))}}),t)})),0===n.length&&!r&&(v||h.jsx(vn,{}))]})),f]}))}function nn(e){var t=e.children,n=e.hasFilter;return h.jsx("div",i({className:"filter-options-button"},{children:h.jsx(mn,i({Icon:n?pn:dn,mainAxisOffset:20,crossAxisOffset:0,placement:"bottom-end"},{children:t}))}))}var rn=function(e){var t=e.column,n=e.row,r=e.width,o=e.renderCell,a=void 0!==n[t.field]?String(n[t.field]):void 0,l={width:r,minWidth:r,maxWidth:r};return t.renderCell?h.jsx("div",i({className:"table-cell ".concat(t.omit?"hide":""),title:a,style:l},{children:o?o(t,n,t.renderCell(n[t.field],t,n)):t.renderCell(n[t.field],t,n)})):"paragraph"===t.datatype?h.jsx(an,{column:t,row:n,title:a,text:n[t.field],style:l,renderCell:o}):h.jsx("div",i({className:"table-cell ".concat(t.omit?"hide":""),title:a,style:l},{children:o?o(t,n,on(n[t.field],t)):on(n[t.field],t)}))},on=function(e,t){if(null==e)return h.jsx("span",{className:"text-wrapper"});if("name"===t.datatype)return h.jsx("span",i({className:"cell-datatype-name text-wrapper"},{children:e}));if("link"===t.datatype)return h.jsx("a",i({className:"text-wrapper",href:e,target:"_blank",rel:"noreferrer"},{children:new URL(e).hostname}));if("email"===t.datatype)return h.jsx("a",i({className:"text-wrapper",href:"mailto:".concat(e),target:"_blank",rel:"noreferrer"},{children:e}));if("date"===t.datatype)return h.jsx("span",i({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric"}):""}));if("datetime"===t.datatype)return h.jsx("span",i({className:"text-wrapper"},{children:e?new Date(e).toLocaleString("en-IN",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}));if("boolean"===t.datatype)return h.jsx(h.Fragment,{children:JSON.parse(e)?h.jsx(sn,{}):h.jsx(cn,{})});if("phone"===t.datatype){var n={code:!1,number:e},r=e.split(" ");r.length>1&&(n.code=r[0],n.number=r[1]);var o=n.number.slice(0,3)+"-"+n.number.slice(3,6)+"-"+n.number.slice(6);return n.code?h.jsx("span",i({className:"text-wrapper"},{children:"".concat(n.code," ").concat(o)})):h.jsx("span",i({className:"text-wrapper"},{children:o}))}return"image"===t.datatype?h.jsx("a",i({href:e,target:"_blank",rel:"noreferrer"},{children:h.jsx("img",{alt:"row",className:"cell-datatype-image",src:e})})):h.jsx("span",i({className:"text-wrapper"},{children:e}))},an=function(t){var n=t.text,r=t.title,o=t.column,a=t.row,l=t.style,s=t.renderCell,c=e.useState(!1),u=c[0],f=c[1];return h.jsx("div",i({className:"table-cell cell-datatype-paragraph ".concat(o.omit?"hide":""," ").concat(u?"cell-datatype-paragraph-open":"cell-datatype-paragraph-closed"),title:r,onClick:function(e){e.stopPropagation(),f((function(e){return!e}))},style:l},{children:s?s(o,a,h.jsx("span",i({className:"text-wrapper"},{children:n}))):h.jsx("span",i({className:"text-wrapper"},{children:n}))}))},ln=function(e){var t=e.column,n=e.children,r=e.className,o=void 0===r?"":r,a=e.onClick,l=e.width;return h.jsx("div",i({className:"table-cell table-header-cell ".concat(o),onClick:function(){return a&&a(t)},title:t.columnName,style:{width:l,minWidth:l,maxWidth:l}},{children:h.jsxs("div",i({className:"table-header-children-container"},{children:[!!t.columnName&&h.jsx("span",i({className:"table-header-column-name"},{children:t.columnName})),n]}))}),t.columnName)};function sn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-true-svg"},{children:h.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"})}))}function cn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"boolean-svg boolean-false-svg"},{children:h.jsx("path",{d:"M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 11-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 01-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0122.62-22.62L256 233.37l52.69-52.68a16 16 0 0122.62 22.62L278.63 256z"})}))}function un(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-apps"},{children:h.jsx("path",{d:"M104 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 160a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 312a56 56 0 1156-56 56.06 56.06 0 01-56 56zM104 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM256 464a56 56 0 1156-56 56.06 56.06 0 01-56 56zM408 464a56 56 0 1156-56 56.06 56.06 0 01-56 56z"})}))}function fn(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"options-svg io-ellipsis"},{children:[h.jsx("circle",{cx:"256",cy:"256",r:"48"}),h.jsx("circle",{cx:"256",cy:"416",r:"48"}),h.jsx("circle",{cx:"256",cy:"96",r:"48"})]}))}function dn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-menu"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"48",d:"M88 152h336M88 256h336M88 360h336"})}))}function pn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-funnel"},{children:h.jsx("path",{d:"M296 464a23.88 23.88 0 01-7.55-1.23L208.3 436.1a23.92 23.92 0 01-16.3-22.78V294.11a.44.44 0 00-.09-.13L23.26 97.54A30 30 0 0146.05 48H466a30 30 0 0122.79 49.54L320.09 294a.77.77 0 00-.09.13V440a23.93 23.93 0 01-24 24z"})}))}function mn(t){var n=t.Icon,r=t.children,o=t.mainAxisOffset,a=t.crossAxisOffset,l=t.placement,s=t.className,c=e.useRef(null),u=e.useState(!1),f=u[0],d=Yt({open:f,onOpenChange:u[1],whileElementsMounted:ge,placement:l,middleware:[be({element:c,padding:16}),z({mainAxis:o,crossAxis:a}),_(),W()]}),p=d.refs,m=d.floatingStyles,v=d.context,g=Xt([Bt(v),Gt(v),Zt(v)]),y=g.getReferenceProps,b=g.getFloatingProps,x=y();return h.jsxs(h.Fragment,{children:[h.jsx("button",i({"aria-label":"table options",type:"button",ref:p.setReference},x,{className:"icon-button ".concat(null!=s?s:""),onClick:function(e){e.stopPropagation(),x.onClick(e)}},{children:h.jsx(n,{})})),f&&h.jsx(_t,i({context:v,modal:!1},{children:h.jsxs("div",i({ref:p.setFloating,style:m,className:"popup-floating-container"},b(),{children:[h.jsx(at,{ref:c,context:v,className:"popup-floating-arrow"}),h.jsx("div",i({className:"popup-container"},{children:r}))]}))}))]})}function hn(t){var n=t.children,r=t.PopUp,o=t.crossAxisOffset,a=t.placement,l=t.className,s=t.useCursorOffset,c=e.useRef(null),u=e.useState(!1),f=u[0],d=u[1],p=e.useState(s?0:10),m=p[0],v=p[1],g=Yt({open:f,onOpenChange:d,placement:a,middleware:[be({element:c,padding:16}),z({mainAxis:m,crossAxis:o}),_()]}),y=g.refs,b=g.floatingStyles,x=g.context,w=Xt([Bt(x),Gt(x),Zt(x)]),S=w.getReferenceProps,j=w.getFloatingProps,k=S(),E=i(i({type:"button",ref:y.setReference},k),{className:"icon-button ".concat(null!=l?l:""),onClick:function(e){if(e.stopPropagation(),s){var t=e.nativeEvent.clientX-e.currentTarget.getBoundingClientRect().left;v(t)}k.onClick(e)}});return h.jsxs(h.Fragment,{children:[n(E),f&&h.jsx(_t,i({context:x,modal:!1},{children:h.jsxs("div",i({ref:y.setFloating,style:b},j(),{className:"popup-floating-container"},{children:[h.jsx(at,{ref:c,context:x,className:"popup-floating-arrow"}),h.jsx("div",i({className:"popup-container"},{children:r}))]}))}))]})}function vn(){return h.jsx("p",i({className:"no-items-to-display"},{children:"No items to display."}))}function gn(t){var n=t.onChange,r=t.initialSortOrder,o=void 0===r?{}:r,a=e.useState(!1),l=a[0],s=a[1],c=e.useState(o),u=c[0],f=c[1];e.useEffect((function(){var e=function(e){return s(e.shiftKey)};return window.addEventListener("keyup",e),window.addEventListener("keydown",e),function(){window.removeEventListener("keyup",e),window.removeEventListener("keydown",e)}}),[]),e.useEffect((function(){n(u)}),[]);return{sortOrder:u,Sort:yn,onSort:l?function(e){var t,r=i({},u),o=Object.entries(r).reduce((function(t,n){var r=n[0],o=n[1];return r===e.field||o.orderIndex>t?t:o.orderIndex+1}),1);r[e.field]={sortDirection:"asc"===(null===(t=u[e.field])||void 0===t?void 0:t.sortDirection)?"desc":"asc",orderIndex:o},f(r),n(r)}:function(e){var t,r={};r[e.field]={sortDirection:"asc"===(null===(t=u[e.field])||void 0===t?void 0:t.sortDirection)?"desc":"asc",orderIndex:1},f(r),n(r)},reset:function(e){var t=null!=e?e:o;return s(!1),f(t),t}}}var yn=function(e){var t=e.column,n=e.sortDirection,r=e.orderIndex,o=e.isMultiSort;return t.sortable?h.jsxs("div",i({className:"sortable-caret-container"},{children:[void 0===r?null:o&&r,r&&h.jsx(h.Fragment,{children:"asc"===n?h.jsx(xn,{}):h.jsx(bn,{})})]})):null},bn=function(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:h.jsx("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"})}))},xn=function(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"sortable-caret"},{children:h.jsx("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"})}))};function wn(t){var n=t.onChange,r=t.initialPage,o=t.defaultPage,a=t.numberOfRows,l=t.count,s=e.useState(null!=r?r:o),c=s[0],u=s[1],f=Math.ceil(l/c.currentRowsPerPage),d=function(e){return u((function(t){var r=e(t);return n(r),r}))};e.useEffect((function(){n(c)}),[]);return{page:c,count:l,numberOfRows:a,Pagination:Sn,firstPage:function(){return d((function(e){return i(i({},e),{currentPage:1})}))},lastPage:function(){return d((function(e){return i(i({},e),{currentPage:f})}))},nextPage:function(){return d((function(e){return i(i({},e),{currentPage:Math.min(e.currentPage+1,f)})}))},previousPage:function(){return d((function(e){return i(i({},e),{currentPage:Math.max(e.currentPage-1,1)})}))},goToPage:function(e){},onChangeRowsPerPage:function(e){return d((function(t){return i(i({},t),{currentRowsPerPage:e})}))},reset:function(e,t){var n,i=t?o:null!==(n=null!=e?e:r)&&void 0!==n?n:o;return u(i),i}}}var Sn=function(t){var n=t.page,r=t.count,o=t.numberOfRows,a=t.firstPage,l=t.lastPage,s=t.nextPage,c=t.previousPage;t.goToPage;var u=t.onChangeRowsPerPage,f=n.currentPage,d=n.currentRowsPerPage,p=n.rowsPerPage,m=e.useId(),v=f*d-d;return h.jsxs("div",i({className:"pagination-container"},{children:[h.jsxs("div",i({className:"pagination-rpp-container"},{children:[h.jsx("label",i({htmlFor:"rows-per-page-".concat(m)},{children:"Rows per page:"})),h.jsx("select",i({id:"rows-per-page-".concat(m),value:d,onChange:function(e){return u(Number(e.target.value))},className:"pagination-select-input"},{children:p.map((function(e){return h.jsx("option",i({value:e},{children:e}),"rows-per-page-".concat(e))}))})),0===r&&h.jsx("span",{children:"0-0 of 0"}),r>0&&h.jsxs("span",{children:[v+1,"-",o+v," of ",r]})]})),h.jsxs("div",i({className:"pagination-icon-button-container"},{children:[h.jsx(jn,{"aria-label":"first page",onClick:a,SVG:kn}),h.jsx(jn,{"aria-label":"previous page",onClick:c,SVG:Nn}),h.jsx(jn,{"aria-label":"next page",onClick:s,SVG:On}),h.jsx(jn,{"aria-label":"last page",onClick:l,SVG:En})]}))]}))},jn=function(e){var t=e.onClick,n=e.SVG;return h.jsx("button",i({"aria-label":e["aria-label"],onClick:t,className:"pagination-icon-button",type:"button"},{children:h.jsx(n,{})}))},kn=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),h.jsx("path",{fill:"none",d:"M24 24H0V0h24v24z"})]}))},En=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),h.jsx("path",{fill:"none",d:"M0 0h24v24H0V0z"})]}))},Nn=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))},On=function(){return h.jsxs("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-hidden":"true",role:"presentation",className:"pagination-navigation-svg"},{children:[h.jsx("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}))};function Rn(t){var n=t.numberOfRows,r=t.onChange,o=e.useState(!1),i=o[0],a=o[1],l=e.useState([]),s=l[0],u=l[1],f=e.useState([]),d=f[0],p=f[1],m=function(e){a(e);var t=e?new Array(n).fill(0).flatMap((function(e,t){return d.includes(t)?[]:t})):[];u(t)};e.useEffect((function(){r({isAllSelected:i,selectedRows:s})}),[i,s]);return{Header:Cn,Row:Pn,selectAll:m,selectedRows:s,onSelectRow:function(e,t){u((function(n){return e?c(c([],n,!0),[t],!1):n.filter((function(e){return e!==t}))})),i&&a(!1)},isAllSelected:i,onDisableRow:function(e,t){p((function(n){var r=n.findIndex((function(e){return e===t})),o=c([],n,!0);return r>-1&&!e?(o.splice(r,1),o):-1===r&&e?(o.push(t),o):n}))},reset:function(){return m(!1),!1}}}function Cn(e){var t=e.selectAll,n=e.isAllSelected;return h.jsx("input",{name:"check-uncheck all","aria-label":"check-uncheck all",className:"select-header-checkbox",type:"checkbox",checked:n,onChange:function(e){return t(e.target.checked)}})}function Pn(e){var t=e.index,n=e.disabled,r=e.checked,o=e.onChange;return h.jsx("input",{name:"check-uncheck row","aria-label":"check-uncheck row",checked:r,onClick:function(e){return e.stopPropagation()},onChange:function(e){return o(e.target.checked,t)},disabled:n,type:"checkbox"})}function Fn(t){var n=t.columns,r=t.setColumns,o=e.useId(),a=!!n.find((function(e){return e.omit}));return h.jsxs("div",i({className:"omit-column-container"},{children:[h.jsx("span",i({className:"omit-column-title"},{children:"Columns"})),h.jsxs("div",i({className:"omit-column-list"},{children:[h.jsxs("div",i({className:"omit-column-list-item-container"},{children:[h.jsx("input",{name:"check-uncheck all",type:"checkbox",id:"omit-column-list-item-".concat(o,"-all"),checked:!a,onChange:function(){return r((function(e){return e.map((function(e){return i(i({},e),{omit:!a})}))}))}}),h.jsx("label",i({htmlFor:"omit-column-list-item-".concat(o,"-all"),className:"omit-column-label"},{children:"(Select All)"}))]})),n.map((function(e){return h.jsxs("div",i({className:"omit-column-list-item-container"},{children:[h.jsx("input",{name:"check-uncheck",id:"omit-column-list-item-".concat(o,"-").concat(String(e.field)),type:"checkbox",checked:!e.omit,onChange:function(t){return function(e){r((function(t){for(var n=c([],t,!0),r=0;rn[r])return 1*i}return 0})):e}(c,a),d=function(e,t){if(!t)return e;var n=t.currentPage,r=t.currentRowsPerPage,o=(n-1)*r,i=o+r;return e.slice(o,i)}(f,e);l(f.length),u(d)}}),[o,t,n]),o?{data:n,count:r,numberOfRows:n.length}:{data:c,count:a,numberOfRows:c.length}}function In(e,t){var n,r;for(var o in t){var i=t[o],a=i.operation,l=i.value,s=i.and,c=i.or;if(!_n(e[o],a,l))return!(!c||!In(e,(n={},n[o]=c,n)));if(s&&!In(e,(r={},r[o]=s,r)))return!1}return!0}function _n(e,t,n){if(void 0===n)return!1;var r=function(e,t){var n=typeof e;if("number"===n)t=Number(t);else if("boolean"===n)t="true"===t||"false"===t?"true"===t:Boolean(t);else if("string"===n){var r=Number(e),o=Number(t);isNaN(r)||isNaN(o)||(e=r,t=o);var i=Date.parse(e),a=Date.parse(t);isNaN(i)||isNaN(a)||(e=new Date(i),t=new Date(a))}return[e,t]}(e,n),o=r[0],i=r[1];return"Not blank"===t?!(null==o||""===o):"Is blank"===t?null==o||""===o:"Equal"===t?o===i:"Not equal"===t?o!==i:"Greater than or equal"===t?o>=i:"Less than or equal"===t?o<=i:"Greater than"===t?o>i:"Less than"===t?o1},String(e.field))},onColumnClick:function(e){return e.sortable&&s.onSort(e)},RowOptionMenu:d,hideSelect:!m,SelectHeader:function(){return h.jsx(k,{selectAll:N.selectAll,isAllSelected:N.isAllSelected})},SelectCell:function(t){var n=t.row,r=t.index,o=!m||m(n);return e.useEffect((function(){c.onDisableRow(!o,r)}),[o]),h.jsx(E,{index:r,disabled:!o,checked:N.selectedRows.includes(r),onChange:N.onSelectRow})},NoData:v,onRowClick:g,showOptionsOnRowClick:y,minColumnSize:b,columnNameFontSize:x,renderCell:function(e,t,n){if(!L.isEditable)return h.jsx(h.Fragment,{children:n});var r=L.isDirty(t,e.field),o=L.dirtyValue(t,e.field);return"boolean"==typeof e.editable&&!1===e.editable||"function"==typeof e.editable&&!1===e.editable(t[e.field],e,t)?n:h.jsx(Kn,i({className:"edit-row-cell"},{children:function(a){return h.jsxs(h.Fragment,{children:[r?h.jsx(T,{value:void 0===o?t[e.field]:o,onChange:function(n){return L.onChange(t,e.field,n)},inputType:qn[e.datatype],setOptions:e.setOptions,error:L.getValidationError(t,e.field)}):n,h.jsx("button",i({"aria-label":"edit",type:"button",className:"edit-row-button ".concat(a?"edit-row-button-hover":""),onClick:function(n){n.stopPropagation(),L.onEdit(t,e.field,r)}},{children:r?h.jsx(Yn,{}):h.jsx(Gn,{})}))]})}}))},renderHeaderPanel:function(e,t){return L.isDirty()&&L.isEditable?h.jsx("div",i({className:"table-header-panel"},{children:h.jsxs("div",i({className:"table-header-panel-row"},{children:[h.jsxs("button",i({disabled:L.isSaving,className:"table-header-panel-button ".concat(L.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:function(){return L.save(e,t)}},{children:[h.jsx(Jn,{}),"Save"]})),"|",h.jsxs("button",i({disabled:L.isSaving,className:"table-header-panel-button ".concat(L.isSaving?"table-header-panel-button-disabled":""),type:"button",onClick:L.cancel},{children:[h.jsx(Yn,{}),"Cancel"]})),L.submitError&&h.jsx("span",i({title:L.submitError,className:"save-error-message"},{children:L.submitError}))]}))})):null},Footer:S?h.jsx(S,i({},j)):null,AppsPanel:h.jsxs(h.Fragment,{children:[!p&&h.jsx(Fn,{columns:M,setColumns:I}),!!p&&h.jsx(p,{OmitColumns:h.jsx(Fn,{columns:M,setColumns:I})})]})})}function Kn(t){var n=e.useState(!1),r=n[0],o=n[1];return h.jsx("span",i({className:t.className,onMouseOver:function(){return o(!0)},onMouseLeave:function(){return o(!1)}},{children:t.children(r)}))}function Gn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-pencil"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"44",d:"M358.62 129.28L86.49 402.08 70 442l39.92-16.49 272.8-272.13-24.1-24.1zM413.07 74.84l-11.79 11.78 24.1 24.1 11.79-11.79a16.51 16.51 0 000-23.34l-.75-.75a16.51 16.51 0 00-23.35 0z"})}))}function Yn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-close-outline"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})}))}function Jn(){return h.jsx("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:"header-svg io-checkmark-outline"},{children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128L192 384l-96-96"})}))}exports.BaseDatatable=tn,exports.OmitColumn=Fn,exports.useClientSide=Mn,exports.useDatatable=function(t){var n=t.columns,r=t.onFilter,o=t.initialSortOrder,a=t.initialPage,c=void 0===a?Bn:a,u=t.initialOperationFilter,f=t.onSubmitChanges,d=t.submitError,p=t.validateChanges,m=t.uniqueRowIdentifier,h=function(e){return e.reduce((function(e,t){var n;return t.setOptions?i(i({},e),((n={})[t.field]={include:t.setOptions,isAll:!0},n)):e}),{})}(n),v=function(e,t){var n,r,o,i,a,l,s,c={};if(!t||0===Object.keys(t).length)return e;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var f=t[u];(null==f?void 0:f.include)?(c[u]||(c[u]={}),c[u].include=f.isAll?null===(n=e[u])||void 0===n?void 0:n.include:f.include,c[u].isAll=null!==(r=f.isAll)&&void 0!==r?r:f.include.length===(null===(i=null===(o=e[u])||void 0===o?void 0:o.include)||void 0===i?void 0:i.length)):(c[u]||(c[u]={}),c[u].isAll=!0,c[u].include=null!==(s=null!==(l=null===(a=e[u])||void 0===a?void 0:a.include)&&void 0!==l?l:f.include)&&void 0!==s?s:[])}return c}(h,t.initialSetFilter),g={sortOrder:null!=o?o:{},page:null!=c?c:{},operationFilter:null!=u?u:{},setFilter:null!=v?v:{}},y=e.useState(g),b=y[0],x=y[1],w=Mn(b,t.data,t.count,t.serverSide),S=w.data,j=w.count,k=w.numberOfRows,E=gn({initialSortOrder:o,onChange:function(e){return x((function(t){return i(i({},t),{sortOrder:e})}))}}),N=wn({initialPage:c,count:j,numberOfRows:k,defaultPage:Bn,onChange:function(e){return x((function(t){return i(i({},t),{page:e})}))}}),O=Rn({numberOfRows:k,onChange:function(e){return x((function(t){return i(i({},t),{select:e})}))}}),R=function(t){var n=t.onChange,r=t.initialSetFilter,o=t.defaultSetFilter,a=e.useState(r),l=a[0],s=a[1];return{SetFilter:An,setFilter:l,onSetFilter:function(e){var t=i({},l);for(var r in e)t[r]=e[r];s(t),n(t)},reset:function(e,t){var n=t?o:null!=e?e:r;return s(n),n}}}({initialSetFilter:v,defaultSetFilter:h,onChange:function(e){return x((function(t){return i(i({},t),{setFilter:e})}))}}),C=function(t){var n=t.onChange,r=t.initialOperationFilter,o=e.useState(null!=r?r:{}),a=o[0],l=o[1];return{OperationFilter:Dn,operationFilter:a,onSetOperationFilter:function(e){var t=i({},a);for(var r in e){var o=i({},e[r]);o.operation?Ln(o.value,o.operation)?delete t[r]:(o.and&&Ln(o.and.value,o.and.operation)&&delete o.and,o.or&&Ln(o.or.value,o.or.operation)&&delete o.or,t[r]=o):delete t[r]}l(t),n(t)},reset:function(e){var t,n=null!==(t=null!=e?e:r)&&void 0!==t?t:{};return l(n),n}}}({initialOperationFilter:u,onChange:function(e){return x((function(t){return i(i({},t),{operationFilter:e})}))}}),P=function(t){var n=this,r=t.uniqueRowIdentifier,o=void 0===r?"id":r,a=t.onSubmitChanges,c=t.submitError,u=t.validateChanges,f=e.useState({}),d=f[0],p=f[1],m=e.useState(!1),h=m[0],v=m[1],g=e.useState({}),y=g[0],b=g[1],x=function(e){var t=e[o];if(!t)throw new Error("Field 'id' was not found in a row, all rows must contain an 'id' or you must specify the 'uniqueRowIdentifier' prop. This error came while trying to edit a row.");return t},w=function(){b({}),p({}),v(!1)};return{isEditable:!!a,submitError:c,isSaving:h,getValidationError:function(e,t){var n=x(e);return d[n]&&d[n][t]?d[n][t].error:null},EditableCell:zn,onEdit:function(e,t,n){var r,a=x(e),l=JSON.parse(JSON.stringify(y)),s=JSON.parse(JSON.stringify(d));if(n)return s[a]&&(delete s[a][t],1===Object.keys(s[a]).length&&delete s[a]),l[a]&&(delete l[a][t],1===Object.keys(l[a]).length&&delete l[a]),p(s),void b(l);var c=l[a];l[a]=i(i({},c||{}),((r={})[t]=e[t],r[o]=a,r)),b(l)},isDirty:function(e,t){if(!e||!t)return Object.entries(y).length>0;var n=x(e);return void 0!==y[n]&&void 0!==y[n][t]},onChange:function(e,t,n){var r=x(e);b((function(e){var o,a=i({},e),l=a[r];return a[r]=i(i({},l||{}),((o={})[t]=n,o)),a}))},dirtyValue:function(e,t){var n=x(e);if(void 0!==y[n]&&void 0!==y[n][t])return y[n][t]},save:function(e,t){return l(n,void 0,void 0,(function(){var n,r,l,c,f,m,h;return s(this,(function(s){switch(s.label){case 0:if(!a)return[2];if(p({}),n=!1,u){for(r=Object.values(y),l=JSON.parse(JSON.stringify(d)),c=u.__allRows__,f=function(i){var a=r[i],s=x(a),f=t.find((function(e){return e[o]===s}));for(var d in a)if(Object.prototype.hasOwnProperty.call(a,d)){var p=u[d],m={fieldValidatorError:null,allFieldValidatorError:null};p&&(m.fieldValidatorError=p(a[d],d,y[s],e,f)),c&&(m.allFieldValidatorError=c(a[d],d,y[s],e,f)),(m.fieldValidatorError||m.allFieldValidatorError)&&(l[s]||(l[s]={}),l[s][d]={value:a[d],error:m.fieldValidatorError&&m.allFieldValidatorError?"".concat(m.fieldValidatorError," \n").concat(m.allFieldValidatorError):m.fieldValidatorError?m.fieldValidatorError:m.allFieldValidatorError},n=!0)}for(var d in f)if(Object.prototype.hasOwnProperty.call(f,d)&&c&&(!l[s]||!l[s][d])){var h=c(f[d],d,y[s],e,f);h&&(l[s]||(l[s]={}),l[s][d]={error:h,value:f[d]},n=!0)}},m=0;m row.isActive} columnNameFontSize={16} {...controller} diff --git a/src/lib/BaseDatatable.tsx b/src/lib/BaseDatatable.tsx index ea9b665..aa78b6f 100644 --- a/src/lib/BaseDatatable.tsx +++ b/src/lib/BaseDatatable.tsx @@ -123,6 +123,8 @@ export function BaseDatatable>(props: Datatable { RowOptionMenu && (