(()=>{"use strict";var e,t,n,r,o,i,s,a,l,c,u,d,f,p={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var o,i,s,a={};for(s in n)"key"==s?o=n[s]:"ref"==s?i=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return w(t,a,o,i,null)}function w(e,r,o,i,s){var a={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++n:s,__i:-1,__u:0};return null==s&&null!=t.vnode&&t.vnode(a),a}function _(){return{current:null}}function x(e){return e.children}function S(e,t){this.props=e,this.context=t}function C(e,t){if(null==t)return e.__?C(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?C(e):null}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function R(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!I.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||s)(I)}function I(){for(var e,n,r,i,s,l,c,u=1;o.length;)o.length>u&&o.sort(a),e=o.shift(),u=o.length,e.__d&&(r=void 0,i=void 0,s=(i=(n=e).__v).__e,l=[],c=[],n.__P&&((r=v({},i)).__v=i.__v+1,t.vnode&&t.vnode(r),N(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[s]:null,l,null==s?C(i):s,!!(32&i.__u),c),r.__v=i.__v,r.__.__k[r.__i]=r,L(l,r,c),i.__e=i.__=null,r.__e!=s&&E(r)));I.__r=0}function P(e,t,n,r,o,i,s,a,l,c,u){var d,f,g,v,y,b,_,S=r&&r.__k||h,E=t.length;for(l=function(e,t,n,r,o){var i,s,a,l,c,u=n.length,d=u,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[i]=w(null,s,null,null,null):m(s)?s=e.__k[i]=w(x,{children:s},null,null,null):null==s.constructor&&s.__b>0?s=e.__k[i]=w(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,l=i+f,s.__=e,s.__b=e.__b+1,a=null,-1!=(c=s.__i=M(s,n,l,d))&&(d--,(a=n[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(o>u?f--:o<u&&f++),"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?f--:c==l+1?f++:(c>l?f--:f++,s.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)null!=(a=n[i])&&!(2&a.__u)&&(a.__e==r&&(r=C(a)),j(a,a));return r}(n,t,S,l,E),d=0;d<E;d++)null!=(g=n.__k[d])&&(f=-1==g.__i?p:S[g.__i]||p,g.__i=d,b=N(e,g,f,o,i,s,a,l,c,u),v=g.__e,g.ref&&f.ref!=g.ref&&(f.ref&&$(f.ref,null,g),u.push(g.ref,g.__c||v,g)),null==y&&null!=v&&(y=v),(_=!!(4&g.__u))||f.__k===g.__k?l=k(g,l,e,_):"function"==typeof g.type&&void 0!==b?l=b:v&&(l=v.nextSibling),g.__u&=-7);return n.__e=y,l}function k(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=k(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=C(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function O(e,t){return t=t||[],null==e||"boolean"==typeof e||(m(e)?e.some(function(e){O(e,t)}):t.push(e)),t}function M(e,t,n,r){var o,i,s,a=e.key,l=e.type,c=t[n],u=null!=c&&!(2&c.__u);if(null===c&&null==a||u&&a==c.key&&l==c.type)return n;if(r>(u?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(c=t[s=o>=0?o--:i++])&&!(2&c.__u)&&a==c.key&&l==c.type)return s;return-1}function T(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||g.test(t)?n:n+"px"}function A(e,t,n,r,o){var i,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||T(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||T(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(l,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=c,e.addEventListener(t,i?d:u,i)):e.removeEventListener(t,i?d:u,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(n){if(this.l){var r=this.l[n.type+e];if(null==n.t)n.t=c++;else if(n.t<r.u)return;return r(t.event?t.event(n):n)}}}function N(e,n,r,o,i,s,a,l,c,u){var d,f,p,h,g,b,w,_,C,E,R,I,k,O,M,T,A,F=n.type;if(null!=n.constructor)return null;128&r.__u&&(c=!!(32&r.__u),s=[l=n.__e=r.__e]),(d=t.__b)&&d(n);e:if("function"==typeof F)try{if(_=n.props,C="prototype"in F&&F.prototype.render,E=(d=F.contextType)&&o[d.__c],R=d?E?E.props.value:d.__:o,r.__c?w=(f=n.__c=r.__c).__=f.__E:(C?n.__c=f=new F(_,R):(n.__c=f=new S(_,R),f.constructor=F,f.render=q),E&&E.sub(f),f.state||(f.state={}),f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),C&&null==f.__s&&(f.__s=f.state),C&&null!=F.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=v({},f.__s)),v(f.__s,F.getDerivedStateFromProps(_,f.__s))),h=f.props,g=f.state,f.__v=n,p)C&&null==F.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),C&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(C&&null==F.getDerivedStateFromProps&&_!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(_,R),n.__v==r.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(_,f.__s,R)){for(n.__v!=r.__v&&(f.props=_,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),I=0;I<f._sb.length;I++)f.__h.push(f._sb[I]);f._sb=[],f.__h.length&&a.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(_,f.__s,R),C&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(h,g,b)})}if(f.context=R,f.props=_,f.__P=e,f.__e=!1,k=t.__r,O=0,C){for(f.state=f.__s,f.__d=!1,k&&k(n),d=f.render(f.props,f.state,f.context),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[]}else do{f.__d=!1,k&&k(n),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++O<25);f.state=f.__s,null!=f.getChildContext&&(o=v(v({},o),f.getChildContext())),C&&!p&&null!=f.getSnapshotBeforeUpdate&&(b=f.getSnapshotBeforeUpdate(h,g)),T=d,null!=d&&d.type===x&&null==d.key&&(T=D(d.props.children)),l=P(e,m(T)?T:[T],n,r,o,i,s,a,l,c,u),f.base=n.__e,n.__u&=-161,f.__h.length&&a.push(f),w&&(f.__E=f.__=null)}catch(e){if(n.__v=null,c||null!=s)if(e.then){for(n.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,n.__e=l}else{for(A=s.length;A--;)y(s[A]);z(n)}else n.__e=r.__e,n.__k=r.__k,e.then||z(n);t.__e(e,n,r)}else null==s&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):l=n.__e=V(r.__e,n,r,o,i,s,a,c,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:l}function z(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(z)}function L(e,n,r){for(var o=0;o<r.length;o++)$(r[o],r[++o],r[++o]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function D(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:m(e)?e.map(D):v({},e)}function V(n,r,o,i,s,a,l,c,u){var d,f,h,g,v,b,w,_=o.props||p,x=r.props,S=r.type;if("svg"==S?s="http://www.w3.org/2000/svg":"math"==S?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(d=0;d<a.length;d++)if((v=a[d])&&"setAttribute"in v==!!S&&(S?v.localName==S:3==v.nodeType)){n=v,a[d]=null;break}if(null==n){if(null==S)return document.createTextNode(x);n=document.createElementNS(s,S,x.is&&x),c&&(t.__m&&t.__m(r,a),c=!1),a=null}if(null==S)_===x||c&&n.data==x||(n.data=x);else{if(a=a&&e.call(n.childNodes),!c&&null!=a)for(_={},d=0;d<n.attributes.length;d++)_[(v=n.attributes[d]).name]=v.value;for(d in _)if(v=_[d],"children"==d);else if("dangerouslySetInnerHTML"==d)h=v;else if(!(d in x)){if("value"==d&&"defaultValue"in x||"checked"==d&&"defaultChecked"in x)continue;A(n,d,null,v,s)}for(d in x)v=x[d],"children"==d?g=v:"dangerouslySetInnerHTML"==d?f=v:"value"==d?b=v:"checked"==d?w=v:c&&"function"!=typeof v||_[d]===v||A(n,d,v,_[d],s);if(f)c||h&&(f.__html==h.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(h&&(n.innerHTML=""),P("template"==r.type?n.content:n,m(g)?g:[g],r,o,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":s,a,l,a?a[0]:o.__k&&C(o,0),c,u),null!=a)for(d=a.length;d--;)y(a[d]);c||(d="value","progress"==S&&null==b?n.removeAttribute("value"):null!=b&&(b!==n[d]||"progress"==S&&!b||"option"==S&&b!=_[d])&&A(n,d,b,_[d],s),d="checked",null!=w&&w!=n[d]&&A(n,d,w,_[d],s))}return n}function $(e,n,r){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==n||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function j(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||$(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&j(o[i],n,r||"function"!=typeof e.type);r||y(e.__e),e.__c=e.__=e.__e=void 0}function q(e,t,n){return this.constructor(e,n)}function H(n,r,o){var i,s,a,l;r==document&&(r=document.documentElement),t.__&&t.__(n,r),s=(i="function"==typeof o)?null:o&&o.__k||r.__k,a=[],l=[],N(r,n=(!i&&o||r).__k=b(x,null,[n]),s||p,p,r.namespaceURI,!i&&o?[o]:s?null:r.firstChild?e.call(r.childNodes):null,a,!i&&o?o:s?s.__e:r.firstChild,i,l),L(a,n,l)}function W(e,t){H(e,t,W)}function U(t,n,r){var o,i,s,a,l=v({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),n)"key"==s?o=n[s]:"ref"==s?i=n[s]:l[s]=void 0===n[s]&&null!=a?a[s]:n[s];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):r),w(t.type,l,o||t.key,i||t.ref,null)}function B(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,R(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+f++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e=h.slice,t={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},n=0,r=function(e){return null!=e&&null==e.constructor},S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},n),this.props)),e&&v(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),R(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),R(this))},S.prototype.render=x,o=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0,l=/(PointerCapture)$|Capture$/i,c=0,u=F(!1),d=F(!0),f=0;var G,Z,K,Q,X=0,J=[],Y=t,ee=Y.__b,te=Y.__r,ne=Y.diffed,re=Y.__c,oe=Y.unmount,ie=Y.__;function se(e,t){Y.__h&&Y.__h(Z,e,X||t),X=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ae(e){return X=1,le(Ce,e)}function le(e,t,n){var r=se(G++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ce(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter(function(e){return!!e.__c});if(o.every(function(e){return!e.__N}))return!i||i.call(this,e,t,n);var s=r.__c.props!==e;return o.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),i&&i.call(this,e,t,n)||s};Z.__f=!0;var i=Z.shouldComponentUpdate,s=Z.componentWillUpdate;Z.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},Z.shouldComponentUpdate=o}return r.__N||r.__}function ce(e,t){var n=se(G++,3);!Y.__s&&Se(n.__H,t)&&(n.__=e,n.u=t,Z.__H.__h.push(n))}function ue(e,t){var n=se(G++,4);!Y.__s&&Se(n.__H,t)&&(n.__=e,n.u=t,Z.__h.push(n))}function de(e){return X=5,pe(function(){return{current:e}},[])}function fe(e,t,n){X=6,ue(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function pe(e,t){var n=se(G++,7);return Se(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function he(e,t){return X=8,pe(function(){return e},t)}function ge(e){var t=Z.context[e.__c],n=se(G++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Z)),t.props.value):e.__}function me(e,t){Y.useDebugValue&&Y.useDebugValue(t?t(e):e)}function ve(){var e=se(G++,11);if(!e.__){for(var t=Z.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function ye(){for(var e;e=J.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_e),e.__H.__h.forEach(xe),e.__H.__h=[]}catch(t){e.__H.__h=[],Y.__e(t,e.__v)}}Y.__b=function(e){Z=null,ee&&ee(e)},Y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ie&&ie(e,t)},Y.__r=function(e){te&&te(e),G=0;var t=(Z=e.__c).__H;t&&(K===Z?(t.__h=[],Z.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(_e),t.__h.forEach(xe),t.__h=[],G=0)),K=Z},Y.diffed=function(e){ne&&ne(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==J.push(t)&&Q===Y.requestAnimationFrame||((Q=Y.requestAnimationFrame)||we)(ye)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),K=Z=null},Y.__c=function(e,t){t.some(function(e){try{e.__h.forEach(_e),e.__h=e.__h.filter(function(e){return!e.__||xe(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Y.__e(n,e.__v)}}),re&&re(e,t)},Y.unmount=function(e){oe&&oe(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{_e(e)}catch(e){t=e}}),n.__H=void 0,t&&Y.__e(t,n.__v))};var be="function"==typeof requestAnimationFrame;function we(e){var t,n=function(){clearTimeout(r),be&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);be&&(t=requestAnimationFrame(n))}function _e(e){var t=Z,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Z=t}function xe(e){var t=Z;e.__c=e.__(),Z=t}function Se(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Ce(e,t){return"function"==typeof t?t(e):t}function Ee(e,t){for(var n in t)e[n]=t[n];return e}function Re(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Ie(e,t){var n=t(),r=ae({t:{__:n,u:t}}),o=r[0].t,i=r[1];return ue(function(){o.__=n,o.u=t,Pe(o)&&i({t:o})},[e,n,t]),ce(function(){return Pe(o)&&i({t:o}),e(function(){Pe(o)&&i({t:o})})},[e]),n}function Pe(e){var t,n,r=e.u,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function ke(e){e()}function Oe(e){return e}function Me(){return[!1,ke]}var Te=ue;function Ae(e,t){this.props=e,this.context=t}function Fe(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Re(this.props,e)}function r(t){return this.shouldComponentUpdate=n,b(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r.type=e,r}(Ae.prototype=new S).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(e,t){return Re(this.props,e)||Re(this.state,t)};var Ne=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ne&&Ne(e)};var ze="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Le(e){function t(t){var n=Ee({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=ze,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var De=function(e,t){return null==e?null:O(O(e).map(t))},Ve={map:De,forEach:De,count:function(e){return e?O(e).length:0},only:function(e){var t=O(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:O},$e=t.__e;t.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);$e(e,t,n,r)};var je=t.unmount;function qe(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=Ee({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return qe(e,t,n)})),e}function He(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return He(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function We(){this.__u=0,this.o=null,this.__b=null}function Ue(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Be(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?b(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function Ge(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),je&&je(e)},(We.prototype=new S).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=Ue(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=He(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},We.prototype.componentWillUnmount=function(){this.o=[]},We.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=qe(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&b(x,null,e.fallback);return o&&(o.__u&=-33),[b(x,null,t.__a?null:e.children),o]};var Ze=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Ke(e){return this.getChildContext=function(){return e.context},e.children}function Qe(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){H(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}H(b(Ke,{context:t.context},e.__v),t.v)}function Xe(e,t){var n=b(Qe,{__v:e,h:t});return n.containerInfo=t,n}(Ge.prototype=new S).__a=function(e){var t=this,n=Ue(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ze(t,e,r)):o()};n?n(i):i()}},Ge.prototype.render=function(e){this.i=null,this.l=new Map;var t=O(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ge.prototype.componentDidUpdate=Ge.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ze(e,n,t)})};var Je="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ye=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,et=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,tt=/[A-Z0-9]/g,nt="undefined"!=typeof document,rt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function ot(e,t,n){return null==t.__k&&(t.textContent=""),H(e,t),"function"==typeof n&&n(),e?e.__c:null}function it(e,t,n){return W(e,t),"function"==typeof n&&n(),e?e.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var st=t.event;function at(){}function lt(){return this.cancelBubble}function ct(){return this.defaultPrevented}t.event=function(e){return st&&(e=st(e)),e.persist=at,e.isPropagationStopped=lt,e.isDefaultPrevented=ct,e.nativeEvent=e};var ut,dt={enumerable:!1,configurable:!0,get:function(){return this.class}},ft=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1===n.indexOf("-");for(var i in t){var s=t[i];if(!("value"===i&&"defaultValue"in t&&null==s||nt&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===s?s="":"translate"===a&&"no"===s?s=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||rt(t.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":et.test(i)&&(i=a):a=i="oninput":o&&Ye.test(i)?i=i.replace(tt,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===a&&r[i=a]&&(i="oninputCapture"),r[i]=s}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=O(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=O(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",dt)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Je,ft&&ft(e)};var pt=t.__r;t.__r=function(e){pt&&pt(e),ut=e.__c};var ht=t.diffed;t.diffed=function(e){ht&&ht(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ut=null};var gt={ReactCurrentDispatcher:{current:{readContext:function(e){return ut.__n[e.__c].props.value},useCallback:he,useContext:ge,useDebugValue:me,useDeferredValue:Oe,useEffect:ce,useId:ve,useImperativeHandle:fe,useInsertionEffect:Te,useLayoutEffect:ue,useMemo:pe,useReducer:le,useRef:de,useState:ae,useSyncExternalStore:Ie,useTransition:Me}}},mt="18.3.1";function vt(e){return b.bind(null,e)}function yt(e){return!!e&&e.$$typeof===Je}function bt(e){return yt(e)&&e.type===x}function wt(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function _n(e){return yt(e)?U.apply(null,arguments):e}function _t(e){return!!e.__k&&(H(null,e),!0)}function xt(e){return e&&(e.base||1===e.nodeType&&e)||null}var St=function(e,t){return e(t)},Ct=function(e,t){return e(t)},Et=x,Rt=yt,It={useState:ae,useId:ve,useReducer:le,useEffect:ce,useLayoutEffect:ue,useInsertionEffect:Te,useTransition:Me,useDeferredValue:Oe,useSyncExternalStore:Ie,startTransition:ke,useRef:de,useImperativeHandle:fe,useMemo:pe,useCallback:he,useContext:ge,useDebugValue:me,version:"18.3.1",Children:Ve,render:ot,hydrate:it,unmountComponentAtNode:_t,createPortal:Xe,createElement:b,createContext:B,createFactory:vt,cloneElement:_n,createRef:_,Fragment:x,isValidElement:yt,isElement:Rt,isFragment:bt,isMemo:wt,findDOMNode:xt,Component:S,PureComponent:Ae,memo:Fe,forwardRef:Le,flushSync:Ct,unstable_batchedUpdates:St,StrictMode:Et,Suspense:We,SuspenseList:Ge,lazy:Be,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:gt},Pt=Object.freeze({__proto__:null,Children:Ve,Component:S,Fragment:x,PureComponent:Ae,StrictMode:Et,Suspense:We,SuspenseList:Ge,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:gt,cloneElement:_n,createContext:B,createElement:b,createFactory:vt,createPortal:Xe,createRef:_,default:It,findDOMNode:xt,flushSync:Ct,forwardRef:Le,hydrate:it,isElement:Rt,isFragment:bt,isMemo:wt,isValidElement:yt,lazy:Be,memo:Fe,render:ot,startTransition:ke,unmountComponentAtNode:_t,unstable_batchedUpdates:St,useCallback:he,useContext:ge,useDebugValue:me,useDeferredValue:Oe,useEffect:ce,useErrorBoundary:function(e){var t=se(G++,10),n=ae();return t.__=e,Z.componentDidCatch||(Z.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:ve,useImperativeHandle:fe,useInsertionEffect:Te,useLayoutEffect:ue,useMemo:pe,useReducer:le,useRef:de,useState:ae,useSyncExternalStore:Ie,useTransition:Me,version:mt}),kt=Symbol.for("preact-signals");function Ot(){if(Ft>1)Ft--;else{for(var e,t=!1;void 0!==At;){var n=At;for(At=void 0,Nt++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&$t(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(Nt=0,Ft--,t)throw e}}var Mt=void 0;function Tt(e){var t=Mt;Mt=void 0;try{return e()}finally{Mt=t}}var At=void 0,Ft=0,Nt=0,zt=0;function Lt(e){if(void 0!==Mt){var t=e.n;if(void 0===t||t.t!==Mt)return t={i:0,S:e,p:Mt.s,n:void 0,t:Mt,e:void 0,x:void 0,r:t},void 0!==Mt.s&&(Mt.s.n=t),Mt.s=t,e.n=t,32&Mt.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Mt.s,t.n=void 0,Mt.s.n=t,Mt.s=t),t}}function Dt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Vt(e,t){return new Dt(e,t)}function $t(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jt(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function qt(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function Ht(e,t){Dt.call(this,void 0),this.x=e,this.s=void 0,this.g=zt-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Wt(e,t){return new Ht(e,t)}function Ut(e){var t=e.u;if(e.u=void 0,"function"==typeof t){Ft++;var n=Mt;Mt=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Bt(e),t}finally{Mt=n,Ot()}}}function Bt(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ut(e)}function Gt(e){if(Mt!==this)throw new Error("Out-of-order effect");qt(this),Mt=e,this.f&=-2,8&this.f&&Bt(this),Ot()}function Zt(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function Kt(e,t){var n=new Zt(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}Dt.prototype.brand=kt,Dt.prototype.h=function(){return!0},Dt.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:Tt(function(){var e;null==(e=t.W)||e.call(t)}))},Dt.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&Tt(function(){var e;null==(e=t.Z)||e.call(t)}))}},Dt.prototype.subscribe=function(e){var t=this;return Kt(function(){var n=t.value,r=Mt;Mt=void 0;try{e(n)}finally{Mt=r}},{name:"sub"})},Dt.prototype.valueOf=function(){return this.value},Dt.prototype.toString=function(){return this.value+""},Dt.prototype.toJSON=function(){return this.value},Dt.prototype.peek=function(){var e=Mt;Mt=void 0;try{return this.value}finally{Mt=e}},Object.defineProperty(Dt.prototype,"value",{get:function(){var e=Lt(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Nt>100)throw new Error("Cycle detected");this.v=e,this.i++,zt++,Ft++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{Ot()}}}}),Ht.prototype=new Dt,Ht.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===zt)return!0;if(this.g=zt,this.f|=1,this.i>0&&!$t(this))return this.f&=-2,!0;var e=Mt;try{jt(this),Mt=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Mt=e,qt(this),this.f&=-2,!0},Ht.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Dt.prototype.S.call(this,e)},Ht.prototype.U=function(e){if(void 0!==this.t&&(Dt.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},Ht.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(Ht.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Lt(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Zt.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Zt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ut(this),jt(this),Ft++;var e=Mt;return Mt=this,Gt.bind(this,e)},Zt.prototype.N=function(){2&this.f||(this.f|=2,this.o=At,At=this)},Zt.prototype.d=function(){this.f|=8,1&this.f||Bt(this)},Zt.prototype.dispose=function(){this.d()};var Qt,Xt,Jt="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,Yt=[];function en(e,n){t[e]=n.bind(null,t[e]||function(){})}function tn(e){Xt&&Xt(),Xt=e&&e.S()}function nn(e){var t=this,n=e.data,o=function(e){return ae(function(){return Vt(e,undefined)})[0]}(n);o.value=n;var i=pe(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var i=Wt(function(){var e=o.value.value;return 0===e?0:!0===e?"":e||""}),s=Wt(function(){return!Array.isArray(i.value)&&!r(i.value)}),a=Kt(function(){if(this.N=an,s.value){var t=i.value;e.__v&&e.__v.__e&&3===e.__v.__e.nodeType&&(e.__v.__e.data=t)}}),l=t.__$u.d;return t.__$u.d=function(){a(),l.call(this)},[s,i]},[]),s=i[0],a=i[1];return s.value?a.peek():a.value}function rn(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=Vt(n);return{o:function(e,t){i.value=e,r=t},d:Kt(function(){this.N=an;var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))})}}Kt(function(){Qt=this.N})(),nn.displayName="ReactiveTextNode",Object.defineProperties(Dt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:nn},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),en("__b",function(e,t){if(Jt&&"function"==typeof t.type&&window.__PREACT_SIGNALS_DEVTOOLS__.exitComponent(),"string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof Dt&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)}),en("__r",function(e,t){if(Jt&&"function"==typeof t.type&&window.__PREACT_SIGNALS_DEVTOOLS__.enterComponent(t),t.type!==x){tn();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return Kt(function(){e=this}),e.c=function(){r.__$f|=1,r.setState({})},e}())),tn(n)}e(t)}),en("__e",function(e,t,n,r){Jt&&window.__PREACT_SIGNALS_DEVTOOLS__.exitComponent(),tn(),e(t,n,r)}),en("diffed",function(e,t){var n;if(Jt&&"function"==typeof t.type&&window.__PREACT_SIGNALS_DEVTOOLS__.exitComponent(),tn(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];void 0===a||s in r||(a.d(),i[s]=void 0)}else i={},n.U=i;for(var l in r){var c=i[l],u=r[l];void 0===c?(c=rn(n,l,u,o),i[l]=c):c.o(u,o)}}}e(t)}),en("unmount",function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)}),en("__h",function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)}),S.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&void 0!==n.s;for(var o in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var i=2&this.__$f;if(!(r||i||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var s in e)if("__source"!==s&&e[s]!==this.props[s])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};var on=function(e){queueMicrotask(function(){queueMicrotask(e)})};function sn(){!function(e){if(Ft>0)return e();Ft++;try{return e()}finally{Ot()}}(function(){for(var e;e=Yt.shift();)Qt.call(e)})}function an(){1===Yt.push(this)&&(t.requestAnimationFrame||on)(sn)}var ln=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},un=new class{#e=cn;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},dn="undefined"==typeof window||"Deno"in globalThis;function fn(){}function pn(e){return"number"==typeof e&&e>=0&&e!==1/0}function hn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gn(e,t){return"function"==typeof e?e(t):e}function mn(e,t){return"function"==typeof e?e(t):e}function vn(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s)if(r){if(t.queryHash!==bn(s,t.options))return!1}else if(!xn(t.queryKey,s))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function yn(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(wn(t.options.mutationKey)!==wn(i))return!1}else if(!xn(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function bn(e,t){return(t?.queryKeyHashFn||wn)(e)}function wn(e){return JSON.stringify(e,(e,t)=>In(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function xn(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>xn(e[n],t[n]))}var Sn=Object.prototype.hasOwnProperty;function Cn(e,t){if(e===t)return e;const n=Rn(e)&&Rn(t);if(!(n||In(e)&&In(t)))return t;const r=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),i=o.length,s=n?new Array(i):{};let a=0;for(let l=0;l<i;l++){const i=n?l:o[l],c=e[i],u=t[i];if(c===u){s[i]=c,(n?l<r:Sn.call(e,i))&&a++;continue}if(null===c||null===u||"object"!=typeof c||"object"!=typeof u){s[i]=u;continue}const d=Cn(c,u);s[i]=d,d===c&&a++}return r===i&&a===r?e:s}function En(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Rn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function In(e){if(!Pn(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!Pn(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Pn(e){return"[object Object]"===Object.prototype.toString.call(e)}function kn(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?Cn(e,t):t}function On(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Mn(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Tn=Symbol();function An(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Tn?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function Fn(e,t){return"function"==typeof e?e(...t):!!e}var Nn=new class extends ln{#n;#r;#o;constructor(){super(),this.#o=e=>{if(!dn&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#o=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:"hidden"!==globalThis.document?.visibilityState}};function zn(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}var Ln=function(e){setTimeout(e,0)},Dn=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},o=Ln;const i=r=>{t?e.push(r):o(()=>{n(r)})};return{batch:i=>{let s;t++;try{s=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return s},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{o=e}}}(),Vn=new class extends ln{#i=!0;#r;#o;constructor(){super(),this.#o=e=>{if(!dn&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#o=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}};function $n(e){return Math.min(1e3*2**e,3e4)}function jn(e){return"online"!==(e??"online")||Vn.isOnline()}var qn=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Hn(e){let t,n=!1,r=0;const o=zn(),i=()=>"pending"!==o.status,s=()=>Nn.isFocused()&&("always"===e.networkMode||Vn.isOnline())&&e.canRun(),a=()=>jn(e.networkMode)&&e.canRun(),l=e=>{i()||(t?.(),o.resolve(e))},c=e=>{i()||(t?.(),o.reject(e))},u=()=>new Promise(n=>{t=e=>{(i()||s())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,i()||e.onContinue?.()}),d=()=>{if(i())return;let t;const o=0===r?e.initialPromise:void 0;try{t=o??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(l).catch(t=>{if(i())return;const o=e.retry??(dn?0:3),a=e.retryDelay??$n,l="function"==typeof a?a(r,t):a,f=!0===o||"number"==typeof o&&r<o||"function"==typeof o&&o(r,t);var p;!n&&f?(r++,e.onFail?.(r,t),(p=l,new Promise(e=>{un.setTimeout(e,p)})).then(()=>s()?void 0:u()).then(()=>{n?c(t):d()})):c(t)})};return{promise:o,status:()=>o.status,cancel:t=>{if(!i()){const n=new qn(t);c(n),e.onCancel?.(n)}},continue:()=>(t?.(),o),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?d():u().then(d),o)}}var Wn=class{#s;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pn(this.gcTime)&&(this.#s=un.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dn?1/0:3e5))}clearGcTimeout(){this.#s&&(un.clearTimeout(this.#s),this.#s=void 0)}},Un=class extends Wn{#a;#l;#c;#u;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#c=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=Zn(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=Zn(this.options);void 0!==e.data&&(this.setState(Gn(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){const n=kn(this.state.data,e,this.options);return this.#h({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#h({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(fn).catch(fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==mn(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===gn(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!hn(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#h({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,n.signal)})},o=()=>{const e=An(this.options,t),n=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,n,this):e(n)},i=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:o};return r(e),e})();this.options.behavior?.onFetch(i,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===i.fetchOptions?.meta||this.#h({type:"fetch",meta:i.fetchOptions?.meta}),this.#d=Hn({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof qn&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:()=>{this.#h({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof qn){if(e.silent)return this.#d.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#h({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Bn(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...Gn(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?n:void 0,n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Dn.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function Bn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jn(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function Gn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Zn(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kn=class extends ln{constructor(e,t){super(),this.options=t,this.#u=e,this.#g=null,this.#m=zn(),this.bindMethods(),this.setOptions(t)}#u;#v=void 0;#y=void 0;#b=void 0;#w;#_;#m;#g;#x;#S;#C;#E;#R;#I;#P=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#v.addObserver(this),Qn(this.#v,this.options)?this.#k():this.updateResult(),this.#O())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xn(this.#v,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xn(this.#v,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#T(),this.#v.removeObserver(this)}setOptions(e){const t=this.options,n=this.#v;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof mn(this.options.enabled,this.#v))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#A(),this.#v.setOptions(this.options),t._defaulted&&!En(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#v,observer:this});const r=this.hasListeners();r&&Jn(this.#v,n,this.options,t)&&this.#k(),this.updateResult(),!r||this.#v===n&&mn(this.options.enabled,this.#v)===mn(t.enabled,this.#v)&&gn(this.options.staleTime,this.#v)===gn(t.staleTime,this.#v)||this.#F();const o=this.#N();!r||this.#v===n&&mn(this.options.enabled,this.#v)===mn(t.enabled,this.#v)&&o===this.#I||this.#z(o)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),n=this.createResult(t,e);return r=n,!En(this.getCurrentResult(),r)&&(this.#b=n,this.#_=this.options,this.#w=this.#v.state),n;var r}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#m.status||this.#m.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#P.add(e)}getCurrentQuery(){return this.#v}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),n=this.#u.getQueryCache().build(this.#u,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#k({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#k(e){this.#A();let t=this.#v.fetch(this.options,e);return e?.throwOnError||(t=t.catch(fn)),t}#F(){this.#M();const e=gn(this.options.staleTime,this.#v);if(dn||this.#b.isStale||!pn(e))return;const t=hn(this.#b.dataUpdatedAt,e)+1;this.#E=un.setTimeout(()=>{this.#b.isStale||this.updateResult()},t)}#N(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#v):this.options.refetchInterval)??!1}#z(e){this.#T(),this.#I=e,!dn&&!1!==mn(this.options.enabled,this.#v)&&pn(this.#I)&&0!==this.#I&&(this.#R=un.setInterval(()=>{(this.options.refetchIntervalInBackground||Nn.isFocused())&&this.#k()},this.#I))}#O(){this.#F(),this.#z(this.#N())}#M(){this.#E&&(un.clearTimeout(this.#E),this.#E=void 0)}#T(){this.#R&&(un.clearInterval(this.#R),this.#R=void 0)}createResult(e,t){const n=this.#v,r=this.options,o=this.#b,i=this.#w,s=this.#_,a=e!==n?e.state:this.#y,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const o=this.hasListeners(),i=!o&&Qn(e,t),s=o&&Jn(e,n,t,r);(i||s)&&(u={...u,...Bn(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:h}=u;c=u.data;let g=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===h){let e;o?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=o.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#C?.state.data,this.#C):t.placeholderData,void 0!==e&&(h="success",c=kn(o?.data,e,t),d=!0)}if(t.select&&void 0!==c&&!g)if(o&&c===i?.data&&t.select===this.#x)c=this.#S;else try{this.#x=t.select,c=t.select(c),c=kn(o?.data,c,t),this.#S=c,this.#g=null}catch(e){this.#g=e}this.#g&&(f=this.#g,c=this.#S,p=Date.now(),h="error");const m="fetching"===u.fetchStatus,v="pending"===h,y="error"===h,b=v&&m,w=void 0!==c,_={status:h,fetchStatus:u.fetchStatus,isPending:v,isSuccess:"success"===h,isError:y,isInitialLoading:b,isLoading:b,data:c,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>a.dataUpdateCount||u.errorUpdateCount>a.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:y&&!w,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:y&&w,isStale:Yn(e,t),refetch:this.refetch,promise:this.#m,isEnabled:!1!==mn(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===_.status?e.reject(_.error):void 0!==_.data&&e.resolve(_.data)},r=()=>{const e=this.#m=_.promise=zn();t(e)},o=this.#m;switch(o.status){case"pending":e.queryHash===n.queryHash&&t(o);break;case"fulfilled":"error"!==_.status&&_.data===o.value||r();break;case"rejected":"error"===_.status&&_.error===o.reason||r()}}return _}updateResult(){const e=this.#b,t=this.createResult(this.#v,this.options);this.#w=this.#v.state,this.#_=this.options,void 0!==this.#w.data&&(this.#C=this.#v),En(t,e)||(this.#b=t,this.#L({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#P.size)return!0;const r=new Set(n??this.#P);return this.options.throwOnError&&r.add("error"),Object.keys(this.#b).some(t=>{const n=t;return this.#b[n]!==e[n]&&r.has(n)})})()}))}#A(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#v)return;const t=this.#v;this.#v=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#O()}#L(e){Dn.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#u.getQueryCache().notify({query:this.#v,type:"observerResultsUpdated"})})}};function Qn(e,t){return function(e,t){return!1!==mn(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&Xn(e,t,t.refetchOnMount)}function Xn(e,t,n){if(!1!==mn(t.enabled,e)&&"static"!==gn(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&Yn(e,t)}return!1}function Jn(e,t,n,r){return(e!==t||!1===mn(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&Yn(e,n)}function Yn(e,t){return!1!==mn(t.enabled,e)&&e.isStaleByTime(gn(t.staleTime,e))}function er(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let n=!1;const c=e=>{!function(e,n,r){let o,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t.signal,i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)})}(e,0,()=>n=!0)},u=An(t.options,t.fetchOptions),d=async(e,r,o)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:o?"backward":"forward",meta:t.options.meta};return c(e),e})(),s=await u(i),{maxPages:a}=t.options,l=o?Mn:On;return{pages:l(e.pages,s,a),pageParams:l(e.pageParams,r,a)}};if(o&&i.length){const e="backward"===o,t={pages:i,pageParams:s},n=(e?nr:tr)(r,t);a=await d(t,n,e)}else{const t=e??i.length;do{const e=0===l?s[0]??r.initialPageParam:tr(r,a);if(l>0&&null==e)break;a=await d(a,e),l++}while(l<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function tr(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function rr(e,t){return!!t&&null!=tr(e,t)}function or(e,t){return!(!t||!e.getPreviousPageParam)&&null!=nr(e,t)}var ir=class extends Kn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:er()})}getOptimisticResult(e){return e.behavior=er(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:o,isRefetching:i,isError:s,isRefetchError:a}=r,l=n.fetchMeta?.fetchMore?.direction,c=s&&"forward"===l,u=o&&"forward"===l,d=s&&"backward"===l,f=o&&"backward"===l;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:rr(t,n.data),hasPreviousPage:or(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:a&&!c&&!d,isRefetching:i&&!u&&!f}}},sr=class extends Wn{#u;#D;#V;#d;constructor(e){super(),this.#u=e.client,this.mutationId=e.mutationId,this.#V=e.mutationCache,this.#D=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#D.includes(e)||(this.#D.push(e),this.clearGcTimeout(),this.#V.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#D=this.#D.filter(t=>t!==e),this.scheduleGc(),this.#V.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#D.length||("pending"===this.state.status?this.scheduleGc():this.#V.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#h({type:"continue"})},n={client:this.#u,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=Hn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#V.canRun(this)});const r="pending"===this.state.status,o=!this.#d.canStart();try{if(r)t();else{this.#h({type:"pending",variables:e,isPaused:o}),await(this.#V.config.onMutate?.(e,this,n));const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#h({type:"pending",context:t,variables:e,isPaused:o})}const i=await this.#d.start();return await(this.#V.config.onSuccess?.(i,e,this.state.context,this,n)),await(this.options.onSuccess?.(i,e,this.state.context,n)),await(this.#V.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(i,null,e,this.state.context,n)),this.#h({type:"success",data:i}),i}catch(t){try{await(this.#V.config.onError?.(t,e,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,n))}catch(e){Promise.reject(e)}try{await(this.#V.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,n))}catch(e){Promise.reject(e)}throw this.#h({type:"error",error:t}),t}finally{this.#V.runNext(this)}}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),Dn.batch(()=>{this.#D.forEach(t=>{t.onMutationUpdate(e)}),this.#V.notify({mutation:this,type:"updated",action:e})})}},ar=class extends ln{constructor(e={}){super(),this.config=e,this.#$=new Set,this.#j=new Map,this.#q=0}#$;#j;#q;build(e,t,n){const r=new sr({client:e,mutationCache:this,mutationId:++this.#q,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#$.add(e);const t=lr(e);if("string"==typeof t){const n=this.#j.get(t);n?n.push(e):this.#j.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#$.delete(e)){const t=lr(e);if("string"==typeof t){const n=this.#j.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#j.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=lr(e);if("string"==typeof t){const n=this.#j.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=lr(e);if("string"==typeof t){const n=this.#j.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){Dn.batch(()=>{this.#$.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#$.clear(),this.#j.clear()})}getAll(){return Array.from(this.#$)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>yn(t,e))}findAll(e={}){return this.getAll().filter(t=>yn(e,t))}notify(e){Dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Dn.batch(()=>Promise.all(e.map(e=>e.continue().catch(fn))))}};function lr(e){return e.options.scope?.id}var cr=class extends ln{constructor(e={}){super(),this.config=e,this.#H=new Map}#H;build(e,t,n){const r=t.queryKey,o=t.queryHash??bn(r,t);let i=this.get(o);return i||(i=new Un({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#H.has(e.queryHash)||(this.#H.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#H.get(e.queryHash);t&&(e.destroy(),t===e&&this.#H.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Dn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#H.get(e)}getAll(){return[...this.#H.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>vn(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>vn(e,t)):t}notify(e){Dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ur=class{#W;#V;#f;#U;#B;#G;#Z;#K;constructor(e={}){this.#W=e.queryCache||new cr,this.#V=e.mutationCache||new ar,this.#f=e.defaultOptions||{},this.#U=new Map,this.#B=new Map,this.#G=0}mount(){this.#G++,1===this.#G&&(this.#Z=Nn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())}),this.#K=Vn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())}))}unmount(){this.#G--,0===this.#G&&(this.#Z?.(),this.#Z=void 0,this.#K?.(),this.#K=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#V.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#W.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#W.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#W.get(r.queryHash),i=o?.state.data,s=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==s)return this.#W.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Dn.batch(()=>this.#W.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;Dn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#W;return Dn.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Dn.batch(()=>this.#W.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(fn).catch(fn)}invalidateQueries(e,t={}){return Dn.batch(()=>(this.#W.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Dn.batch(()=>this.#W.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(fn)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#W.build(this,t);return n.isStaleByTime(gn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(fn).catch(fn)}fetchInfiniteQuery(e){return e.behavior=er(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(fn).catch(fn)}ensureInfiniteQueryData(e){return e.behavior=er(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vn.isOnline()?this.#V.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#V}getDefaultOptions(){return this.#f}setDefaultOptions(e){this.#f=e}setQueryDefaults(e,t){this.#U.set(wn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#U.values()],n={};return t.forEach(t=>{xn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#B.set(wn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#B.values()],n={};return t.forEach(t=>{xn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#f.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bn(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Tn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#f.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#V.clear()}};function dr(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var fr=dr(Pt),pr=/["&<]/;function hr(e){if(0===e.length||!1===pr.test(e))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=o,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var gr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mr=0,vr=Array.isArray;function yr(e,n,r,o,i,s){n||(n={});var a,l,c=n;if("ref"in c)for(l in c={},n)"ref"==l?a=n[l]:c[l]=n[l];var u={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mr,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return t.vnode&&t.vnode(u),u}var br,wr,_r={},xr=/[A-Z]/g,Sr=Object.freeze({__proto__:null,Fragment:x,jsx:yr,jsxAttr:function(e,n){if(t.attr){var r=t.attr(e,n);if("string"==typeof r)return r}if(n=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.valueOf?e.valueOf():e}(n),"ref"===e||"key"===e)return"";if("style"===e&&"object"==typeof n){var o="";for(var i in n){var s=n[i];if(null!=s&&""!==s){var a="-"==i[0]?i:_r[i]||(_r[i]=i.replace(xr,"-$&").toLowerCase()),l=";";"number"!=typeof s||a.startsWith("--")||gr.test(a)||(l="px;"),o=o+a+":"+s+l}}return e+'="'+hr(o)+'"'}return null==n||!1===n||"function"==typeof n||"object"==typeof n?"":!0===n?e:e+'="'+hr(""+n)+'"'},jsxDEV:yr,jsxEscape:function e(t){if(null==t||"boolean"==typeof t||"function"==typeof t)return null;if("object"==typeof t){if(void 0===t.constructor)return t;if(vr(t)){for(var n=0;n<t.length;n++)t[n]=e(t[n]);return t}}return hr(""+t)},jsxTemplate:function(e){var t=yr(x,{tpl:e,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t},jsxs:yr}),Cr=wr?br:(wr=1,br=dr(Sr)),Er=B(void 0),Rr=e=>{const t=ge(Er);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ir=({client:e,children:t})=>(ce(()=>(e.mount(),()=>{e.unmount()}),[e]),Cr.jsx(Er.Provider,{value:e,children:t})),Pr=B(!1);Pr.Provider;var kr=B(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),Or=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Mr(e,t,n){const r=ge(Pr),o=ge(kr),i=Rr(),s=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(s);const a=i.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(s),((e,t,n)=>{const r=n?.state.error&&"function"==typeof e.throwOnError?Fn(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))})(s,o,a),(e=>{ce(()=>{e.clearReset()},[e])})(o);const l=!i.getQueryCache().get(s.queryHash),[c]=ae(()=>new t(i,s)),u=c.getOptimisticResult(s),d=!r&&!1!==e.subscribed;if(Ie(he(e=>{const t=d?c.subscribe(Dn.batchCalls(e)):fn;return c.updateResult(),t},[c,d]),()=>c.getCurrentResult()),ce(()=>{c.setOptions(s)},[s,c]),((e,t)=>e?.suspense&&t.isPending)(s,u))throw Or(s,c,o);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&void 0===e.data||Fn(n,[e.error,r])))({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:a,suspense:s.suspense}))throw u.error;if(i.getDefaultOptions().queries?._experimental_afterQuery?.(s,u),s.experimental_prefetchInRender&&!dn&&((e,t)=>e.isLoading&&e.isFetching&&!t)(u,r)){const e=l?Or(s,c,o):a?.promise;e?.catch(fn).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?u:c.trackResult(u)}function Tr(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Tr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ar(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Tr(e))&&(r&&(r+=" "),r+=t);return r}const Fr={show:"Show",perPage:"per page",showingRangeOfTotal:({start:e,end:t,total:n})=>`Showing ${e}-${t} of ${n}`,showingRangeToTotal:({start:e,end:t,total:n})=>`Showing ${e} to ${t} of ${n}`,itemsPerPageOption:({count:e})=>`${e} / page`,firstPage:"First page",previousPage:"Previous page",page:({page:e})=>`Page ${e}`,nextPage:"Next page",lastPage:"Last page",tableView:"Table view",gridView:"Grid view",selectAll:"Select all",resetFilters:"Reset Filters",reset:"Reset",searchPlaceholder:"Search...",searchTableData:"Search table data",clearSearch:"Clear search",selectFilter:({filterName:e})=>`Select ${e}`,clearSelection:"Clear selection",clearAllSelections:"Clear all selections",searchFilter:({filterName:e})=>`Search ${e}`,searchFilterPlaceholder:({filterName:e})=>`Search ${e}...`,noResultsFound:"No results found",activeSearch:({query:e})=>`Search: ${e}`,removeActiveItem:({label:e})=>`Remove ${e}`,filterBy:({filterName:e})=>`Filter by ${e}`,clear:"Clear",sort:"Sort",sortByColumn:({columnName:e})=>`Sort by ${e}`,columnOptionsFor:({columnName:e})=>`Column options for ${e}`,sortAscending:"Sort ascending",sortDescending:"Sort descending",switchToPrimarySort:"Switch to primary sort",switchToSecondarySort:"Switch to secondary sort",setAsPrimarySort:"Set as primary sort",setAsSecondarySort:"Set as secondary sort",replacePrimarySort:({columnName:e})=>`Replace ${e} as primary sort`,replaceSecondarySort:({columnName:e})=>`Replace ${e} as secondary sort`,loadingMore:"Loading more...",loadingMoreItems:"Loading more items...",noMoreItemsToLoad:"No more items to load",allItemsLoaded:"All items loaded",noDataAvailable:"No data available",noItemsFound:"No items found",adjustFiltersOrSearch:"Try adjusting your filters or search criteria",details:"Details",close:"Close",additionalRowDetails:"Additional row details",expandRowDetails:"Expand row details",collapseRowDetails:"Collapse row details",openLightboxFor:({label:e})=>`Open lightbox for ${e}`,image:"image",filterByTerm:({term:e})=>`Filter by ${e}`},Nr=B({displayMode:"table",i18n:Fr}),zr=Nr.Provider,Lr=()=>ge(Nr),Dr=B({selectedItems:new Map,selectItem:()=>{},deselectItem:()=>{},selectAll:()=>{},deselectAll:()=>{},containerRef:null,selectedCount:0,isActionLoading:!1}),Vr=Dr.Provider;function $r(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class jr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qr extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Hr={};function Wr(e){return Hr}function Ur(e){const t=Object.values(e).filter(e=>"number"==typeof e),n=Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t);return n}function Br(e,t){return"bigint"==typeof t?t.toString():t}function Gr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Zr(e){return null==e}function Kr(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Qr=Symbol("evaluating");function Xr(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Qr)return void 0===r&&(r=Qr,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yr(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function eo(e){return JSON.stringify(e)}const to="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function no(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ro=Gr(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function oo(e){if(!1===no(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==no(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function io(e){return oo(e)?{...e}:Array.isArray(e)?[...e]:e}const so=new Set(["string","number","symbol"]);function ao(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function co(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const uo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fo(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function po(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ho(e){return"string"==typeof e?e:e?.message}function go(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=ho(e.inst?._zod.def?.error?.(e))??ho(t?.error?.(e))??ho(n.customError?.(e))??ho(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function mo(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function vo(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const yo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Br,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bo=$r("$ZodError",yo),wo=$r("$ZodError",yo,{Parent:Error}),_o=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new jr;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>go(e,i,Wr())));throw to(t,o?.callee),t}return s.value},xo=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>go(e,i,Wr())));throw to(t,o?.callee),t}return s.value},So=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new jr;return i.issues.length?{success:!1,error:new(e??bo)(i.issues.map(e=>go(e,o,Wr())))}:{success:!0,data:i.value}},Co=So(wo),Eo=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>go(e,o,Wr())))}:{success:!0,data:i.value}},Ro=Eo(wo),Io=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _o(e)(t,n,o)},Po=e=>(t,n,r)=>_o(e)(t,n,r),ko=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xo(e)(t,n,o)},Oo=e=>async(t,n,r)=>xo(e)(t,n,r),Mo=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return So(e)(t,n,o)},To=e=>(t,n,r)=>So(e)(t,n,r),Ao=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Eo(e)(t,n,o)},Fo=e=>async(t,n,r)=>Eo(e)(t,n,r),No=/^[cC][^\s-]{8,}$/,zo=/^[0-9a-z]+$/,Lo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Do=/^[0-9a-vA-V]{20}$/,Vo=/^[A-Za-z0-9]{27}$/,$o=/^[a-zA-Z0-9_-]{21}$/,jo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ho=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Wo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Uo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Go=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Zo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ko=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qo=/^[A-Za-z0-9_-]*$/,Xo=/^\+[1-9]\d{6,14}$/,Jo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Yo=new RegExp(`^${Jo}$`);function ei(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ti=/^-?\d+$/,ni=/^-?\d+(?:\.\d+)?$/,ri=/^(?:true|false)$/i,oi=/^[^A-Z]*$/,ii=/^[^a-z]*$/,si=$r("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ai={number:"number",bigint:"bigint",object:"date"},li=$r("$ZodCheckLessThan",(e,t)=>{si.init(e,t);const n=ai[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ci=$r("$ZodCheckGreaterThan",(e,t)=>{si.init(e,t);const n=ai[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ui=$r("$ZodCheckMultipleOf",(e,t)=>{si.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),di=$r("$ZodCheckNumberFormat",(e,t)=>{si.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=uo[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=ti)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),fi=$r("$ZodCheckMaxLength",(e,t)=>{var n;si.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Zr(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=mo(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pi=$r("$ZodCheckMinLength",(e,t)=>{var n;si.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Zr(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=mo(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),hi=$r("$ZodCheckLengthEquals",(e,t)=>{var n;si.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Zr(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=mo(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),gi=$r("$ZodCheckStringFormat",(e,t)=>{var n,r;si.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mi=$r("$ZodCheckRegex",(e,t)=>{gi.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vi=$r("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oi),gi.init(e,t)}),yi=$r("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ii),gi.init(e,t)}),bi=$r("$ZodCheckIncludes",(e,t)=>{si.init(e,t);const n=ao(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),wi=$r("$ZodCheckStartsWith",(e,t)=>{si.init(e,t);const n=new RegExp(`^${ao(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),_i=$r("$ZodCheckEndsWith",(e,t)=>{si.init(e,t);const n=new RegExp(`.*${ao(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),xi=$r("$ZodCheckOverwrite",(e,t)=>{si.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Si{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args,n=[...(this?.content??[""]).map(e=>`  ${e}`)];return new e(...t,n.join("\n"))}}const Ci={major:4,minor:3,patch:5},Ei=$r("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ci;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=fo(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new jr;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(o||(o=fo(e,t)))});else{if(e.issues.length===t)continue;o||(o=fo(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(fo(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new jr;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new jr;return s.then(e=>t(e,r,i))}return t(s,r,i)}}Xr(e,"~standard",()=>({validate:t=>{try{const n=Co(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return Ro(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ri=$r("$ZodString",(e,t)=>{var n;Ei.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ii=$r("$ZodStringFormat",(e,t)=>{gi.init(e,t),Ri.init(e,t)}),Pi=$r("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qo),Ii.init(e,t)}),ki=$r("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ho(e))}else t.pattern??(t.pattern=Ho());Ii.init(e,t)}),Oi=$r("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wo),Ii.init(e,t)}),Mi=$r("$ZodURL",(e,t)=>{Ii.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ti=$r("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ii.init(e,t)}),Ai=$r("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$o),Ii.init(e,t)}),Fi=$r("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=No),Ii.init(e,t)}),Ni=$r("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zo),Ii.init(e,t)}),zi=$r("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Lo),Ii.init(e,t)}),Li=$r("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Do),Ii.init(e,t)}),Di=$r("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Vo),Ii.init(e,t)}),Vi=$r("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=ei({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Jo}T(?:${r})$`)}(t)),Ii.init(e,t)}),$i=$r("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Yo),Ii.init(e,t)}),ji=$r("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ei(t)}$`)),Ii.init(e,t)}),qi=$r("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jo),Ii.init(e,t)}),Hi=$r("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Uo),Ii.init(e,t),e._zod.bag.format="ipv4"}),Wi=$r("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bo),Ii.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Ui=$r("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Go),Ii.init(e,t)}),Bi=$r("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Zo),Ii.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Gi(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Zi=$r("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ko),Ii.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Gi(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ki=$r("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qo),Ii.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Qo.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Gi(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Qi=$r("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Xo),Ii.init(e,t)}),Xi=$r("$ZodJWT",(e,t)=>{Ii.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ji=$r("$ZodNumber",(e,t)=>{Ei.init(e,t),e._zod.pattern=e._zod.bag.pattern??ni,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Yi=$r("$ZodNumberFormat",(e,t)=>{di.init(e,t),Ji.init(e,t)}),es=$r("$ZodBoolean",(e,t)=>{Ei.init(e,t),e._zod.pattern=ri,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),ts=$r("$ZodUnknown",(e,t)=>{Ei.init(e,t),e._zod.parse=e=>e}),ns=$r("$ZodNever",(e,t)=>{Ei.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function rs(e,t,n){e.issues.length&&t.issues.push(...po(n,e.issues)),t.value[n]=e.value}const os=$r("$ZodArray",(e,t)=>{Ei.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>rs(t,n,e))):rs(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function is(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...po(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ss(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function as(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,c=l.def.type,u="optional"===l.optout;for(const o in t){if(a.has(o))continue;if("never"===c){s.push(o);continue}const i=l.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>is(e,n,o,t,u))):is(i,n,o,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const ls=$r("$ZodObject",(e,t)=>{Ei.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Gr(()=>ss(t));Xr(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=no,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const l=[],c=s.shape;for(const e of s.keys){const r=c[e],o="optional"===r._zod.optout,i=r._zod.run({value:a[e],issues:[]},n);i instanceof Promise?l.push(i.then(n=>is(n,t,e,a,o))):is(i,t,e,a,o)}return i?as(l,a,t,n,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),cs=$r("$ZodObjectJIT",(e,t)=>{ls.init(e,t);const n=e._zod.parse,r=Gr(()=>ss(t));let o;const i=no,s=!Hr.jitless,a=s&&ro.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=r.value);const f=u.value;return i(f)?s&&a&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new Si(["shape","payload","ctx"]),n=r.value,o=e=>{const t=eo(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input=payload.value;");const i=Object.create(null);let s=0;for(const e of n.keys)i[e]="key_"+s++;t.write("const newResult={};");for(const r of n.keys){const n=i[r],s=eo(r),a=e[r],l="optional"===a?._zod?.optout;t.write(`const ${n}=${o(r)};`),l?t.write(`\n        if(${n}.issues.length){\n          if(${s} in input){\n            payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n              ...iss,\n              path: iss.path ? [${s}, ...iss.path]:[${s}]\n            })));\n          }\n        }\n        \n        if(${n}.value===undefined){\n          if(${s} in input){\n            newResult[${s}]=undefined;\n          }\n        }else{\n          newResult[${s}]=${n}.value;\n        }\n        \n      `):t.write(`\n        if(${n}.issues.length){\n          payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n            ...iss,\n            path: iss.path ? [${s}, ...iss.path]:[${s}]\n          })));\n        }\n        \n        if(${n}.value===undefined){\n          if(${s} in input){\n            newResult[${s}]=undefined;\n          }\n        }else{\n          newResult[${s}]=${n}.value;\n        }\n        \n      `)}t.write("payload.value=newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),u=o(u,d),l?as([],f,u,d,c,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function us(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!fo(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>go(e,r,Wr())))}),t)}const ds=$r("$ZodUnion",(e,t)=>{Ei.init(e,t),Xr(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Xr(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Xr(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Xr(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Kr(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>us(t,o,e,i)):us(a,o,e,i)}}),fs=$r("$ZodIntersection",(e,t)=>{Ei.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>hs(e,t,n)):hs(e,o,i)}});function ps(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(oo(e)&&oo(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=ps(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=ps(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function hs(e,t,n){const r=new Map;let o;for(const n of t.issues)if("unrecognized_keys"===n.code){o??(o=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),fo(e))return e;const s=ps(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const gs=$r("$ZodEnum",(e,t)=>{Ei.init(e,t);const n=Ur(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>so.has(typeof e)).map(e=>"string"==typeof e?ao(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),ms=$r("$ZodTransform",(e,t)=>{Ei.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new qr(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new jr;return n.value=o,n}});function vs(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const ys=$r("$ZodOptional",(e,t)=>{Ei.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Xr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Xr(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Kr(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>vs(t,e.value)):vs(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),bs=$r("$ZodExactOptional",(e,t)=>{ys.init(e,t),Xr(e._zod,"values",()=>t.innerType._zod.values),Xr(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ws=$r("$ZodNullable",(e,t)=>{Ei.init(e,t),Xr(e._zod,"optin",()=>t.innerType._zod.optin),Xr(e._zod,"optout",()=>t.innerType._zod.optout),Xr(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Kr(e.source)}|null)$`):void 0}),Xr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),_s=$r("$ZodDefault",(e,t)=>{Ei.init(e,t),e._zod.optin="optional",Xr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xs(e,t)):xs(r,t)}});function xs(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Ss=$r("$ZodPrefault",(e,t)=>{Ei.init(e,t),e._zod.optin="optional",Xr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Cs=$r("$ZodNonOptional",(e,t)=>{Ei.init(e,t),Xr(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Es(t,e)):Es(o,e)}});function Es(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Rs=$r("$ZodCatch",(e,t)=>{Ei.init(e,t),Xr(e._zod,"optin",()=>t.innerType._zod.optin),Xr(e._zod,"optout",()=>t.innerType._zod.optout),Xr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>go(e,n,Wr()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>go(e,n,Wr()))},input:e.value}),e.issues=[]),e)}}),Is=$r("$ZodPipe",(e,t)=>{Ei.init(e,t),Xr(e._zod,"values",()=>t.in._zod.values),Xr(e._zod,"optin",()=>t.in._zod.optin),Xr(e._zod,"optout",()=>t.out._zod.optout),Xr(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ps(e,t.in,n)):Ps(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ps(e,t.out,n)):Ps(r,t.out,n)}});function Ps(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ks=$r("$ZodReadonly",(e,t)=>{Ei.init(e,t),Xr(e._zod,"propValues",()=>t.innerType._zod.propValues),Xr(e._zod,"values",()=>t.innerType._zod.values),Xr(e._zod,"optin",()=>t.innerType?._zod?.optin),Xr(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Os):Os(r)}});function Os(e){return e.value=Object.freeze(e.value),e}const Ms=$r("$ZodCustom",(e,t)=>{si.init(e,t),Ei.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Ts(t,n,r,e));Ts(o,n,r,e)}});function Ts(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(vo(e))}}var As;(As=globalThis).__zod_globalRegistry??(As.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Fs=globalThis.__zod_globalRegistry;function Ns(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...co(t)})}function zs(e,t){return new li({check:"less_than",...co(t),value:e,inclusive:!1})}function Ls(e,t){return new li({check:"less_than",...co(t),value:e,inclusive:!0})}function Ds(e,t){return new ci({check:"greater_than",...co(t),value:e,inclusive:!1})}function Vs(e,t){return new ci({check:"greater_than",...co(t),value:e,inclusive:!0})}function $s(e,t){return new ui({check:"multiple_of",...co(t),value:e})}function js(e,t){return new fi({check:"max_length",...co(t),maximum:e})}function qs(e,t){return new pi({check:"min_length",...co(t),minimum:e})}function Hs(e,t){return new hi({check:"length_equals",...co(t),length:e})}function Ws(e){return new xi({check:"overwrite",tx:e})}function Us(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Fs,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Bs(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),Bs(i,t,r),t.seen.get(i).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===t.io&&Ks(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Gs(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const s=r.schema;for(const e in s)delete s[e];s.$ref=o};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){o(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;(i||r.cycle||r.count>1&&"ref"===e.reused)&&o(n)}}function Zs(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},s=n.ref;if(n.ref=null,s){r(s);const n=e.seen.get(s),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,i),t._zod.parent===s)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(a.$ref)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?o.$defs=i:o.definitions=i);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Qs(t,"input",e.processors),output:Qs(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Ks(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Ks(r.element,n);if("set"===r.type)return Ks(r.valueType,n);if("lazy"===r.type)return Ks(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Ks(r.innerType,n);if("intersection"===r.type)return Ks(r.left,n)||Ks(r.right,n);if("record"===r.type||"map"===r.type)return Ks(r.keyType,n)||Ks(r.valueType,n);if("pipe"===r.type)return Ks(r.in,n)||Ks(r.out,n);if("object"===r.type){for(const e in r.shape)if(Ks(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Ks(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Ks(e,n))return!0;return!(!r.rest||!Ks(r.rest,n))}return!1}const Qs=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=Us({...o??{},target:i,io:t,processors:n});return Bs(e,s),Gs(s,e),Zs(s,e)},Xs={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Js=(e,t,n,r)=>{const o=e._zod.def;Bs(o.innerType,t,r),t.seen.get(e).ref=o.innerType},Ys=$r("ZodISODateTime",(e,t)=>{Vi.init(e,t),wa.init(e,t)});const ea=$r("ZodISODate",(e,t)=>{$i.init(e,t),wa.init(e,t)});const ta=$r("ZodISOTime",(e,t)=>{ji.init(e,t),wa.init(e,t)});const na=$r("ZodISODuration",(e,t)=>{qi.init(e,t),wa.init(e,t)});const ra=$r("ZodError",(e,t)=>{bo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Br,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Br,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),oa=_o(ra),ia=xo(ra),sa=So(ra),aa=Eo(ra),la=Io(ra),ca=Po(ra),ua=ko(ra),da=Oo(ra),fa=Mo(ra),pa=To(ra),ha=Ao(ra),ga=Fo(ra),ma=$r("ZodType",(e,t)=>(Ei.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Qs(e,"input"),output:Qs(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Us({...n,processors:t});return Bs(e,r),Gs(r,e),Zs(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Yr(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>lo(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>oa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sa(e,t,n),e.parseAsync=async(t,n)=>ia(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>aa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>la(e,t,n),e.decode=(t,n)=>ca(e,t,n),e.encodeAsync=async(t,n)=>ua(e,t,n),e.decodeAsync=async(t,n)=>da(e,t,n),e.safeEncode=(t,n)=>fa(e,t,n),e.safeDecode=(t,n)=>pa(e,t,n),e.safeEncodeAsync=async(t,n)=>ha(e,t,n),e.safeDecodeAsync=async(t,n)=>ga(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...co(n)})}(ml,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){return function(e){const t=function(e){const t=new si({check:"custom",...co(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(vo(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(vo(r))}},e(n.value,n)));return t}(e)}(t)),e.overwrite=t=>e.check(Ws(t)),e.optional=()=>il(e),e.exactOptional=()=>new sl({type:"optional",innerType:e}),e.nullable=()=>ll(e),e.nullish=()=>il(ll(e)),e.nonoptional=t=>function(e,t){return new dl({type:"nonoptional",innerType:e,...co(t)})}(e,t),e.array=()=>Qa(e),e.or=t=>el([e,t]),e.and=t=>new tl({type:"intersection",left:e,right:t}),e.transform=t=>hl(e,function(e){return new rl({type:"transform",transform:e})}(t)),e.default=t=>{return n=t,new cl({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():io(n)}});var n},e.prefault=t=>{return n=t,new ul({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():io(n)}});var n},e.catch=t=>{return new fl({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>hl(e,t),e.readonly=()=>new gl({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Fs.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Fs.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Fs.get(e);const n=e.clone();return Fs.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),va=$r("_ZodString",(e,t)=>{Ri.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:s,patterns:a,contentEncoding:l}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),s&&(r.format=Xs[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),l&&(r.contentEncoding=l),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new mi({check:"string_format",format:"regex",...co(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new bi({check:"string_format",format:"includes",...co(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new wi({check:"string_format",format:"starts_with",...co(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new _i({check:"string_format",format:"ends_with",...co(t),suffix:e})}(...t)),e.min=(...t)=>e.check(qs(...t)),e.max=(...t)=>e.check(js(...t)),e.length=(...t)=>e.check(Hs(...t)),e.nonempty=(...t)=>e.check(qs(1,...t)),e.lowercase=t=>e.check(function(e){return new vi({check:"string_format",format:"lowercase",...co(e)})}(t)),e.uppercase=t=>e.check(function(e){return new yi({check:"string_format",format:"uppercase",...co(e)})}(t)),e.trim=()=>e.check(Ws(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Ws(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Ws(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Ws(e=>e.toUpperCase())),e.slugify=()=>e.check(Ws(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),ya=$r("ZodString",(e,t)=>{Ri.init(e,t),va.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...co(t)})}(_a,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...co(t)})}(Ca,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...co(t)})}(Va,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...co(t)})}(Ea,t)),e.guid=t=>e.check(Ns(xa,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...co(t)})}(Sa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...co(t)})}(Sa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...co(t)})}(Sa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...co(t)})}(Sa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...co(t)})}(Ra,t)),e.guid=t=>e.check(Ns(xa,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...co(t)})}(Ia,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...co(t)})}(Pa,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...co(t)})}(ka,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...co(t)})}(za,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...co(t)})}(La,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...co(t)})}(Oa,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...co(t)})}(Ma,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...co(t)})}(Ta,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...co(t)})}(Aa,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...co(t)})}(Fa,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...co(t)})}(Na,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...co(t)})}(Da,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...co(t)})}(Ys,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...co(t)})}(ea,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...co(t)})}(ta,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...co(t)})}(na,e)}(t))});function ba(e){return function(e,t){return new e({type:"string",...co(t)})}(ya,e)}const wa=$r("ZodStringFormat",(e,t)=>{Ii.init(e,t),va.init(e,t)}),_a=$r("ZodEmail",(e,t)=>{Oi.init(e,t),wa.init(e,t)}),xa=$r("ZodGUID",(e,t)=>{Pi.init(e,t),wa.init(e,t)}),Sa=$r("ZodUUID",(e,t)=>{ki.init(e,t),wa.init(e,t)}),Ca=$r("ZodURL",(e,t)=>{Mi.init(e,t),wa.init(e,t)}),Ea=$r("ZodEmoji",(e,t)=>{Ti.init(e,t),wa.init(e,t)}),Ra=$r("ZodNanoID",(e,t)=>{Ai.init(e,t),wa.init(e,t)}),Ia=$r("ZodCUID",(e,t)=>{Fi.init(e,t),wa.init(e,t)}),Pa=$r("ZodCUID2",(e,t)=>{Ni.init(e,t),wa.init(e,t)}),ka=$r("ZodULID",(e,t)=>{zi.init(e,t),wa.init(e,t)}),Oa=$r("ZodXID",(e,t)=>{Li.init(e,t),wa.init(e,t)}),Ma=$r("ZodKSUID",(e,t)=>{Di.init(e,t),wa.init(e,t)}),Ta=$r("ZodIPv4",(e,t)=>{Hi.init(e,t),wa.init(e,t)}),Aa=$r("ZodIPv6",(e,t)=>{Wi.init(e,t),wa.init(e,t)}),Fa=$r("ZodCIDRv4",(e,t)=>{Ui.init(e,t),wa.init(e,t)}),Na=$r("ZodCIDRv6",(e,t)=>{Bi.init(e,t),wa.init(e,t)}),za=$r("ZodBase64",(e,t)=>{Zi.init(e,t),wa.init(e,t)}),La=$r("ZodBase64URL",(e,t)=>{Ki.init(e,t),wa.init(e,t)}),Da=$r("ZodE164",(e,t)=>{Qi.init(e,t),wa.init(e,t)}),Va=$r("ZodJWT",(e,t)=>{Xi.init(e,t),wa.init(e,t)}),$a=$r("ZodNumber",(e,t)=>{Ji.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:s,multipleOf:a,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number","number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c),"number"==typeof o&&(r.minimum=o,"number"==typeof c&&"draft-04"!==t.target&&(c>=o?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l),"number"==typeof i&&(r.maximum=i,"number"==typeof l&&"draft-04"!==t.target&&(l<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(Ds(t,n)),e.gte=(t,n)=>e.check(Vs(t,n)),e.min=(t,n)=>e.check(Vs(t,n)),e.lt=(t,n)=>e.check(zs(t,n)),e.lte=(t,n)=>e.check(Ls(t,n)),e.max=(t,n)=>e.check(Ls(t,n)),e.int=t=>e.check(Ha(t)),e.safe=t=>e.check(Ha(t)),e.positive=t=>e.check(Ds(0,t)),e.nonnegative=t=>e.check(Vs(0,t)),e.negative=t=>e.check(zs(0,t)),e.nonpositive=t=>e.check(Ls(0,t)),e.multipleOf=(t,n)=>e.check($s(t,n)),e.step=(t,n)=>e.check($s(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ja(e){return function(e,t){return new e({type:"number",checks:[],...co(t)})}($a,e)}const qa=$r("ZodNumberFormat",(e,t)=>{Yi.init(e,t),$a.init(e,t)});function Ha(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...co(t)})}(qa,e)}const Wa=$r("ZodBoolean",(e,t)=>{es.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Ua(e){return function(e,t){return new e({type:"boolean",...co(t)})}(Wa,e)}const Ba=$r("ZodUnknown",(e,t)=>{ts.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Ga(){return new Ba({type:"unknown"})}const Za=$r("ZodNever",(e,t)=>{ns.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});const Ka=$r("ZodArray",(e,t)=>{os.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(o.minItems=s),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=Bs(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(qs(t,n)),e.nonempty=t=>e.check(qs(1,t)),e.max=(t,n)=>e.check(js(t,n)),e.length=(t,n)=>e.check(Hs(t,n)),e.unwrap=()=>e.element});function Qa(e,t){return function(e,t,n){return new e({type:"array",element:t,...co(n)})}(Ka,e,t)}const Xa=$r("ZodObject",(e,t)=>{cs.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const e in s)o.properties[e]=Bs(s[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));l.size>0&&(o.required=Array.from(l)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Bs(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),Xr(e,"shape",()=>t.shape),e.keyof=()=>function(e){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new nl({type:"enum",entries:t,...co(void 0)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ga()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ga()}),e.strict=()=>{return e.clone({...e._zod.def,catchall:function(e,t){return new e({type:"never",...co(t)})}(Za,t)});var t},e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!oo(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Yr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Jr(this,"shape",n),n}});return lo(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!oo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Yr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Jr(this,"shape",n),n}});return lo(e,n)}(e,t),e.merge=t=>function(e,t){const n=Yr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Jr(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return lo(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return lo(e,Yr(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jr(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Yr(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jr(this,"shape",r),r},checks:[]});return lo(e,o)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Yr(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Jr(this,"shape",o),o},checks:[]});return lo(t,o)}(ol,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Yr(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return Jr(this,"shape",o),o}});return lo(t,r)}(dl,e,t[0])});function Ja(e,t){const n={type:"object",shape:e??{},...co(t)};return new Xa(n)}const Ya=$r("ZodUnion",(e,t)=>{ds.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,s=o.options.map((e,n)=>Bs(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options});function el(e,t){return new Ya({type:"union",options:e,...co(t)})}const tl=$r("ZodIntersection",(e,t)=>{fs.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Bs(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Bs(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l})(e,t,n,r)}),nl=$r("ZodEnum",(e,t)=>{gs.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Ur(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new nl({...t,checks:[],...co(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new nl({...t,checks:[],...co(r),entries:o})}}),rl=$r("ZodTransform",(e,t)=>{ms.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new qr(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(vo(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(vo(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}}),ol=$r("ZodOptional",(e,t)=>{ys.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function il(e){return new ol({type:"optional",innerType:e})}const sl=$r("ZodExactOptional",(e,t)=>{bs.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),al=$r("ZodNullable",(e,t)=>{ws.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Bs(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ll(e){return new al({type:"nullable",innerType:e})}const cl=$r("ZodDefault",(e,t)=>{_s.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Bs(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ul=$r("ZodPrefault",(e,t)=>{Ss.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Bs(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),dl=$r("ZodNonOptional",(e,t)=>{Cs.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Bs(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),fl=$r("ZodCatch",(e,t)=>{Rs.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;Bs(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),pl=$r("ZodPipe",(e,t)=>{Is.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;Bs(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function hl(e,t){return new pl({type:"pipe",in:e,out:t})}const gl=$r("ZodReadonly",(e,t)=>{ks.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Bs(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),ml=$r("ZodCustom",(e,t)=>{Ms.init(e,t),ma.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}),vl=500,yl=100,bl=Ja({pageIndex:ja().int().min(0).max(1e4).catch(0),pageSize:ja().int().positive().max(1e3).catch(10)}).catch({pageIndex:0,pageSize:10}),wl=Qa(Ja({id:ba().max(vl).catch(""),desc:Ua().catch(!1)})).max(yl).catch([]),_l=el([ba().max(200),ja(),Ua()]).catch(""),xl=el([_l,Qa(_l).max(yl)]).catch([]),Sl=Qa(Ja({id:ba().max(vl).catch(""),value:xl}).catch({id:"",value:""})).max(yl).catch([]),Cl=Ja({query:ba().max(vl).catch("")}).catch({query:""});Ja({pagination:bl,sorting:wl,filters:Sl,search:Cl}),Ja({page:ba().regex(/^\d+$/).transform(e=>parseInt(e,10)).pipe(ja().int().min(1).max(1e4)).catch(1),per_page:ba().regex(/^\d+$/).transform(e=>parseInt(e,10)).pipe(ja().int().positive().max(1e3)).catch(10),search:ba().max(vl).catch("").optional(),sort:ba().max(5e3).catch("").optional()}).catchall(ba().max(200).catch(""));const El=new class{get(){return window.location.hash.substring(1)}set(e){const t=e?`#${e}`:window.location.pathname+window.location.search;window.history.replaceState(null,"",t)}subscribe(e){return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}}},Rl=(e,t,n)=>{const r=e.startsWith("#")?e.substring(1):e;if(!r)return{};const o=new URLSearchParams(r),i={sorting:n.sorting||[]};let s;if(t.includes("page")){const e=o.get("page");if(e)try{const t=parseInt(e,10);!isNaN(t)&&t>=1&&t<=1e4&&(s={...s,pageIndex:t-1})}catch{console.warn(`Invalid page parameter: ${e}`)}}if(t.includes("pageSize")){const e=o.get("per_page");if(e)try{const t=parseInt(e,10);!isNaN(t)&&t>0&&t<=1e3&&(s={...s,pageSize:t})}catch{console.warn(`Invalid per_page parameter: ${e}`)}}if(s&&(i.pagination={...n.pagination,...s}),t.includes("filters")){const e=(e=>{const t=[];return e.forEach((e,n)=>{if(n.startsWith("_")){const r=n.substring(1);try{const n=(e=>{const t=e=>{const t=e.trim().slice(0,200);if(/^-?\d+$/.test(t)){const e=parseInt(t,10);if(!isNaN(e)&&e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER)return e}return t};return e.includes(",")?e.split(",").slice(0,yl).map(t).filter(e=>""!==e):t(e)})(e);""===n||null==n||Array.isArray(n)&&0===n.length||t.push({id:r,value:n})}catch(t){console.warn(`Invalid filter value for "${r}":`,e,t)}}}),t})(o);i.filters=e.length>0?e:[]}if(t.includes("search")){const e=o.get("search");if(e)try{const t=e.substring(0,500);i.search={query:t}}catch(e){console.warn("Invalid search parameters:",e),i.search={query:""}}else i.search={query:""}}if(t.includes("sorting"))if(o.has("sort")){const e=(e=>{if(!e||""===e.trim())return[];try{const t=e.split(",").slice(0,yl),n=[];for(const e of t){const t=e.trim();if(!t)continue;const[r,o]=t.split(":");r&&o&&(r.length>vl||"asc"!==o&&"desc"!==o||n.push({id:r,desc:"desc"===o}))}return n}catch(t){return console.warn(`Invalid sorting parameter: ${e}`,t),[]}})(o.get("sort")||"");i.sorting=e}else i.sorting=n.sorting||[];return i},Il=()=>El.get(),Pl=(e,t,n,r)=>{const{enabled:o,syncParams:i=["page","pageSize","filters","search","sorting"]}=n,s=pe(()=>i,[JSON.stringify(i)]),a=de(""),l=de(!1);ce(()=>{o&&(a.current=Il())},[]),ce(()=>{if(!o)return;if(l.current)return;const t=setTimeout(()=>{const t=((e,t,n)=>{const r=new URLSearchParams,o=Il(),i=new URLSearchParams(o),s=n?.pagination.pageSize??10,a=n?.sorting??[];if(t.includes("page")){const t=e.pagination.pageIndex+1;(t>1||i.has("page"))&&r.set("page",String(t))}if(t.includes("pageSize")&&e.pagination.pageSize!==s&&r.set("per_page",String(e.pagination.pageSize)),t.includes("filters")&&e.filters.length>0){const t=(e=>{const t={};return e.forEach(e=>{if(null===e.value||void 0===e.value)return;const n=`_${e.id}`,r=Array.isArray(e.value)?e.value.join(","):String(e.value);r&&""!==r&&(t[n]=r)}),t})(e.filters);Object.entries(t).forEach(([e,t])=>{r.set(e,t)})}if(t.includes("search")&&e.search.query&&r.set("search",e.search.query),t.includes("sorting")&&!((e,t)=>e.length===t.length&&e.every((e,n)=>{const r=t[n];return e.id===r.id&&e.desc===r.desc}))(e.sorting,a)){const t=e.sorting.map(e=>`${e.id}:${e.desc?"desc":"asc"}`).join(",");r.set("sort",t)}return r.toString()})(e,s,r);var n;t!==a.current&&(n=t,El.set(n),a.current=t)},150);return()=>clearTimeout(t)},[e,o,s,r]),ce(()=>{if(!o)return;const e=El.subscribe(()=>{const e=Il();if(e===a.current)return;const n=Rl(e,s,r);Object.keys(n).length>0&&(l.current=!0,t(e=>({...e,...n,pagination:n.pagination?{...e.pagination,...n.pagination}:e.pagination,sorting:void 0!==n.sorting?n.sorting:e.sorting})),queueMicrotask(()=>{l.current=!1})),a.current=e});return()=>{e()}},[o,s,r])},kl=e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}),Ol=(e,t,n,r,o)=>{const i={filters:n.filters.map(e=>kl(e)),pageSize:n.pagination.pageSize,search:kl(n.search),sorting:n.sorting.map(e=>kl(e))};return["serverData","infinite",e,t,i,r||"table",o]},Ml=e=>{const{serverUrl:t,fetchData:n,viewId:r,state:o,enabled:i=!0,urlSync:s,displayMode:a,extraRequestData:l}=e,c=Rr(),[u,d]=ae(0),f=de(n);ce(()=>{f.current!==n&&(f.current=n,d(e=>e+1))},[n]);const p=n?"fetchData":t||"missing-data-source",h=de(o||{pagination:{pageIndex:0,pageSize:25},sorting:[],filters:[],search:{query:""}}),g=pe(()=>{const e=h.current;if(!s?.enabled)return e;const t=Il();if(!t)return e;const n=s.syncParams||["pageSize","filters","search","sorting"],r=Rl(t,n,e);return{...e,...r,pagination:{pageIndex:0,pageSize:r.pagination?.pageSize||e.pagination.pageSize},sorting:void 0!==r.sorting?r.sorting:e.sorting}},[]),[m,v]=ae(g);Pl(m,v,s||{enabled:!1,syncParams:[]},h.current);const y=he(e=>{v(t=>({...t,...e,pagination:{pageIndex:0,pageSize:e.pagination?.pageSize||t.pagination.pageSize}}))},[]),{data:b,isLoading:w,isFetching:_,error:x,fetchNextPage:S,hasNextPage:C,isFetchingNextPage:E,refetch:R}=function(e){return Mr(e,ir)}({queryKey:Ol(p,u,m,a,r),queryFn:({pageParam:e})=>(async(e,t,n,r)=>{const o=r?{...e,...r}:e;if(t)return t(o);if(n)return(async(e,t)=>{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`Server error: ${n.status} ${n.statusText}`);return n.json()})(n,o);throw new Error("DataView configuration error: provide fetchData or serverUrl.")})(((e,t,n,r)=>({viewId:r,pagination:{pageIndex:t,pageSize:e.pagination.pageSize},sorting:e.sorting,filters:e.filters,search:e.search,displayMode:n}))(m,e,a,r),n,t,l),initialPageParam:0,getNextPageParam:(e,t,n)=>{if(e.currentPage+1<e.totalPages)return n+1},enabled:i,placeholderData:e=>e,refetchOnWindowFocus:!0,staleTime:6e4,gcTime:3e5}),I=pe(()=>b?.pages?b.pages.flatMap(e=>e.data):[],[b?.pages]),P=pe(()=>b?.pages?b.pages.flatMap(e=>e.cardHtml||[]):[],[b?.pages]),k=pe(()=>b?.pages&&0!==b.pages.length?b.pages[b.pages.length-1].totalRows:0,[b?.pages]),O=pe(()=>b?.pages&&0!==b.pages.length?b.pages[b.pages.length-1].totalPages:0,[b?.pages]),M=pe(()=>{if(b?.pages&&0!==b.pages.length)return b.pages[b.pages.length-1].filterCounts},[b?.pages]);return ce(()=>{c.invalidateQueries({queryKey:Ol(p,u,m,a,r)})},[m.filters,m.search,m.sorting,p,u,c,m,a,r]),pe(()=>({data:I,cardHtml:P.length>0?P:void 0,loading:w,isFetching:_,isPlaceholderData:!1,error:x,totalRows:k,totalPages:O,state:m,setState:y,refetch:R,hasNextPage:C,fetchNextPage:S,isFetchingNextPage:E,filterCounts:M}),[I,P,w,_,x,k,O,m,y,R,C,S,E,M])},Tl=e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}),Al=(e,t,n,r,o)=>{const i={filters:n.filters.map(e=>Tl(e)),pagination:Tl(n.pagination),search:Tl(n.search),sorting:n.sorting.map(e=>Tl(e))};return["serverData",e,t,i,r||"table",o]},Fl=(e,t,n)=>({viewId:n,pagination:e.pagination,sorting:e.sorting,filters:e.filters,search:e.search,displayMode:t}),Nl=async(e,t,n,r)=>{const o=r?{...e,...r}:e;if(t)return t(o);if(n)return(async(e,t)=>{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`Server error: ${n.status} ${n.statusText}`);return n.json()})(n,o);throw new Error("DataView configuration error: provide fetchData or serverUrl.")},zl=({left:e,center:t,right:n})=>{if(t)return e&&!n?"pagination-layout-left-center":!e&&n?"pagination-layout-center-right":void 0},Ll=({config:e,children:t,componentProps:n={},hideControls:r=!1})=>{const o=pe(()=>{const t={top:[],bottom:[],left:[],right:[]};return e.components.forEach(e=>{t[e.position].push(e)}),Object.keys(t).forEach(e=>{t[e].sort((e,t)=>(e.order||0)-(t.order||0))}),t},[e.components]),i=e=>{const t=e.component,r={...n,...e.props};return yr("div",{className:`layout-component layout-component-${e.id}`,children:yr(t,{...r})},e.id)},s=pe(()=>{const e={search:[],filters:[],reset:[],active:[],actions:[]},t=o.top.filter(e=>!e.id.startsWith("per-page-selector-top")&&!e.id.startsWith("document-count-top")&&!e.id.startsWith("page-navigation-top"));return t.forEach(t=>{t.slot&&e[t.slot].push(t)}),Object.keys(e).forEach(t=>{e[t].sort((e,t)=>(e.order||0)-(t.order||0))}),e},[o.top]),a=pe(()=>o.top.filter(e=>e.id.startsWith("per-page-selector-top")||e.id.startsWith("document-count-top")||e.id.startsWith("page-navigation-top")),[o.top]),l=a.length>0,c=!l&&s.actions.length>0,u=pe(()=>s.search.length>0||s.filters.length>0||s.reset.length>0||s.active.length>0||c,[s,c]),d=pe(()=>a.filter(e=>e.id.startsWith("per-page-selector")),[a]),f=pe(()=>a.filter(e=>e.id.startsWith("document-count")),[a]),p=pe(()=>a.filter(e=>e.id.startsWith("page-navigation")),[a]),h=pe(()=>o.bottom.filter(e=>e.id.includes("action-button")),[o.bottom]),g=pe(()=>o.bottom.filter(e=>"table-info"===e.id||e.id.startsWith("per-page-selector")),[o.bottom]),m=pe(()=>o.bottom.filter(e=>e.id.startsWith("document-count")),[o.bottom]),v=pe(()=>o.bottom.filter(e=>"pagination"===e.id||e.id.startsWith("page-navigation")),[o.bottom]),y=zl({left:d.length>0,center:f.length>0,right:p.length>0||s.actions.length>0}),b=zl({left:g.length>0,center:m.length>0,right:v.length>0||h.length>0}),w=s.active.length>0,_=s.search.length>0||s.filters.length>0||!w&&s.reset.length>0;return yr(x,{children:[!r&&e.header?.show&&u&&yr("div",{className:Ar("layout-header",e.header.sticky&&"header-sticky",c&&"layout-header--inline-actions",c&&w&&"layout-header--has-active",c&&_&&"layout-header--has-controls"),children:[_&&yr("div",{className:"header-filters",children:[s.search.map(i),s.filters.map(i),!w&&s.reset.map(i)]}),w&&yr("div",{className:"header-active",children:[s.active.map(i),s.reset.map(i)]}),c&&yr("div",{className:"header-actions",children:s.actions.map(i)})]}),!r&&l&&yr("div",{className:Ar("header-controls",y),children:[yr("div",{className:"pagination-left",children:d.map(i)}),yr("div",{className:"pagination-center",children:f.map(i)}),yr("div",{className:"pagination-right",children:[p.map(i),s.actions.map(i)]})]}),t,!r&&e.footer?.show&&yr("div",{className:Ar("footer-controls",e.footer.sticky&&"footer-controls-sticky",b),children:[yr("div",{className:"pagination-left",children:g.map(i)}),yr("div",{className:"pagination-center",children:m.map(i)}),yr("div",{className:"pagination-right",children:[v.map(i),h.map(i)]})]})]})},Dl={components:[],header:{show:!0,sticky:!1},footer:{show:!0,sticky:!1}},Vl=(e,t,n="top",r=0,o)=>({id:e,component:t,position:n,order:r,slot:o?.slot,props:o});let $l=null;const jl=({value:e,onChange:t,onSearch:n,placeholder:r,debounceMs:o=300,className:i,disabled:s=!1})=>{const{i18n:a}=Lr(),[l,c]=ae(e),u=r??a.searchPlaceholder;ce(()=>{c(e)},[e]);const d=he(e=>{const r=e.target.value;c(r),$l&&clearTimeout($l),$l=setTimeout(()=>{t(r),n()},o)},[t,n,o]),f=he(e=>{"Enter"===e.key&&($l&&clearTimeout($l),t(l),n())},[l,t,n]),p=he(()=>{c(""),t(""),n()},[t,n]);return yr("div",{className:Ar("search-input-wrapper",i),style:s?{pointerEvents:"none"}:void 0,children:yr("div",{className:"search-input-container",children:[yr("svg",{className:"search-icon",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:yr("path",{d:"M9 17A8 8 0 109 1a8 8 0 000 16zM19 19l-4.35-4.35",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),yr("input",{type:"text",value:l,onInput:d,onKeyDown:f,placeholder:u,className:"search-input","aria-label":a.searchTableData}),l&&yr("button",{type:"button",onClick:p,className:"search-clear-btn","aria-label":a.clearSearch,title:a.clearSearch,children:yr("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:yr("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})};function ql({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=de(void 0!==e),[i,s]=ae(t);return[o?e:i,he(e=>{o||s(e)},[])]}const Hl="undefined"!=typeof document?ue:()=>{};function Wl(e){const t=de(!0);t.current&&(t.current=!1,e())}const Ul={};function Bl(e,t){const n=de(Ul);return n.current===Ul&&(n.current=e(t)),n}const Gl=Pt[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Zl=Gl&&Gl!==ue?Gl:e=>e();function Kl(e){const t=Bl(Ql).current;return t.next=e,Zl(t.effect),t.trampoline}function Ql(){const e={next:void 0,callback:Xl,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Xl(){}function Jl(e,t,n,r){const o=Bl(Yl).current;return function(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}(o,e,t,n,r)&&ec(o,[e,t,n,r]),o.callback}function Yl(){return{callback:null,cleanup:null,refs:[]}}function ec(e,t){e.refs=t,t.every(e=>null==e)?e.callback=null:e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){const r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){const o=t[e];if(null!=o)switch(typeof o){case"function":{const t=o(n);"function"==typeof t&&(r[e]=t);break}case"object":o.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){const n=t[e];if(null!=n)switch(typeof n){case"function":{const t=r[e];"function"==typeof t?t():n(null);break}case"object":n.current=null}}}}}}const tc={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function nc(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${n} for the full message.`}var rc=Symbol("NOT_FOUND"),oc=e=>Array.isArray(e)?e:[e];var ic=(e,t)=>e===t,sc="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function ac(){return{s:0,v:void 0,o:null,p:null}}function lc(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,i=0;function s(){let t=n;const{length:s}=arguments;for(let e=0,n=s;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=ac(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=ac(),e.set(n,t)):t=r}}const a=t;let l;if(1===t.s)l=t.v;else if(l=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,l)&&(l=e,0!==i&&i--),o="object"==typeof l&&null!==l||"function"==typeof l?new sc(l):l}return a.s=1,a.v=l,l}return s.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function cc(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},s=e.pop();"object"==typeof s&&(i=s,s=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);const a={...n,...i},{memoize:l,memoizeOptions:c=[],argsMemoize:u=lc,argsMemoizeOptions:d=[]}=a,f=oc(c),p=oc(d),h=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),g=l(function(){return r++,s.apply(null,arguments)},...f),m=u(function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(h,arguments);return t=g.apply(null,e),t},...p);return Object.assign(m,{resultFunc:s,memoizedResultFunc:g,dependencies:h,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:l,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var uc=cc(lc),dc=Object.assign((e,t=uc)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e),r=t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}));return r},{withTypes:()=>dc});cc({memoize:function(e,t){const n="object"==typeof t?t:{equalityCheck:t},{equalityCheck:r=ic,maxSize:o=1,resultEqualityCheck:i}=n,s=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;const{length:r}=t;for(let o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(r);let a=0;const l=o<=1?function(e){let t;return{get:n=>t&&e(t.key,n)?t.value:rc,put(e,n){t={key:e,value:n}},getEntries:()=>t?[t]:[],clear(){t=void 0}}}(s):function(e,t){let n=[];function r(e){const r=n.findIndex(n=>t(e,n.key));if(r>-1){const e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return rc}return{get:r,put:function(t,o){r(t)===rc&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(o,s);function c(){let t=l.get(arguments);if(t===rc){if(t=e.apply(null,arguments),a++,i){const e=l.getEntries().find(e=>i(e.value,t));e&&(t=e.value,0!==a&&a--)}l.put(arguments,t)}return t}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c},memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const fc=(e,t,n,r,o,i,...s)=>{if(s.length>0)throw new Error(nc(1));let a;if(!e)throw new Error("Missing arguments");return a=e,a};var pc,hc,gc={exports:{}},mc={};function vc(){return hc||(hc=1,gc.exports=function(){if(pc)return mc;pc=1;var e=fr,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),l=n({inst:{value:a,getSnapshot:t}}),c=l[0].inst,u=l[1];return o(function(){c.value=a,c.getSnapshot=t,s(c)&&u({inst:c})},[e,a,t]),r(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(a),a};return mc.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:a,mc}()),gc.exports}var yc,bc,wc=vc(),_c={exports:{}},xc={},Sc=(bc||(bc=1,_c.exports=function(){if(yc)return xc;yc=1;var e=fr,t=vc(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,a=e.useDebugValue;return xc.useSyncExternalStoreWithSelector=function(e,t,l,c,u){var d=o(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var s=c(e);return void 0!==u&&u(t,s)?(r=e,t):(r=e,o=s)}var r,o,i=!1,s=void 0===l?null:l;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,l,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),a(p),p},xc}()),_c.exports);const Cc=parseInt(mt,10);function Ec(e){return Cc>=e}const Rc=Ec(19)?function(e,t,n,r,o){const i=he(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return wc.useSyncExternalStore(e.subscribe,i,i)}:function(e,t,n,r,o){return Sc.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))};function Ic(e,t,n,r,o){return Rc(e,t,n,r,o)}class Pc{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const t=this.updateTick;for(const n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t]))return void Pc.prototype.setState.call(this,{...this.state,...e})}set(e,t){Object.is(this.state[e],t)||Pc.prototype.setState.call(this,{...this.state,[e]:t})}notifyAll(){const e={...this.state};Pc.prototype.setState.call(this,e)}}function kc(){}const Oc=Object.freeze([]),Mc=Object.freeze({});class Tc extends Pc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,t){me(e),Hl(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){Hl(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){const t=Object.values(e);Hl(()=>{this.update(e)},t)}useControlledProp(e,t,n){me(e);const r=void 0!==t;this.controlledValues.has(e)||(this.controlledValues.set(e,r),r||Object.is(this.state[e],n)||super.setState({...this.state,[e]:n})),Hl(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n,r])}set(e,t){!0!==this.controlledValues.get(e)&&super.set(e,t)}update(e){const t={...e};for(const e in t)Object.hasOwn(t,e)&&(!0!==this.controlledValues.get(e)||delete t[e]);super.update(t)}setState(e){const t={...e};for(const e in t)Object.hasOwn(t,e)&&(!0!==this.controlledValues.get(e)||delete t[e]);super.setState({...this.state,...t})}select=(e,t,n,r)=>(0,this.selectors[e])(this.state,t,n,r);useState=(e,t,n,r)=>(me(e),Ic(this,this.selectors[e],t,n,r));useContextCallback(e,t){me(e);const n=Kl(t??kc);this.context[e]=n}useStateSetter(e){const t=de(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n="function"==typeof e?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{const o=n(e);if(!Object.is(r,o)){const e=r;r=o,t(o,e,this)}})}}const Ac=[];function Fc(e){ce(e,Ac)}const Nc=null,zc=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){const t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class Lc{static create(){return new Lc}static request(e){return zc.request(e)}static cancel(e){return zc.cancel(e)}currentId=Nc;request(e){this.cancel(),this.currentId=zc.request(()=>{this.currentId=Nc,e()})}cancel=()=>{this.currentId!==Nc&&(zc.cancel(this.currentId),this.currentId=Nc)};disposeEffect=()=>this.cancel}function Dc(){const e=Bl(Lc.create).current;return Fc(e.disposeEffect),e}class Vc{static create(){return new Vc}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}function $c(){const e=Bl(Vc.create).current;return Fc(e.disposeEffect),e}function jc(e){const t=Bl(qc,e).current;return t.next=e,Hl(t.effect),t}function qc(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Hc(){return"undefined"!=typeof window}function Wc(e){return Gc(e)?(e.nodeName||"").toLowerCase():"#document"}function Uc(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Bc(e){var t;return null==(t=(Gc(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Gc(e){return!!Hc()&&(e instanceof Node||e instanceof Uc(e).Node)}function Zc(e){return!!Hc()&&(e instanceof Element||e instanceof Uc(e).Element)}function Kc(e){return!!Hc()&&(e instanceof HTMLElement||e instanceof Uc(e).HTMLElement)}function Qc(e){return!(!Hc()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Uc(e).ShadowRoot)}const Xc=new Set(["inline","contents"]);function Jc(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=uu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Xc.has(o)}const Yc=new Set(["table","td","th"]);function eu(e){return Yc.has(Wc(e))}const tu=[":popover-open",":modal"];function nu(e){return tu.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ru=["transform","translate","scale","rotate","perspective"],ou=["transform","translate","scale","rotate","perspective","filter"],iu=["paint","layout","strict","content"];function su(e){const t=au(),n=Zc(e)?uu(e):e;return ru.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ou.some(e=>(n.willChange||"").includes(e))||iu.some(e=>(n.contain||"").includes(e))}function au(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const lu=new Set(["html","body","#document"]);function cu(e){return lu.has(Wc(e))}function uu(e){return Uc(e).getComputedStyle(e)}function du(e){return Zc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fu(e){if("html"===Wc(e))return e;const t=e.assignedSlot||e.parentNode||Qc(e)&&e.host||Bc(e);return Qc(t)?t.host:t}function pu(e){const t=fu(e);return cu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kc(t)&&Jc(t)?t:pu(t)}function hu(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=pu(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Uc(o);if(i){const e=gu(s);return t.concat(s,s.visualViewport||[],Jc(o)?o:[],e&&n?hu(e):[])}return t.concat(o,hu(o,[],n))}function gu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const mu="undefined"!=typeof navigator,vu=function(){if(!mu)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),yu=function(){if(!mu)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}(),bu=function(){if(!mu)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),wu=!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter:none"),_u="MacIntel"===vu.platform&&vu.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(vu.platform),xu=mu&&/firefox/i.test(bu),Su=mu&&/apple/i.test(navigator.vendor),Cu=mu&&/android/i.test(yu)||/android/i.test(bu),Eu=mu&&yu.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Ru=bu.includes("jsdom/"),Iu="data-base-ui-focusable",Pu="active",ku="selected",Ou="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Mu="ArrowLeft",Tu="ArrowRight",Au="ArrowUp",Fu="ArrowDown";function Nu(e){let t=e.activeElement;for(;null!=t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function zu(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Qc(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Lu(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Du(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Vu(e){return e?.ownerDocument||document}function $u(e){return Kc(e)&&e.matches(Ou)}function ju(e){return!!e&&"combobox"===e.getAttribute("role")&&$u(e)}function qu(e){return e?e.hasAttribute(Iu)?e:e.querySelector(`[${Iu}]`)||e:null}function Hu(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Hu(e,t.id,n)])}function Wu(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){const t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Uu(e){e.preventDefault(),e.stopPropagation()}function Bu(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Cu&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Gu(e){return!Ru&&(!Cu&&0===e.width&&0===e.height||Cu&&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&&"touch"===e.pointerType)}function Zu(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ku(e){const t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}const Qu=["top","right","bottom","left"],Xu=Math.min,Ju=Math.max,Yu=Math.round,ed=Math.floor,td=e=>({x:e,y:e}),nd={left:"right",right:"left",bottom:"top",top:"bottom"},rd={start:"end",end:"start"};function od(e,t,n){return Ju(e,Xu(t,n))}function id(e,t){return"function"==typeof e?e(t):e}function sd(e){return e.split("-")[0]}function ad(e){return e.split("-")[1]}function ld(e){return"x"===e?"y":"x"}function cd(e){return"y"===e?"height":"width"}const ud=new Set(["top","bottom"]);function dd(e){return ud.has(sd(e))?"y":"x"}function fd(e){return ld(dd(e))}function pd(e){return e.replace(/start|end/g,e=>rd[e])}const hd=["left","right"],gd=["right","left"],md=["top","bottom"],vd=["bottom","top"];function yd(e){return e.replace(/left|right|bottom|top/g,e=>nd[e])}function bd(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 wd(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function _d(e,t,n){return Math.floor(e/t)!==n}function xd(e,t){return t<0||t>=e.current.length}function Sd(e,t){return Ed(e,{disabledIndices:t})}function Cd(e,t){return Ed(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ed(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let i=t;do{i+=n?-o:o}while(i>=0&&i<=e.current.length-1&&Pd(e,i,r));return i}function Rd(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e);default:return-1}}function Id(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Pd(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const r=e.current[t];return!!r&&(r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled"))}var kd=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),Od="undefined"==typeof Element,Md=Od?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Td=!Od&&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},Ad=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):Ad(e.parentNode))},Fd=function(e,t,n){if(Ad(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(kd));return t&&Md.call(e,kd)&&r.unshift(e),r.filter(n)},Nd=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!Ad(i,!1))if("SLOT"===i.tagName){var s=i.assignedElements(),a=s.length?s:i.children,l=Nd(a,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{Md.call(i,kd)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var c=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),u=!Ad(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(c&&u){var d=Nd(!0===c?i.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return r},zd=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ld=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))&&!zd(e)?0:e.tabIndex},Dd=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Vd=function(e){return"INPUT"===e.tagName},$d=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},jd=function(e,t){return!(t.disabled||function(e){return Vd(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=Md.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Md.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return $d(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=Td(e);if(s&&!s.shadowRoot&&!0===r(s))return $d(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Td(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=Td(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Md.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},qd=function(e,t){return!(function(e){return function(e){return Vd(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Td(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Ld(t)<0||!jd(e,t))},Hd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Wd=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,s=function(e,t){var n=Ld(e);return n<0&&t&&!zd(e)?0:n}(i,o),a=o?Wd(e.candidates):i;0===s?o?t.push.apply(t,a):t.push(i):n.push({documentOrder:r,tabIndex:s,item:e,isScope:o,content:a})}),n.sort(Dd).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Ud=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Nd([e],t.includeContainer,{filter:qd.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Hd}):Fd(e,t.includeContainer,qd.bind(null,t)),Wd(n)},Bd=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Md.call(e,kd)&&qd(t,e)};const Gd=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Zd(e,t){const n=Ud(e,Gd()),r=n.length;if(0===r)return;const o=Nu(Vu(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function Kd(e){return Zd(Vu(e).body,1)||e}function Qd(e){return Zd(Vu(e).body,-1)||e}function Xd(e,t){if(!e)return null;const n=Ud(Vu(e).body,Gd()),r=n.length;if(0===r)return null;const o=n.indexOf(e);return-1===o?null:n[(o+t+r)%r]}function Jd(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!zu(n,r)}function Yd(e){Ud(e,Gd()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function ef(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const tf={...Pt};let nf=0;const rf=tf.useId;function of(e,t){if(void 0!==rf){const n=rf();return e??(t?`${t}-${n}`:n)}return function(e,t="mui"){const[n,r]=ae(e),o=e||n;return ce(()=>{null==n&&(nf+=1,r(`${t}-${nf}`))},[n,t]),o}(e,t)}function sf(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class af{nodesRef={current:[]};events=sf();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const t=this.nodesRef.current.findIndex(t=>t===e);-1!==t&&this.nodesRef.current.splice(t,1)}}const lf=B(null),cf=B(null),uf=()=>ge(lf)?.id||null,df=e=>{const t=ge(cf);return e??t};function ff(e){const t=of(),n=df(e),r=uf();return Hl(()=>{if(!t)return;const e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function pf(e){const{children:t,id:n}=e,r=uf();return Cr.jsx(lf.Provider,{value:pe(()=>({id:n,parentId:r}),[n,r]),children:t})}function hf(e){const{children:t,externalTree:n}=e,r=Bl(()=>n??new af).current;return Cr.jsx(cf.Provider,{value:r,children:t})}const gf={style:{transition:"none"}},mf={fallbackAxisSide:"none"},vf={fallbackAxisSide:"end"},yf={clipPath:"inset(50%)",position:"fixed",top:0,left:0},bf="none",wf="trigger-press",_f="trigger-hover",xf="trigger-focus",Sf="outside-press",Cf="item-press",Ef="clear-press",Rf="input-change",If="input-clear",Pf="focus-out",kf="escape-key",Of="list-navigation",Mf="cancel-open",Tf="sibling-open",Af="imperative-action";function Ff(e,t,n,r){let o=!1,i=!1;const s=Mc;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){i=!0},get isCanceled(){return o},get isPropagationAllowed(){return i},trigger:n,...s}}function Nf(e,t,n){const r=n??Mc;return{reason:e,event:t??new Event("base-ui"),...r}}function zf(e){return`data-base-ui-${e}`}function Lf(e,t,n){if(n&&!Zu(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:n?.[t]}return e?.[t]}function Df(e){return e?.ownerDocument||document}const Vf=Le(function(e,t){const[n,r]=ae();Hl(()=>{Su&&r("button")},[]);const o={tabIndex:0,role:n};return Cr.jsx("span",{...e,ref:t,style:tc,"aria-hidden":!n||void 0,...o,"data-base-ui-focus-guard":""})});let $f=0;function jf(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame($f);const i=()=>e?.focus({preventScroll:n});o?i():$f=requestAnimationFrame(i)}const qf={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Hf(e){return"inert"===e?qf.inert:"aria-hidden"===e?qf["aria-hidden"]:qf.none}let Wf=new WeakSet,Uf={},Bf=0;const Gf=e=>e&&(e.host||Gf(e.parentNode));function Zf(e){if(!yt(e))return null;const t=e,n=t.props;return(Ec(19)?n?.ref:t.ref)??null}function Kf(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}const Qf={};function Xf(e,t,n,r,o){let i={...tp(e,Qf)};return t&&(i=Jf(i,t)),n&&(i=Jf(i,n)),r&&(i=Jf(i,r)),o&&(i=Jf(i,o)),i}function Jf(e,t){return ep(t)?t(e):function(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":e[n]=Kf(e.style,r);break;case"className":e[n]=op(e.className,r);break;default:Yf(n,r)?e[n]=np(e[n],r):e[n]=r}}return e}(e,t)}function Yf(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return 111===n&&110===r&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}function ep(e){return"function"==typeof e}function tp(e,t){return ep(e)?e(t):e??Qf}function np(e,t){return t?e?n=>{if(function(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}(n)){const r=n;rp(r);const o=t(r);return r.baseUIHandlerPrevented||e?.(r),o}const r=t(n);return e?.(n),r}:t:e}function rp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function op(e,t){return t?e?t+" "+e:t:e}function ip(e,t,n={}){const r=t.render,o=function(e,t={}){const{className:n,style:r,render:o}=e,{state:i=Mc,ref:s,props:a,stateAttributesMapping:l,enabled:c=!0}=t,u=c?function(e,t){return"function"==typeof e?e(t):e}(n,i):void 0,d=c?function(e,t){return"function"==typeof e?e(t):e}(r,i):void 0,f=c?function(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const e=t[r](o);null!=e&&Object.assign(n,e);continue}!0===o?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}(i,l):Mc,p=c?Kf(f,Array.isArray(a)?function(e){if(0===e.length)return Qf;if(1===e.length)return tp(e[0],Qf);let t={...tp(e[0],Qf)};for(let n=1;n<e.length;n+=1)t=Jf(t,e[n]);return t}(a):a)??Mc:Mc;return"undefined"!=typeof document&&(c?Array.isArray(s)?p.ref=function(e){const t=Bl(Yl).current;return function(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}(t,e)&&ec(t,e),t.callback}([p.ref,Zf(o),...s]):p.ref=Jl(p.ref,Zf(o),s):Jl(null,null)),c?(void 0!==u&&(p.className=op(p.className,u)),void 0!==d&&(p.style=Kf(p.style,d)),p):Mc}(t,n);return!1===n.enabled?null:function(e,t,n,r){if(t){if("function"==typeof t)return t(n,r);const e=Xf(n,t.props);return e.ref=n.ref,_n(t,e)}if(e&&"string"==typeof e)return function(e,t){return"button"===e?b("button",{type:"button",...t,key:t.key}):"img"===e?b("img",{alt:"",...t,key:t.key}):b(e,t)}(e,n);throw new Error(nc(8))}(e,r,o,n.state??Mc)}const sp=B(null),ap=()=>ge(sp),lp=zf("portal"),cp=Le(function(e,t){const{children:n,container:r,className:o,render:i,renderGuards:s,...a}=e,{portalNode:l,portalSubtree:c}=function(e={}){const{ref:t,container:n,componentProps:r=Mc,elementProps:o,elementState:i}=e,s=of(),a=ap(),l=a?.portalNode,[c,u]=ae(null),[d,f]=ae(null),p=de(null);Hl(()=>{if(null===n)return void(p.current&&(p.current=null,f(null),u(null)));if(null==s)return;const e=(n&&(Gc(n)?n:n.current))??l??document.body;null!=e?p.current!==e&&(p.current=e,f(null),u(e)):p.current&&(p.current=null,f(null),u(null))},[n,l,s]);const h=ip("div",r,{ref:[t,f],state:i,props:[{id:s,[lp]:""},o]});return{portalNode:d,portalSubtree:c&&h?Xe(h,c):null}}({container:r,ref:t,componentProps:e,elementProps:a}),u=de(null),d=de(null),f=de(null),p=de(null),[h,g]=ae(null),m=h?.modal,v=h?.open,y="boolean"==typeof s?s:!!h&&!h.modal&&h.open&&!!l;ce(()=>{if(l&&!m)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){l&&Jd(e)&&("focusin"===e.type?ef:Yd)(l)}},[l,m]),ce(()=>{l&&!v&&ef(l)},[v,l]);const b=pe(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:l,setFocusManagerState:g}),[l]);return Cr.jsxs(x,{children:[c,Cr.jsxs(sp.Provider,{value:b,children:[y&&l&&Cr.jsx(Vf,{"data-type":"outside",ref:u,onFocus:e=>{if(Jd(e,l))f.current?.focus();else{const e=Qd(h?h.domReference:null);e?.focus()}}}),y&&l&&Cr.jsx("span",{"aria-owns":l.id,style:yf}),l&&Xe(n,l),y&&l&&Cr.jsx(Vf,{"data-type":"outside",ref:d,onFocus:e=>{if(Jd(e,l))p.current?.focus();else{const t=Kd(h?h.domReference:null);t?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Ff(Pf,e.nativeEvent))}}})]})]})});function up(e){return null==e?e:"current"in e?e.current:e}let dp=[];function fp(){dp=dp.filter(e=>e.isConnected)}function pp(){return fp(),dp[dp.length-1]}function hp(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Gd(),r=function(e,t){return(t=t||{}).getShadowRoot?Nd([e],t.includeContainer,{filter:jd.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Fd(e,t.includeContainer,jd.bind(null,t))}(e,n),o=r.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Bd(e,n)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||0===o.length?"0"!==i&&e.setAttribute("tabindex","0"):("-1"!==i||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function gp(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:i=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",getInsideElements:d=()=>[],nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:h,externalTree:g}=e,m="rootStore"in t?t.rootStore:t,v=m.useState("open"),y=m.useState("domReferenceElement"),b=m.useState("floatingElement"),{events:w,dataRef:_}=m.context,S=Kl(()=>_.current.floatingContext?.nodeId),C=Kl(d),E=!1===i,R=ju(y)&&E,I=jc(o),P=jc(i),k=jc(s),O=jc(u),M=df(g),T=ap(),A=de(null),F=de(null),N=de(!1),z=de(!1),L=de(!1),D=de(-1),V=de(""),$=de(""),j=$c(),q=$c(),H=Dc(),W=null!=T,U=qu(b),B=Kl((e=U)=>e?Ud(e,Gd()):[]),G=Kl(e=>{const t=B(e);return I.current.map(()=>t).filter(Boolean).flat()});ce(()=>{if(r)return;if(!l)return;function e(e){"Tab"===e.key&&zu(U,Nu(Vu(U)))&&0===B().length&&!R&&Uu(e)}const t=Vu(U);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,U,l,I,R,B,G]),ce(()=>{if(!r&&b)return b.addEventListener("focusin",e),()=>{b.removeEventListener("focusin",e)};function e(e){const t=Lu(e),n=B().indexOf(t);-1!==n&&(D.current=n)}},[r,b,B]),ce(()=>{if(r||!v)return;const e=Vu(U);function t(){L.current=!1}function n(e){const t=Lu(e),n=zu(b,t)||zu(y,t)||zu(T?.portalNode,t);L.current=!n,$.current=e.pointerType||"keyboard"}function o(){$.current="keyboard"}return e.addEventListener("pointerdown",n,!0),e.addEventListener("pointerup",t,!0),e.addEventListener("pointercancel",t,!0),e.addEventListener("keydown",o,!0),()=>{e.removeEventListener("pointerdown",n,!0),e.removeEventListener("pointerup",t,!0),e.removeEventListener("pointercancel",t,!0),e.removeEventListener("keydown",o,!0)}},[r,b,y,U,v,T]),ce(()=>{if(r)return;if(!c)return;function e(){z.current=!0,q.start(0,()=>{z.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=Lu(e);queueMicrotask(()=>{const o=S(),i=m.context.triggerElements,s=!(zu(y,t)||zu(b,t)||zu(t,b)||zu(T?.portalNode,t)||null!=t&&i.hasElement(t)||i.hasMatchingElement(e=>zu(e,t))||t?.hasAttribute(zf("focus-guard"))||M&&(Hu(M.nodesRef.current,o).find(e=>zu(e.context?.elements.floating,t)||zu(e.context?.elements.domReference,t))||Wu(M.nodesRef.current,o).find(e=>[e.context?.elements.floating,qu(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&U&&hp(U,I),a&&n!==y&&!((c=r)&&c.isConnected&&("function"==typeof c.checkVisibility?c.checkVisibility():"none"!==uu(c).display))&&Nu(Vu(U))===Vu(U).body){if(Kc(U)&&(U.focus(),"popup"===a))return void H.request(()=>{U.focus()});const e=D.current,t=B(),n=t[e]||t[t.length-1]||U;Kc(n)&&n.focus()}var c;_.current.insideReactTree?_.current.insideReactTree=!1:!R&&l||!t||!s||z.current||!R&&t===pp()||(N.current=!0,m.setOpen(!1,Ff(Pf,e)))})}function n(){L.current||(_.current.insideReactTree=!0,j.start(0,()=>{_.current.insideReactTree=!1}))}const o=Kc(y)?y:null,i=[];return b||o?(o&&(o.addEventListener("focusout",t),o.addEventListener("pointerdown",e),i.push(()=>{o.removeEventListener("focusout",t),o.removeEventListener("pointerdown",e)})),b&&(b.addEventListener("focusout",t),T&&(b.addEventListener("focusout",n,!0),i.push(()=>{b.removeEventListener("focusout",n,!0)})),i.push(()=>{b.removeEventListener("focusout",t)})),()=>{i.forEach(e=>{e()})}):void 0},[r,y,b,U,l,M,T,m,c,a,B,R,S,I,_,j,q,H]);const Z=de(null),K=de(null),Q=Jl(Z,h,T?.beforeInsideRef),X=Jl(K,T?.afterInsideRef);ce(()=>{if(r||!b||!v)return;const e=Array.from(T?.portalNode?.querySelectorAll(`[${zf("portal")}]`)||[]),t=M?Wu(M.nodesRef.current,S()):[],n=t.find(e=>ju(e.context?.elements.domReference||null))?.context?.elements.domReference,o=[b,n,...e,...C(),A.current,F.current,Z.current,K.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,up(p),up(f),R?y:null].filter(e=>null!=e),i=function(e,t=!1,n=!1){const r=Vu(e[0]).body;return function(e,t,n,r){const o="data-base-ui-inert",i=r?"inert":n?"aria-hidden":null,s=(a=t,e.map(e=>{if(a.contains(e))return e;const t=Gf(e);return a.contains(t)?t:null}).filter(e=>null!=e));var a;const l=new Set,c=new Set(s),u=[];Uf[o]||(Uf[o]=new WeakMap);const d=Uf[o];return s.forEach(function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Wc(t))if(l.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Hf(i),s=(r.get(t)||0)+1,a=(d.get(t)||0)+1;r.set(t,s),d.set(t,a),u.push(t),1===s&&n&&Wf.add(t),1===a&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),l.clear(),Bf+=1,()=>{u.forEach(e=>{const t=Hf(i),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Wf.has(e)&&i&&e.removeAttribute(i),Wf.delete(e)),r||e.removeAttribute(o)}),Bf-=1,Bf||(qf.inert=new WeakMap,qf["aria-hidden"]=new WeakMap,qf.none=new WeakMap,Wf=new WeakSet,Uf={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}(o,l||R);return()=>{i()}},[v,r,y,b,l,I,T,R,M,S,C,f,p]),Hl(()=>{if(!v||r||!Kc(U))return;const e=Nu(Vu(U));queueMicrotask(()=>{const t=G(U),n=P.current,r="function"==typeof n?n(O.current||""):n;if(void 0===r||!1===r)return;let o;o=!0===r||null===r?t[0]||U:up(r),o=o||t[0]||U,zu(U,e)||jf(o,{preventScroll:o===U})})},[r,v,U,E,G,P,O]),Hl(()=>{if(r||!U)return;const e=Vu(U);var t;function n(e){if(e.open||(V.current=function(e,t){const n=Uc(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(0===e.detail?"keyboard":"mouse"):""}(e.nativeEvent,$.current)),e.reason===_f&&"mouseleave"===e.nativeEvent.type&&(N.current=!0),e.reason===Sf)if(e.nested)N.current=!1;else if(Bu(e.nativeEvent)||Gu(e.nativeEvent))N.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),N.current=!e}}t=Nu(e),fp(),t&&"body"!==Wc(t)&&(dp.push(t),dp.length>20&&(dp=dp.slice(-20))),w.on("openchange",n);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,tc),W&&y&&y.insertAdjacentElement("afterend",o),()=>{w.off("openchange",n);const t=Nu(e),r=zu(b,t)||M&&Hu(M.nodesRef.current,S(),!1).some(e=>zu(e.context?.elements.floating,t)),i=function(){const e=k.current;let t="function"==typeof e?e(V.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){const e=y||pp();return e&&e.isConnected?e:o}const n=y||pp()||o;return up(t)||n}();queueMicrotask(()=>{const n=function(e){if(!e)return null;const t=Gd();return Bd(e,t)?e:Ud(e,t)[0]||e}(i),s="boolean"!=typeof k.current;k.current&&!N.current&&Kc(n)&&(s||n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,b,U,k,_,w,M,W,y,S]),ce(()=>{queueMicrotask(()=>{N.current=!1})},[r]),ce(()=>{if(r||!v)return;function e(e){const t=Lu(e);t?.closest("[data-base-ui-click-trigger]")&&(z.current=!0)}const t=Vu(U);return t.addEventListener("pointerdown",e,!0),()=>{t.removeEventListener("pointerdown",e,!0)}},[r,v,U]),Hl(()=>{if(!r&&T)return T.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:m.setOpen,domReference:y}),()=>{T.setFocusManagerState(null)}},[r,T,l,v,m,c,y]),Hl(()=>{if(!r&&U)return hp(U,I),()=>{queueMicrotask(fp)}},[r,U,I]);const J=!r&&(!l||!R)&&(W||l);return Cr.jsxs(x,{children:[J&&Cr.jsx(Vf,{"data-type":"inside",ref:Q,onFocus:e=>{if(l){const e=G();jf(e[e.length-1])}else if(T?.portalNode)if(N.current=!1,Jd(e,T.portalNode)){const e=Kd(y);e?.focus()}else up(p??T.beforeOutsideRef)?.focus()}}),n,J&&Cr.jsx(Vf,{"data-type":"inside",ref:X,onFocus:e=>{if(l)jf(G()[0]);else if(T?.portalNode)if(c&&(N.current=!0),Jd(e,T.portalNode)){const e=Qd(y);e?.focus()}else up(f??T.afterOutsideRef)?.focus()}})]})}function mp(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:i="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0}=t,u=de(void 0),d=Dc(),f=$c(),p=pe(()=>({onPointerDown(e){u.current=e.pointerType},onMouseDown(e){const t=u.current,o=e.nativeEvent,p=n.select("open");if(0!==e.button||"click"===i||Zu(t,!0)&&a)return;const h=r.current.openEvent,g=h?.type,m=n.select("domReferenceElement")!==e.currentTarget,v=p&&m||!(p&&s&&(!h||!l||"click"===g||"mousedown"===g));if($u(o.target)){const e=Ff(wf,o,o.target);return void(v&&"touch"===t&&c>0?f.start(c,()=>{n.setOpen(!0,e)}):n.setOpen(v,e))}const y=e.currentTarget;d.request(()=>{const e=Ff(wf,o,y);v&&"touch"===t&&c>0?f.start(c,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if("mousedown-only"===i)return;const t=u.current;if("mousedown"===i&&t)return void(u.current=void 0);if(Zu(t,!0)&&a)return;const o=n.select("open"),d=r.current.openEvent,p=n.select("domReferenceElement")!==e.currentTarget,h=o&&p||!(o&&s&&(!d||!l||Ku(d))),g=Ff(wf,e.nativeEvent,e.currentTarget);h&&"touch"===t&&c>0?f.start(c,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){u.current=void 0}}),[r,i,a,n,l,s,d,f,c]);return pe(()=>o?{reference:p}:Mc,[o,p])}function vp(e,t,n){let{reference:r,floating:o}=e;const i=dd(t),s=fd(t),a=cd(s),l=sd(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){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:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ad(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1)}return p}async function yp(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=id(t,e),h=bd(p),g=a[f?"floating"===d?"reference":"floating":d],m=wd(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=wd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}function bp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wp(e){return Qu.some(t=>e[t]>=0)}const _p=new Set(["left","top"]);function xp(e){const t=uu(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Kc(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Yu(n)!==i||Yu(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Sp(e){return Zc(e)?e:e.contextElement}function Cp(e){const t=Sp(e);if(!Kc(t))return td(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=xp(t);let s=(i?Yu(n.width):n.width)/r,a=(i?Yu(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Ep=td(0);function Rp(e){const t=Uc(e);return au()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ep}function Ip(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Sp(e);let s=td(1);t&&(r?Zc(r)&&(s=Cp(r)):s=Cp(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Uc(e))&&t}(i,n,r)?Rp(i):td(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Uc(i),t=r&&Zc(r)?Uc(r):r;let n=e,o=gu(n);for(;o&&r&&t!==n;){const e=Cp(o),t=o.getBoundingClientRect(),r=uu(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Uc(o),o=gu(n)}}return wd({width:u,height:d,x:l,y:c})}function Pp(e,t){const n=du(e).scrollLeft;return t?t.left+n:Ip(Bc(e)).left+n}function kp(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Pp(e,n),y:n.top+t.scrollTop}}const Op=new Set(["absolute","fixed"]);function Mp(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Uc(e),r=Bc(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=au();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=Pp(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Bc(e),n=du(e),r=e.ownerDocument.body,o=Ju(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ju(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Pp(e);const a=-n.scrollTop;return"rtl"===uu(r).direction&&(s+=Ju(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Bc(e));else if(Zc(t))r=function(e,t){const n=Ip(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Kc(e)?Cp(e):td(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=Rp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wd(r)}function Tp(e,t){const n=fu(e);return!(n===t||!Zc(n)||cu(n))&&("fixed"===uu(n).position||Tp(n,t))}function Ap(e,t,n){const r=Kc(t),o=Bc(t),i="fixed"===n,s=Ip(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=td(0);function c(){l.x=Pp(o)}if(r||!r&&!i)if(("body"!==Wc(t)||Jc(o))&&(a=du(t)),r){const e=Ip(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?td(0):kp(o,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}function Fp(e){return"static"===uu(e).position}function Np(e,t){if(!Kc(e)||"fixed"===uu(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Bc(e)===n&&(n=n.ownerDocument.body),n}function zp(e,t){const n=Uc(e);if(nu(e))return n;if(!Kc(e)){let t=fu(e);for(;t&&!cu(t);){if(Zc(t)&&!Fp(t))return t;t=fu(t)}return n}let r=Np(e,t);for(;r&&eu(r)&&Fp(r);)r=Np(r,t);return r&&cu(r)&&Fp(r)&&!su(r)?n:r||function(e){let t=fu(e);for(;Kc(t)&&!cu(t);){if(su(t))return t;if(nu(t))return null;t=fu(t)}return null}(e)||n}const Lp={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Bc(r),a=!!t&&nu(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=td(1);const u=td(0),d=Kc(r);if((d||!d&&!i)&&(("body"!==Wc(r)||Jc(s))&&(l=du(r)),Kc(r))){const e=Ip(r);c=Cp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?td(0):kp(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Bc,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?nu(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=hu(e,[],!1).filter(e=>Zc(e)&&"body"!==Wc(e)),o=null;const i="fixed"===uu(e).position;let s=i?fu(e):e;for(;Zc(s)&&!cu(s);){const t=uu(s),n=su(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Op.has(o.position)||Jc(s)&&!n&&Tp(e,s))?r=r.filter(e=>e!==s):o=t,s=fu(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce((e,n)=>{const r=Mp(t,n,o);return e.top=Ju(r.top,e.top),e.right=Xu(r.right,e.right),e.bottom=Xu(r.bottom,e.bottom),e.left=Ju(r.left,e.left),e},Mp(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:zp,getElementRects:async function(e){const t=this.getOffsetParent||zp,n=this.getDimensions,r=await n(e.floating);return{reference:Ap(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=xp(e);return{width:t,height:n}},getScale:Cp,isElement:Zc,isRTL:function(e){return"rtl"===uu(e).direction}};function Dp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vp(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Sp(e),u=o||i?[...c?hu(c):[],...hu(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&a?function(e,t){let n,r=null;const o=Bc(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(a||t(),!f||!p)return;const h={rootMargin:-ed(d)+"px "+-ed(o.clientWidth-(u+f))+"px "+-ed(o.clientHeight-(d+p))+"px "+-ed(u)+"px",threshold:Ju(0,Xu(1,l))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!g)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==r||Dp(c,e.getBoundingClientRect())||s(),g=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;s&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g=l?Ip(e):null;return l&&function t(){const r=Ip(e);g&&!Dp(g,r)&&n(),g=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const $p=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=sd(n),a=ad(n),l="y"===dd(n),c=_p.has(s)?-1:1,u=i&&l?-1:1,d=id(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},jp=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:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=id(e,t),c={x:n,y:r},u=await yp(t,l),d=dd(sd(o)),f=ld(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=od(p+u["y"===f?"top":"left"],p,p-u[e])}if(s){const e="y"===d?"bottom":"right";h=od(h+u["y"===d?"top":"left"],h,h-u[e])}const g=a.fn({...t,[f]:p,[d]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:i,[d]:s}}}}}},qp=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=id(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=sd(o),y=dd(a),b=sd(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=f||(b||!g?[yd(a)]:function(e){const t=yd(e);return[pd(e),t,pd(t)]}(a)),x="none"!==h;!f&&x&&_.push(...function(e,t,n,r){const o=ad(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?gd:hd:t?hd:gd;case"left":case"right":return t?md:vd;default:return[]}}(sd(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(pd)))),i}(a,g,h,w));const S=[a,..._],C=await yp(t,m),E=[];let R=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=ad(e),o=fd(e),i=cd(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=yd(s)),[s,yd(s)]}(o,s,w);E.push(C[e[0]],C[e[1]])}if(R=[...R,{placement:o,overflows:E}],!E.every(e=>e<=0)){var I,P;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=S[e];if(t&&("alignment"!==d||y===dd(t)||R.every(e=>dd(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(P=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=R.filter(e=>{if(x){const t=dd(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Hp=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=id(e,t),u=await yp(t,c),d=sd(o),f=ad(o),p="y"===dd(o),{width:h,height:g}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,m="end"===f?"top":"bottom");const y=g-u.top-u.bottom,b=h-u.left-u.right,w=Xu(g-u[m],y),_=Xu(h-u[v],b),x=!t.middlewareData.shift;let S=w,C=_;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=y),x&&!f){const e=Ju(u.left,0),t=Ju(u.right,0),n=Ju(u.top,0),r=Ju(u.bottom,0);p?C=h-2*(0!==e||0!==t?e+t:Ju(u.left,u.right)):S=g-2*(0!==n||0!==r?n+r:Ju(u.top,u.bottom))}await l({...t,availableWidth:C,availableHeight:S});const E=await s.getDimensions(a.floating);return h!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}},Wp=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=id(e,t);switch(r){case"referenceHidden":{const e=bp(await yp(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wp(e)}}}case"escaped":{const e=bp(await yp(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wp(e)}}}default:return{}}}}},Up=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=id(e,t),u={x:n,y:r},d=dd(o),f=ld(d);let p=u[f],h=u[d];const g=id(a,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+m.mainAxis,n=i.reference[f]+i.reference[e]-m.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,y;const e="y"===f?"width":"height",t=_p.has(sd(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[d]:h}}}},Bp=(e,t,n)=>{const r=new Map,o={platform:Lp,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=vp(c,r,l),f=r,p={},h=0;for(let n=0;n<a.length;n++){const{name:i,fn:g}=a[n],{x:m,y:v,data:y,reset:b}=await g({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=m?m:u,d=null!=v?v:d,p={...p,[i]:{...p[i],...y}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=vp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Gp="undefined"!=typeof document?ue:function(){};function Zp(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(!Zp(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||Zp(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Kp(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qp(e,t){const n=Kp(e);return Math.round(t*n)/n}function Xp(e){const t=de(e);return Gp(()=>{t.current=e}),t}const Jp=(e,t)=>({...Up(e),options:[e,t]}),Yp={intentional:"onClick",sloppy:"onPointerDown"};function eh(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),i=n.useState("referenceElement"),s=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:l}=n.context,{enabled:c=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f="sloppy",referencePress:p=!1,referencePressEvent:h="sloppy",ancestorScroll:g=!1,bubbles:m,externalTree:v}=t,y=df(v),b=Kl("function"==typeof d?d:()=>!1),w="function"==typeof d?b:d,_=de(!1),{escapeKey:x,outsidePress:S}={escapeKey:"boolean"==typeof(C=m)?C:C?.escapeKey??!1,outsidePress:"boolean"==typeof C?C:C?.outsidePress??!0};var C;const E=de(null),R=$c(),I=$c(),P=Kl(()=>{I.clear(),l.current.insideReactTree=!1}),k=de(!1),O=de(""),M=Kl(e=>{O.current=e.pointerType}),T=Kl(()=>{const e=O.current,t="pen"!==e&&e?e:"mouse",n="function"==typeof f?f():f;return"string"==typeof n?n:n[t]}),A=Kl(e=>{if(!r||!c||!u||"Escape"!==e.key)return;if(k.current)return;const t=l.current.floatingContext?.nodeId,o=y?Hu(y.nodesRef.current,t):[];if(!x&&o.length>0){let e=!0;if(o.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}const i=function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,s=Ff(kf,i);n.setOpen(!1,s),x||s.isPropagationAllowed||e.stopPropagation()}),F=Kl(e=>{const t=T();return"intentional"===t&&"click"!==e.type||"sloppy"===t&&"click"===e.type}),N=Kl(()=>{l.current.insideReactTree=!0,I.start(0,P)}),z=Kl((e,t=!1)=>{if(F(e))return void P();if(l.current.insideReactTree)return void P();if("intentional"===T()&&t)return;if("function"==typeof w&&!w(e))return;const r=Lu(e),o=`[${zf("inert")}]`,i=Vu(n.select("floatingElement")).querySelectorAll(o),s=n.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>zu(e,r))))return;let a=Zc(r)?r:null;for(;a&&!cu(a);){const e=fu(a);if(cu(e)||!Zc(e))break;a=e}if(i.length&&Zc(r)&&!r.matches("html,body")&&!zu(r,n.select("floatingElement"))&&Array.from(i).every(e=>!zu(a,e)))return;if(Kc(r)&&!("touches"in e)){const t=cu(r),n=uu(r),o=/auto|scroll/,i=t||o.test(n.overflowX),s=t||o.test(n.overflowY),a=i&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,l=s&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,c="rtl"===n.direction,u=l&&(c?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=a&&e.offsetY>r.clientHeight;if(u||d)return}const c=l.current.floatingContext?.nodeId,u=y&&Hu(y.nodesRef.current,c).some(t=>Du(e,t.context?.elements.floating));if(Du(e,n.select("floatingElement"))||Du(e,n.select("domReferenceElement"))||u)return;const d=y?Hu(y.nodesRef.current,c):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Ff(Sf,e)),P()}),L=Kl(e=>{"sloppy"===T()&&"touch"!==e.pointerType&&n.select("open")&&c&&!Du(e,n.select("floatingElement"))&&!Du(e,n.select("domReferenceElement"))&&z(e)}),D=Kl(e=>{if("sloppy"!==T()||!n.select("open")||!c||Du(e,n.select("floatingElement"))||Du(e,n.select("domReferenceElement")))return;const t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},R.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}),V=Kl(e=>{const t=Lu(e);t?.addEventListener(e.type,function n(){D(e),t?.removeEventListener(e.type,n)})}),$=Kl(e=>{const t=_.current;if(_.current=!1,R.clear(),"mousedown"===e.type&&E.current&&!E.current.dismissOnMouseDown)return;const n=Lu(e);n?.addEventListener(e.type,function r(){"pointerdown"===e.type?L(e):z(e,t),n?.removeEventListener(e.type,r)})}),j=Kl(e=>{if("sloppy"!==T()||!E.current||Du(e,n.select("floatingElement"))||Du(e,n.select("domReferenceElement")))return;const t=e.touches[0];if(!t)return;const r=Math.abs(t.clientX-E.current.startX),o=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(r*r+o*o);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(z(e),R.clear(),E.current=null)}),q=Kl(e=>{const t=Lu(e);t?.addEventListener(e.type,function n(){j(e),t?.removeEventListener(e.type,n)})}),H=Kl(e=>{"sloppy"!==T()||!E.current||Du(e,n.select("floatingElement"))||Du(e,n.select("domReferenceElement"))||(E.current.dismissOnTouchEnd&&z(e),R.clear(),E.current=null)}),W=Kl(e=>{const t=Lu(e);t?.addEventListener(e.type,function n(){H(e),t?.removeEventListener(e.type,n)})});ce(()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=x,l.current.__outsidePressBubbles=S;const e=new Vc;function t(e){n.setOpen(!1,Ff(bf,e))}function a(){e.clear(),k.current=!0}function d(){e.start(au()?5:0,()=>{k.current=!1})}const f=Vu(o);f.addEventListener("pointerdown",M,!0),u&&(f.addEventListener("keydown",A),f.addEventListener("compositionstart",a),f.addEventListener("compositionend",d)),w&&(f.addEventListener("click",$,!0),f.addEventListener("pointerdown",$,!0),f.addEventListener("touchstart",V,!0),f.addEventListener("touchmove",q,!0),f.addEventListener("touchend",W,!0),f.addEventListener("mousedown",$,!0));let p=[];return g&&(Zc(s)&&(p=hu(s)),Zc(o)&&(p=p.concat(hu(o))),!Zc(i)&&i&&i.contextElement&&(p=p.concat(hu(i.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{f.removeEventListener("pointerdown",M,!0),u&&(f.removeEventListener("keydown",A),f.removeEventListener("compositionstart",a),f.removeEventListener("compositionend",d)),w&&(f.removeEventListener("click",$,!0),f.removeEventListener("pointerdown",$,!0),f.removeEventListener("touchstart",V,!0),f.removeEventListener("touchmove",q,!0),f.removeEventListener("touchend",W,!0),f.removeEventListener("mousedown",$,!0)),p.forEach(e=>{e.removeEventListener("scroll",t)}),e.clear()}},[l,o,i,s,u,w,r,a,g,c,x,S,A,z,$,L,V,q,W,M,n]),ce(P,[w,P]);const U=pe(()=>({onKeyDown:A,...p&&{[Yp[h]]:e=>{n.setOpen(!1,Ff(wf,e.nativeEvent))},..."intentional"!==h&&{onClick(e){n.setOpen(!1,Ff(wf,e.nativeEvent))}}}}),[A,n,p,h]),B=Kl(e=>{const t=Lu(e.nativeEvent);zu(n.select("floatingElement"),t)&&0===e.button&&(_.current=!0)}),G=pe(()=>({onKeyDown:A,onPointerDown:B,onMouseDown:B,onMouseUp:B,onClickCapture:N,onMouseDownCapture:N,onPointerDownCapture:N,onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[A,B,N]);return pe(()=>c?{reference:U,floating:G,trigger:U}:{},[c,U,G])}const th={open:fc(e=>e.open),domReferenceElement:fc(e=>e.domReferenceElement),referenceElement:fc(e=>e.positionReference??e.referenceElement),floatingElement:fc(e=>e.floatingElement),floatingId:fc(e=>e.floatingId)};class nh extends Tc{constructor(e){const{nested:t,noEmit:n,onOpenChange:r,triggerElements:o,...i}=e;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:sf(),nested:t,noEmit:n,triggerElements:o},th)}setOpen=(e,t)=>{if(e&&this.state.open&&!Ku(t.event)||(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){const n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",n)}this.context.onOpenChange?.(e,t)}}function rh(e,t=!1,n=!1){const[r,o]=ae(e&&t?"idle":void 0),[i,s]=ae(e);return e&&!i&&(s(!0),o("starting")),e||!i||"ending"===r||n||o("ending"),e||i||"ending"!==r||o(void 0),Hl(()=>{if(!e&&i&&"ending"!==r&&n){const e=Lc.request(()=>{o("ending")});return()=>{Lc.cancel(e)}}},[e,i,r,n]),Hl(()=>{if(!e||t)return;const n=Lc.request(()=>{o(void 0)});return()=>{Lc.cancel(n)}},[t,e]),Hl(()=>{if(!e||!t)return;e&&i&&"idle"!==r&&o("starting");const n=Lc.request(()=>{o("idle")});return()=>{Lc.cancel(n)}},[t,e,i,o,r]),pe(()=>({mounted:i,setMounted:s,transitionStatus:r}),[i,r])}function oh(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,i=jc(n),s=Kl(o),a=function(e,t=!1,n=!0){const r=Dc();return Kl((o,i=null)=>{r.cancel();const s=up(e);null!=s&&("function"!=typeof s.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():r.request(()=>{function e(){s&&Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{null!=i&&i.aborted||Ct(o)}).catch(()=>{if(n){if(null!=i&&i.aborted)return;Ct(o)}else s.getAnimations().length>0&&s.getAnimations().some(e=>e.pending||"finished"!==e.playState)&&e()})}t?r.request(e):e()}))})}(r,n);ce(()=>{t&&a(()=>{n===i.current&&s()})},[t,n,s,a,i])}function ih(e){const t=e.useState("open");Hl(()=>{if(t&&!e.select("activeTriggerId")&&1===e.context.triggerElements.size){const t=e.context.triggerElements.entries().next();if(!t.done){const[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function sh(e,t,n){const{mounted:r,setMounted:o,transitionStatus:i}=rh(e);t.useSyncedValues({mounted:r,transitionStatus:i});const s=Kl(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return oh({enabled:!t.useState("preventUnmountingOnClose"),open:e,ref:t.context.popupRef,onComplete(){e||s()}}),{forceUnmount:s,transitionStatus:i}}class ah{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){const n=this.idMap.get(e);n!==t&&(void 0!==n&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){const t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(const t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function lh(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:new nh({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ah,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Mc,inactiveTriggerProps:Mc,popupProps:Mc}}const ch={open:fc(e=>e.open),mounted:fc(e=>e.mounted),transitionStatus:fc(e=>e.transitionStatus),floatingRootContext:fc(e=>e.floatingRootContext),preventUnmountingOnClose:fc(e=>e.preventUnmountingOnClose),payload:fc(e=>e.payload),activeTriggerId:fc(e=>e.activeTriggerId),activeTriggerElement:fc(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:fc((e,t)=>void 0!==t&&e.activeTriggerId===t),isOpenedByTrigger:fc((e,t)=>void 0!==t&&e.activeTriggerId===t&&e.open),isMountedByTrigger:fc((e,t)=>void 0!==t&&e.activeTriggerId===t&&e.mounted),triggerProps:fc((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:fc(e=>e.popupProps),popupElement:fc(e=>e.popupElement),positionerElement:fc(e=>e.positionerElement)};function uh(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=of(),i=null!=uf(),s=Bl(()=>new nh({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new ah,floatingId:o,nested:i,noEmit:e.noEmit||!1})).current;return Hl(()=>{const e={open:t,floatingId:o};void 0!==r.reference&&(e.referenceElement=r.reference,e.domReferenceElement=Zc(r.reference)?r.reference:null),void 0!==r.floating&&(e.floatingElement=r.floating),s.update(e)},[t,o,r.reference,r.floating,s]),s.context.onOpenChange=n,s.context.nested=i,s.context.noEmit=e.noEmit||!1,s}function dh(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,i=of(),s=null!=uf(),a=t.useState("open"),l=t.useState("activeTriggerElement"),c=t.useState(r?"popupElement":"positionerElement"),u=t.context.triggerElements,d=Bl(()=>new nh({open:a,referenceElement:l,floatingElement:c,triggerElements:u,onOpenChange:o,floatingId:i,nested:s,noEmit:n})).current;return Hl(()=>{const e={open:a,floatingId:i,referenceElement:l,floatingElement:c};Zc(l)&&(e.domReferenceElement=l),d.update(e)},[a,i,l,c,d]),d.context.onOpenChange=o,d.context.nested=s,d.context.noEmit=n,d}const fh=Eu&&Su;const ph=zf("safe-polygon"),hh=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ou}`;function gh(e){const t=de(void 0),n=de(!1),r=de(void 0),o=de(!0),i=de(!1),s=de(()=>{}),a=de(!1),l=$c(),c=$c(),u=de(void 0);return pe(()=>{const d=e.context.dataRef.current;return d.hoverInteractionState||(d.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:o,performedPointerEventsMutationRef:i,unbindMouseMoveRef:s,restTimeoutPendingRef:a,openChangeTimeout:l,restTimeout:c,handleCloseOptionsRef:u}),d.hoverInteractionState},[e,t,n,r,o,i,s,a,l,c,u])}const mh=new Set(["click","mousedown"]);function vh(e){return"function"==typeof e?e():e}const yh={current:null};function bh(e=[]){const t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),o=e.map(e=>e?.trigger),i=he(t=>wh(t,e,"reference"),t),s=he(t=>wh(t,e,"floating"),n),a=he(t=>wh(t,e,"item"),r),l=he(t=>wh(t,e,"trigger"),o);return pe(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a,getTriggerProps:l}),[i,s,a,l])}function wh(e,t,n){const r=new Map,o="item"===n,i={};"floating"===n&&(i.tabIndex=-1,i[Iu]="");for(const t in e)o&&e&&(t===Pu||t===ku)||(i[t]=e[t]);for(let s=0;s<t.length;s+=1){let a;const l=t[s]?.[n];a="function"==typeof l?e?l(e):null:l,a&&_h(i,a,o,r)}return _h(i,e,o,r),i}function _h(e,t,n,r){for(const o in t){const i=t[o];(!n||o!==Pu&&o!==ku)&&(o.startsWith("on")?(r.has(o)||r.set(o,[]),"function"==typeof i&&(r.get(o)?.push(i),e[o]=(...e)=>r.get(o)?.map(t=>t(...e)).find(e=>void 0!==e))):e[o]=i)}}function xh(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Sh(e,t){return xh(t,e===Au||e===Fu,e===Mu||e===Tu)}function Ch(e,t,n){return xh(t,e===Fu,n?e===Mu:e===Tu)||"Enter"===e||" "===e||""===e}function Eh(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),i=n.useState("domReferenceElement"),s=n.context.dataRef,{listRef:a,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:h=!1,rtl:g=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w,orientation:_="vertical",parentOrientation:x,cols:S=1,scrollItemIntoView:C=!0,itemSizes:E,dense:R=!1,id:I,resetOnPointerLeave:P=!0,externalTree:k}=t,O=jc(qu(o)),M=uf(),T=df(k);Hl(()=>{s.current.orientation=_},[s,_]);const A=ju(i),F=de(v),N=de(d??-1),z=de(null),L=de(!0),D=Kl(e=>{c(-1===N.current?null:N.current,e)}),V=de(D),$=de(!!o),j=de(r),q=de(!1),H=de(!1),W=jc(w),U=jc(r),B=jc(C),G=jc(d),Z=jc(P),K=Kl(()=>{function e(e){m?T?.events.emit("virtualfocus",e):jf(e,{sync:q.current,preventScroll:!0})}const t=a.current[N.current],n=H.current;t&&e(t);const r=q.current?e=>e():requestAnimationFrame;r(()=>{const r=a.current[N.current]||t;if(!r)return;t||e(r);const o=B.current;o&&X&&(n||!L.current)&&r.scrollIntoView?.("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o)})});Hl(()=>{u&&(r&&o?(N.current=d??-1,F.current&&null!=d&&(H.current=!0,D())):$.current&&(N.current=-1,V.current()))},[u,r,o,d,D]),Hl(()=>{if(u)if(r){if(o)if(null==l){if(q.current=!1,null!=G.current)return;if($.current&&(N.current=-1,K()),(!j.current||!$.current)&&F.current&&(null!=z.current||!0===F.current&&null==z.current)){let e=0;const t=()=>{null==a.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(N.current=null==z.current||Ch(z.current,_,g)||h?Sd(a):Cd(a),z.current=null,D())};t()}}else xd(a,l)||(N.current=l,K(),H.current=!1)}else q.current=!1},[u,r,o,l,G,h,a,_,g,D,K,W]),Hl(()=>{if(!u||o||!T||m||!$.current)return;const e=T.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=Nu(Vu(o)),r=e.some(e=>e.context&&zu(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[u,o,T,M,m]),Hl(()=>{V.current=D,j.current=r,$.current=!!o}),Hl(()=>{r||(z.current=null,F.current=v)},[r,v]);const Q=null!=l,X=pe(()=>{function e(e){if(!U.current)return;const t=a.current.indexOf(e.currentTarget);-1!==t&&N.current!==t&&(N.current=t,D(e))}return{onFocus(t){q.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){q.current=!0,H.current=!1,y&&e(t)},onPointerLeave(e){if(!U.current||!L.current||"touch"===e.pointerType)return;q.current=!0;const t=e.relatedTarget;y&&!a.current.includes(t)&&Z.current&&(N.current=-1,D(e),m||O.current?.focus({preventScroll:!0}))}}},[U,O,y,a,D,Z,m]),J=he(()=>x??T?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation,[M,T,x]),Y=Kl(e=>{if(L.current=!1,q.current=!0,229===e.which)return;if(!U.current&&e.currentTarget===O.current)return;if(h&&function(e,t,n,r){return"both"===t||"horizontal"===t&&r&&r>1?"Escape"===e:xh(t,n?e===Tu:e===Mu,e===Au)}(e.key,_,g,S))return Sh(e.key,J())||Uu(e),n.setOpen(!1,Ff(Of,e.nativeEvent)),void(Kc(i)&&(m?T?.events.emit("virtualfocus",i):i.focus()));const t=N.current,o=Sd(a,w),s=Cd(a,w);if(A||("Home"===e.key&&(Uu(e),N.current=o,D(e)),"End"===e.key&&(Uu(e),N.current=s,D(e))),S>1){const t=E||Array.from({length:a.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach(({width:e,height:i},s)=>{let a=!1;for(n&&(o=0);!a;){const n=[];for(let r=0;r<e;r+=1)for(let e=0;e<i;e+=1)n.push(o+r+e*t);o%t+e<=t&&n.every(e=>null==r[e])?(n.forEach(e=>{r[e]=s}),a=!0):o+=1}}),[...r]}(t,S,R),r=n.findIndex(e=>null!=e&&!Pd(a,e,w)),i=n.reduce((e,t,n)=>null==t||Pd(a,t,w)?e:n,-1),l=n[function(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}){let d=c;const f=[],p={};let h=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(null==e)return;const o=e.closest('[role="row"]');o&&(h=!0),o===t&&-1!==n||(t=o,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}const g=h&&f.length>0&&f.some(e=>e.length!==i);function m(t){if(!g||-1===c)return;const n=p[c];if(null==n)return;const o=f[n].indexOf(c);let i="up"===t?n-1:n+1;r&&(i<0?i=f.length-1:i>=f.length&&(i=0));const a=new Set;for(;i>=0&&i<f.length&&!a.has(i);){a.add(i);const n=f[i];if(0!==n.length){for(let t=Math.min(o,n.length-1);t>=0;t-=1){const r=n[t];if(!Pd(e,r,s))return r}i="up"===t?i-1:i+1,r&&(i<0?i=f.length-1:i>=f.length&&(i=0))}else i="up"===t?i-1:i+1}}if(t.key===Au){const n=m("up");if(void 0!==n)u&&Uu(t),d=n;else{if(u&&Uu(t),-1===c)d=l;else if(d=Ed(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),r&&(c-i<a||d<0)){const e=c%i,t=l%i,n=l-(t-e);d=t===e?l:t>e?n:n-i}xd(e,d)&&(d=c)}}if(t.key===Fu){const n=m("down");void 0!==n?(u&&Uu(t),d=n):(u&&Uu(t),-1===c?d=a:(d=Ed(e,{startingIndex:c,amount:i,disabledIndices:s}),r&&c+i>l&&(d=Ed(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),xd(e,d)&&(d=c))}if("both"===n){const n=ed(c/i);t.key===(o?Mu:Tu)&&(u&&Uu(t),c%i!==i-1?(d=Ed(e,{startingIndex:c,disabledIndices:s}),r&&_d(d,i,n)&&(d=Ed(e,{startingIndex:c-c%i-1,disabledIndices:s}))):r&&(d=Ed(e,{startingIndex:c-c%i-1,disabledIndices:s})),_d(d,i,n)&&(d=c)),t.key===(o?Tu:Mu)&&(u&&Uu(t),c%i!==0?(d=Ed(e,{startingIndex:c,decrement:!0,disabledIndices:s}),r&&_d(d,i,n)&&(d=Ed(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):r&&(d=Ed(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),_d(d,i,n)&&(d=c));const a=ed(l/i)===n;xd(e,d)&&(d=r&&a?t.key===(o?Tu:Mu)?l:Ed(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:_,loopFocus:p,rtl:g,cols:S,disabledIndices:Id([...("function"!=typeof w?w:null)||a.current.map((e,t)=>Pd(a,t,w)?t:void 0),void 0],n),minIndex:r,maxIndex:i,prevIndex:Rd(N.current>s?o:N.current,t,n,S,e.key===Fu?"bl":e.key===(g?Mu:Tu)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(N.current=l,D(e)),"both"===_)return}if(Sh(e.key,_)){if(Uu(e),r&&!m&&Nu(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Ch(e.key,_,g)?o:s,void D(e);Ch(e.key,_,g)?p?t>=s?f&&t!==a.current.length?N.current=-1:(q.current=!1,N.current=o):N.current=Ed(a,{startingIndex:t,disabledIndices:w}):N.current=Math.min(s,Ed(a,{startingIndex:t,disabledIndices:w})):p?t<=o?f&&-1!==t?N.current=a.current.length:(q.current=!1,N.current=s):N.current=Ed(a,{startingIndex:t,decrement:!0,disabledIndices:w}):N.current=Math.max(o,Ed(a,{startingIndex:t,decrement:!0,disabledIndices:w})),xd(a,N.current)&&(N.current=-1),D(e)}}),ee=pe(()=>m&&r&&Q&&{"aria-activedescendant":`${I}-${l}`},[m,r,Q,I,l]),te=pe(()=>({"aria-orientation":"both"===_?void 0:_,...A?{}:ee,onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&r&&!m){const t=Lu(e.nativeEvent);if(t&&!zu(O.current,t))return;return Uu(e),n.setOpen(!1,Ff(Pf,e.nativeEvent)),void(Kc(i)&&i.focus())}Y(e)},onPointerMove(){L.current=!0}}),[ee,Y,O,_,A,n,r,m,i]),ne=pe(()=>{function e(e){"auto"===v&&Bu(e.nativeEvent)&&(F.current=!m)}function t(e){F.current=v,"auto"===v&&Gu(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(e){const t=n.select("open");L.current=!1;const r=e.key.startsWith("Arrow"),o=function(e,t,n){return xh(t,n?e===Mu:e===Tu,e===Fu)}(e.key,J(),g),i=Sh(e.key,_),s=(h?o:i)||"Enter"===e.key||""===e.key.trim();if(m&&t)return Y(e);if(t||b||!r){if(s){const t=Sh(e.key,J());z.current=h&&t?null:e.key}h?o&&(Uu(e),t?(N.current=Sd(a,W.current),D(e)):n.setOpen(!0,Ff(Of,e.nativeEvent,e.currentTarget))):i&&(null!=G.current&&(N.current=G.current),Uu(e),!t&&b?n.setOpen(!0,Ff(Of,e.nativeEvent,e.currentTarget)):Y(e),t&&D(e))}},onFocus(e){n.select("open")&&!m&&(N.current=-1,D(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[Y,W,v,a,h,D,n,b,_,J,g,G,m]),re=pe(()=>({...ee,...ne}),[ee,ne]);return pe(()=>u?{reference:re,floating:te,item:X,trigger:ne}:{},[u,re,te,ne,X])}const Rh=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ih(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),i=n.useState("domReferenceElement"),s=n.useState("floatingElement"),{enabled:a=!0,role:l="dialog"}=t,c=of(),u=i?.id||c,d=pe(()=>qu(s)?.id||o,[s,o]),f=Rh.get(l)??l,p=null!=uf(),h=pe(()=>"tooltip"===f||"label"===l?Mc:{"aria-haspopup":"alertdialog"===f?"dialog":f,"aria-expanded":"false",..."listbox"===f&&{role:"combobox"},..."menu"===f&&p&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[f,p,l]),g=pe(()=>"tooltip"===f||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:r?d:void 0}:{...h,"aria-expanded":r?"true":"false","aria-controls":r?d:void 0,..."menu"===f&&{id:u}},[f,d,r,u,l,h]),m=pe(()=>{const e={id:d,...f&&{role:f}};return"tooltip"===f||"label"===l?e:{...e,..."menu"===f&&{"aria-labelledby":u}}},[f,d,u,l]),v=he(({active:e,selected:t})=>{const n={role:"option",...e&&{id:`${d}-fui-option`}};switch(l){case"select":case"combobox":return{...n,"aria-selected":t}}return{}},[d,l]);return pe(()=>a?{reference:g,floating:m,item:v,trigger:h}:{},[a,g,m,h,v])}function Ph(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.context.dataRef,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=Oc,selectedIndex:p=null}=t,h=$c(),g=de(""),m=de(p??s??-1),v=de(null);Hl(()=>{r&&(h.clear(),v.current=null,g.current="")},[r,h]),Hl(()=>{r&&""===g.current&&(m.current=p??s??-1)},[r,p,s]);const y=Kl(e=>{e?o.current.typing||(o.current.typing=e,l?.(e)):o.current.typing&&(o.current.typing=e,l?.(e))}),b=Kl(e=>{function t(e,t,n){const r=u?u(t,n):t.find(e=>0===e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()));return r?e.indexOf(r):-1}const n=i.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?y(!1):" "===e.key&&Uu(e)),null==n||f.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Uu(e),y(!0)),n.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&g.current===e.key&&(g.current="",m.current=v.current),g.current+=e.key,h.start(d,()=>{g.current="",m.current=v.current,y(!1)});const o=m.current,s=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==s?(a?.(s),v.current=s):" "!==e.key&&(g.current="",y(!1))}),w=pe(()=>({onKeyDown:b}),[b]),_=pe(()=>({onKeyDown:b,onKeyUp(e){" "===e.key&&y(!1)}}),[b,y]);return pe(()=>c?{reference:w,floating:_}:{},[c,w,_])}function kh(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e<i;s=e++){const[i,a]=t[e]||[0,0],[l,c]=t[s]||[0,0];a>=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function Oh(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o=new Vc;let i=!1,s=null,a=null,l="undefined"!=typeof performance?performance.now():0;const c=({x:e,y:n,placement:c,elements:u,onClose:d,nodeId:f,tree:p})=>function(h){function g(){o.clear(),d()}if(o.clear(),!u.domReference||!u.floating||null==c||null==e||null==n)return;const{clientX:m,clientY:v}=h,y=[m,v],b=Lu(h),w="mouseleave"===h.type,_=zu(u.floating,b),x=zu(u.domReference,b),S=u.domReference.getBoundingClientRect(),C=u.floating.getBoundingClientRect(),E=c.split("-")[0],R=e>C.right-C.width/2,I=n>C.bottom-C.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,S),k=C.width>S.width,O=C.height>S.height,M=(k?S:C).left,T=(k?S:C).right,A=(O?S:C).top,F=(O?S:C).bottom;if(_&&(i=!0,!w))return;if(x&&(i=!1),x&&!w)return void(i=!0);if(w&&Zc(h.relatedTarget)&&zu(u.floating,h.relatedTarget))return;if(p&&Hu(p.nodesRef.current,f).some(({context:e})=>e?.open))return;if("top"===E&&n>=S.bottom-1||"bottom"===E&&n<=S.top+1||"left"===E&&e>=S.right-1||"right"===E&&e<=S.left+1)return g();let N=[];switch(E){case"top":N=[[M,S.top+1],[M,C.bottom-1],[T,C.bottom-1],[T,S.top+1]];break;case"bottom":N=[[M,C.top+1],[M,S.bottom-1],[T,S.bottom-1],[T,C.top+1]];break;case"left":N=[[C.right-1,F],[C.right-1,A],[S.left+1,A],[S.left+1,F]];break;case"right":N=[[S.right-1,F],[S.right-1,A],[C.left+1,A],[C.left+1,F]]}if(!kh([m,v],N)){if(i&&!P)return g();if(!w&&r){const e=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(h.clientX,h.clientY);if(null!==e&&e<.1)return g()}kh([m,v],function([e,n]){switch(E){case"top":return[[k?e+t/2:R?e+4*t:e-4*t,n+t+1],[k?e-t/2:R?e+4*t:e-4*t,n+t+1],[C.left,R||k?C.bottom-t:C.top],[C.right,R?k?C.bottom-t:C.top:C.bottom-t]];case"bottom":return[[k?e+t/2:R?e+4*t:e-4*t,n-t],[k?e-t/2:R?e+4*t:e-4*t,n-t],[C.left,R||k?C.top+t:C.bottom],[C.right,R?k?C.top+t:C.bottom:C.top+t]];case"left":{const r=[e+t+1,O?n+t/2:I?n+4*t:n-4*t],o=[e+t+1,O?n-t/2:I?n+4*t:n-4*t];return[[I||O?C.right-t:C.left,C.top],[I?O?C.right-t:C.left:C.right-t,C.bottom],r,o]}case"right":return[[e-t,O?n+t/2:I?n+4*t:n-4*t],[e-t,O?n-t/2:I?n+4*t:n-4*t],[I||O?C.left+t:C.right,C.top],[I?O?C.left+t:C.right:C.left+t,C.bottom]];default:return[]}}([e,n]))?!i&&r&&o.start(40,g):g()}};return c.__options={blockPointerEvents:n},c}const Mh=B(void 0),Th=B(void 0),Ah=B(void 0),Fh=B("");function Nh(){const e=ge(Mh);if(!e)throw new Error(nc(22));return e}function zh(){const e=ge(Th);if(!e)throw new Error(nc(23));return e}function Lh(){const e=ge(Ah);if(!e)throw new Error(nc(24));return e}function Dh(){return ge(Fh)}const Vh=(e,t)=>Object.is(e,t);function $h(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function jh(e,t,n){return!(!e||0===e.length)&&e.some(e=>void 0!==e&&$h(e,t,n))}function qh(e,t,n){return e&&0!==e.length?e.findIndex(e=>void 0!==e&&$h(e,t,n)):-1}function Hh(e,t,n){return e.filter(e=>!$h(e,t,n))}const Wh={id:fc(e=>e.id),query:fc(e=>e.query),items:fc(e=>e.items),selectedValue:fc(e=>e.selectedValue),open:fc(e=>e.open),mounted:fc(e=>e.mounted),forceMounted:fc(e=>e.forceMounted),inline:fc(e=>e.inline),activeIndex:fc(e=>e.activeIndex),selectedIndex:fc(e=>e.selectedIndex),isActive:fc((e,t)=>e.activeIndex===t),isSelected:fc((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>$h(e,t,n)):$h(r,t,n)}),transitionStatus:fc(e=>e.transitionStatus),popupProps:fc(e=>e.popupProps),inputProps:fc(e=>e.inputProps),triggerProps:fc(e=>e.triggerProps),getItemProps:fc(e=>e.getItemProps),positionerElement:fc(e=>e.positionerElement),listElement:fc(e=>e.listElement),triggerElement:fc(e=>e.triggerElement),inputElement:fc(e=>e.inputElement),popupSide:fc(e=>e.popupSide),openMethod:fc(e=>e.openMethod),inputInsidePopup:fc(e=>e.inputInsidePopup),selectionMode:fc(e=>e.selectionMode),listRef:fc(e=>e.listRef),labelsRef:fc(e=>e.labelsRef),popupRef:fc(e=>e.popupRef),emptyRef:fc(e=>e.emptyRef),inputRef:fc(e=>e.inputRef),keyboardActiveRef:fc(e=>e.keyboardActiveRef),chipsContainerRef:fc(e=>e.chipsContainerRef),clearRef:fc(e=>e.clearRef),valuesRef:fc(e=>e.valuesRef),allValuesRef:fc(e=>e.allValuesRef),name:fc(e=>e.name),disabled:fc(e=>e.disabled),readOnly:fc(e=>e.readOnly),required:fc(e=>e.required),grid:fc(e=>e.grid),isGrouped:fc(e=>e.isGrouped),virtualized:fc(e=>e.virtualized),onOpenChangeComplete:fc(e=>e.onOpenChangeComplete),openOnInputClick:fc(e=>e.openOnInputClick),itemToStringLabel:fc(e=>e.itemToStringLabel),isItemEqualToValue:fc(e=>e.isItemEqualToValue),modal:fc(e=>e.modal),autoHighlight:fc(e=>e.autoHighlight),submitOnItemClick:fc(e=>e.submitOnItemClick)};let Uh=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const Bh={valid:e=>null===e?null:e?{[Uh.valid]:""}:{[Uh.invalid]:""}},Gh=B({invalid:void 0,name:void 0,validityData:{state:{badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},errors:[],error:"",value:"",initialValue:null},setValidityData:kc,disabled:void 0,touched:!1,setTouched:kc,dirty:!1,setDirty:kc,filled:!1,setFilled:kc,focused:!1,setFocused:kc,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Mc)=>e,getInputValidationProps:(e=Mc)=>e,inputRef:{current:null},commit:async()=>{}}});function Zh(e=!0){const t=ge(Gh);if(t.setValidityData===kc&&!e)throw new Error(nc(28));return t}function Kh(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Qh=B({formRef:{current:{fields:new Map}},errors:{},clearErrors:kc,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Xh(){return ge(Qh)}function Jh(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=Xh(),{invalid:l,markedDirtyRef:c,validityData:u,setValidityData:d}=Zh(),f=Kl(e.getValue);Hl(()=>{if(!t)return;let e=n;void 0===e&&(e=f()),null===u.initialValue&&null!==e&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Hl(()=>{t&&r&&a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:Kh(u,l),validate(){let e=n;void 0===e&&(e=f()),c.current=!0,Ct(()=>s(e))}})},[s,i,t,a,f,r,l,c,o,u,n]),Hl(()=>{const e=a.current.fields;return()=>{r&&e.delete(r)}},[a,r])}function Yh(e){return of(e,"base-ui")}const eg=B({controlId:void 0,setControlId:kc,labelId:void 0,setLabelId:kc,messageIds:[],setMessageIds:kc,getDescriptionProps:e=>e});function tg(){return ge(eg)}function ng(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,setControlId:i}=tg(),s=Yh(t);return Hl(()=>{if((n||t)&&i!==kc){if(n){const e=r?.current;Zc(e)&&null!=e.closest("label")?i(t??null):i(o??s)}else t&&i(t);return()=>{t&&i(void 0)}}},[t,r,o,i,n,s]),o??s}function rg(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function og(e){return null!=e&&e.length>0&&"object"==typeof e[0]&&null!=e[0]&&"items"in e[0]}function ig(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return rg(e)}function sg(e,t){return t&&null!=e?t(e)??"":rg(e&&"object"==typeof e&&"value"in e&&"label"in e?e.value:e)}const ag=new Map;function lg(e){return Array.isArray(e)?e.map(e=>lg(e)).join(","):null==e?"":String(e)}const cg=function(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${lg(e.locale)}|${JSON.stringify(t)}`,r=ag.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(e,t,n){if(!t)return!0;const r=ig(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(0===o.compare(r.slice(e,e+t.length),t))return!0;return!1},startsWith(e,t,n){if(!t)return!0;const r=ig(e,n);return 0===o.compare(r.slice(0,t.length),t)},endsWith(e,t,n){if(!t)return!0;const r=ig(e,n),i=t.length;return r.length>=i&&0===o.compare(r.slice(r.length-i),t)}};return ag.set(n,i),i};function ug(e){const[t,n]=ae(null),r=Kl((t,r)=>{e||n(r)}),o=he(()=>{n(null)},[]),{onClick:i,onPointerDown:s}=function(e){const t=de(""),n=he(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:he(n=>{0!==n.detail?("pointerType"in n&&e(n,n.pointerType),e(n,t.current),t.current=""):e(n,"keyboard")},[e]),onPointerDown:n}}(r);return pe(()=>({openMethod:t,reset:o,triggerProps:{onClick:i,onPointerDown:s}}),[t,o,i,s])}function dg(e,t){const n=de(e),r=Kl(t);Hl(()=>{n.current!==e&&r(n.current)},[e,r]),Hl(()=>{n.current=e},[e])}const fg=Symbol("none"),pg={value:fg,index:-1};function hg(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:c,name:u,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:h,grid:g=!1,items:m,filteredItems:v,filter:y,openOnInputClick:b=!0,autoHighlight:w=!1,keepHighlight:_=!1,highlightItemOnHover:S=!0,itemToStringLabel:C,itemToStringValue:E,isItemEqualToValue:R=Vh,virtualized:I=!1,inline:P=!1,fillInputOnItemPress:k=!0,modal:O=!1,limit:M=-1,autoComplete:T="list",locale:A,submitOnItemClick:F=!1}=e,{clearErrors:N}=Xh(),{setDirty:z,validityData:L,shouldValidateOnChange:D,setFilled:V,name:$,disabled:j,validation:q}=Zh(),H=ng({id:t}),W=cg({locale:A}),[U,B]=ae(!1),[G,Z]=ae(null),K=de([]),Q=de([]),X=de(null),J=de(null),Y=de(null),ee=de(!0),te=de(!1),ne=de(null),re=de(null),oe=de(null),ie=de(pg),se=de(null),le=de([]),ue=de([]),he=j||d,ge=$??u,me="multiple"===l,ve="single"===l,ye=void 0!==a||void 0!==s,be=void 0!==m,we=void 0!==v;let _e;_e="always"===w?"always":!!w&&"input-change";const[xe,Se]=ql({controlled:o,default:me?r??Oc:r,name:"Combobox",state:"selectedValue"}),Ce=pe(()=>null===y?()=>!0:void 0!==y?y:ve&&!U?function(e,t,n){return(r,o)=>{if(null==r)return!1;if(!o)return!0;const i=ig(r,t),s=null!=n?ig(n,t):"";return!(!s||!e.contains(s,o)||s.length!==o.length)||e.contains(i,o)}}(W,C,xe):function(e,t){return(n,r)=>{if(null==n)return!1;const o=ig(n,t);return e.contains(o,r)}}(W,C),[y,ve,xe,U,W,C]),Ee=Bl(()=>ye?s??"":ve?ig(xe,C):"").current,[Re,Ie]=ql({controlled:a,default:Ee,name:"Combobox",state:"inputValue"}),[Pe,ke]=ql({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),Oe=og(m),Me=G??(""===Re?"":String(Re).trim()),Te=ve?ig(xe,C):"",Ae=ve&&!U&&""!==Me&&""!==Te&&Te.length===Me.length&&W.contains(Te,Me),Fe=Ae?"":Me,Ne=be&&we&&Ae,ze=pe(()=>m?Oe?m.flatMap(e=>e.items):m:Oc,[m,Oe]),Le=pe(()=>{if(v&&!Ne)return v;if(!m)return Oc;if(Oe){const e=m,t=[];let n=0;for(const r of e){if(M>-1&&n>=M)break;const e=""===Fe?r.items:r.items.filter(e=>Ce(e,Fe,C));if(0===e.length)continue;const o=M>-1?M-n:1/0,i=e.slice(0,o);if(i.length>0){const e={...r,items:i};t.push(e),n+=i.length}}return t}if(""===Fe)return M>-1?ze.slice(0,M):ze;const e=[];for(const t of ze){if(M>-1&&e.length>=M)break;Ce(t,Fe,C)&&e.push(t)}return e},[v,Ne,m,Oe,Fe,M,Ce,C,ze]),De=pe(()=>Oe?Le.flatMap(e=>e.items):Le,[Le,Oe]),Ve=Bl(()=>new Pc({id:H,selectedValue:xe,open:Pe,filter:Ce,query:Me,items:m,selectionMode:l,listRef:K,labelsRef:Q,popupRef:X,emptyRef:Y,inputRef:J,keyboardActiveRef:ee,chipsContainerRef:ne,clearRef:re,valuesRef:le,allValuesRef:ue,selectionEventRef:oe,name:ge,disabled:he,readOnly:f,required:p,grid:g,isGrouped:Oe,virtualized:I,openOnInputClick:b,itemToStringLabel:C,isItemEqualToValue:R,modal:O,autoHighlight:_e,submitOnItemClick:F,hasInputValue:ye,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:P,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||kc,setOpen:kc,setInputValue:kc,setSelectedValue:kc,setIndices:kc,onItemHighlighted:kc,handleSelection:kc,getItemProps:()=>Mc,forceMount:kc,requestSubmit:kc})).current,$e="none"===l?Re:xe,je=pe(()=>"none"===l?$e:Array.isArray(xe)?xe.map(e=>sg(e,E)):sg(xe,E),[$e,E,l,xe]),qe=Kl(c),He=Kl(n),We=Ic(Ve,Wh.activeIndex),Ue=Ic(Ve,Wh.selectedIndex),Be=Ic(Ve,Wh.positionerElement),Ge=Ic(Ve,Wh.listElement),Ze=Ic(Ve,Wh.triggerElement),Ke=Ic(Ve,Wh.inputElement),Qe=Ic(Ve,Wh.inline),Xe=Ic(Ve,Wh.inputInsidePopup),Je=jc(Ze),{mounted:Ye,setMounted:et,transitionStatus:tt}=rh(Pe),{openMethod:nt,triggerProps:rt,reset:ot}=ug(Pe);Jh({id:H,name:ge,commit:q.commit,value:$e,controlRef:Xe?Je:J,getValue:()=>je});const it=Kl(()=>{m?Q.current=De.map(e=>ig(e,C)):Ve.set("forceMounted",!0)}),st=de(xe);Hl(()=>{xe!==st.current&&it()},[it,xe]);const at=Kl(e=>{Ve.update(e);const t=e.type||"none";if(void 0!==e.activeIndex)if(null===e.activeIndex)ie.current!==pg&&(ie.current=pg,qe(void 0,Nf(t,void 0,{index:-1})));else{const n=le.current[e.activeIndex];ie.current={value:n,index:e.activeIndex},qe(n,Nf(t,void 0,{index:e.activeIndex}))}}),lt=Kl((t,n)=>{if(te.current=n.reason===If,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===Rf){const e=""!==t.trim();e&&B(!0),se.current={hasQuery:e},e&&_e&&null==Ve.state.activeIndex&&Ve.set("activeIndex",0)}Ie(t)}}),ct=Kl((t,n)=>{Pe!==t&&("escape-key"===n.reason&&be&&0===De.length&&!Ve.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),n.isCanceled||(!t&&U&&(ve?(Z(Me),""===Me&&B(!1)):me&&(Qe||Xe?at({activeIndex:null}):Z(Me),lt("",Ff(If,n.event)))),ke(t)))}),ut=Kl((e,t)=>{i?.(e,t),t.isCanceled||(Se(e),("none"===l&&X.current&&k||ve&&!Ve.state.inputInsidePopup)&&lt(ig(e,C),Ff(t.reason,t.event)),ve&&null!=e&&t.reason!==Rf&&U&&Z(Me))}),dt=Kl((e,t)=>{let n=t;if(void 0===n){if(null===We)return;n=le.current[We]}const r=Lu(e),o=oe.current??e;oe.current=null;const i=Ff(Cf,o),s=r?.closest("a")?.getAttribute("href");if(s)s.startsWith("#")&&ct(!1,i);else if(me){const e=Array.isArray(xe)?xe:[],t=jh(e,n,Ve.state.isItemEqualToValue)?Hh(e,n,Ve.state.isItemEqualToValue):[...e,n];if(ut(t,i),!J.current||""===J.current.value.trim())return;Ve.state.inputInsidePopup?lt("",Ff(If,i.event)):ct(!1,i)}else ut(n,i),ct(!1,i)}),ft=Kl(()=>{if(!Ve.state.submitOnItemClick)return;const e=Ve.state.inputElement?.form;e&&"function"==typeof e.requestSubmit&&e.requestSubmit()}),pt=Kl(()=>{if(et(!1),He?.(!1),B(!1),ot(),Z(null),at("none"===l?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),me&&J.current&&""!==J.current.value&&!te.current&&lt("",Ff(If)),ve)if(Ve.state.inputInsidePopup)J.current&&""!==J.current.value&&lt("",Ff(If));else{const e=ig(xe,C);J.current&&J.current.value!==e&&lt(e,Ff(""===e?If:bf))}}),ht=pe(()=>Qe&&Be?{current:Be.closest('[role="dialog"]')}:X,[Qe,Be]);oh({enabled:!e.actionsRef,open:Pe,ref:ht,onComplete(){Pe||pt()}}),fe(e.actionsRef,()=>({unmount:pt}),[pt]),Hl(function(){if(Pe||"none"===l)return;const e=m?ze:ue.current;if(me){const t=Array.isArray(xe)?xe:[],n=qh(e,t[t.length-1],R);at({selectedIndex:-1===n?null:n})}else{const t=qh(e,xe,R);at({selectedIndex:-1===t?null:t})}},[Pe,xe,m,l,ze,me,R,at]),Hl(()=>{m&&(le.current=De,K.current.length=De.length)},[m,De]),Hl(()=>{const e=se.current;if(e&&(e.hasQuery?_e&&Ve.set("activeIndex",0):"always"===_e&&Ve.set("activeIndex",0),se.current=null),!Pe&&!Qe)return;const t=be||we?De:le.current,n=Ve.state.activeIndex;if(null==n)return"always"===_e&&t.length>0?void Ve.set("activeIndex",0):void(ie.current!==pg&&(ie.current=pg,Ve.state.onItemHighlighted(void 0,Nf(bf,void 0,{index:-1}))));if(n>=t.length)return ie.current!==pg&&(ie.current=pg,Ve.state.onItemHighlighted(void 0,Nf(bf,void 0,{index:-1}))),void Ve.set("activeIndex",null);const r=t[n],o=ie.current.value,i=o!==fg&&Ve.state.isItemEqualToValue(r,o);ie.current.index===n&&i||(ie.current={value:r,index:n},Ve.state.onItemHighlighted(r,Nf(bf,void 0,{index:n})))},[We,_e,we,be,De,Qe,Pe,Ve]),Hl(()=>{if(!m||"none"===l)return;const e=ze;if(me){const t=Array.isArray(xe)?xe:Oc,n=t.filter(t=>jh(e,t,Ve.state.isItemEqualToValue));return void(n.length!==t.length&&Se(n))}if(null==xe||jh(e,xe,Ve.state.isItemEqualToValue))return;let t=null;if(null!=r&&jh(e,r,Ve.state.isItemEqualToValue)&&(t=r),Se(t),!Ve.state.inputInsidePopup){const e=ig(t,C);J.current&&J.current.value!==e&&lt(e,Ff(bf))}},[m,ze,me,l,xe,r,Se,C,Ve,lt]),Hl(()=>{V("none"!==l?me?Array.isArray(xe)&&xe.length>0:null!=xe:""!==String(Re))},[V,l,Re,xe,me]),ce(()=>{be&&_e&&0===De.length&&at({activeIndex:null})},[be,_e,De.length,at]),dg(Me,()=>{Pe&&""!==Me&&Me!==String(Ee)&&B(!0)}),dg(xe,()=>{if("none"!==l&&(N(ge),z(xe!==L.initialValue),D()?q.commit(xe):q.commit(xe,!0),!me||null===Ve.state.selectedIndex||Array.isArray(xe)&&0!==xe.length||at({activeIndex:null,selectedIndex:null}),ve&&!ye&&!Xe)){const e=ig(xe,C);Re!==e&&lt(e,Ff(bf))}}),dg(Re,()=>{"none"===l&&(N(ge),z(Re!==L.initialValue),D()?q.commit(Re):q.commit(Re,!0))}),dg(m,()=>{if(!ve||ye||Xe||U)return;const e=ig(xe,C);Re!==e&&lt(e,Ff(bf))});const gt=uh({open:!!Qe||Pe,onOpenChange:ct,elements:{reference:Xe?Ze:Ke,floating:Be}});let mt,vt;Qe||(mt=g?"grid":"listbox",vt=Pe?"true":"false");const yt=pe(()=>{const e="INPUT"===Ke?.tagName,t=e?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return(e||Pe)&&(t.role="combobox",t["aria-expanded"]=vt,t["aria-haspopup"]=mt,t["aria-controls"]=Pe?Ge?.id:void 0,t["aria-autocomplete"]=T),{reference:t,floating:{role:"presentation"}}},[Ke,Pe,vt,mt,Ge?.id,T]),bt=mp(gt,{enabled:!f&&!he&&b,event:"mousedown-only",toggle:!1,touchOpenDelay:Xe?0:50}),wt=eh(gt,{enabled:!f&&!he&&!Qe,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!Qe||void 0,outsidePress(e){const t=Lu(e);return!zu(Ze,t)&&!zu(re.current,t)&&!zu(ne.current,t)}}),_t=Eh(gt,{enabled:!f&&!he,id:H,listRef:K,activeIndex:We,selectedIndex:Ue,virtual:!0,loopFocus:!0,allowEscape:!_e,focusItemOnOpen:!(U||"none"===l&&!_e)&&"auto",focusItemOnHover:S,resetOnPointerLeave:!_,cols:g?2:1,orientation:g?"horizontal":void 0,disabledIndices:Oc,onNavigate(e,t){(t||Pe)&&"ending"!==tt&&at(t?{activeIndex:e,type:ee.current?"keyboard":"pointer"}:{activeIndex:e})}}),{getReferenceProps:xt,getFloatingProps:St,getItemProps:Ct}=bh([yt,bt,wt,_t]);Wl(()=>{Ve.update({inline:P,popupProps:St(),inputProps:xt(),triggerProps:rt,getItemProps:Ct,setOpen:ct,setInputValue:lt,setSelectedValue:ut,setIndices:at,onItemHighlighted:qe,handleSelection:dt,forceMount:it,requestSubmit:ft})}),Hl(()=>{Ve.update({id:H,selectedValue:xe,open:Pe,mounted:Ye,transitionStatus:tt,items:m,inline:P,popupProps:St(),inputProps:xt(),triggerProps:rt,openMethod:nt,getItemProps:Ct,selectionMode:l,name:ge,disabled:he,readOnly:f,required:p,grid:g,isGrouped:Oe,virtualized:I,onOpenChangeComplete:He,openOnInputClick:b,itemToStringLabel:C,modal:O,autoHighlight:_e,isItemEqualToValue:R,submitOnItemClick:F,hasInputValue:ye,requestSubmit:ft})},[Ve,H,xe,Pe,Ye,tt,m,St,xt,Ct,nt,rt,l,ge,he,f,p,q,g,Oe,I,He,b,C,O,R,F,ye,P,ft,_e]);const Et=Jl(h,q.inputRef),Rt=pe(()=>({query:Me,filteredItems:Le,flatFilteredItems:De}),[Me,Le,De]),It=pe(()=>Array.isArray($e)?"":sg($e,E),[$e,E]),Pt=me&&Array.isArray(xe)&&xe.length>0,kt=pe(()=>me&&Array.isArray(xe)&&ge?xe.map(e=>{const t=sg(e,E);return Cr.jsx("input",{type:"hidden",name:ge,value:t},t)}):null,[me,xe,ge,E]),Ot=Cr.jsxs(x,{children:[e.children,Cr.jsx("input",{...q.getInputValidationProps({onFocus(){Xe?Ze?.focus():(J.current||Ze)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;const t=e.target.value,n=Ff(Rf,e.nativeEvent);function r(){if(me)return;if("none"===l)return z(t!==L.initialValue),lt(t,n),void(D()&&q.commit(t));const e=le.current.find(e=>sg(e,E).toLowerCase()===t.toLowerCase());null!=e&&(z(e!==L.initialValue),ut?.(e,n),D()&&q.commit(e))}m?r():(it(),queueMicrotask(r))}}),id:H,name:me||"none"===l?void 0:ge,disabled:he,required:p&&!Pt,readOnly:f,value:It,ref:Et,style:tc,tabIndex:-1,"aria-hidden":!0}),kt]});return Cr.jsx(Mh.Provider,{value:Ve,children:Cr.jsx(Th.Provider,{value:gt,children:Cr.jsx(Ah.Provider,{value:Rt,children:Cr.jsx(Fh.Provider,{value:Re,children:Ot})})})})}function gg(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,...i}=e;return Cr.jsx(hg,{...i,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o})}let mg=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const vg={[mg.startingStyle]:""},yg={[mg.endingStyle]:""},bg={transitionStatus:e=>"starting"===e?vg:"ending"===e?yg:null};let wg=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=mg.startingStyle]="startingStyle",e[e.endingStyle=mg.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),_g=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const xg={[_g.popupOpen]:""},Sg={[_g.popupOpen]:"",[_g.pressed]:""},Cg={[wg.open]:""},Eg={[wg.closed]:""},Rg={[wg.anchorHidden]:""},Ig={open:e=>e?xg:null},Pg={open:e=>e?Sg:null},kg={open:e=>e?Cg:Eg,anchorHidden:e=>e?Rg:null},Og=B(void 0),Mg=B(void 0);function Tg(e){const t=ge(Mg);if(void 0===t&&!e)throw new Error(nc(21));return t}const Ag=B(void 0);function Fg(){const e=ge(Ag);return e?.direction??"ltr"}const Ng={...Pg,...Bh,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},zg=Le(function(e,t){const{render:n,className:r,disabled:o=!1,id:i,...s}=e,{state:a,disabled:l,setTouched:c,setFocused:u,validationMode:d,validation:f}=Zh(),{labelId:p}=tg(),h=ge(Og),g=Tg(!0),m=Boolean(g),v=Nh(),{filteredItems:y}=Lh(),b=Dh(),w=Yh(i),_=Fg(),x=Ic(v,Wh.disabled),S=Ic(v,Wh.readOnly),C=Ic(v,Wh.name),E=Ic(v,Wh.selectionMode),R=Ic(v,Wh.autoHighlight),I=Ic(v,Wh.inputProps),P=Ic(v,Wh.triggerProps),k=Ic(v,Wh.open),O=Ic(v,Wh.mounted),M=Ic(v,Wh.selectedValue),T=Ic(v,Wh.popupSide),A=Ic(v,Wh.positionerElement),F=Boolean(R),N=O&&A?T:null,z=l||x||o,L=0===y.length,[D,V]=ae(null),$=de(!1),j=Kl(e=>{const t=m||v.state.inline;t&&!v.state.hasInputValue&&v.state.setInputValue("",Ff(bf)),v.update({inputElement:e,inputInsidePopup:t})});return ip("input",e,{state:pe(()=>({...a,open:k,disabled:z,readOnly:S,popupSide:N,listEmpty:L}),[a,k,z,S,N,L]),ref:[t,v.state.inputRef,j],props:[I,P,{type:"text",value:e.value??D??b,"aria-readonly":S||void 0,"aria-labelledby":p,disabled:z,readOnly:S,..."none"===E&&C&&{name:C},id:w,onFocus(){u(!0)},onBlur(){if(c(!0),u(!1),"onBlur"===d){const e="none"===E?b:M;f.commit(e)}},onCompositionStart(e){Cu||($.current=!0,V(e.currentTarget.value))},onCompositionEnd(e){$.current=!1;const t=e.currentTarget.value;V(null),v.state.setInputValue(t,Ff(Rf,e.nativeEvent))},onChange(e){if($.current){const t=e.currentTarget.value;V(t),""!==t||v.state.openOnInputClick||v.state.inputInsidePopup||v.state.setOpen(!1,Ff(If,e.nativeEvent));const n=t.trim(),r=F&&""!==n;return S||z||""!==n&&(v.state.setOpen(!0,Ff(Rf,e.nativeEvent)),F||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),void(k&&null!==v.state.activeIndex&&!r&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}))}v.state.setInputValue(e.currentTarget.value,Ff(Rf,e.nativeEvent));const t=""===e.currentTarget.value,n=Ff(If,e.nativeEvent);t&&!v.state.inputInsidePopup&&("single"===E&&v.state.setSelectedValue(null,n),v.state.openOnInputClick||v.state.setOpen(!1,n));const r=e.currentTarget.value.trim();S||z||""!==r&&(v.state.setOpen(!0,Ff(Rf,e.nativeEvent)),F||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),k&&null!==v.state.activeIndex&&!F&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(e){if(z||S)return;if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;v.state.keyboardActiveRef.current=!0;const t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r="rtl"===_;if("Home"===e.key){Uu(e);const n=xu&&r?t.value.length:0;return t.setSelectionRange(n,n),void(t.scrollLeft=0)}if("End"===e.key){Uu(e);const o=xu&&r?0:t.value.length;return t.setSelectionRange(o,o),void(t.scrollLeft=r?-n:n)}if(!O&&"Escape"===e.key){const t="multiple"===E&&Array.isArray(M)?0===M.length:null===M,n=Ff(kf,e.nativeEvent),r="multiple"===E?[]:null;return v.state.setInputValue("",n),v.state.setSelectedValue(r,n),void(t||v.state.inline||n.isPropagationAllowed||e.stopPropagation())}if(h&&"Backspace"===e.key&&""===t.value&&void 0===h.highlightedChipIndex&&Array.isArray(M)&&M.length>0){const t=M.slice(0,-1);return v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),void v.state.setSelectedValue(t,Ff(bf,e.nativeEvent))}const o=function(e){if(!h)return;let t;const{highlightedChipIndex:n}=h;if(void 0!==n){if("ArrowLeft"===e.key)e.preventDefault(),t=n>0?n-1:void 0;else if("ArrowRight"===e.key)e.preventDefault(),t=n<M.length-1?n+1:void 0;else if("Backspace"===e.key||"Delete"===e.key){e.preventDefault();const r=n>=M.length-1?M.length-2:n;t=r>=0?r:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return t}return"ArrowLeft"===e.key&&0===(e.currentTarget.selectionStart??0)&&M.length>0?(e.preventDefault(),t=Math.max(M.length-1,0)):"Backspace"===e.key&&""===e.currentTarget.value&&M.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),e.preventDefault()),t}(e);if(h?.setHighlightedChipIndex(o),void 0!==o?h?.chipsRef.current[o]?.focus():v.state.inputRef.current?.focus(),229!==e.which&&"Enter"===e.key&&k){const t=v.state.activeIndex,n=e.nativeEvent;if(null===t)return void v.state.setOpen(!1,Ff(bf,n));Uu(e);const r=v.state.listRef.current[t];r&&(v.state.selectionEventRef.current=n,r.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},f?f.getValidationProps(s):s],stateAttributesMapping:Ng})}),Lg=B(void 0);function Dg(e=!1){const t=ge(Lg);if(void 0===t&&!e)throw new Error(nc(16));return t}function Vg(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,i=de(null),s=void 0!==Dg(!0),a=Kl(()=>{const e=i.current;return Boolean("A"===e?.tagName&&e?.href)}),{props:l}=function(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:i}=e,s=r&&!1!==t,a=r&&!1===t;return{props:pe(()=>{const e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return r||(e.tabIndex=o,!i&&n&&(e.tabIndex=t?o:-1)),(i&&(t||s)||!i&&n)&&(e["aria-disabled"]=n),!i||t&&!a||(e.disabled=n),e},[r,n,t,s,a,i,o])}}({focusableWhenDisabled:n,disabled:t,composite:s,tabIndex:r,isNativeButton:o}),c=he(()=>{const e=i.current;var n;Kc(n=e)&&"BUTTON"===n.tagName&&s&&t&&void 0===l.disabled&&e.disabled&&(e.disabled=!1)},[t,l.disabled,s]);return Hl(c,[c]),{getButtonProps:he((e={})=>{const{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:s,onPointerDown:c,...u}=e;return Xf({type:o?"button":void 0,onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(rp(e),s?.(e)),e.baseUIHandlerPrevented)return;const r=e.target===e.currentTarget&&!o&&!a()&&!t,i="Enter"===e.key,l=" "===e.key;r&&((l||i)&&e.preventDefault(),i&&n?.(e))},onKeyUp(e){t||(rp(e),i?.(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||o||t||" "!==e.key||n?.(e)},onPointerDown(e){t?e.preventDefault():c?.(e)}},o?void 0:{role:"button"},l,u)},[t,l,o,a]),buttonRef:Kl(e=>{i.current=e,c()})}}function $g(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if("none"===n.content&&"none"===r.content)return t;const o=parseFloat(n.width)||0,i=parseFloat(n.height)||0,s=parseFloat(r.width)||0,a=parseFloat(r.height)||0,l=Math.max(t.width,o,s),c=Math.max(t.height,i,a),u=l-t.width,d=c-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}const jg={...Pg,...Bh},qg=Le(function(e,t){const{render:n,className:r,nativeButton:o=!0,disabled:i=!1,...s}=e,{state:a,disabled:l,setTouched:c,setFocused:u,validationMode:d,validation:f}=Zh(),{labelId:p}=tg(),h=Nh(),g=Ic(h,Wh.selectionMode),m=Ic(h,Wh.disabled),v=Ic(h,Wh.readOnly),y=Ic(h,Wh.listElement),b=Ic(h,Wh.triggerProps),w=Ic(h,Wh.triggerElement),_=Ic(h,Wh.inputInsidePopup),x=Ic(h,Wh.open),S=Ic(h,Wh.selectedValue),C=Ic(h,Wh.activeIndex),E=Ic(h,Wh.selectedIndex),R=zh(),I=Dh(),P=$c(),k=l||m||i,O=de("");function M(e){O.current=e.pointerType}const T=R.select("domReferenceElement");ce(()=>{_&&w&&w!==T&&R.set("domReferenceElement",w)},[w,T,R,_]);const{reference:A}=Ph(R,{enabled:!x&&!v&&!m&&"single"===g,listRef:h.state.labelsRef,activeIndex:C,selectedIndex:E,onMatch(e){const t=h.state.valuesRef.current[e];void 0!==t&&h.state.setSelectedValue(t,Ff("none"))}}),{reference:F}=mp(R,{enabled:!v&&!m,event:"mousedown"}),{buttonRef:N,getButtonProps:z}=Vg({native:o,disabled:k}),L=pe(()=>({...a,open:x,disabled:k}),[a,x,k]);return ip("button",e,{ref:[t,N,Kl(e=>{h.set("triggerElement",e)})],state:L,props:[b,F,A,{tabIndex:_?0:-1,disabled:k,role:_?"combobox":void 0,"aria-expanded":x?"true":"false","aria-haspopup":_?"dialog":"listbox","aria-controls":x?y?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":p,onPointerDown:M,onPointerEnter:M,onFocus(){u(!0),k||v||P.start(0,h.state.forceMount)},onBlur(){if(c(!0),u(!1),"onBlur"===d){const e="none"===g?I:S;f.commit(e)}},onMouseDown(e){if(k||v)return;if(_||R.set("domReferenceElement",e.currentTarget),h.state.forceMount(),"touch"!==O.current&&(h.state.inputRef.current?.focus(),_||e.preventDefault()),x)return;const t=Df(e.currentTarget);_&&t.addEventListener("mouseup",function(e){if(!w)return;const t=Lu(e),n=h.state.positionerElement,r=h.state.listElement;if(zu(w,t)||zu(n,t)||zu(r,t)||t===w)return;const o=$g(w),i=e.clientX>=o.left-2&&e.clientX<=o.right+2,s=e.clientY>=o.top-2&&e.clientY<=o.bottom+2;i&&s||h.state.setOpen(!1,Ff("cancel-open",e))},{once:!0})},onKeyDown(e){k||v||"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(Uu(e),h.state.setOpen(!0,Ff(Of,e.nativeEvent)),h.state.inputRef.current?.focus())}},f?f.getValidationProps(s):s,z],stateAttributesMapping:jg})}),Hg=B(null);function Wg(e){const{children:t}=e,{filteredItems:n}=Lh(),r=ge(Hg),o=r?r.items:n;return o?Cr.jsx(x,{children:o.map(t)}):null}const Ug=B({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Bg(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,i=Kl(o),s=de(0),a=Bl(Zg).current,l=Bl(Gg).current,[c,u]=ae(0),d=de(c),f=Kl((e,t)=>{l.set(e,t??null),d.current+=1,u(d.current)}),p=Kl(e=>{l.delete(e),d.current+=1,u(d.current)}),h=pe(()=>{const e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(Kg).forEach((t,n)=>{const r=l.get(t)??{};e.set(t,{...r,index:n})}),e},[l,c]);Hl(()=>{if("function"!=typeof MutationObserver||0===h.size)return;const e=new MutationObserver(e=>{const t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(d.current+=1,u(d.current))});return h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),Hl(()=>{d.current===c&&(n.current.length!==h.size&&(n.current.length=h.size),r&&r.current.length!==h.size&&(r.current.length=h.size),s.current=h.size),i(h)},[i,h,n,r,c]),Hl(()=>()=>{n.current=[]},[n]),Hl(()=>()=>{r&&(r.current=[])},[r]);const g=Kl(e=>(a.add(e),()=>{a.delete(e)}));Hl(()=>{a.forEach(e=>e(h))},[a,h]);const m=pe(()=>({register:f,unregister:p,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:s}),[f,p,g,n,r,s]);return Cr.jsx(Ug.Provider,{value:m,children:t})}function Gg(){return new Map}function Zg(){return new Set}function Kg(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Qg=Le(function(e,t){var n;const{render:r,className:o,children:i,...s}=e,a=Nh(),l=zh(),c=Boolean(Tg(!0)),{filteredItems:u}=Lh(),d=Ic(a,Wh.items),f=Ic(a,Wh.labelsRef),p=Ic(a,Wh.listRef),h=Ic(a,Wh.selectionMode),g=Ic(a,Wh.grid),m=Ic(a,Wh.popupProps),v=Ic(a,Wh.disabled),y=Ic(a,Wh.readOnly),b=Ic(a,Wh.virtualized),w="multiple"===h,_=0===u.length,x=Kl(e=>{a.set("positionerElement",e)}),S=Kl(e=>{a.set("listElement",e)}),C=pe(()=>"function"==typeof i?n||(n=Cr.jsx(Wg,{children:i})):i,[i]),E=ip("div",e,{state:pe(()=>({empty:_}),[_]),ref:[t,S,c?null:x],props:[m,{children:C,tabIndex:-1,id:l.useState("floatingId"),role:g?"grid":"listbox","aria-multiselectable":w?"true":void 0,onKeyDown(e){if(!v&&!y&&"Enter"===e.key){const t=a.state.activeIndex;if(null==t)return;Uu(e);const n=e.nativeEvent,r=a.state.listRef.current[t];r&&(a.state.selectionEventRef.current=n,r.click(),a.state.selectionEventRef.current=null)}},onKeyDownCapture(){a.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){a.state.keyboardActiveRef.current=!1}},s]});return b?E:Cr.jsx(Bg,{elementsRef:p,labelsRef:d?void 0:f,children:E})}),Xg=B(void 0),Jg=Le(function(e,t){const{keepMounted:n=!1,...r}=e,o=Nh(),i=Ic(o,Wh.mounted),s=Ic(o,Wh.forceMounted);return i||n||s?Cr.jsx(Xg.Provider,{value:n,children:Cr.jsx(cp,{ref:t,...r})}):null});function Yg(e){return Ec(19)?e:e?"true":void 0}let em={},tm={},nm="";const rm=new class{lockCount=0;restore=null;timeoutLock=Vc.create();timeoutUnlock=Vc.create();acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(0===this.lockCount||null!==this.restore)return;const t=Df(e).documentElement,n=Uc(t).getComputedStyle(t).overflowY;if("hidden"===n||"clip"===n)return void(this.restore=kc);const r=_u||!function(e){if("undefined"==typeof document)return!1;const t=Df(e);return Uc(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=r?function(e){const t=Df(e),n=t.documentElement,r=t.body,o=Jc(n)?n:r,i=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=i}}(e):function(e){const t=Df(e),n=t.documentElement,r=t.body,o=Uc(n);let i=0,s=0;const a=Lc.create(),l="undefined"!=typeof CSS&&CSS.supports?.("scrollbar-gutter","stable");if(wu&&1!==(o.visualViewport?.scale??1))return()=>{};function c(){const e=o.getComputedStyle(n),t=o.getComputedStyle(r),a=(e.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,s=n.scrollLeft,em={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},nm=n.style.scrollBehavior,tm={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const c=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d="scroll"===e.overflowY||"scroll"===t.overflowY,f="scroll"===e.overflowX||"scroll"===t.overflowX,p=Math.max(0,o.innerWidth-n.clientWidth),h=Math.max(0,o.innerHeight-n.clientHeight),g=parseFloat(t.marginTop)+parseFloat(t.marginBottom),m=parseFloat(t.marginLeft)+parseFloat(t.marginRight),v=Jc(n)?n:r;if(l)return n.style.scrollbarGutter=a,v.style.overflowY="hidden",void(v.style.overflowX="hidden");Object.assign(n.style,{scrollbarGutter:a,overflowY:"hidden",overflowX:"hidden"}),(c||d)&&(n.style.overflowY="scroll"),(u||f)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:g||h?`calc(100dvh - ${g+h}px)`:"100dvh",width:m||p?`calc(100vw - ${m+p}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=s,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,em),Object.assign(r.style,tm),l||(n.scrollTop=i,n.scrollLeft=s,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=nm)}function d(){u(),a.request(c)}return c(),o.addEventListener("resize",d),()=>{a.cancel(),u(),"function"==typeof o.removeEventListener&&o.removeEventListener("resize",d)}}(e)}};function om(e=!0,t=null){Hl(()=>{if(e)return rm.acquire(t)},[e,t])}const im=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0,offsetParent:d="real"}=id(e,t)||{};if(null==c)return{};const f=bd(u),p={x:n,y:r},h=fd(o),g=cd(h),m=await s.getDimensions(c),v="y"===h,y=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",_=i.reference[g]+i.reference[h]-p[h]-i.floating[g],x=p[h]-i.reference[h],S="real"===d?await(s.getOffsetParent?.(c)):a.floating;let C=a.floating[w]||i.floating[g];C&&await(s.isElement?.(S))||(C=a.floating[w]||i.floating[g]);const E=_/2-x/2,R=C/2-m[g]/2-1,I=Math.min(f[y],R),P=Math.min(f[b],R),k=I,O=C-m[g]-P,M=C/2-m[g]/2+E,T=od(k,M,O),A=!l.arrow&&null!=ad(o)&&M!==T&&i.reference[g]/2-(M<k?I:P)-m[g]/2<0,F=A?M<k?M-k:M-O:0;return{[h]:p[h]+F,data:{[h]:T,centerOffset:M-T-F,...A&&{alignmentOffset:F}},reset:A}}}),sm={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=0===t&&0===n&&0===r&&0===o,s=await{...Wp(a),options:[a,l]}.fn(e);var a,l;return{data:{referenceHidden:s.data?.referenceHidden||i}}}},am={sideX:"left",sideY:"top"};function lm(e,t,n){const r="inline-start"===e||"inline-end"===e;return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function cm(e,t,n){const{rects:r,placement:o}=e;return{side:lm(t,sd(o),n),align:ad(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function um(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:c=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:h,collisionAvoidance:g,shiftCrossAxis:m=!1,nodeId:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:w}=e,[_,x]=ae(null);h||null===_||x(null);const S=g.side||"flip",C=g.align||"flip",E=g.fallbackAxisSide||"end",R="function"==typeof t?t:void 0,I=Kl(R),P=R?I:t,k=jc(t),O="rtl"===Fg(),M=_||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[r],T="center"===i?M:`${M}-${i}`;let A=l;const F="bottom"===r?1:0,N="top"===r?1:0,z="right"===r?1:0,L="left"===r?1:0;"number"==typeof A?A={top:A+F,right:A+L,bottom:A+N,left:A+z}:A&&(A={top:(A.top||0)+F,right:(A.right||0)+L,bottom:(A.bottom||0)+N,left:(A.left||0)+z});const D={boundary:"clipping-ancestors"===a?"clippingAncestors":a,padding:A},V=de(null),$=jc(o),j=jc(s),q=[(H=e=>{const t=cm(e,r,O),n="function"==typeof $.current?$.current(t):$.current,o="function"==typeof j.current?j.current(t):j.current;return{mainAxis:n,crossAxis:o,alignmentAxis:o}},W=["function"!=typeof o?o:0,"function"!=typeof s?s:0,O,r],{...$p(H),options:[H,W]})];var H,W;const U="none"===C&&"shift"!==S,B=!U&&(c||m||"shift"===S),G="none"===S?null:(e=>({...qp(e),options:[e,void 0]}))({...D,padding:{top:A.top+1,right:A.right+1,bottom:A.bottom+1,left:A.left+1},mainAxis:!m&&"flip"===S,crossAxis:"flip"===C&&"alignment",fallbackAxisSideDirection:E}),Z=U?null:((e,t)=>({...jp(e),options:[e,t]}))(e=>{const t=Df(e.elements.floating).documentElement;return{...D,rootBoundary:m?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:"none"!==C,crossAxis:B,limiter:c||m?void 0:Jp(e=>{if(!V.current)return{};const{width:t,height:n}=V.current.getBoundingClientRect(),r=dd(sd(e.placement));return{offset:("y"===r?t:n)/2+("y"===r?A.left+A.right:A.top+A.bottom)/2}})}},[D,c,m,A,C]);"shift"===S||"shift"===C||"center"===i?q.push(Z,G):q.push(G,Z),q.push((e=>({...Hp(e),options:[e,void 0]}))({...D,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),((e,t)=>({...im(e),options:[e,t]}))(()=>({element:V.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(e){const{elements:t,middlewareData:n,placement:i,rects:s,y:a}=e,l=sd(i),c=dd(l),u=V.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=d+(u?.clientWidth||0)/2,h=f+(u?.clientHeight||0)/2,g=Math.abs(n.shift?.y||0),m=s.reference.height/2,v="function"==typeof o?o(cm(e,r,O)):o,y=g>v,b={top:`${p}px calc(100% + ${v}px)`,bottom:`${p}px ${-v}px`,left:`calc(100% + ${v}px) ${h}px`,right:`${-v}px ${h}px`}[l],w=`${p}px ${s.reference.y+m-a}px`;return t.floating.style.setProperty("--transform-origin",B&&"y"===c&&y?w:b),{}}},sm,y),Hl(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,p]);const K=pe(()=>({elementResize:!d&&"undefined"!=typeof ResizeObserver,layoutShift:!d&&"undefined"!=typeof IntersectionObserver}),[d]),{refs:Q,elements:X,x:J,y:Y,middlewareData:ee,update:te,placement:ne,context:re,isPositioned:oe,floatingStyles:ie}=function(e={}){const{nodeId:t,externalTree:n}=e,r=uh(e),o=e.rootContext||r,i={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[s,a]=ae(null),l=de(null),c=df(n);Hl(()=>{i.domReference&&(l.current=i.domReference)},[i.domReference]);const u=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=ae({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=ae(r);Zp(f,r)||p(r);const[h,g]=ae(null),[m,v]=ae(null),y=he(e=>{e!==x.current&&(x.current=e,g(e))},[]),b=he(e=>{e!==S.current&&(S.current=e,v(e))},[]),w=i||h,_=s||m,x=de(null),S=de(null),C=de(u),E=null!=l,R=Xp(l),I=Xp(o),P=Xp(c),k=he(()=>{if(!x.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};I.current&&(e.platform=I.current),Bp(x.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};O.current&&!Zp(C.current,t)&&(C.current=t,Ct(()=>{d(t)}))})},[f,t,n,I,P]);Gp(()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const O=de(!1);Gp(()=>(O.current=!0,()=>{O.current=!1}),[]),Gp(()=>{if(w&&(x.current=w),_&&(S.current=_),w&&_){if(R.current)return R.current(w,_,k);k()}},[w,_,k,R,E]);const M=pe(()=>({reference:x,floating:S,setReference:y,setFloating:b}),[y,b]),T=pe(()=>({reference:w,floating:_}),[w,_]),A=pe(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Qp(T.floating,u.x),r=Qp(T.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...Kp(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,T.floating,u.x,u.y]);return pe(()=>({...u,update:k,refs:M,elements:T,floatingStyles:A}),[u,k,M,T,A])}({...e,elements:{...i,...s&&{reference:s}}}),d=he(e=>{const t=Zc(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;a(t),u.refs.setReference(t)},[u.refs]),[f,p]=ae(null),[h,g]=ae(null);o.useSyncedValue("referenceElement",f),o.useSyncedValue("domReferenceElement",Zc(f)?f:null),o.useSyncedValue("floatingElement",h);const m=he(e=>{(Zc(e)||null===e)&&(l.current=e,p(e)),(Zc(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!Zc(e))&&u.refs.setReference(e)},[u.refs,p]),v=he(e=>{g(e),u.refs.setFloating(e)},[u.refs]),y=pe(()=>({...u.refs,setReference:m,setFloating:v,setPositionReference:d,domReference:l}),[u.refs,m,v,d]),b=pe(()=>({...u.elements,domReference:i.domReference}),[u.elements,i.domReference]),w=o.useState("open"),_=o.useState("floatingId"),x=pe(()=>({...u,dataRef:o.context.dataRef,open:w,onOpenChange:o.setOpen,events:o.context.events,floatingId:_,refs:y,elements:b,nodeId:t,rootStore:o}),[u,y,b,t,o,w,_]);return Hl(()=>{o.context.dataRef.current.floatingContext=x;const e=c?.nodesRef.current.find(e=>e.id===t);e&&(e.context=x)}),pe(()=>({...u,context:x,refs:y,elements:b,rootStore:o}),[u,y,b,x,o])}({rootContext:p,placement:T,middleware:q,strategy:n,whileElementsMounted:f?void 0:(...e)=>Vp(...e,K),nodeId:v,externalTree:w}),{sideX:se,sideY:le}=ee.adaptiveOrigin||am,ue=oe?n:"fixed",fe=pe(()=>y?{position:ue,[se]:J,[le]:Y}:{position:ue,...ie},[y,ue,se,J,le,Y,ie]),ge=de(null);Hl(()=>{if(!h)return;const e=k.current,t="function"==typeof e?e():e,n=(dm(t)?t.current:t)||null;n!==ge.current&&(Q.setPositionReference(n),ge.current=n)},[h,Q,P,k]),ce(()=>{if(!h)return;const e=k.current;"function"!=typeof e&&dm(e)&&e.current!==ge.current&&(Q.setPositionReference(e.current),ge.current=e.current)},[h,Q,P,k]),ce(()=>{if(f&&h&&X.domReference&&X.floating)return Vp(X.domReference,X.floating,te,K)},[f,h,X,te,K]);const me=sd(ne),ve=lm(r,me,O),ye=ad(ne)||"center",be=Boolean(ee.hide?.referenceHidden);Hl(()=>{b&&h&&oe&&x(me)},[b,h,oe,me]);const we=pe(()=>({position:"absolute",top:ee.arrow?.y,left:ee.arrow?.x}),[ee.arrow]),_e=0!==ee.arrow?.centerOffset;return pe(()=>({positionerStyles:fe,arrowStyles:we,arrowRef:V,arrowUncentered:_e,side:ve,align:ye,physicalSide:me,anchorHidden:be,refs:Q,context:re,isPositioned:oe,update:te}),[fe,we,V,_e,ve,ye,me,be,Q,re,oe,te])}function dm(e){return null!=e&&"current"in e}const fm=Le(function(e,t){const{cutout:n,...r}=e;let o;if(n){const e=n?.getBoundingClientRect();o=`polygon(\n      0% 0%,\n      100% 0%,\n      100% 100%,\n      0% 100%,\n      0% 0%,\n      ${e.left}px ${e.top}px,\n      ${e.left}px ${e.bottom}px,\n      ${e.right}px ${e.bottom}px,\n      ${e.right}px ${e.top}px,\n      ${e.left}px ${e.top}px\n)`}return Cr.jsx("div",{ref:t,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),pm=Le(function(e,t){const{render:n,className:r,anchor:o,positionMethod:i="absolute",side:s="bottom",align:a="center",sideOffset:l=0,alignOffset:c=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=mf,...m}=e,v=Nh(),{filteredItems:y}=Lh(),b=zh(),w=function(){const e=ge(Xg);if(void 0===e)throw new Error(nc(20));return e}(),_=Ic(v,Wh.modal),x=Ic(v,Wh.open),S=Ic(v,Wh.mounted),C=Ic(v,Wh.openMethod),E=Ic(v,Wh.triggerElement),R=Ic(v,Wh.inputElement),I=Ic(v,Wh.inputInsidePopup),P=0===y.length,k=um({anchor:o??(I?E:R),floatingRootContext:b,positionMethod:i,mounted:S,side:s,sideOffset:l,align:a,alignOffset:c,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:h,keepMounted:w,collisionAvoidance:g,lazyFlip:!0});om(x&&_&&"touch"!==C,E);const O=pe(()=>{const e={...k.positionerStyles};return x||(e.pointerEvents="none"),{role:"presentation",hidden:!S,style:e}},[x,S,k.positionerStyles]),M=pe(()=>({open:x,side:k.side,align:k.align,anchorHidden:k.anchorHidden,empty:P}),[x,k.side,k.align,k.anchorHidden,P]);Hl(()=>{v.set("popupSide",k.side)},[v,k.side]);const T=pe(()=>({side:k.side,align:k.align,arrowRef:k.arrowRef,arrowUncentered:k.arrowUncentered,arrowStyles:k.arrowStyles,anchorHidden:k.anchorHidden,isPositioned:k.isPositioned}),[k.side,k.align,k.arrowRef,k.arrowUncentered,k.arrowStyles,k.anchorHidden,k.isPositioned]),A=Kl(e=>{v.set("positionerElement",e)}),F=ip("div",e,{state:M,ref:[t,A],props:[O,m],stateAttributesMapping:kg});return Cr.jsxs(Mg.Provider,{value:T,children:[S&&_&&Cr.jsx(fm,{inert:Yg(!x),cutout:R??E}),F]})});function hm(e){return"starting"===e?gf:Mc}const gm={...kg,...bg},mm=Le(function(e,t){const{render:n,className:r,initialFocus:o,finalFocus:i,...s}=e,a=Nh(),l=Tg(),c=zh(),{filteredItems:u}=Lh(),d=Ic(a,Wh.mounted),f=Ic(a,Wh.open),p=Ic(a,Wh.openMethod),h=Ic(a,Wh.transitionStatus),g=Ic(a,Wh.inputInsidePopup),m=Ic(a,Wh.inputElement),v=0===u.length;oh({open:f,ref:a.state.popupRef,onComplete(){f&&a.state.onOpenChangeComplete(!0)}});const y=ip("div",e,{state:pe(()=>({open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:v}),[f,l.side,l.align,l.anchorHidden,h,v]),ref:[t,a.state.popupRef],props:[{role:g?"dialog":"presentation",tabIndex:-1,onFocus(e){const t=Lu(e.nativeEvent);"touch"===p||!zu(a.state.listElement,t)&&t!==e.currentTarget||a.state.inputRef.current?.focus()}},hm(h),s],stateAttributesMapping:gm}),b=void 0===o?!!g&&(e=>"touch"===e?a.state.popupRef.current:m):o;let w;return w=null!=i?i:!!g&&void 0,Cr.jsx(gp,{context:c,disabled:!d,modal:!g,openInteractionType:p,initialFocus:b,returnFocus:w,children:y})});let vm=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function ym(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:i}=e,{register:s,unregister:a,subscribeMapChange:l,elementsRef:c,labelsRef:u,nextIndexRef:d}=ge(Ug),f=de(-1),[p,h]=ae(i??(o===vm.GuessFromOrder?()=>{if(-1===f.current){const e=d.current;d.current+=1,f.current=e}return f.current}:-1)),g=de(null),m=he(e=>{if(g.current=e,-1!==p&&null!==e&&(c.current[p]=e,u)){const n=void 0!==t;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,c,u,t,r]);return Hl(()=>{if(null!=i)return;const e=g.current;return e?(s(e,n),()=>{a(e)}):void 0},[i,s,a,n]),Hl(()=>{if(null==i)return l(e=>{const t=g.current?e.get(g.current)?.index:null;null!=t&&h(t)})},[i,l,h]),pe(()=>({ref:m,index:p}),[p,m])}const bm=B(void 0);function wm(){const e=ge(bm);if(!e)throw new Error(nc(19));return e}const _m=B(!1),xm=Fe(Le(function(e,t){const{render:n,className:r,value:o=null,index:i,disabled:s=!1,nativeButton:a=!1,...l}=e,c=de(!1),u=de(null),d=ym({index:i,textRef:u,indexGuessBehavior:vm.GuessFromOrder}),f=Nh(),p=ge(_m),{flatFilteredItems:h}=Lh(),g=Ic(f,Wh.open),m=Ic(f,Wh.selectionMode),v=Ic(f,Wh.readOnly),y=Ic(f,Wh.virtualized),b=Ic(f,Wh.isItemEqualToValue),w="none"!==m,_=i??(y?qh(h,o,b):d.index),x=-1!==d.index,S=Ic(f,Wh.id),C=Ic(f,Wh.isActive,_),E=Ic(f,Wh.isSelected,o),R=Ic(f,Wh.items),I=Ic(f,Wh.getItemProps),P=de(null),k=null!=S&&x?`${S}-${_}`:void 0,O=E&&w;Hl(()=>{if(!x||!y&&null==i)return;const e=f.state.listRef.current;return e[_]=P.current,()=>{delete e[_]}},[x,y,_,i,f]),Hl(()=>{if(!x||R)return;const e=f.state.valuesRef.current;return e[_]=o,"none"!==m&&f.state.allValuesRef.current.push(o),()=>{delete e[_]}},[x,R,_,o,f,m]),Hl(()=>{if(!g)return void(c.current=!1);if(!x||R)return;const e=f.state.selectedValue;$h(Array.isArray(e)?e[e.length-1]:e,o,b)&&f.set("selectedIndex",_)},[x,R,g,f,_,o,b]);const M=pe(()=>({disabled:s,selected:O,highlighted:C}),[s,O,C]),T=I({active:C,selected:O});T.id=void 0,T.onFocus=void 0;const{getButtonProps:A,buttonRef:F}=Vg({disabled:s,focusableWhenDisabled:!0,native:a});function N(e){function t(){f.state.handleSelection(e,o)}f.state.submitOnItemClick?(Ct(t),f.state.requestSubmit()):t()}const z={id:k,role:p?"gridcell":"option","aria-disabled":s||void 0,"aria-selected":w?O:void 0,tabIndex:void 0,onPointerDownCapture(e){c.current=!0,e.preventDefault()},onClick(e){s||v||N(e.nativeEvent)},onMouseUp(e){const t=c.current;c.current=!1,s||v||0!==e.button||t||!C||N(e.nativeEvent)}},L=ip("div",e,{ref:[F,t,d.ref,P],state:M,props:[T,z,l,A]}),D=pe(()=>({selected:O,textRef:u}),[O,u]);return Cr.jsx(bm.Provider,{value:D,children:L})})),Sm=Le(function(e,t){const n=e.keepMounted??!1,{selected:r}=wm();return n||r?Cr.jsx(Cm,{...e,ref:t}):null}),Cm=Fe(Le((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=wm(),a=de(null),{transitionStatus:l,setMounted:c}=rh(s),u=ip("span",e,{ref:[t,a],state:pe(()=>({selected:s,transitionStatus:l}),[s,l]),props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:bg});return oh({open:s,ref:a,onComplete(){s||c(!1)}}),u})),Em=Le(function(e,t){const{render:n,className:r,children:o,...i}=e,{filteredItems:s}=Lh(),a=Nh(),l=0===s.length?o:null;return ip("div",e,{ref:[t,a.state.emptyRef],props:[{children:l,role:"status","aria-live":"polite","aria-atomic":!0},i]})}),Rm={...bg,...Ig},Im=Le(function(e,t){const{render:n,className:r,disabled:o=!1,nativeButton:i=!0,keepMounted:s=!1,...a}=e,{disabled:l}=Zh(),c=Nh(),u=Ic(c,Wh.selectionMode),d=Ic(c,Wh.disabled),f=Ic(c,Wh.readOnly),p=Ic(c,Wh.open),h=Ic(c,Wh.selectedValue),g=Dh();let m=!1;m="none"===u?""!==g:"single"===u?null!=h:Array.isArray(h)&&h.length>0;const v=l||d||o,{buttonRef:y,getButtonProps:b}=Vg({native:i,disabled:v}),{mounted:w,transitionStatus:_,setMounted:x}=rh(m),S=pe(()=>({disabled:v,open:p,transitionStatus:_}),[v,p,_]);oh({open:m,ref:c.state.clearRef,onComplete(){m||x(!1)}});const C=ip("button",e,{state:S,ref:[t,y,c.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":f||void 0,onMouseDown(e){e.preventDefault()},onClick(e){if(v||f)return;const t=c.state.keyboardActiveRef;c.state.setInputValue("",Ff(Ef,e.nativeEvent)),"none"!==u?(c.state.setSelectedValue(Array.isArray(h)?[]:null,Ff(Ef,e.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:t.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:t.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},a,b],stateAttributesMapping:Rm});return s||w?C:null}),Pm=Le(function(e,t){const{className:n,render:r,orientation:o="horizontal",...i}=e;return ip("div",e,{state:pe(()=>({orientation:o}),[o]),ref:t,props:[{role:"separator","aria-orientation":o},i]})});function km(e){return yr("svg",{fill:"currentcolor",width:"10",height:"10",viewBox:"0 0 10 10",...e,children:yr("path",{d:"M9.1603 1.12218C9.50684 1.34873 9.60427 1.81354 9.37792 2.16038L5.13603 8.66012C5.01614 8.8438 4.82192 8.96576 4.60451 8.99384C4.3871 9.02194 4.1683 8.95335 4.00574 8.80615L1.24664 6.30769C0.939709 6.02975 0.916013 5.55541 1.19372 5.24822C1.47142 4.94102 1.94536 4.91731 2.2523 5.19524L4.36085 7.10461L8.12299 1.33999C8.34934 0.993152 8.81376 0.895638 9.1603 1.12218Z"})})}function Om(e){return yr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[yr("path",{d:"M18 6L6 18"}),yr("path",{d:"M6 6l12 12"})]})}function Mm(e){return yr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:yr("path",{d:"M6 9l6 6 6-6"})})}function Tm(e){return yr("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:[yr("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),yr("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Am(e,t=0,n){const r=[];for(const o of e)r.push({...o,level:t,parentValue:n}),o.children&&o.children.length>0&&r.push(...Am(o.children,t+1,o.value));return r}function Fm(e,t){return e?.[t]?.items}function Nm({options:e,filterCounts:t,value:n,multiple:r=!1}){const o=pe(()=>Am(e),[e]),i=pe(()=>function(e,t){if(!t||0===t.length)return e;const n=function(e){const t=new Map;for(const n of e)t.set(n.value,n.count);return t}(t);return e.map(e=>({...e,count:n.get(e.value)??0}))}(o.map(e=>({value:e.value,label:e.label,level:e.level})),t),[o,t]),s=pe(()=>{if(!n)return new Set;const e=Array.isArray(n)?n:[n];return new Set(e)},[n]),a=pe(()=>r?function(e,t){return e.some(e=>void 0!==e.count)?e.filter(e=>!!t.has(e.value)||void 0===e.count||0!==e.count):e}(i,s):function(e){return e.some(e=>void 0!==e.count)?e.filter(e=>void 0===e.count||e.count>0):e}(i),[i,s,r]),l=pe(()=>0===s.size?[]:a.filter(e=>s.has(e.value)),[s,a]),c=pe(()=>r?function(e,t){return[...e.filter(e=>t.has(e.value)),...e.filter(e=>!t.has(e.value))]}(a,s):a,[a,r,s]),u=pe(()=>r?l.length:-1,[r,l.length]),d=r&&l.length>0&&c.length>l.length;return{items:a,sortedItems:c,selectedValues:s,selectedItems:l,firstUnselectedIndex:u,showSeparator:d}}function zm({className:e="barn2-multiselect-separator"}){return yr("div",{className:e,role:"separator","aria-hidden":"true"})}function Lm({item:e,className:t="barn2-select-item-text",prefixClassName:n="barn2-select-hierarchy-prefix",countClassName:r="barn2-select-item-count",showCounts:o=!0}){return yr("div",{className:t,children:[e.level>0&&yr("span",{className:n,"aria-hidden":"true",children:[(i=e.level,"—".repeat(i))," "]}),yr("span",{children:e.label}),o&&void 0!==e.count&&yr("span",{className:r,children:["(",e.count,")"]})]});var i}const Dm=({filter:e,value:t,onChange:n,disabled:r=!1,filterCounts:o,showCounts:i=!0})=>{const s=ve(),{displayMode:a,i18n:l}=Lr(),{items:c,selectedItems:u}=Nm({options:e.options,filterCounts:o,value:t,multiple:!1}),d=u.length>0?u[0]:null,f=c.length>9;return yr("div",{className:"select-filter-wrapper",style:r?{pointerEvents:"none"}:void 0,children:yr(gg,{items:c,value:d,onValueChange:he(e=>{n(null==e?null:e.value)},[n]),itemToStringLabel:he(e=>e?e.label||String(e.value):"",[]),children:[yr("div",{className:"select-label",children:yr("div",{className:"select-display-wrapper",children:[yr(qg,{className:"select-display-trigger","aria-label":l.selectFilter({filterName:e.name}),children:yr("span",{className:"select-display-text",children:d?d.label:e.name})}),yr("div",{className:"select-action-buttons",children:[d&&yr(Im,{className:"select-clear","aria-label":l.clearSelection,children:yr(Om,{className:"select-clear-icon"})}),yr(Mm,{className:"select-trigger-icon"})]})]})}),yr(Jg,{children:yr(pm,{className:"barn2-select-positioner",positionMethod:"fixed",sideOffset:4,children:yr(mm,{className:"barn2-select-popup","data-display-mode":a,children:[f&&yr("div",{className:"barn2-select-popup-input-wrapper",children:[yr(Tm,{className:"barn2-select-search-icon"}),yr(zg,{id:s,className:"barn2-select-popup-input",placeholder:l.searchFilterPlaceholder({filterName:e.name}),"aria-label":l.searchFilter({filterName:e.name})})]}),yr(Em,{className:"barn2-select-empty",children:l.noResultsFound}),yr(Qg,{className:"barn2-select-list",children:e=>yr(xm,{value:e,className:"barn2-select-item",children:[yr(Sm,{className:"barn2-select-item-indicator",children:yr(km,{"aria-hidden":"true",className:"barn2-select-item-indicator-icon"})}),yr(Lm,{item:e,showCounts:i})]},String(e.value))})]})})})]},d?String(d.value):"empty")})},Vm=({filter:e,value:t,onChange:n,disabled:r=!1,filterCounts:o,showCounts:i=!0})=>{const{displayMode:s,i18n:a}=Lr(),{sortedItems:l,selectedItems:c,firstUnselectedIndex:u,showSeparator:d}=Nm({options:e.options,filterCounts:o,value:t,multiple:!0}),f=l.length>9;return yr("div",{className:"select-filter-wrapper multiselect",style:r?{pointerEvents:"none"}:void 0,children:yr(gg,{multiple:!0,items:l,value:c,onValueChange:he(e=>{e&&0!==e.length?n(e.map(e=>e.value)):n(null)},[n]),itemToStringLabel:he(e=>e?e.label||String(e.value):"",[]),children:[yr("div",{className:"multiselect-display-wrapper",children:[yr(qg,{className:"multiselect-trigger","aria-label":`${e.name} filter`,children:yr("span",{className:"multiselect-display-text",children:[e.name,c.length>0&&yr("span",{className:"multiselect-count-badge",children:["(",c.length,")"]})]})}),yr("div",{className:"multiselect-actions",children:[c.length>0&&yr(Im,{className:"select-clear","aria-label":a.clearAllSelections,children:yr(Om,{className:"select-clear-icon"})}),yr(Mm,{className:"select-trigger-icon"})]})]}),yr(Jg,{children:yr(pm,{className:"barn2-select-positioner",positionMethod:"fixed",sideOffset:4,children:yr(mm,{className:"barn2-select-popup barn2-multiselect-popup","data-display-mode":s,children:[f&&yr("div",{className:"barn2-select-popup-input-wrapper",children:[yr(Tm,{className:"barn2-select-search-icon"}),yr(zg,{className:"barn2-select-popup-input",placeholder:a.searchFilterPlaceholder({filterName:e.name}),"aria-label":a.searchFilter({filterName:e.name})})]}),yr(Em,{className:"barn2-select-empty",children:a.noResultsFound}),yr(Qg,{className:"barn2-select-list barn2-multiselect-list",children:(e,t)=>yr(x,{children:[t.index===u&&d&&yr(zm,{}),yr(xm,{value:e,className:"barn2-select-item barn2-multiselect-item",children:[yr("div",{className:"barn2-filter-checkbox",children:yr(Sm,{children:yr(km,{})})}),yr(Lm,{item:e,showCounts:i})]},String(e.value))]})})]})})})]})})},$m=({onReset:e,hasActiveFilters:t,label:n,className:r})=>{const{i18n:o}=Lr(),i=n??o.resetFilters;return t?yr("button",{type:"button",onClick:e,className:Ar("filter-reset-btn",r),"aria-label":i,title:i,children:[yr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"filter-reset-icon","aria-hidden":"true",children:[yr("circle",{cx:"6",cy:"19",r:"3"}),yr("path",{d:"M9 19h8.5c.4 0 .9-.1 1.3-.2"}),yr("path",{d:"M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12"}),yr("path",{d:"m2 2 20 20"}),yr("path",{d:"M21 15.3a3.5 3.5 0 0 0-3.3-3.3"}),yr("path",{d:"M15 5h-4.3"}),yr("circle",{cx:"18",cy:"5",r:"3"})]}),yr("span",{children:o.reset})]}):null},jm=()=>yr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[yr("path",{d:"M18 6 6 18"}),yr("path",{d:"m6 6 12 12"})]}),qm=({filters:e,search:t,filterConfigs:n,onRemoveFilter:r,onClearSearch:o,className:i})=>{const{i18n:s}=Lr(),a=function(e){const t=new Map;for(const n of e){const e=Am(n.options);for(const n of e)t.set(n.value,n.label)}return t}(n),l=function(e,t,n,r){const o=[];t.query&&t.query.trim().length>0&&o.push({id:"search",label:r.activeSearch({query:t.query}),type:"search"});for(const t of e){const e=Array.isArray(t.value)?t.value:[t.value];for(const r of e){const e=n.get(r)||String(r);o.push({id:`${t.id}-${r}`,label:e,type:"filter",filterId:t.id,value:r})}}return o}(e,t,a,s);return 0===l.length?null:yr("div",{className:Ar("active-filters",i),children:l.map(e=>yr("span",{className:Ar("active-filter-badge","search"===e.type&&"active-filter-badge--search"),children:[yr("span",{className:"active-filter-badge-label",children:e.label}),yr("button",{type:"button",onClick:()=>(e=>{"search"===e.type?o():e.filterId&&void 0!==e.value&&r(e.filterId,e.value)})(e),className:"active-filter-badge-remove","aria-label":s.removeActiveItem({label:e.label}),children:yr(jm,{})})]},e.id))})},Hm=B(null),Wm=B(null);function Um(){const e=ge(Hm);if(null===e)throw new Error(nc(60));return e}function Bm(){const e=ge(Wm);if(null===e)throw new Error(nc(61));return e}const Gm={id:fc(e=>e.id),modal:fc(e=>e.modal),multiple:fc(e=>e.multiple),items:fc(e=>e.items),itemToStringLabel:fc(e=>e.itemToStringLabel),itemToStringValue:fc(e=>e.itemToStringValue),isItemEqualToValue:fc(e=>e.isItemEqualToValue),value:fc(e=>e.value),open:fc(e=>e.open),mounted:fc(e=>e.mounted),forceMount:fc(e=>e.forceMount),transitionStatus:fc(e=>e.transitionStatus),openMethod:fc(e=>e.openMethod),activeIndex:fc(e=>e.activeIndex),selectedIndex:fc(e=>e.selectedIndex),isActive:fc((e,t)=>e.activeIndex===t),isSelected:fc((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(e=>$h(e,n,r)):e.selectedIndex===t&&null!==e.selectedIndex||$h(o,n,r)}),isSelectedByFocus:fc((e,t)=>e.selectedIndex===t),popupProps:fc(e=>e.popupProps),triggerProps:fc(e=>e.triggerProps),triggerElement:fc(e=>e.triggerElement),positionerElement:fc(e=>e.positionerElement),listElement:fc(e=>e.listElement),scrollUpArrowVisible:fc(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:fc(e=>e.scrollDownArrowVisible),hasScrollArrows:fc(e=>e.hasScrollArrows),serializedValue:fc(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&0===n.length?"":sg(n,r)})};function Zm(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:i,defaultOpen:s=!1,onOpenChange:a,name:l,disabled:c=!1,readOnly:u=!1,required:d=!1,modal:f=!0,actionsRef:p,inputRef:h,onOpenChangeComplete:g,items:m,multiple:v=!1,itemToStringLabel:y,itemToStringValue:b,isItemEqualToValue:w=Vh,highlightItemOnHover:_=!0,children:x}=e,{clearErrors:S}=Xh(),{setDirty:C,shouldValidateOnChange:E,validityData:R,setFilled:I,name:P,disabled:k,validation:O}=Zh(),{controlId:M}=tg(),T=ng({id:t}),A=k||c,F=P??l,[N,z]=ql({controlled:n,default:v?r??Oc:r,name:"Select",state:"value"}),[L,D]=ql({controlled:i,default:s,name:"Select",state:"open"}),V=de([]),$=de([]),j=de(null),q=de(null),H=de(0),W=de(null),U=de([]),B=de(!1),G=de(!1),Z=de(null),K=de({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Q=de(!1),{mounted:X,setMounted:J,transitionStatus:Y}=rh(L),{openMethod:ee,triggerProps:te,reset:ne}=ug(L),re=Bl(()=>new Pc({id:T,modal:f,multiple:v,itemToStringLabel:y,itemToStringValue:b,isItemEqualToValue:w,value:N,open:L,mounted:X,transitionStatus:Y,items:m,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,oe=Ic(re,Gm.activeIndex),ie=Ic(re,Gm.selectedIndex),se=Ic(re,Gm.triggerElement),ae=Ic(re,Gm.positionerElement),le=pe(()=>v&&Array.isArray(N)&&0===N.length?"":sg(N,b),[v,N,b]),ce=pe(()=>v&&Array.isArray(N)?N.map(e=>sg(e,b)):sg(N,b),[v,N,b]),ue=jc(re.state.triggerElement);Jh({id:T,commit:O.commit,value:N,controlRef:ue,name:F,getValue:()=>ce});const he=de(N);Hl(()=>{N!==he.current&&re.set("forceMount",!0)},[re,N]),Hl(()=>{I(null!==N)},[N,I]),Hl(function(){if(L)return;const e=U.current;if(v){const t=Array.isArray(N)?N:[];if(0===t.length)return void re.set("selectedIndex",null);const n=qh(e,t[t.length-1],w);return void re.set("selectedIndex",-1===n?null:n)}const t=qh(e,N,w);re.set("selectedIndex",-1===t?null:t)},[v,L,N,U,w,re]),dg(N,()=>{S(F),C(N!==R.initialValue),E()?O.commit(N):O.commit(N,!0)});const ge=Kl((e,t)=>{if(a?.(e,t),!t.isCanceled&&(D(e),!e&&null!==re.state.activeIndex)){const e=V.current[re.state.activeIndex];queueMicrotask(()=>{e?.setAttribute("tabindex","-1")})}}),me=Kl(()=>{J(!1),re.set("activeIndex",null),ne(),g?.(!1)});oh({enabled:!p,open:L,ref:j,onComplete(){L||me()}}),fe(p,()=>({unmount:me}),[me]);const ve=Kl((e,t)=>{o?.(e,t),t.isCanceled||z(e)}),ye=Kl(()=>{const e=re.state.listElement||j.current;if(!e)return;const t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;re.state.scrollUpArrowVisible!==t&&re.set("scrollUpArrowVisible",t),re.state.scrollDownArrowVisible!==n&&re.set("scrollDownArrowVisible",n)}),be=uh({open:L,onOpenChange:ge,elements:{reference:se,floating:ae}}),we=mp(be,{enabled:!u&&!A,event:"mousedown"}),_e=eh(be,{bubbles:!1}),xe=Eh(be,{enabled:!u&&!A,listRef:V,activeIndex:oe,selectedIndex:ie,disabledIndices:Oc,onNavigate(e){(null!==e||L)&&re.set("activeIndex",e)},focusItemOnHover:!1}),Se=Ph(be,{enabled:!u&&!A&&(L||!v),listRef:$,activeIndex:oe,selectedIndex:ie,onMatch(e){L?re.set("activeIndex",e):ve(U.current[e],Ff("none"))},onTypingChange(e){B.current=e}}),{getReferenceProps:Ce,getFloatingProps:Ee,getItemProps:Re}=bh([we,_e,xe,Se]),Ie=pe(()=>Xf(Ce(),te),[Ce,te]);Wl(()=>{re.update({popupProps:Ee(),triggerProps:Ie})}),Hl(()=>{re.update({id:T,modal:f,multiple:v,value:N,open:L,mounted:X,transitionStatus:Y,popupProps:Ee(),triggerProps:Ie,items:m,itemToStringLabel:y,itemToStringValue:b,isItemEqualToValue:w,openMethod:ee})},[re,T,f,v,N,L,X,Y,Ee,Ie,m,y,b,w,ee]);const Pe=pe(()=>({store:re,name:F,required:d,disabled:A,readOnly:u,multiple:v,itemToStringLabel:y,itemToStringValue:b,highlightItemOnHover:_,setValue:ve,setOpen:ge,listRef:V,popupRef:j,scrollHandlerRef:q,handleScrollArrowVisibility:ye,scrollArrowsMountedCountRef:H,getItemProps:Re,events:be.context.events,valueRef:W,valuesRef:U,labelsRef:$,typingRef:B,selectionRef:K,selectedItemTextRef:Z,validation:O,onOpenChangeComplete:g,keyboardActiveRef:G,alignItemWithTriggerActiveRef:Q,initialValueRef:he}),[re,F,d,A,u,v,y,b,_,ve,ge,Re,be.context.events,O,g,ye]),ke=Jl(h,O.inputRef),Oe=v&&Array.isArray(N)&&N.length>0,Me=pe(()=>v&&Array.isArray(N)&&F?N.map(e=>{const t=sg(e,b);return Cr.jsx("input",{type:"hidden",name:F,value:t},t)}):null,[v,N,F,b]);return Cr.jsx(Hm.Provider,{value:Pe,children:Cr.jsxs(Wm.Provider,{value:be,children:[x,Cr.jsx("input",{...O.getInputValidationProps({onFocus(){re.state.triggerElement?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;const t=e.target.value,n=Ff(bf,e.nativeEvent);re.set("forceMount",!0),queueMicrotask(function(){if(v)return;const e=U.current.find(e=>sg(e,b).toLowerCase()===t.toLowerCase());null!=e&&(C(e!==R.initialValue),ve(e,n),E()&&O.commit(e))})}}),id:t||M||void 0,name:v?void 0:F,value:le,disabled:A,required:d&&!Oe,readOnly:u,ref:ke,style:tc,tabIndex:-1,"aria-hidden":!0}),Me]})})}const Km={...Pg,...Bh,value:()=>null},Qm=Le(function(e,t){const{render:n,className:r,disabled:o=!1,nativeButton:i=!0,...s}=e,{setTouched:a,setFocused:l,validationMode:c,state:u,disabled:d}=Zh(),{labelId:f}=tg(),{store:p,setOpen:h,selectionRef:g,validation:m,readOnly:v,alignItemWithTriggerActiveRef:y,disabled:b,keyboardActiveRef:w}=Um(),_=d||b||o,x=Ic(p,Gm.open),S=Ic(p,Gm.value),C=Ic(p,Gm.triggerProps),E=Ic(p,Gm.positionerElement),R=Ic(p,Gm.listElement),I=Ic(p,Gm.serializedValue),P=jc(E),k=de(null),O=$c(),M=$c(),{getButtonProps:T,buttonRef:A}=Vg({disabled:_,native:i}),F=Kl(e=>{p.set("triggerElement",e)}),N=Jl(t,k,A,F),z=$c(),L=$c();ce(()=>{if(x)return L.start(200,()=>{g.current.allowUnselectedMouseUp=!0,z.start(200,()=>{g.current.allowSelectedMouseUp=!0})}),()=>{z.clear(),L.clear()};g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},M.clear()},[x,g,M,z,L]);const D=pe(()=>R?.id??qu(E)?.id,[R,E]),V=Xf(C,{role:"combobox","aria-expanded":x?"true":"false","aria-haspopup":"listbox","aria-controls":x?D:void 0,"aria-labelledby":f,"aria-readonly":v||void 0,tabIndex:_?-1:0,ref:N,onFocus(e){l(!0),x&&y.current&&h(!1,Ff(Pf,e.nativeEvent)),O.start(0,()=>{p.set("forceMount",!0)})},onBlur(){a(!0),l(!1),"onBlur"===c&&m.commit(S)},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(e){if(x)return;const t=Df(e.currentTarget);function n(e){if(!k.current)return;const t=e.target;if(zu(k.current,t)||zu(P.current,t)||t===k.current)return;const n=$g(k.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||h(!1,Ff(Mf,e))}M.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},m.getValidationProps,s,T);V.role="combobox";const $=pe(()=>({...u,open:x,disabled:_,value:S,readOnly:v,placeholder:!I}),[u,x,_,S,v,I]);return ip("button",e,{ref:[t,k],state:$,stateAttributesMapping:Km,props:V})}),Xm={value:()=>null},Jm=Le(function(e,t){const{className:n,render:r,children:o,...i}=e,{store:s,valueRef:a}=Um(),l=Ic(s,Gm.value),c=Ic(s,Gm.items),u=Ic(s,Gm.itemToStringLabel),d=Ic(s,Gm.serializedValue),f=pe(()=>({value:l,placeholder:!d}),[l,d]),p="function"==typeof o?o(l):o??(Array.isArray(l)?function(e,t){return Array.isArray(e)&&0!==e.length?e.map(e=>ig(e,t)).join(", "):""}(l,u):function(e,t,n){if(n&&null!=e)return n(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return t[e]??ig(e,n);if(Array.isArray(t)){const r=og(t)?t.flatMap(e=>e.items):t;if(null==e){const t=r.find(e=>null==e.value);return t&&null!=t.label?t.label:ig(e,n)}if("object"!=typeof e){const t=r.find(t=>t&&t.value===e);return t&&null!=t.label?t.label:ig(e,n)}if("value"in e){const t=r.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return ig(e,n)}(l,c,u));return ip("span",e,{state:f,ref:[t,a],props:[{children:p},i],stateAttributesMapping:Xm})}),Ym=Le(function(e,t){const{className:n,render:r,...o}=e,{store:i}=Um(),s=Ic(i,Gm.open);return ip("span",e,{state:pe(()=>({open:s}),[s]),ref:t,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:Ig})}),ev=B(void 0),tv=Le(function(e,t){const{store:n}=Um(),r=Ic(n,Gm.mounted),o=Ic(n,Gm.forceMount);return r||o?Cr.jsx(ev.Provider,{value:!0,children:Cr.jsx(cp,{ref:t,...e})}):null}),nv=B(void 0);function rv(e,t){e&&Object.assign(e.style,t)}const ov={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},iv={position:"fixed"},sv=Le(function(e,t){const{anchor:n,positionMethod:r="absolute",className:o,render:i,side:s="bottom",align:a="center",sideOffset:l=0,alignOffset:c=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:m=mf,...v}=e,{store:y,listRef:b,labelsRef:w,alignItemWithTriggerActiveRef:_,selectedItemTextRef:x,valuesRef:S,initialValueRef:C,popupRef:E,setValue:R}=Um(),I=Bm(),P=Ic(y,Gm.open),k=Ic(y,Gm.mounted),O=Ic(y,Gm.modal),M=Ic(y,Gm.value),T=Ic(y,Gm.openMethod),A=Ic(y,Gm.positionerElement),F=Ic(y,Gm.triggerElement),N=Ic(y,Gm.isItemEqualToValue),z=de(null),L=de(null),[D,V]=ae(g),$=k&&D&&"touch"!==T;k||D===g||V(g),Hl(()=>{k||(Gm.scrollUpArrowVisible(y.state)&&y.set("scrollUpArrowVisible",!1),Gm.scrollDownArrowVisible(y.state)&&y.set("scrollDownArrowVisible",!1))},[y,k]),fe(_,()=>$),om(($||O)&&P&&"touch"!==T,F);const j=um({anchor:n,floatingRootContext:I,positionMethod:r,mounted:k,side:s,sideOffset:l,align:a,alignOffset:c,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:h??$,collisionAvoidance:m,keepMounted:!0}),q=$?"none":j.side,H=$?iv:j.positionerStyles,W=pe(()=>{const e={};return P||(e.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...H,...e}}},[P,k,H]),U=pe(()=>({open:P,side:q,align:j.align,anchorHidden:j.anchorHidden}),[P,q,j.align,j.anchorHidden]),B=Kl(e=>{y.set("positionerElement",e)}),G=ip("div",e,{ref:[t,B],state:U,stateAttributesMapping:kg,props:[W,v]}),Z=de(0),K=Kl(e=>{if(0===e.size&&0===Z.current)return;if(0===S.current.length)return;const t=Z.current;if(Z.current=e.size,e.size===t)return;const n=Ff(bf);if(0!==t&&!y.state.multiple&&null!==M&&-1===qh(S.current,M,N)){const e=C.current,t=null!=e&&jh(S.current,e,N)?e:null;R(t,n),null===t&&(y.set("selectedIndex",null),x.current=null)}if(0!==t&&y.state.multiple&&Array.isArray(M)){const e=M.filter(e=>jh(S.current,e,N));(e.length!==M.length||e.some(e=>!jh(M,e,N)))&&(R(e,n),0===e.length&&(y.set("selectedIndex",null),x.current=null))}if(P&&$){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const e={height:""};rv(A,e),rv(E.current,e)}}),Q=pe(()=>({...j,side:q,alignItemWithTriggerActive:$,setControlledAlignItemWithTrigger:V,scrollUpArrowRef:z,scrollDownArrowRef:L}),[j,q,$,V]);return Cr.jsx(Bg,{elementsRef:b,labelsRef:w,onMapChange:K,children:Cr.jsxs(nv.Provider,{value:Q,children:[k&&O&&Cr.jsx(fm,{inert:Yg(!P),cutout:F}),G]})})});function av(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const lv="base-ui-disable-scrollbar",cv={className:lv,element:Cr.jsx("style",{href:lv,precedence:"base-ui:low",children:`.${lv}{scrollbar-width:none}.${lv}::-webkit-scrollbar{display:none}`})},uv=B(void 0);function dv(e){return ge(uv)}const fv="ArrowUp",pv="ArrowDown",hv="ArrowLeft",gv="ArrowRight",mv="Home",vv=new Set([hv,gv]),yv=new Set([fv,pv]),bv=new Set([...vv,...yv]);new Set([...bv,mv,"End"]);const wv=new Set([fv,pv,hv,gv,mv,"End"]),_v={...kg,...bg},xv=Le(function(e,t){const{render:n,className:r,...o}=e,{store:i,popupRef:s,onOpenChangeComplete:a,setOpen:l,valueRef:c,selectedItemTextRef:u,keyboardActiveRef:d,multiple:f,handleScrollArrowVisibility:p,scrollHandlerRef:h}=Um(),{side:g,align:m,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:y,scrollDownArrowRef:b,scrollUpArrowRef:w}=function(){const e=ge(nv);if(!e)throw new Error(nc(59));return e}(),_=null!=dv(),S=Bm(),C=$c(),E=Ic(i,Gm.id),R=Ic(i,Gm.open),I=Ic(i,Gm.mounted),P=Ic(i,Gm.popupProps),k=Ic(i,Gm.transitionStatus),O=Ic(i,Gm.triggerElement),M=Ic(i,Gm.positionerElement),T=Ic(i,Gm.listElement),A=de(0),F=de(!1),N=de(0),z=de(!1),L=de({}),D=Dc(),V=Kl(e=>{if(!M||!s.current||!z.current)return;if(F.current||!v)return void p();const t="0px"===M.style.top,n="0px"===M.style.bottom,r=M.getBoundingClientRect().height,o=Df(M),i=getComputedStyle(M),a=parseFloat(i.marginTop),l=parseFloat(i.marginBottom),c=o.documentElement.clientHeight-a-l,u=e.scrollTop,d=e.scrollHeight-e.clientHeight;let f=null,h=null,g=!1;if(t){const e=r+(d-u),t=Math.min(e,c);f=t,t!==c?h=d:g=!0}else if(n){const e=u-0,t=r+e,n=Math.min(t,c);f=n,n!==c?h=0:(g=!0,u<d&&(h=u-(e-(t-c))))}null!=f&&(M.style.height=`${f}px`),null!=h&&(e.scrollTop=h),g&&(F.current=!0),p()});fe(h,()=>V,[V]),oh({open:R,ref:s,onComplete(){R&&a?.(!0)}});const $=pe(()=>({open:R,transitionStatus:k,side:g,align:m}),[R,k,g,m]);Hl(()=>{M&&s.current&&!Object.keys(L.current).length&&(L.current={top:M.style.top||"0",left:M.style.left||"0",right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[s,M]),Hl(()=>{I||v||(z.current=!1,F.current=!1,A.current=0,N.current=0,rv(M,L.current))},[I,v,M,s]),Hl(()=>{const e=s.current;if(I&&O&&M&&e)return v?void queueMicrotask(()=>{const t=getComputedStyle(M),n=getComputedStyle(e),r=Df(O),o=Uc(M),i=O.getBoundingClientRect(),s=M.getBoundingClientRect(),a=i.left,l=i.height,d=T||e,f=d.scrollHeight,h=parseFloat(n.borderBottomWidth),g=parseFloat(t.marginTop)||10,m=parseFloat(t.marginBottom)||10,v=parseFloat(t.minHeight)||100,b=r.documentElement.clientHeight-g-m,w=r.documentElement.clientWidth,_=b-i.bottom+l,x=u.current,S=c.current;let C=0,E=0;if(x&&S){const e=S.getBoundingClientRect(),t=x.getBoundingClientRect(),n=e.left-a,r=t.left-s.left,o=e.top-i.top+e.height/2;C=n-r,E=t.top-s.top+t.height/2-o}const R=_+E+m+h;let I=Math.min(b,R);const P=b-g-m,k=R-I,N=Math.max(5,a+C),D=w-5,V=Math.max(0,N+s.width-D);M.style.left=N-V+"px",M.style.height=`${I}px`,M.style.maxHeight="auto",M.style.marginTop=`${g}px`,M.style.marginBottom=`${m}px`,e.style.height="100%";const $=d.scrollHeight-d.clientHeight,j=k>=$;j&&(I=Math.min(b,s.height)-(k-$));const q=i.top<20||i.bottom>b-20||I<Math.min(f,v),H=1!==(o.visualViewport?.scale??1)&&wu;if(q||H)return z.current=!0,rv(M,L.current),void Ct(()=>y(!1));if(j){const e=Math.max(0,b-R);M.style.top=s.height>=P?"0":`${e}px`,M.style.height=`${I}px`,d.scrollTop=d.scrollHeight-d.clientHeight,A.current=Math.max(v,I)}else M.style.bottom="0",A.current=Math.max(v,I),d.scrollTop=k;A.current===b&&(F.current=!0),p(),setTimeout(()=>{z.current=!0})}):(z.current=!0,void D.request(p))},[i,I,M,O,c,u,s,p,v,y,D,b,w,T]),ce(()=>{if(!v||!M||!I)return;const e=Uc(M);function t(e){l(!1,Ff("window-resize",e))}return e.addEventListener("resize",t),()=>{e.removeEventListener("resize",t)}},[l,v,M,I]);const j={...T?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":f||void 0,id:`${E}-list`},onKeyDown(e){d.current=!0,_&&wv.has(e.key)&&e.stopPropagation()},onMouseMove(){d.current=!1},onPointerLeave(e){if(av(e)||"touch"===e.pointerType)return;const t=e.currentTarget;C.start(0,()=>{i.set("activeIndex",null),t.focus({preventScroll:!0})})},onScroll(e){T||h.current?.(e.currentTarget)},...v&&{style:T?{height:"100%"}:ov}},q=ip("div",e,{ref:[t,s],state:$,stateAttributesMapping:_v,props:[P,j,hm(k),{className:!T&&v?cv.className:void 0},o]});return Cr.jsxs(x,{children:[cv.element,Cr.jsx(gp,{context:S,modal:!1,disabled:!I,restoreFocus:!0,children:q})]})}),Sv=B(void 0),Cv=Fe(Le(function(e,t){const{render:n,className:r,value:o=null,label:i,disabled:s=!1,nativeButton:a=!1,...l}=e,c=de(null),u=ym({label:i,textRef:c,indexGuessBehavior:vm.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:h,selectionRef:g,typingRef:m,valuesRef:v,keyboardActiveRef:y,multiple:b,highlightItemOnHover:w}=Um(),_=$c(),x=Ic(d,Gm.isActive,u.index),S=Ic(d,Gm.isSelected,u.index,o),C=Ic(d,Gm.isSelectedByFocus,u.index),E=Ic(d,Gm.isItemEqualToValue),R=u.index,I=-1!==R,P=de(null),k=jc(R);Hl(()=>{if(!I)return;const e=v.current;return e[R]=o,()=>{delete e[R]}},[I,R,o,v]),Hl(()=>{if(!I)return;const e=d.state.value;let t=e;b&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),void 0!==t&&$h(t,o,E)&&d.set("selectedIndex",R)},[I,R,b,E,d,o]);const O=pe(()=>({disabled:s,selected:S,highlighted:x}),[s,S,x]),M=f({active:x,selected:S});M.onFocus=void 0,M.id=void 0;const T=de(null),A=de("mouse"),F=de(!1),{getButtonProps:N,buttonRef:z}=Vg({disabled:s,focusableWhenDisabled:!0,native:a});function L(e){const t=d.state.value;if(b){const n=Array.isArray(t)?t:[],r=S?Hh(n,o,E):[...n,o];h(r,Ff(Cf,e))}else h(o,Ff(Cf,e)),p(!1,Ff(Cf,e))}const D={role:"option","aria-selected":S,"aria-disabled":s||void 0,tabIndex:x?0:-1,onFocus(){d.set("activeIndex",R)},onMouseEnter(){y.current||null!==d.state.selectedIndex||d.set("activeIndex",R)},onMouseMove(){w&&d.set("activeIndex",R)},onMouseLeave(e){!w||y.current||av(e)||_.start(0,()=>{d.state.activeIndex===R&&d.set("activeIndex",null)})},onTouchStart(){g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){T.current=e.key,d.set("activeIndex",R)},onClick(e){F.current=!1,"keydown"===e.type&&null===T.current||s||" "===T.current&&m.current||"touch"!==A.current&&!x||(T.current=null,L(e.nativeEvent))},onPointerEnter(e){A.current=e.pointerType},onPointerDown(e){A.current=e.pointerType,F.current=!0},onMouseUp(e){if(s)return;if(F.current)return void(F.current=!1);const t=!g.current.allowSelectedMouseUp&&S,n=!g.current.allowUnselectedMouseUp&&!S;t||n||"touch"!==A.current&&!x||L(e.nativeEvent)}},V=ip("div",e,{ref:[z,t,u.ref,P],state:O,props:[M,D,l,N]}),$=pe(()=>({selected:S,indexRef:k,textRef:c,selectedByFocus:C,hasRegistered:I}),[S,k,c,C,I]);return Cr.jsx(Sv.Provider,{value:$,children:V})})),Ev=Fe(Le(function(e,t){const{indexRef:n,textRef:r,selectedByFocus:o,hasRegistered:i}=function(){const e=ge(Sv);if(!e)throw new Error(nc(57));return e}(),{selectedItemTextRef:s}=Um(),{className:a,render:l,...c}=e;return ip("div",e,{ref:[he(e=>{if(!e||!i)return;const t=null===s.current||!s.current.isConnected;(o||t&&0===n.current)&&(s.current=e)},[s,n,o,i]),t,r],props:c})})),Rv=({pageSize:e,rowsPerPageOptions:t=[10,25,50,100],onPageSizeChange:n,className:r,disabled:o=!1})=>{const{displayMode:i,i18n:s}=Lr(),a=he(e=>{if(null===e)return;const t=parseInt(e,10);isNaN(t)||n(t)},[n]);return yr("div",{className:Ar("per-page-selector",r),children:[yr("span",{className:"per-page-selector-label",children:s.show}),yr(Zm,{value:String(e),onValueChange:a,disabled:o,children:[yr(Qm,{className:"per-page-selector-trigger",children:[yr(Jm,{children:t=>t??String(e)}),yr(Ym,{className:"per-page-selector-icon",children:yr(Mm,{})})]}),yr(tv,{children:yr(sv,{className:"barn2-select-positioner",positionMethod:"fixed",sideOffset:4,alignItemWithTrigger:!1,children:yr(xv,{className:"barn2-select-popup per-page-popup","data-display-mode":i,children:t.map(e=>yr(Cv,{value:String(e),className:"barn2-select-item per-page-item",children:yr(Ev,{children:e})},e))})})})]}),yr("span",{className:"per-page-selector-label",children:s.perPage})]})},Iv=({currentPage:e,pageSize:t,totalRows:n,className:r,infiniteScrollMode:o=!1})=>{const{i18n:i}=Lr(),{startRow:s,endRow:a}=pe(()=>o?{startRow:t>0?1:0,endRow:t}:{startRow:e*t+1,endRow:Math.min((e+1)*t,n)},[e,t,n,o]);return 0===n?null:yr("div",{className:Ar("document-count",r),children:yr("span",{className:"document-count-text",children:i.showingRangeOfTotal({start:s,end:a,total:n})})})},Pv=({currentPage:e,totalPages:t,paginationType:n="full_numbers",onPageChange:r,className:o,disabled:i=!1})=>{const{i18n:s}=Lr(),a=he(()=>["simple","simple_numbers","full","full_numbers"].includes(n),[n]),l=he(()=>["full","full_numbers"].includes(n),[n]),c=he(()=>["numbers","simple_numbers","full_numbers"].includes(n),[n]),u=he(()=>{const n=[];if(t<=7)for(let e=0;e<t;e++)n.push(e);else if(e<=2){for(let e=0;e<5;e++)n.push(e);n.push("..."),n.push(t-1)}else if(e>=t-3){n.push(0),n.push("...");for(let e=t-5;e<t;e++)n.push(e)}else{n.push(0),n.push("...");for(let t=e-1;t<=e+1;t++)n.push(t);n.push("..."),n.push(t-1)}return n},[e,t]);return t<=1?null:yr("div",{className:Ar("page-navigation",o),style:i?{pointerEvents:"none"}:void 0,children:yr("div",{className:"page-navigation-buttons",children:[l()&&yr("button",{type:"button",onClick:()=>r(0),disabled:0===e,className:"pagination-btn pagination-btn-first","aria-label":s.firstPage,children:yr("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:yr("path",{d:"M11 12L7 8L11 4M5 12V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),a()&&yr("button",{type:"button",onClick:()=>r(Math.max(e-1,0)),disabled:0===e,className:"pagination-btn pagination-btn-prev","aria-label":s.previousPage,children:yr("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:yr("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),c()&&yr("div",{className:"pagination-pages",children:u().map((t,n)=>{if("..."===t)return yr("span",{className:"pagination-ellipsis",children:"…"},`ellipsis-${n}`);const o=t;return yr("button",{type:"button",onClick:()=>r(o),className:Ar("pagination-btn","pagination-btn-page",o===e&&"pagination-btn-active"),"aria-label":s.page({page:o+1}),"aria-current":o===e?"page":void 0,children:o+1},o)})}),a()&&yr("button",{type:"button",onClick:()=>r(Math.min(e+1,t-1)),disabled:e>=t-1,className:"pagination-btn pagination-btn-next","aria-label":s.nextPage,children:yr("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:yr("path",{d:"M6 12L10 8L6 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),l()&&yr("button",{type:"button",onClick:()=>r(t-1),disabled:e>=t-1,className:"pagination-btn pagination-btn-last","aria-label":s.lastPage,children:yr("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:yr("path",{d:"M5 12L9 8L5 4M11 4V12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})},kv=({currentPage:e,pageSize:t,totalRows:n,rowsPerPageOptions:r=[10,25,50,100],onPageSizeChange:o,className:i,disabled:s=!1})=>{const{i18n:a}=Lr(),l=e*t+1,c=Math.min((e+1)*t,n);return yr("div",{className:Ar("pagination-controls-info",i),style:s?{pointerEvents:"none"}:void 0,children:[yr("span",{className:"pagination-controls-text",children:a.showingRangeToTotal({start:l,end:c,total:n})}),yr("select",{id:"page-size",value:t,onChange:e=>{const t=parseInt(e.target.value,10);o(t)},className:"pagination-controls-select",children:r.map(e=>yr("option",{value:e,children:a.itemsPerPageOption({count:e})},e))})]})},Ov=()=>yr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[yr("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),yr("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),yr("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),Mv=()=>yr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[yr("rect",{x:"3",y:"3",width:"7",height:"7"}),yr("rect",{x:"14",y:"3",width:"7",height:"7"}),yr("rect",{x:"3",y:"14",width:"7",height:"7"}),yr("rect",{x:"14",y:"14",width:"7",height:"7"})]}),Tv=({currentView:e,onViewChange:t,className:n,disabled:r=!1})=>{const{i18n:o}=Lr();return yr("div",{className:Ar("view-switcher",n),children:[yr("button",{type:"button",onClick:()=>t("table"),className:Ar("view-switcher-btn","table"===e&&"active"),disabled:r,"aria-label":o.tableView,title:o.tableView,children:yr(Ov,{})}),yr("button",{type:"button",onClick:()=>t("grid"),className:Ar("view-switcher-btn","grid"===e&&"active"),disabled:r,"aria-label":o.gridView,title:o.gridView,children:yr(Mv,{})})]})},Av=({label:e,labelOverrideSignal:t,selectedCount:n,onClick:r,isLoading:o=!1,className:i})=>{const s=t?.value,a=null!=s,l=s??e,c=0===n||o,u=!a&&n>0&&!o,d=a?l:n>0?`${l} (${n})`:l;return yr("button",{type:"button",className:Ar("dv-action-button",c&&"dv-action-button-disabled",o&&"dv-action-button-loading",i),disabled:c,onClick:r,"aria-label":d,"aria-busy":o,children:[o&&yr("span",{className:"dv-action-button-spinner","aria-hidden":"true"}),yr("span",{className:"dv-action-button-label",children:l}),u&&yr("span",{className:"dv-action-button-badge",children:n})]})},Fv="data-dv-row-selection-id",Nv=`input[type="checkbox"][${Fv}]`;function zv(e){const t={};for(const n of Array.from(e.attributes))n.name.startsWith("data-")&&(t[n.name.slice(5).replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n.value);return t}function Lv(e,t){return"function"==typeof e?e(t):e}function Dv(e,t){return n=>{t.setState(t=>({...t,[e]:Lv(n,t[e])}))}}function Vv(e){return e instanceof Function}function $v(e,t,n){let r,o=[];return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i),l=a.length!==o.length||a.some((e,t)=>o[t]!==e);if(!l)return r;let c;if(o=a,n.key&&n.debug&&(c=Date.now()),r=t(...a),null==n||null==n.onChange||n.onChange(r),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-s))/100,t=Math.round(100*(Date.now()-c))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n            font-size: .6rem;\n            font-weight: bold;\n            color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function jv(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}const qv="debugHeaders";function Hv(e,t,n){var r;let o={id:null!=(r=n.id)?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(o,e)}),o}const Wv={createTable:e=>{e.getHeaderGroups=$v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],l=null!=(s=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[];return Uv(t,[...a,...n.filter(e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id))),...l],e)},jv(e.options,qv)),e.getCenterHeaderGroups=$v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>Uv(t,n=n.filter(e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id))),e,"center"),jv(e.options,qv)),e.getLeftHeaderGroups=$v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[];return Uv(t,i,e,"left")},jv(e.options,qv)),e.getRightHeaderGroups=$v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[];return Uv(t,i,e,"right")},jv(e.options,qv)),e.getFooterGroups=$v(()=>[e.getHeaderGroups()],e=>[...e].reverse(),jv(e.options,qv)),e.getLeftFooterGroups=$v(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),jv(e.options,qv)),e.getCenterFooterGroups=$v(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),jv(e.options,qv)),e.getRightFooterGroups=$v(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),jv(e.options,qv)),e.getFlatHeaders=$v(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),jv(e.options,qv)),e.getLeftFlatHeaders=$v(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),jv(e.options,qv)),e.getCenterFlatHeaders=$v(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),jv(e.options,qv)),e.getRightFlatHeaders=$v(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),jv(e.options,qv)),e.getCenterLeafHeaders=$v(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),jv(e.options,qv)),e.getLeftLeafHeaders=$v(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),jv(e.options,qv)),e.getRightLeafHeaders=$v(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),jv(e.options,qv)),e.getLeafHeaders=$v(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var r,o,i,s,a,l;return[...null!=(r=null==(o=e[0])?void 0:o.headers)?r:[],...null!=(i=null==(s=t[0])?void 0:s.headers)?i:[],...null!=(a=null==(l=n[0])?void 0:l.headers)?a:[]].map(e=>e.getLeafHeaders()).flat()},jv(e.options,qv))}};function Uv(e,t,n,r){var o,i;let s=0;const a=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&a(e.columns,t+1)},0)};a(e);let l=[];const c=(e,t)=>{const o={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach(e=>{const s=[...i].reverse()[0];let a,l=!1;if(e.column.depth===o.depth&&e.column.parent?a=e.column.parent:(a=e.column,l=!0),s&&(null==s?void 0:s.column)===a)s.subHeaders.push(e);else{const o=Hv(n,a,{id:[r,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:l,placeholderId:l?`${i.filter(e=>e.column===a).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o}),l.push(o),t>0&&c(i,t-1)},u=t.map((e,t)=>Hv(n,e,{depth:s,index:t}));c(u,s-1),l.reverse();const d=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],d(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:o}=e;t+=n,r.push(o)})):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return d(null!=(o=null==(i=l[0])?void 0:i.headers)?o:[]),l}const Bv=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(a._valuesCache.hasOwnProperty(t))return a._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(a._valuesCache[t]=n.accessorFn(a.original,r),a._valuesCache[t]):void 0},getUniqueValues:t=>{if(a._uniqueValuesCache.hasOwnProperty(t))return a._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(a._uniqueValuesCache[t]=n.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[t]):(a._uniqueValuesCache[t]=[a.getValue(t)],a._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=a.getValue(t))?n:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>function(e){const t=[],n=e=>{e.forEach(e=>{t.push(e);const r=(e=>e.subRows)(e);null!=r&&r.length&&n(r)})};return n(e),t}(a.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let e=[],t=a;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:$v(()=>[e.getAllLeafColumns()],t=>t.map(t=>function(e,t,n,r){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:$v(()=>[e,n,t,o],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),jv(e.options,"debugCells"))};return e._features.forEach(r=>{null==r.createCell||r.createCell(o,n,t,e)},{}),o}(e,a,t,t.id)),jv(e.options,"debugRows")),_getAllCellsByColumnId:$v(()=>[a.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),jv(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(a,e)}return a},Gv={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Zv=(e,t,n)=>{var r,o;const i=null==n||null==(r=n.toString())?void 0:r.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(i))};Zv.autoRemove=e=>oy(e);const Kv=(e,t,n)=>{var r;return Boolean(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};Kv.autoRemove=e=>oy(e);const Qv=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};Qv.autoRemove=e=>oy(e);const Xv=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};Xv.autoRemove=e=>oy(e);const Jv=(e,t,n)=>!n.some(n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))});Jv.autoRemove=e=>oy(e)||!(null!=e&&e.length);const Yv=(e,t,n)=>n.some(n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)});Yv.autoRemove=e=>oy(e)||!(null!=e&&e.length);const ey=(e,t,n)=>e.getValue(t)===n;ey.autoRemove=e=>oy(e);const ty=(e,t,n)=>e.getValue(t)==n;ty.autoRemove=e=>oy(e);const ny=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};ny.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(r)?-1/0:r,s=null===n||Number.isNaN(o)?1/0:o;if(i>s){const e=i;i=s,s=e}return[i,s]},ny.autoRemove=e=>oy(e)||oy(e[0])&&oy(e[1]);const ry={includesString:Zv,includesStringSensitive:Kv,equalsString:Qv,arrIncludes:Xv,arrIncludesAll:Jv,arrIncludesSome:Yv,equals:ey,weakEquals:ty,inNumberRange:ny};function oy(e){return null==e||""===e}const iy={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Dv("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?ry.includesString:"number"==typeof r?ry.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?ry.equals:Array.isArray(r)?ry.arrIncludes:ry.weakEquals},e.getFilterFn=()=>{var n,r;return Vv(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:ry[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{const r=e.getFilterFn(),o=null==t?void 0:t.find(t=>t.id===e.id),i=Lv(n,o?o.value:void 0);var s;if(sy(r,i,e))return null!=(s=null==t?void 0:t.filter(t=>t.id!==e.id))?s:[];const a={id:e.id,value:i};var l;return o?null!=(l=null==t?void 0:t.map(t=>t.id===e.id?a:t))?l:[]:null!=t&&t.length?[...t,a]:[a]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var r;return null==(r=Lv(t,e))?void 0:r.filter(e=>{const t=n.find(t=>t.id===e.id);return!t||!sy(t.getFilterFn(),e.value,t)})})},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function sy(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const ay={sum:(e,t,n)=>n.reduce((t,n)=>{const r=n.getValue(e);return t+("number"==typeof r?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=o=n):(r>n&&(r=n),o<n&&(o=n)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(t=>t.getValue(e));if(!function(e){return Array.isArray(e)&&e.every(e=>"number"==typeof e)}(n))return;if(1===n.length)return n[0];const r=Math.floor(n.length/2),o=n.sort((e,t)=>e-t);return n.length%2!=0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},ly={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Dv("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,r;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?ay.sum:"[object Date]"===Object.prototype.toString.call(r)?ay.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Vv(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:ay[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},cy={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Dv("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=$v(e=>[my(t,e)],t=>t.findIndex(t=>t.id===e.id),jv(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return(null==(r=my(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=my(t,n);return(null==(r=o[o.length-1])?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=$v(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...r];for(;n.length&&t.length;){const e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&o.push(n.splice(r,1)[0])}o=[...o,...n]}else o=r;return function(e,t,n){if(null==t||!t.length||!n)return e;const r=e.filter(e=>!t.includes(e.id));if("remove"===n)return r;const o=t.map(t=>e.find(e=>e.id===t)).filter(Boolean);return[...o,...r]}(o,t,n)},jv(e.options,"debugTable"))}},uy={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:Dv("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,o,i,s,a,l;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter(e=>!(null!=r&&r.includes(e))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=r&&r.includes(e))),...r]}:"left"===n?{left:[...(null!=(a=null==e?void 0:e.left)?a:[]).filter(e=>!(null!=r&&r.includes(e))),...r],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=r&&r.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=r&&r.includes(e))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter(e=>!(null!=r&&r.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,r,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||r)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(e=>e.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(e=>null==r?void 0:r.includes(e)),s=n.some(e=>null==o?void 0:o.includes(e));return i?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[o])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=$v(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.column.id))},jv(t.options,"debugRows")),e.getLeftVisibleCells=$v(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>{const n=(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"}));return n},jv(t.options,"debugRows")),e.getRightVisibleCells=$v(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>{const n=(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"}));return n},jv(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;var o,i;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.left)?void 0:o.length)||(null==(i=r.right)?void 0:i.length))},e.getLeftLeafColumns=$v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),jv(e.options,"debugColumns")),e.getRightLeafColumns=$v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),jv(e.options,"debugColumns")),e.getCenterLeafColumns=$v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.id))},jv(e.options,"debugColumns"))}},dy={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},fy={getDefaultColumnDef:()=>dy,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Dv("columnSizing",e),onColumnSizingInfoChange:Dv("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:dy.minSize,null!=(r=null!=i?i:e.columnDef.size)?r:dy.size),null!=(o=e.columnDef.maxSize)?o:dy.maxSize)},e.getStart=$v(e=>[e,my(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),jv(t.options,"debugColumns")),e.getAfter=$v(e=>[e,my(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),jv(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var r;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(r=e.column.getSize())?r:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=null==r?void 0:r.getCanResize();return i=>{if(!r||!o)return;if(null==i.persist||i.persist(),hy(i)&&i.touches&&i.touches.length>1)return;const s=e.getSize(),a=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],l=hy(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var r,o;const i="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*i,a=Math.max(s/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;c[t]=Math.round(100*Math.max(n+n*a,0))/100}),{...e,deltaOffset:s,deltaPercentage:a}}),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing(e=>({...e,...c})))},d=e=>u("move",e),f=e=>{u("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||("undefined"!=typeof document?document:null),h={moveHandler:e=>d(e.clientX),upHandler:e=>{null==p||p.removeEventListener("mousemove",h.moveHandler),null==p||p.removeEventListener("mouseup",h.upHandler),f(e.clientX)}},g={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==p||p.removeEventListener("touchmove",g.moveHandler),null==p||p.removeEventListener("touchend",g.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof py)return py;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return py=e,py}()&&{passive:!1};hy(i)?(null==p||p.addEventListener("touchmove",g.moveHandler,m),null==p||p.addEventListener("touchend",g.upHandler,m)):(null==p||p.addEventListener("mousemove",h.moveHandler,m),null==p||p.addEventListener("mouseup",h.upHandler,m)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}};let py=null;function hy(e){return"touchstart"===e.type}const gy={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Dv("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return null==(n=o.length?o.some(e=>e.getIsVisible()):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=$v(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),jv(t.options,"debugRows")),e.getVisibleCells=$v(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],jv(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>$v(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),jv(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(0,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(0,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(0,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(0,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};function my(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const vy={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Dv("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}}else e._queue(()=>{t=!0})},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand ()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some(e=>!e.getIsExpanded())},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{const n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=!0===r||!(null==r||!r[e.id]);let s={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach(e=>{s[e]=!0}):s=r,n=null!=(o=n)?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=s;return n}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand (e))?n:(null==(r=t.options.enableExpanding)||r)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand ();return()=>{t&&e.toggleExpanded()}}}},yy={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Dv("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}}else e._queue(()=>{t=!0})},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>Lv(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination(n=>{let r=Lv(t,n.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{const n=Math.max(1,Lv(t,e.pageSize)),r=e.pageSize*e.pageIndex,o=Math.floor(r/n);return{...e,pageIndex:o,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var r;let o=Lv(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}}),e.getPageOptions=$v(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map((e,t)=>t)),t},jv(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},by={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:Dv("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],s=o?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(e=>{var t,r,o,i,s,l;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter(e=>!(null!=a&&a.has(e))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)],bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=a&&a.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=a&&a.has(e))),bottom:(null!=(r=null==e?void 0:e.bottom)?r:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(e=>null==r?void 0:r.includes(e)),s=n.some(e=>null==o?void 0:o.includes(e));return i?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=null==(n="top"===o?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(r=null==i?void 0:i.indexOf(e.id))?r:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;var o,i;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.top)?void 0:o.length)||(null==(i=r.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,r)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map(t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r}))},e.getTopRows=$v(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),jv(e.options,"debugRows")),e.getBottomRows=$v(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),jv(e.options,"debugRows")),e.getCenterRows=$v(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{const r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!r.has(e.id))},jv(e.options,"debugRows"))}},wy={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Dv("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):o.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(t=>{_y(o,t.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=$v(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?xy(e,n):{rows:[],flatRows:[],rowsById:{}},jv(e.options,"debugTable")),e.getFilteredSelectedRowModel=$v(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?xy(e,n):{rows:[],flatRows:[],rowsById:{}},jv(e.options,"debugTable")),e.getGroupedSelectedRowModel=$v(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?xy(e,n):{rows:[],flatRows:[],rowsById:{}},jv(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=Boolean(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return _y(a,e.id,n,null==(s=null==r?void 0:r.selectChildren)||s,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Sy(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Cy(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Cy(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},_y=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(i=s.subRows)&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(t=>_y(e,t.id,n,r,o))};function xy(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(e,t){return e.map(e=>{var t;const s=Sy(e,n);if(s&&(r.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),s)return e}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Sy(e,t){var n;return null!=(n=t[e.id])&&n}function Cy(e,t,n){var r;if(null==(r=e.subRows)||!r.length)return!1;let o=!0,i=!1;return e.subRows.forEach(e=>{if((!i||o)&&(e.getCanSelect()&&(Sy(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const n=Cy(e,t);"all"===n?i=!0:"some"===n?(i=!0,o=!1):o=!1}}),o?"all":!!i&&"some"}const Ey=/([0-9]+)/gm;function Ry(e,t){return e===t?0:e>t?1:-1}function Iy(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Py(e,t){const n=e.split(Ey).filter(Boolean),r=t.split(Ey).filter(Boolean);for(;n.length&&r.length;){const e=n.shift(),t=r.shift(),o=parseInt(e,10),i=parseInt(t,10),s=[o,i].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(s[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return n.length-r.length}const ky={alphanumeric:(e,t,n)=>Py(Iy(e.getValue(n)).toLowerCase(),Iy(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Py(Iy(e.getValue(n)),Iy(t.getValue(n))),text:(e,t,n)=>Ry(Iy(e.getValue(n)).toLowerCase(),Iy(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>Ry(Iy(e.getValue(n)),Iy(t.getValue(n))),datetime:(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},basic:(e,t,n)=>Ry(e.getValue(n),t.getValue(n))},Oy={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Dv("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return ky.datetime;if("string"==typeof n&&(r=!0,n.split(Ey).length>1))return ky.alphanumeric}return r?ky.text:ky.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Vv(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:ky[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=null!=n;t.setSorting(s=>{const a=null==s?void 0:s.find(t=>t.id===e.id),l=null==s?void 0:s.findIndex(t=>t.id===e.id);let c,u=[],d=i?n:"desc"===o;var f;return c=null!=s&&s.length&&e.getCanMultiSort()&&r?a?"toggle":"add":null!=s&&s.length&&l!==s.length-1?"replace":a?"toggle":"replace","toggle"===c&&(i||o||(c="remove")),"add"===c?(u=[...s,{id:e.id,desc:d}],u.splice(0,u.length-(null!=(f=t.options.maxMultiSortColCount)?f:Number.MAX_SAFE_INTEGER))):u="toggle"===c?s.map(t=>t.id===e.id?{...t,desc:d}:t):"remove"===c?s.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],u})},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?!!(s===i||null!=(r=t.options.enableSortingRemoval)&&!r||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===s?"asc":"desc"):i},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},My=[Wv,gy,cy,uy,Gv,iy,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Dv("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(o=t.options.enableFilters)||o)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ry.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Vv(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:ry[r]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Oy,ly,vy,yy,by,wy,fy];function Ty(e){var t,n;const r=[...My,...null!=(t=e._features)?t:[]];let o={_features:r};const i=o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o)),{});let s={...null!=(n=e.initialState)?n:{}};o._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});const a=[];let l=!1;const c={_features:r,options:{...i,...e},initialState:s,_queue:e=>{a.push(e),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{const t=Lv(e,o.options);o.options=(e=>o.options.mergeOptions?o.options.mergeOptions(i,e):{...i,...e})(t)},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,n)=>{var r;return null!=(r=null==o.options.getRowId?void 0:o.options.getRowId(e,t,n))?r:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!n&&(n=o.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:$v(()=>[o.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},jv(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:$v(()=>[o._getColumnDefs()],e=>{const t=function(e,n,r){return void 0===r&&(r=0),e.map(e=>{const i=function(e,t,n,r){var o,i;const s={...e._getDefaultColumnDef(),...t},a=s.accessorKey;let l,c=null!=(o=null!=(i=s.id)?i:a?"function"==typeof String.prototype.replaceAll?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)?o:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?l=s.accessorFn:a&&(l=a.includes(".")?e=>{let t=e;for(const e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!c)throw new Error;let u={id:`${String(c)}`,accessorFn:l,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:$v(()=>[!0],()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},jv(e.options,"debugColumns")),getLeafColumns:$v(()=>[e._getOrderColumnsFn()],e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap(e=>e.getLeafColumns());return e(t)}return[u]},jv(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(u,e);return u}(o,e,r,n),s=e;return i.columns=s.columns?t(s.columns,i,r+1):[],i})};return t(e)},jv(e,"debugColumns")),getAllFlatColumns:$v(()=>[o.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),jv(e,"debugColumns")),_getAllFlatColumnsById:$v(()=>[o.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),jv(e,"debugColumns")),getAllLeafColumns:$v(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),jv(e,"debugColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,c);for(let e=0;e<o._features.length;e++){const t=o._features[e];null==t||null==t.createTable||t.createTable(o)}return o}function Ay(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?b(e,t):e:null;var n}function Fy(e,t,n){let r,o=n.initialDeps??[],i=!0;function s(){var s,a,l;let c;n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(c=Date.now());const u=e(),d=u.length!==o.length||u.some((e,t)=>o[t]!==e);if(!d)return r;let f;if(o=u,n.key&&(null==(a=n.debug)?void 0:a.call(n))&&(f=Date.now()),r=t(...u),n.key&&(null==(l=n.debug)?void 0:l.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-f))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n            font-size: .6rem;\n            font-weight: bold;\n            color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return!(null==n?void 0:n.onChange)||i&&n.skipInitialOnChange||n.onChange(r),i=!1,r}return s.updateDeps=e=>{o=e},s}function Ny(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const zy=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Ly=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Dy=e=>e,Vy=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},$y=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(o(Ly(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void o({width:t.inlineSize,height:t.blockSize})}o(Ly(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},jy={passive:!0},qy="undefined"==typeof window||"onscrollend"in window,Hy=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&qy?()=>{}:zy(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=r=>()=>{const{horizontal:s,isRtl:a}=e.options;o=s?n.scrollLeft*(a?-1:1):n.scrollTop,i(),t(o,r)},a=s(!0),l=s(!1);n.addEventListener("scroll",a,jy);const c=e.options.useScrollendEvent&&qy;return c&&n.addEventListener("scrollend",l,jy),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},Wy=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Uy=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;null==(i=null==(o=r.scrollElement)?void 0:o.scrollTo)||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class By{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{void 0===n&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Dy,rangeExtractor:Vy,onChange:()=>{},measureElement:Wy,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=Fy(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(n.has(t.lane))continue;const i=r.get(t.lane);if(null==i||t.end>i.end?r.set(t.lane,t):t.end<i.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Fy(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,o,i)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Fy(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i},s)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,a),c=new Array(i).fill(void 0);for(let e=0;e<a;e++){const t=l[e];t&&(c[t.lane]=e)}for(let o=a;o<e;o++){const e=r(o),i=this.laneAssignments.get(o);let a,u;if(void 0!==i&&this.options.lanes>1){a=i;const e=c[a],r=void 0!==e?l[e]:void 0;u=r?r.end+this.options.gap:t+n}else{const e=1===this.options.lanes?l[o-1]:this.getFurthestMeasurement(l,o);u=e?e.end+this.options.gap:t+n,a=e?e.lane:o%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(o,a)}const d=s.get(e),f="number"==typeof d?d:this.options.estimateSize(o),p=u+f;l[o]={index:o,start:u,size:f,end:p,key:e,lane:a},c[a]=o}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Fy(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:o};let i=Gy(0,o,t=>e[t].start,n),s=i;if(1===r)for(;s<o&&e[s].end<n+t;)s++;else if(r>1){const a=Array(r).fill(0);for(;s<o&&a.some(e=>e<n+t);){const t=e[s];a[t.lane]=t.end,s++}const l=Array(r).fill(n+t);for(;i>=0&&l.some(e=>e>=n);){const t=e[i];l[t.lane]=t.start,i--}i=Math.max(0,i-i%r),s=Math.min(o,s+(r-1-s%r))}return{startIndex:i,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Fy(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,o)=>null===r||null===o?[]:e({startIndex:r,endIndex:o,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const o=r.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=Fy(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Ny(t[Gy(0,t.length-1,e=>Ny(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e>=o+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(n.end>=o+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=o+this.options.scrollPaddingStart))return[o,"start"];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let r=0;const o=t=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(e,t);if(!r)return void console.warn("Failed to get offset for index:",e);const[o,s]=r;this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),n=this.getOffsetForIndex(e,s);n?((e,t)=>Math.abs(e-t)<1.01)(n[0],t)||i(s):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},i=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(r++,r<10?this.targetWindow.requestAnimationFrame(()=>o(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};o(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some(e=>null===e);){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const Gy=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else{if(!(i>r))return o;t=o-1}}return e>0?e-1:0},Zy="undefined"!=typeof document?ue:ce;const Ky=/[^a-zA-Z0-9_-]/g,Qy="http://www.w3.org/2000/svg";function Xy(e){const t=Array.from(e.querySelectorAll("button, a.button, .multi-cart-check, .wpt-multi-checkbox"));if(t.length<2)return 0;let n=0;for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++){const o=t[e],i=t[r];if(o.contains(i)||i.contains(o))continue;const s=o.getBoundingClientRect(),a=i.getBoundingClientRect();if(s.width<=0||s.height<=0||a.width<=0||a.height<=0)continue;if(Math.min(s.bottom,a.bottom)-Math.max(s.top,a.top)<=0)continue;const l=Math.min(s.right,a.right)-Math.max(s.left,a.left);l>0&&(n=Math.max(n,l+4))}return Math.ceil(n)}const Jy=e=>{const t=parseFloat(e);return Number.isFinite(t)?t:0},Yy=e=>e.replace(/<[^>]*>/g,""),eb=e=>"object"==typeof e&&null!==e&&"taxonomy"===e.dataType&&Array.isArray(e.items),tb=e=>{const t=e.split(/\s+/).filter(Boolean);return 0===t.length?0:t.reduce((e,t)=>Math.max(e,t.length),0)},nb=e=>e&&"__responsive_control__"!==e?`col-${e.replace(Ky,"")}`:"",rb=e=>e?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/\s(id|name)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\son[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""):"",ob=(e,t)=>{const n=t.trim();if(!n||e.has(n))return;const r=Yy(n).replace(/\s+/g," ").trim();e.set(n,{value:n,rawLength:n.length,visibleLength:r.length,longestWordLength:tb(r)})},ib=e=>Array.from(e.values()).sort((e,t)=>t.longestWordLength!==e.longestWordLength?t.longestWordLength-e.longestWordLength:t.visibleLength!==e.visibleLength?t.visibleLength-e.visibleLength:t.rawLength-e.rawLength).slice(0,12).map(e=>e.value),sb=e=>e.nodeType===Node.ELEMENT_NODE&&(e.matches('a[rel~="tag"]')||e.matches("span[data-slug]")),ab=e=>{const t=e.cloneNode(!0);var n;return[...(n=t).matches(".combined-column")?[n]:[],...Array.from(n.querySelectorAll(".combined-column"))].forEach(e=>{const t=Array.from(e.childNodes);if(t.filter(sb).length<2)return;const n=document.createDocumentFragment();let r=0;for(;r<t.length;){const e=t[r];if(!sb(e)){n.appendChild(e),r++;continue}const o=document.createElement("span");for(o.className="taxonomy-term-group",o.appendChild(e),r++;r<t.length&&!sb(t[r]);)o.appendChild(t[r]),r++;n.appendChild(o)}e.appendChild(n)}),t.outerHTML},lb=e=>{const t=e.trim();if(!t||!t.includes("combined-column"))return[];const n=document.createElement("template");n.innerHTML=rb(t);const r=Array.from(n.content.querySelectorAll(".combined-column-block"));return(r.length>0?r:Array.from(n.content.querySelectorAll(".combined-column"))).map(ab).filter(Boolean)},cb=e=>lb(e).length>0,ub=e=>"number"==typeof e||"string"==typeof e&&e.endsWith("px"),db=e=>{const t=new Set,n=[];return e.forEach(e=>{t.has(e.id)||(t.add(e.id),n.push(e))}),n},fb=e=>!1!==e.visible&&!e.responsive?.never,pb=({columnsToMeasure:e,htmlColumnIds:t,htmlMeasureCandidates:n,textMeasureContent:r,pixelColumnIds:o,contentLineColumnIds:i,suppressContentLineHeaders:s=!1,mode:a,constrainedWidth:l})=>{const c=document.createElement("table");c.className=`data-table measurement-table measurement-table--${a}`,c.style.cssText="legacyFit"===a?"table-layout: auto; width: 100%; max-width: 100%;":"table-layout: auto; width: auto; max-width: none;";const u=document.createElement("thead"),d=document.createElement("tr");e.forEach(e=>{const t=document.createElement("th"),n=nb(e.id),r=s&&i.has(e.id),o=r?"":String(e.header||""),a=!1!==e.sortable&&!r;if(t.className=["table-header-cell",n].filter(Boolean).join(" "),t.setAttribute("data-column-id",e.id),a){const e=document.createElement("div");e.className="table-header-cell-wrapper";const n=document.createElement("div");n.className="table-header-content clickable";const r=document.createElement("span");r.className="table-header-label",r.textContent=o,n.appendChild(r);const i=document.createElement("div");i.className="header-menu";const s=document.createElement("button");s.type="button",s.className="header-menu-trigger header-menu-trigger-indicator-only",s.tabIndex=-1,s.setAttribute("aria-hidden","true"),s.appendChild((()=>{const e=document.createElementNS(Qy,"svg");return e.setAttribute("width","14"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 14 14"),e.setAttribute("fill","none"),e.setAttribute("class","header-menu-icon header-menu-icon-none"),e.setAttribute("aria-hidden","true"),[{x:"1",y:"2.75",width:"12"},{x:"3",y:"6.25",width:"8"},{x:"5",y:"9.75",width:"4"}].forEach(t=>{const n=document.createElementNS(Qy,"rect");n.setAttribute("x",t.x),n.setAttribute("y",t.y),n.setAttribute("width",t.width),n.setAttribute("height","1.5"),n.setAttribute("rx","0.75"),n.setAttribute("fill","currentColor"),e.appendChild(n)}),e})()),i.appendChild(s),e.appendChild(n),e.appendChild(i),t.appendChild(e)}else t.textContent=o;d.appendChild(t)}),u.appendChild(d),c.appendChild(u);const f=document.createElement("tbody"),p=e.reduce((e,r)=>{if(!t.has(r.id))return e;const o=n[r.id]?.length||1;return Math.max(e,o)},1);for(let i=0;i<p;i++){const s=document.createElement("tr");s.className="table-row measurement-row",e.forEach(e=>{const l=document.createElement("td"),c=nb(e.id);l.className=["table-cell",c].filter(Boolean).join(" "),l.setAttribute("data-column-id",e.id);const u=document.createElement("div");if(u.className="cell-content","responsiveFit"!==a&&o.has(e.id)&&"button"!==e.dataType){let t=0;"image"===e.dataType&&e.imageSize?.width?t=e.imageSize.width:"number"==typeof e.width?t=e.width:"string"==typeof e.width&&e.width.endsWith("px")&&(t=parseFloat(e.width.slice(0,-2)));const n=document.createElement("div");n.style.cssText=`width: ${t}px; height: ${t}px; display: inline-block;`,u.appendChild(n)}else if("responsiveFit"===a&&"image"===e.dataType&&e.imageSize?.width){const t=document.createElement("div");t.style.cssText=`width: ${e.imageSize.width}px; height: ${e.imageSize.height??e.imageSize.width}px; display: inline-block;`,u.appendChild(t)}else if(t.has(e.id)){const t=n[e.id]||[],r=t[i]??t[0]??"";u.innerHTML=rb(r)}else u.textContent=r[e.id]||"";l.appendChild(u),s.appendChild(l)}),f.appendChild(s)}if(c.appendChild(f),"legacyFit"===a){const e=document.createElement("div");return e.style.cssText=`width: ${l??0}px; max-width: ${l??0}px;`,e.appendChild(c),{hostNode:e,table:c}}return{hostNode:c,table:c}},hb=(e,t)=>{const n={},r={},o=new Set,i=e.querySelectorAll("th[data-column-id]"),s=e.querySelectorAll("td[data-column-id]");i.forEach(e=>{const t=e.getAttribute("data-column-id");if(!t)return;const o=e.getBoundingClientRect().width;r[t]=Math.max(r[t]||0,(e=>{const t=getComputedStyle(e),n=Jy(t.paddingLeft)+Jy(t.paddingRight),r=e.querySelector(".table-header-cell-wrapper"),o=(e=>{const t=e.textContent||"";if(0===t.trim().length)return 0;const n=document.createElement("span"),r=getComputedStyle(e);n.textContent=t,n.style.position="absolute",n.style.visibility="hidden",n.style.pointerEvents="none",n.style.whiteSpace="nowrap",n.style.overflowWrap="normal",n.style.wordBreak="normal",n.style.display="inline-block",n.style.width="auto",n.style.maxWidth="none",n.style.font=r.font,n.style.letterSpacing=r.letterSpacing,n.style.textTransform=r.textTransform,document.body.appendChild(n);const o=n.getBoundingClientRect().width;return n.remove(),o})((r||e).querySelector(".table-header-label")||e);if(o<=0)return 0;const i=r?.querySelector(".header-menu"),s=r?.querySelector(".header-menu-trigger"),a=Math.max(i?.getBoundingClientRect().width||0,s?.getBoundingClientRect().width||0),l=r?getComputedStyle(r):null,c=r&&a>0?Jy(l?.columnGap||l?.gap||"0"):0;return Math.ceil(o+a+c+n)})(e)),n[t]=Math.max(n[t]||0,o)}),s.forEach(e=>{const r=e.getAttribute("data-column-id");if(!r)return;if("responsiveFit"===t)return;if("natural"===t){const t=(e=>{const t=e.getBoundingClientRect();if(t.width<=0)return{requiredWidth:0,shouldAvoidExpansion:!1};let n=t.left,r=t.right;e.querySelectorAll("*").forEach(e=>{const t=getComputedStyle(e);if("none"===t.display||"hidden"===t.visibility)return;const o=e.getBoundingClientRect();o.width<=0||o.height<=0||(n=Math.min(n,o.left),r=Math.max(r,o.right))});const o=Math.max(0,t.left-n),i=Math.max(0,r-t.right),s=Xy(e),a=null!==e.querySelector("button, a.button"),l=null!==e.querySelector('.multi-cart-check, .wpt-multi-checkbox, input[type="checkbox"]');return{requiredWidth:t.width+o+i+s,shouldAvoidExpansion:a&&l}})(e),i=t.requiredWidth;return n[r]=Math.max(n[r]||0,i),void(t.shouldAvoidExpansion&&o.add(r))}const i=e.getBoundingClientRect().width;n[r]=Math.max(n[r]||0,i)});let a=24;if("natural"===t){const e=s[0];if(e){const t=getComputedStyle(e);a=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)}}const l=e.offsetWidth,c=Object.values(n).reduce((e,t)=>e+t,0),u=Math.max(0,l-c);return{widths:n,headerIntrinsicWidths:r,cellPadding:a,borderOverhead:u,noExpandColumnIds:o}};function gb(e,t,n,r){const[o,i]=ae({}),[s,a]=ae({}),[l,c]=ae({}),[u,d]=ae({}),[f,p]=ae(24),[h,g]=ae(0),[m,v]=ae(!1),[y,b]=ae(new Set),w=de(0),_=pe(()=>{const t=new Set;return e.forEach(e=>{"button"===e.dataType&&t.add(e.id)}),t},[e]),x=de(!1),S=de({}),C=de({}),E=pe(()=>e.map(e=>`${e.id}:${e.width??"auto"}:${e.imageSize?.width??""}`).join("|"),[e]),R=pe(()=>r<=0?0:Math.max(10,10*Math.round(r/10)),[r]),I=de(E);return ue(()=>{E!==I.current&&(x.current=!1,S.current={},C.current={},i({}),a({}),c({}),d({}),b(new Set),v(!1),I.current=E)},[E]),ue(()=>{if(0===t.length)return void v(!0);if(!n.current||0===r||0===R)return;const o=`${E}:${R}`,s=S.current[o],l=C.current[o],u=!x.current;if(!u&&s&&l)return c(s),d(l),void v(!0);u&&v(!1);const f=e.filter(e=>{const t=e.width;return!t||"auto"===t||!ub(t)&&!(e=>"string"==typeof e&&e.endsWith("%"))(t)}),h=e.filter(e=>ub(e.width)),m=e.filter(fb),y=db([...f,...h]),_=db([...y,...m]),I=new Set(h.map(e=>e.id));if(0===y.length&&0===m.length){u&&(i({}),a({}),b(new Set),x.current=!0);const e=s||{};return s||(S.current[o]=e),l||(C.current[o]=e),c(e),d(l||e),void v(!0)}const P={},k={},O=new Set,M=new Set(_.filter(e=>"html"===e.dataType||"button"===e.dataType).map(e=>e.id));_.forEach(e=>{const n=e.accessor||e.id;if(M.has(e.id)){const o=[];t.forEach(e=>{const t=(e=>null==e?null:eb(e)?(e=>{if(!eb(e)||0===e.items.length)return null;const t=String(e.separator??", ").replace(/\s+$/,"");return e.items.map((n,r)=>{const o=(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"))(String(n.name??""));return o?`<span class="taxonomy-term-group"><span>${o}</span>${r===e.items.length-1?"":`<span class="taxonomy-separator">${rb(t)}</span> `}</span>`:""}).join("")})(e):"object"==typeof e?null:String(e))(e[n]);null!==t&&o.push(t)});const i=(r=e,"combined-column"===r.metadata?.measurement||o.some(cb)),s=i?(e=>{const t=new Map;return e.forEach(e=>{lb(e).forEach(e=>{ob(t,e)})}),ib(t)})(o):[],a=s.length>0?s:(e=>{const t=new Map;return e.forEach(e=>{ob(t,e)}),ib(t)})(o);return i&&O.add(e.id),void(k[e.id]=a.length>0?a:[i?"":String(e.header||"Column")])}var r;let o=0,i="";const s=String(e.header||"");s.length>o&&(o=s.length,i=s),t.forEach(e=>{const t=(e=>{if(null==e)return"";if(eb(e)){const t=Yy(String(e.separator??", ")).replace(/\s+$/,""),n=t?`${t} `:" ";return e.items.map(e=>String(e.name??"")).filter(Boolean).join(n)}return"object"==typeof e?"[object]":Yy(String(e))})(e[n]);t.length>o&&(o=t.length,i=t)}),P[e.id]=i||e.header||"Column"});const T=document.createElement("div");T.style.cssText="position: absolute; visibility: hidden; pointer-events: none; z-index: -1000; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clear: both;",T.className="barn2-dataview measurement-wrapper";let A=null;if(u&&y.length>0){const e=pb({columnsToMeasure:y,htmlColumnIds:M,htmlMeasureCandidates:k,textMeasureContent:P,pixelColumnIds:I,contentLineColumnIds:O,mode:"natural"});A=e.table,T.appendChild(e.hostNode)}let F=null;if(!s&&y.length>0){const e=pb({columnsToMeasure:y,htmlColumnIds:M,htmlMeasureCandidates:k,textMeasureContent:P,pixelColumnIds:I,contentLineColumnIds:O,mode:"legacyFit",constrainedWidth:R});F=e.table,T.appendChild(e.hostNode)}let N=null;if(!l&&m.length>0){const e=pb({columnsToMeasure:m,htmlColumnIds:M,htmlMeasureCandidates:k,textMeasureContent:P,pixelColumnIds:I,contentLineColumnIds:O,mode:"responsiveFit"});N=e.table,T.appendChild(e.hostNode)}const z=++w.current;return n.current.appendChild(T),requestAnimationFrame(()=>{if(z===w.current)try{if(u){if(A){const e=hb(A,"natural");i(e.widths),a(e.headerIntrinsicWidths),b(e.noExpandColumnIds),p(e.cellPadding),g(e.borderOverhead)}else i({}),a({}),b(new Set);x.current=!0}let e=s||{};s||(F&&(e=hb(F,"legacyFit").widths),S.current[o]=e);let t=l||e;l||(N&&(t=((e,t)=>{const n={...e.headerIntrinsicWidths};return t.forEach(t=>{if("image"!==t.dataType&&"button"!==t.dataType)return;const r=e.widths[t.id]||0;r>0&&(n[t.id]=Math.max(n[t.id]||0,r))}),n})(hb(N,"responsiveFit"),m)),C.current[o]=t),!s&&O.size>0&&Object.keys(e).length>0&&(e=((e,t,n)=>{const r={...e};let o=0;if(t.forEach(e=>{r[e]>0&&(r[e]+=48,o+=48)}),o<=0)return r;const i=Object.keys(r).filter(e=>!t.has(e)&&!n.has(e)&&r[e]>50);let s=o;for(;s>.01&&i.length>0;){const e=i.map(e=>({columnId:e,capacity:Math.max(0,r[e]-50)})),t=e.reduce((e,t)=>e+t.capacity,0);if(t<=0)break;let n=0;if(e.forEach(({columnId:e,capacity:o})=>{if(o<=0)return;const i=Math.min(o,s*o/t);r[e]-=i,n+=i}),n<=0)break;s-=n}return r})(e,O,I),S.current[o]=e),c(e),d(t)}catch{const e=s||{},t=l||e;u&&(x.current=!0),S.current[o]=e,C.current[o]=t,c(e),d(t)}finally{T.remove(),v(!0)}else T.remove()}),()=>{T.parentNode&&T.remove()}},[e,t,n,r,R,E,o]),{naturalWidths:o,headerIntrinsicWidths:s,legacyFitWidths:l,responsiveFitWidths:u,cellPadding:f,borderOverhead:h,ready:m,noExpandColumnIds:pe(()=>0===_.size?y:0===y.size?_:new Set([...y,..._]),[y,_])}}const mb=50;function vb(e,t,n,r,o=24,i=0){const s=t-i,a=he(e=>{if("image"===e.dataType&&e.imageSize?.width)return{type:"pixel",value:e.imageSize.width+o};const t=e.width;return t&&"auto"!==t?"number"==typeof t?{type:"pixel",value:t}:"string"==typeof t&&t.endsWith("%")?{type:"percentage",value:parseFloat(t.slice(0,-1))}:"string"==typeof t&&t.endsWith("px")?{type:"pixel",value:parseFloat(t.slice(0,-2))}:{type:"auto",value:0}:{type:"auto",value:0}},[o]),l=he(e=>Math.max(0,n?.[e]||0),[n]),c=he(e=>Math.max(mb,l(e)),[l]),u=he(e=>Math.min(c(e),120),[c]),d=he(e=>"__responsive_control__"!==e.id&&!r?.has(e.id)&&"button"!==e.dataType&&"image"!==e.dataType,[r]),f=he(e=>"__responsive_control__"!==e.id,[]),p=he(e=>{if("__responsive_control__"===e.id)return e.parsedWidth.value||mb;if("button"===e.dataType||"image"===e.dataType||r?.has(e.id)){const t=l(e.id);return t>0&&"pixel"===e.parsedWidth.type?Math.min(e.parsedWidth.value,t):"pixel"===e.parsedWidth.type?e.parsedWidth.value:mb}return mb},[l,r]),h=he((e,t)=>{const n={};if(0===e.length||t<=0)return n;const r=e.map(e=>({id:e.id,weight:c(e.id)})),o=r.reduce((e,t)=>e+t.weight,0);return r.forEach(r=>{n[r.id]=o>0?t*r.weight/o:t/e.length}),n},[c]),g=he((e,t)=>{const n={};if(0===e.length||t<=0)return n;const r=e.map(e=>({id:e.id,minimum:u(e.id),weight:c(e.id)})),o=r.reduce((e,t)=>e+t.minimum,0);if(o>=t){const o=r.reduce((e,t)=>e+t.minimum,0);return r.forEach(r=>{n[r.id]=o>0?t*r.minimum/o:t/e.length}),n}r.forEach(e=>{n[e.id]=e.minimum});const i=t-o,s=r.reduce((e,t)=>e+t.weight,0);return r.forEach(t=>{const r=s>0?t.weight/s:1/e.length;n[t.id]+=i*r}),n},[u,c]),m=he((e,t,n)=>{const r=e.reduce((e,n)=>e+(t[n.id]||0),0);if(r<=n+.5)return t;const o={...t};let i=r-n,s=e.filter(f).map(e=>({id:e.id,capacity:Math.max(0,(o[e.id]||0)-p(e))})).filter(e=>e.capacity>0);for(;i>.5&&s.length>0;){const e=s.reduce((e,t)=>e+t.capacity,0);if(e<=0)break;let t=0;if(s=s.map(n=>{const r=Math.min(n.capacity,i*n.capacity/e);return o[n.id]-=r,t+=r,{...n,capacity:n.capacity-r}}).filter(e=>e.capacity>.5),t<=0)break;i-=t}return o},[f,p]),v=he((e,t,n)=>{const r=e.reduce((e,n)=>e+(t[n.id]||0),0);if(r<=0||Math.abs(r-n)<=.5)return t;const o={...t};if(r<n){const t=e.filter(d);if(0===t.length)return o;const i=n-r,s=t.reduce((e,t)=>e+Math.max(mb,o[t.id]||0),0);return t.forEach(e=>{const n=Math.max(mb,o[e.id]||0),r=s>0?n/s:1/t.length;o[e.id]=(o[e.id]||0)+i*r}),o}return m(e,o,n)},[d,m]),y=he(t=>{if(!t||0===e.length)return{};const n=e.map(e=>({...e,parsedWidth:a(e)})),r=n.some(e=>"percentage"===e.parsedWidth.type),o=n.some(e=>"pixel"===e.parsedWidth.type),i=n.filter(e=>"auto"===e.parsedWidth.type),s=n.filter(e=>"pixel"===e.parsedWidth.type),l=n.filter(e=>"percentage"===e.parsedWidth.type),c=l.reduce((e,t)=>e+t.parsedWidth.value,0);if(!r&&!o)return h(n,t);if(r){const e={};let r=0;s.forEach(t=>{e[t.id]=t.parsedWidth.value,r+=t.parsedWidth.value});const a=i.reduce((e,t)=>e+u(t.id),0),d=s.reduce((e,t)=>e+p(t),0),f=t*c/100,h=Math.max(0,t-d-a);let y=f;if(o||0!==i.length?f>h&&(y=h):y=t,c>0&&l.forEach(t=>{e[t.id]=y*t.parsedWidth.value/c}),s.length>0){const n=Math.max(0,t-y-a);r>n&&Object.assign(e,m(s,e,n))}if(i.length>0){const n=Math.max(0,t-Object.values(e).reduce((e,t)=>e+t,0)),r=g(i,n);Object.assign(e,r)}return v(n,e,t)}if(o){const e={};let r=0;if(s.forEach(t=>{e[t.id]=t.parsedWidth.value,r+=t.parsedWidth.value}),i.length>0){const n=Math.max(0,t-r),o=g(i,n);Object.assign(e,o)}return v(n,e,t)}return{}},[e,a,h,u,g,v]);return{widths:pe(()=>y(s),[s,y]),tableWidth:s}}const yb={desktop:1/0,"tablet-l":1024,"tablet-p":768,"mobile-l":480,"mobile-p":320},bb=(e,t)=>{const n=Object.entries(t).sort((e,t)=>e[1]-t[1]);for(const[t,r]of n)if(e<=r)return t;return"desktop"},wb=e=>e.trim().toLowerCase().replace(/_/g,"-"),_b=e=>e?(e=>{const t=[];for(const n of e){const e=n.match(/^not-(.+)$/),r=n.match(/^min-(.+)$/),o=n.match(/^max-(.+)$/);if(e){const r=e[1];"tablet"===r?t.push("not-tablet-l","not-tablet-p"):"mobile"===r?t.push("not-mobile-l","not-mobile-p"):t.push(n)}else if(r){const e=r[1];"tablet"===e?t.push("min-tablet-p"):"mobile"===e?t.push("min-mobile-p"):t.push(n)}else if(o){const e=o[1];"tablet"===e?t.push("max-tablet-l"):"mobile"===e?t.push("max-mobile-l"):t.push(n)}else"tablet"===n?t.push("tablet-l","tablet-p"):"mobile"===n?t.push("mobile-l","mobile-p"):t.push(n)}return t})((Array.isArray(e)?e.flatMap(e=>String(e).split(/[\s,]+/)):e.split(/[\s,]+/)).map(wb).filter(Boolean).filter(e=>"default"!==e)):[],xb=(e,t,n)=>{if(0===e.length)return null;if(e.includes("never"))return"never";if(e.includes("all"))return!0;if(e.includes("none"))return!1;const r=(e=>Object.entries(e).sort((e,t)=>e[1]-t[1]).map(([e])=>e))(n),o=r.indexOf(t);for(const n of e)if(n.startsWith("not-")&&n.slice(4)===t)return!1;for(const t of e)if(t.startsWith("min-")){const e=t.slice(4);if(o>=r.indexOf(e))return!0}for(const t of e)if(t.startsWith("max-")){const e=t.slice(4);if(o<=r.indexOf(e))return!0}return!!e.some(e=>r.includes(e)&&e===t)||!e.some(e=>r.includes(e)||e.startsWith("not-")||e.startsWith("min-")||e.startsWith("max-"))},Sb=(e,t,n,r,o=100)=>{const i=r[e];if(i&&i>0)return i;const s=t.width;if("number"==typeof s||"string"==typeof s&&(s.endsWith("px")||s.endsWith("%")))return o;const a=n[e];return a&&a>0?Math.max(a,o):o},Cb=(e,t,n,r,o,i={})=>{const s=new Set,a=new Set,l=new Set,c=[];for(const n of e){if(n.responsive?.never){l.add(n.id);continue}const e=_b(n.responsive?.breakpoints),r=xb(e,t,o);"never"===r?l.add(n.id):null===r?c.push(n):!0===r?s.add(n.id):a.add(n.id)}if(c.length>0){let t=0;for(const n of s){const o=e.find(e=>e.id===n);t+=o?Sb(n,o,r,i,100):i[n]||r[n]||100}const o=((e,t,n,r={})=>{const o=(e=>e.map(e=>({...e,priority:e.column.responsive?.priority??1e4+e.index})).sort((e,t)=>e.priority!==t.priority?e.priority-t.priority:e.index-t.index))(e.map((e,t)=>({column:e,index:t}))),i=new Set;let s=0;for(const{column:e}of o){const o=Sb(e.id,e,n,r,100);if(!(s+o<=t))break;i.add(e.id),s+=o}return 0===i.size&&o.length>0&&i.add(o[0].column.id),i})(c,n-t,r,i);for(const e of c)o.has(e.id)?s.add(e.id):a.add(e.id)}return{visibleColumns:s,hiddenColumns:a,neverColumns:l}},Eb=()=>"undefined"==typeof window?1024:window.innerWidth||document.documentElement.clientWidth,Rb=(e,t)=>{const n="undefined"==typeof window?"":window.location.hash.replace(/^#/,""),r=new URLSearchParams(n);r.delete("page"),r.set(`_${e}`,String(t));const o=r.toString();return"undefined"==typeof window?o?`#${o}`:"#":`${window.location.pathname}${window.location.search}${o?`#${o}`:""}`},Ib=e=>{if(!e)return[];const t=String(e);return t.includes(", ")?t.split(", ").map(e=>e.trim()):t.includes(",")?t.split(",").map(e=>e.trim()):t.includes(" | ")?t.split(" | ").map(e=>e.trim()):t.includes("|")?t.split("|").map(e=>e.trim()):t.includes("; ")?t.split("; ").map(e=>e.trim()):t.includes(";")?t.split(";").map(e=>e.trim()):[t.trim()]},Pb=({value:e,filterOptions:t,filterId:n,onFilterClick:r,valueParser:o,currentFilterValue:i})=>{const{i18n:s}=Lr(),a=pe(()=>(o||Ib)(e),[e,o]),l=pe(()=>(e=>{const t=[],n=e=>{e.forEach(e=>{t.push(e),e.children&&n(e.children)})};return n(e),t})(t),[t]),c=pe(()=>{const e=new Map;return l.forEach(t=>{e.set(t.label.toLowerCase(),t.value)}),e},[l]),u=pe(()=>{if(!i)return new Set;const e=Array.isArray(i)?i:[i];return new Set(e)},[i]),d=e=>{const t=e.toLowerCase(),n=c.get(t);return void 0!==n?n:null},f=e=>u.has(e);if(1===a.length){const e=a[0],t=d(e);return null===t||f(t)?yr(x,{children:e}):yr("a",{href:Rb(n,t),className:"clickable-filter-term",onClick:e=>{e.preventDefault(),r(t)},"aria-label":s.filterByTerm({term:e}),children:e})}return yr(x,{children:a.map((e,t)=>{const o=d(e),i=t===a.length-1;return yr(x,null!==o?f(o)?{children:[yr("span",{children:e}),!i&&yr("span",{children:", "})]}:{children:[yr("a",{href:Rb(n,o),className:"clickable-filter-term",onClick:e=>{e.preventDefault(),r(o)},"aria-label":s.filterByTerm({term:e}),children:e}),!i&&yr("span",{children:", "})]}:{children:[yr("span",{children:e}),!i&&yr("span",{children:", "})]},t)})})},kb="carousel",Ob="controller",Mb="portal",Tb="toolbar",Ab="fullscreen",Fb="thumbnails",Nb="loading",zb="error",Lb="complete",Db="flex_center",Vb="no_scroll_padding",$b="slide",jb="prev",qb="next",Hb="swipe",Wb="close",Ub="onPointerDown",Bb="onPointerMove",Gb="onPointerUp",Zb="onPointerLeave",Kb="onPointerCancel",Qb="onKeyDown",Xb="onWheel",Jb="icon",Yb="contain",ew="cover",tw="yarl__";function nw(...e){return[...e].filter(Boolean).join(" ")}function rw(e){return`${tw}${e}`}function ow(e){return`--${tw}${e}`}function iw(e,t){return`${e}${t?`_${t}`:""}`}function sw(e){return t=>iw(e,t)}function aw(e,t){var n;return null!==(n=null==e?void 0:e[t])&&void 0!==n?n:t}function lw(e,t,n){return aw(e,"{index} of {total}").replace(/\{index}/g,`${mw(n,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function cw(...e){return()=>{e.forEach(e=>{e()})}}function uw(e,t,n){return()=>{const r=ge(n);if(!r)throw new Error(`${e} must be used within a ${t}.Provider`);return r}}function dw(){return"undefined"!=typeof window}function fw(e){return void 0===e.type||"image"===e.type}function pw(e){return"string"==typeof e?Number.parseInt(e,10):e}function hw(e){if("number"==typeof e)return{pixel:e};if("string"==typeof e){const t=pw(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function gw(e,t){const n=hw(t),r=void 0!==n.percent?e.width/100*n.percent:n.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function mw(e,t){return t>0?(e%t+t)%t:0}function vw(e){return e.length>0}function yw(e,t){return e[mw(t,e.length)]}function bw(e,t){return vw(e)?yw(e,t):void 0}function ww(e){return fw(e)?e.src:void 0}function _w(e,t,n){if(!n)return e;const{buttons:r,...o}=e,i=r.findIndex(e=>e===t),s=yt(n)?_n(n,{key:t},null):n;if(i>=0){const e=[...r];return e.splice(i,1,s),{buttons:e,...o}}return{buttons:[s,...r],...o}}const xw=Number(mt.split(".")[0])>=19,Sw={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[Wb]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:Yb,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Cw(e,t){return{name:e,component:t}}function Ew(e,t){return{module:e,children:t}}function Rw(e,t,n){return e.module.name===t?n(e):e.children?[Ew(e.module,e.children.flatMap(e=>{var r;return null!==(r=Rw(e,t,n))&&void 0!==r?r:[]}))]:[e]}function Iw(e,t,n){return e.flatMap(e=>{var r;return null!==(r=Rw(e,t,n))&&void 0!==r?r:[]})}const Pw=B(null),kw=uw("useA11yContext","A11yContext",Pw);function Ow({children:e}){const[t,n]=ae(!1),[r,o]=ae(!1),i=pe(()=>({focusWithin:t,trackFocusWithin:(e,t)=>{const r=r=>o=>{var i;o.currentTarget.contains(o.relatedTarget)||n(r),null===(i=r?e:t)||void 0===i||i(o)};return{onFocus:r(!0),onBlur:r(!1)}},autoPlaying:r,setAutoPlaying:o}),[t,r]);return b(Pw.Provider,{value:i},e)}const Mw=B(null),Tw=uw("useDocument","DocumentContext",Mw);function Aw({nodeRef:e,children:t}){const n=pe(()=>{const t=t=>{var n;return(null===(n=t||e.current)||void 0===n?void 0:n.ownerDocument)||document};return{getOwnerDocument:t,getOwnerWindow:e=>{var n;return(null===(n=t(e))||void 0===n?void 0:n.defaultView)||window}}},[e]);return b(Mw.Provider,{value:n},t)}const Fw=B(null),Nw=uw("useEvents","EventsContext",Fw);function zw({children:e}){const[t]=ae({});ce(()=>()=>{Object.keys(t).forEach(e=>delete t[e])},[t]);const n=pe(()=>{const e=(e,n)=>{var r;null===(r=t[e])||void 0===r||r.splice(0,t[e].length,...t[e].filter(e=>e!==n))};return{publish:(...[e,n])=>{var r;null===(r=t[e])||void 0===r||r.forEach(e=>e(n))},subscribe:(n,r)=>(t[n]||(t[n]=[]),t[n].push(r),()=>e(n,r)),unsubscribe:e}},[t]);return b(Fw.Provider,{value:n},e)}const Lw=B(null),Dw=uw("useLightboxProps","LightboxPropsContext",Lw);function Vw({children:e,...t}){return b(Lw.Provider,{value:t},e)}const $w=B(null),jw=uw("useLightboxState","LightboxStateContext",$w),qw=B(null),Hw=uw("useLightboxDispatch","LightboxDispatchContext",qw);function Ww(e,t){switch(t.type){case"swipe":{const{slides:n}=e,r=(null==t?void 0:t.increment)||0,o=e.globalIndex+r,i=mw(o,n.length);return{slides:n,currentIndex:i,globalIndex:o,currentSlide:bw(n,i),animation:r||void 0!==t.duration?{increment:r,duration:t.duration,easing:t.easing}:void 0}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:bw(t.slides,t.index)}:e;default:throw new Error("Unknown action type")}}function Uw({slides:e,index:t,children:n}){const[r,o]=le(Ww,{slides:e,currentIndex:t,globalIndex:t,currentSlide:bw(e,t)});ce(()=>{o({type:"update",slides:e,index:t})},[e,t]);const i=pe(()=>({...r,state:r,dispatch:o}),[r,o]);return b(qw.Provider,{value:o},b($w.Provider,{value:i},n))}const Bw=B(null),Gw=uw("useTimeouts","TimeoutsContext",Bw);function Zw({children:e}){const[t]=ae([]);ce(()=>()=>{t.forEach(e=>window.clearTimeout(e)),t.splice(0,t.length)},[t]);const n=pe(()=>{const e=e=>{t.splice(0,t.length,...t.filter(t=>t!==e))};return{setTimeout:(n,r)=>{const o=window.setTimeout(()=>{e(o),n()},r);return t.push(o),o},clearTimeout:t=>{void 0!==t&&(e(t),window.clearTimeout(t))}}},[t]);return b(Bw.Provider,{value:n},e)}const Kw=Le(function({label:e,className:t,icon:n,renderIcon:r,onClick:o,style:i,...s},a){const{styles:l,labels:c}=Dw(),u=aw(c,e);return b("button",{ref:a,type:"button",title:u,"aria-label":u,className:nw(rw("button"),t),onClick:o,style:{...i,...l.button},...s},r?r():b(n,{className:rw(Jb),style:l.icon}))});function Qw(e,t){return function(e,t){const n=e=>b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...e},t);return n.displayName=e,n}(e,b("g",{fill:"currentColor"},b("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const Xw=Qw("Close",b("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Jw=Qw("Previous",b("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),Yw=Qw("Next",b("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),e_=Qw("Loading",b(x,null,Array.from({length:8}).map((e,t,n)=>b("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(t+1),transform:`rotate(${360/n.length*t}, 12, 12)`})))),t_=Qw("Error",b("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),n_=dw()?ue:ce;function r_(){const[e,t]=ae(!1);return ce(()=>{var e,n;const r=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-reduced-motion: reduce)");t(null==r?void 0:r.matches);const o=e=>t(e.matches);return null===(n=null==r?void 0:r.addEventListener)||void 0===n||n.call(r,"change",o),()=>{var e;return null===(e=null==r?void 0:r.removeEventListener)||void 0===e?void 0:e.call(r,"change",o)}},[]),e}function o_(e,t){const n=de(void 0),r=de(void 0),o=r_();return n_(()=>{var i,s,a;if(e.current&&void 0!==n.current&&!o){const{keyframes:o,duration:l,easing:c,onfinish:u}=t(n.current,e.current.getBoundingClientRect(),function(e){let t=0,n=0,r=0;const o=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(o){const e=o[1].split(",").map(pw);6===e.length?(t=e[4],n=e[5]):16===e.length&&(t=e[12],n=e[13],r=e[14])}return{x:t,y:n,z:r}}(e.current))||{};if(o&&l){null===(i=r.current)||void 0===i||i.cancel(),r.current=void 0;try{r.current=null===(a=(s=e.current).animate)||void 0===a?void 0:a.call(s,o,{duration:l,easing:c})}catch(e){console.error(e)}r.current&&(r.current.onfinish=()=>{r.current=void 0,null==u||u()})}}n.current=void 0}),{prepareAnimation:e=>{n.current=e},isAnimationPlaying:()=>{var e;return"running"===(null===(e=r.current)||void 0===e?void 0:e.playState)}}}function i_(){const e=de(null),t=de(void 0),[n,r]=ae(),o=he(n=>{e.current=n,t.current&&(t.current.disconnect(),t.current=void 0);const o=()=>{if(n){const e=window.getComputedStyle(n),t=e=>parseFloat(e)||0;r({width:Math.round(n.clientWidth-t(e.paddingLeft)-t(e.paddingRight)),height:Math.round(n.clientHeight-t(e.paddingTop)-t(e.paddingBottom))})}else r(void 0)};o(),n&&"undefined"!=typeof ResizeObserver&&(t.current=new ResizeObserver(o),t.current.observe(n))},[]);return{setContainerRef:o,containerRef:e,containerRect:n}}function s_(){const e=de(void 0),{setTimeout:t,clearTimeout:n}=Gw();return he((r,o)=>{n(e.current),e.current=t(r,o>0?o:0)},[t,n])}function a_(e){const t=de(e);return n_(()=>{t.current=e}),he((...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)},[])}function l_(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function c_(e,t){return pe(()=>null==e&&null==t?null:n=>{l_(e,n),l_(t,n)},[e,t])}function u_(e,t=!1){const n=de(!1);return n_(()=>{t&&n.current&&(n.current=!1,e())},[t,e]),{onFocus:he(()=>{n.current=!0},[]),onBlur:he(()=>{n.current=!1},[])}}function d_(){const[e,t]=ae(!1);return n_(()=>{t("rtl"===window.getComputedStyle(window.document.documentElement).direction)},[]),e}function f_(e,t){const n=de(0),r=s_(),o=a_((...t)=>{n.current=Date.now(),e(t)});return he((...e)=>{r(()=>{o(e)},t-(Date.now()-n.current))},[t,o,r])}const p_=sw("slide"),h_=sw("slide_image");function g_({slide:e,offset:t,render:n,rect:r,imageFit:o,imageProps:i,onClick:s,onLoad:a,onError:l,style:c}){var u,d,f,p,h,g,m,v;const[y,w]=ae(Nb),{publish:_}=Nw(),{setTimeout:S}=Gw(),C=de(null);ce(()=>{0===t&&_((e=>`active-slide-${e}`)(y))},[t,y,_]);const E=a_(e=>{("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{e.parentNode&&(w(Lb),S(()=>{null==a||a(e)},0))})}),R=he(e=>{C.current=e,(null==e?void 0:e.complete)&&E(e)},[E]),I=he(e=>{E(e.currentTarget)},[E]),P=a_(()=>{w(zb),null==l||l()}),k=function(e,t){return e.imageFit===ew||e.imageFit!==Yb&&t===ew}(e,o),O=(e,t)=>Number.isFinite(e)?e:t,M=O(Math.max(...(null!==(d=null===(u=e.srcSet)||void 0===u?void 0:u.map(e=>e.width))&&void 0!==d?d:[]).concat(e.width?[e.width]:[]).filter(Boolean)),(null===(f=C.current)||void 0===f?void 0:f.naturalWidth)||0),T=O(Math.max(...(null!==(h=null===(p=e.srcSet)||void 0===p?void 0:p.map(e=>e.height))&&void 0!==h?h:[]).concat(e.height?[e.height]:[]).filter(Boolean)),(null===(g=C.current)||void 0===g?void 0:g.naturalHeight)||0),A=M&&T?{maxWidth:`min(${M}px, 100%)`,maxHeight:`min(${T}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},F=null===(m=e.srcSet)||void 0===m?void 0:m.sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", "),N=F&&r&&dw()?`${Math.round(Math.min(r&&!k&&e.width&&e.height?r.height/e.height*e.width:Number.MAX_VALUE,r.width))}px`:void 0,{style:z,className:L,...D}=i||{};return b(x,null,b("img",{ref:R,onLoad:I,onError:P,onClick:s,draggable:!1,className:nw(rw(h_()),k&&rw(h_("cover")),y!==Lb&&rw(h_("loading")),L),style:{...A,...c,...z},...D,alt:null!==(v=e.alt)&&void 0!==v?v:"",sizes:N,srcSet:F,src:e.src}),y!==Lb&&b("div",{className:rw(p_("placeholder"))},y===Nb&&((null==n?void 0:n.iconLoading)?n.iconLoading():b(e_,{className:nw(rw(Jb),rw(p_(Nb)))})),y===zb&&((null==n?void 0:n.iconError)?n.iconError():b(t_,{className:nw(rw(Jb),rw(p_(zb)))}))))}const m_=Le(function({className:e,children:t,onFocus:n,onBlur:r,...o},i){const s=de(null),{trackFocusWithin:a}=kw();return b(Aw,{nodeRef:s},b("div",{ref:c_(i,s),className:nw(rw("root"),e),...a(n,r),...o},t))});var v_,y_;!function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"}(v_||(v_={})),function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"}(y_||(y_={}));const b_=sw("container"),w_=B(null),x_=uw("useController","ControllerContext",w_),S_=Cw(Ob,function({children:e,...t}){var n;const{carousel:r,animation:o,controller:i,on:s,styles:a,render:l}=t,{closeOnPullUp:c,closeOnPullDown:u,preventDefaultWheelX:d,preventDefaultWheelY:f}=i,[p,h]=ae(),g=jw(),m=Hw(),[v,y]=ae(v_.NONE),w=de(0),_=de(0),x=de(1),{registerSensors:S,subscribeSensors:C}=function(){const[e]=ae({}),t=he((t,n)=>{var r;null===(r=e[t])||void 0===r||r.forEach(e=>{n.isPropagationStopped()||e(n)})},[e]);return{registerSensors:pe(()=>({onPointerDown:e=>t(Ub,e),onPointerMove:e=>t(Bb,e),onPointerUp:e=>t(Gb,e),onPointerLeave:e=>t(Zb,e),onPointerCancel:e=>t(Kb,e),onKeyDown:e=>t(Qb,e),onKeyUp:e=>t("onKeyUp",e),onWheel:e=>t(Xb,e)}),[t]),subscribeSensors:he((t,n)=>(e[t]||(e[t]=[]),e[t].unshift(n),()=>{const r=e[t];r&&r.splice(0,r.length,...r.filter(e=>e!==n))}),[e])}}(),{subscribe:E,publish:R}=Nw(),I=s_(),P=s_(),k=s_(),{containerRef:O,setContainerRef:M,containerRect:T}=i_(),A=c_(function({preventDefaultWheelX:e,preventDefaultWheelY:t}){const n=de(null),r=a_(n=>{const r=Math.abs(n.deltaX)>Math.abs(n.deltaY);(r&&e||!r&&t||n.ctrlKey)&&n.preventDefault()});return he(e=>{var t;e?e.addEventListener("wheel",r,{passive:!1}):null===(t=n.current)||void 0===t||t.removeEventListener("wheel",r),n.current=e},[r])}({preventDefaultWheelX:d,preventDefaultWheelY:f}),M),F=de(null),N=c_(F,void 0),{getOwnerDocument:z}=Tw(),L=d_(),D=e=>(L?-1:1)*("number"==typeof e?e:1),V=a_(()=>{var e;return null===(e=O.current)||void 0===e?void 0:e.focus()}),$=a_(()=>t),j=a_(()=>g),q=he(e=>R(jb,e),[R]),H=he(e=>R(qb,e),[R]),W=he(()=>R(Wb),[R]),U=e=>!(r.finite&&(D(e)>0&&0===g.currentIndex||D(e)<0&&g.currentIndex===g.slides.length-1)),B=e=>{var t;w.current=e,null===(t=O.current)||void 0===t||t.style.setProperty(ow("swipe_offset"),`${Math.round(e)}px`)},G=e=>{var t,n;_.current=e,x.current=(()=>{const t=u&&e>0?e:c&&e<0?-e:0;return Math.min(Math.max(function(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}(1-t/60*.5,2),.5),1)})(),null===(t=O.current)||void 0===t||t.style.setProperty(ow("pull_offset"),`${Math.round(e)}px`),null===(n=O.current)||void 0===n||n.style.setProperty(ow("pull_opacity"),`${x.current}`)},{prepareAnimation:Z}=o_(F,(e,t,n)=>{if(F.current&&T)return{keyframes:[{transform:`translate(0, ${e.rect.y-t.y+n.y}px)`,opacity:e.opacity},{transform:"translate(0, 0)",opacity:1}],duration:e.duration,easing:o.easing.fade}}),K=(e,t)=>{if(c||u){G(e);let n=0;F.current&&(n=o.fade*(t?2:1),Z({rect:F.current.getBoundingClientRect(),opacity:x.current,duration:n})),k(()=>{G(0),y(v_.NONE)},n),y(v_.ANIMATION),t||W()}},{prepareAnimation:Q,isAnimationPlaying:X}=o_(F,(e,t,n)=>{var o;if(F.current&&T&&(null===(o=g.animation)||void 0===o?void 0:o.duration)){const o=hw(r.spacing),i=(o.percent?o.percent*T.width/100:o.pixel)||0;return{keyframes:[{transform:`translate(${D(g.globalIndex-e.index)*(T.width+i)+e.rect.x-t.x+n.x}px, 0)`},{transform:"translate(0, 0)"}],duration:g.animation.duration,easing:g.animation.easing}}}),J=a_(e=>{var t,n;const r=e.offset||0,i=r?o.swipe:null!==(t=o.navigation)&&void 0!==t?t:o.swipe,s=r||X()?o.easing.swipe:o.easing.navigation;let{direction:a}=e;const l=null!==(n=e.count)&&void 0!==n?n:1;let c=v_.ANIMATION,u=i*l;if(!a){const t=null==T?void 0:T.width,n=e.duration||0,o=t?i/t*Math.abs(r):i;0!==l?(n<o?u=u/o*Math.max(n,o/5):t&&(u=i/t*(t-Math.abs(r))),a=D(r)>0?jb:qb):u=i/2}let d=0;a===jb?U(D(1))?d=-l:(c=v_.NONE,u=i):a===qb&&(U(D(-1))?d=l:(c=v_.NONE,u=i)),u=Math.round(u),P(()=>{B(0),y(v_.NONE)},u),F.current&&Q({rect:F.current.getBoundingClientRect(),index:g.globalIndex}),y(c),R(Hb,{type:"swipe",increment:d,duration:u,easing:s})});ce(()=>{var e,t;(null===(e=g.animation)||void 0===e?void 0:e.increment)&&(null===(t=g.animation)||void 0===t?void 0:t.duration)&&I(()=>m({type:"swipe",increment:0}),g.animation.duration)},[g.animation,m,I]);const Y=[C,U,(null==T?void 0:T.width)||0,o.swipe,()=>y(v_.SWIPE),e=>B(e),(e,t)=>J({offset:e,duration:t,count:1}),e=>J({offset:e,count:0})],ee=[()=>{u&&y(v_.PULL)},e=>G(e),e=>K(e),e=>K(e,!0)];(function({disableSwipeNavigation:e,closeOnBackdropClick:t},n,r,o,i,s,a,l,c,u,d,f,p,h,g,m){const v=de(0),y=de([]),b=de(void 0),w=de(0),_=de(y_.NONE),x=he(e=>{b.current===e.pointerId&&(b.current=void 0,_.current=y_.NONE);const t=y.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),S=he(e=>{x(e),e.persist(),y.current.push(e)},[x]),C=he(e=>y.current.find(({pointerId:t})=>e.pointerId===t),[]),E=a_(e=>{S(e)}),R=(e,t)=>d&&e>t||u&&e<-t,I=a_(e=>{const n=C(e);if(n)if(b.current===e.pointerId){const e=Date.now()-w.current,t=v.current;_.current===y_.SWIPE?Math.abs(t)>.3*o||Math.abs(t)>5&&e<i?l(t,e):c(t):_.current===y_.PULL&&(R(t,60)?h(t,e):g(t)),v.current=0,_.current=y_.NONE}else{const{target:r}=e;t&&r instanceof HTMLElement&&r===n.target&&(r.classList.contains(rw($b))||r.classList.contains(rw("slide_wrapper")))&&m()}x(e)});!function(e,t,n,r){ce(()=>cw(e(Ub,t),e(Bb,n),e(Gb,r),e(Zb,r),e(Kb,r)),[e,t,n,r,void 0])}(n,E,a_(t=>{const n=C(t);if(n){const o=b.current===t.pointerId;if(0===t.buttons)return void(o&&0!==v.current?I(t):x(n));const i=t.clientX-n.clientX,l=t.clientY-n.clientY;if(void 0===b.current){const n=e=>{S(t),b.current=t.pointerId,w.current=Date.now(),_.current=e};Math.abs(i)>Math.abs(l)&&Math.abs(i)>30&&r(i)?e||(n(y_.SWIPE),s()):Math.abs(l)>Math.abs(i)&&R(l,30)&&(n(y_.PULL),f())}else o&&(_.current===y_.SWIPE?(v.current=i,a(i)):_.current===y_.PULL&&(v.current=l,p(l)))}}),I)})(i,...Y,c,u,...ee,W),function(e,t,n,r,o,i,s,a,l){const c=de(0),u=de(0),d=de(void 0),f=de(void 0),p=de(0),h=de(void 0),g=de(0),{setTimeout:m,clearTimeout:v}=Gw(),y=he(()=>{d.current&&(v(d.current),d.current=void 0)},[v]),b=he(()=>{f.current&&(v(f.current),f.current=void 0)},[v]),w=a_(()=>{e!==v_.SWIPE&&(c.current=0,g.current=0,y(),b())});ce(w,[e,w]);const _=a_(e=>{f.current=void 0,c.current===e&&l(c.current)}),x=a_(t=>{if(t.ctrlKey)return;if(Math.abs(t.deltaY)>Math.abs(t.deltaX))return;const l=e=>{p.current=e,v(h.current),h.current=e>0?m(()=>{p.current=0,h.current=void 0},300):void 0};if(e===v_.NONE){if(Math.abs(t.deltaX)<=1.2*Math.abs(p.current))return void l(t.deltaX);if(!n(-t.deltaX))return;if(u.current+=t.deltaX,y(),Math.abs(u.current)>30)u.current=0,l(0),g.current=Date.now(),i();else{const e=u.current;d.current=m(()=>{d.current=void 0,e===u.current&&(u.current=0)},o)}}else if(e===v_.SWIPE){let e=c.current-t.deltaX;if(e=Math.min(Math.abs(e),r)*Math.sign(e),c.current=e,s(e),b(),Math.abs(e)>.2*r)return l(t.deltaX),void a(e,Date.now()-g.current);f.current=m(()=>_(e),2*o)}else l(t.deltaX)});ce(()=>t(Xb,x),[t,x])}(v,...Y);const te=a_(()=>{i.focus&&z().querySelector(`.${rw(Mb)} .${rw(b_())}`)&&V()});ce(te,[te]);const ne=a_(()=>{var e;null===(e=s.view)||void 0===e||e.call(s,{index:g.currentIndex})});ce(ne,[g.globalIndex,ne]),ce(()=>cw(E(jb,e=>J({direction:jb,...e})),E(qb,e=>J({direction:qb,...e})),E(Hb,e=>m(e))),[E,J,m]);const re=pe(()=>({prev:q,next:H,close:W,focus:V,slideRect:T?gw(T,r.padding):{width:0,height:0},containerRect:T||{width:0,height:0},subscribeSensors:C,containerRef:O,setCarouselRef:N,toolbarWidth:p,setToolbarWidth:h}),[q,H,W,V,C,T,O,N,p,h,r.padding]);return fe(i.ref,()=>({prev:q,next:H,close:W,focus:V,getLightboxProps:$,getLightboxState:j}),[q,H,W,V,$,j]),b("div",{ref:A,className:nw(rw(b_()),rw(Db)),style:{...v===v_.SWIPE?{[ow("swipe_offset")]:`${Math.round(w.current)}px`}:null,...v===v_.PULL?{[ow("pull_offset")]:`${Math.round(_.current)}px`,[ow("pull_opacity")]:`${x.current}`}:null,..."none"!==i.touchAction?{[ow("controller_touch_action")]:i.touchAction}:null,...a.container},tabIndex:-1,...S},T&&b(w_.Provider,{value:re},e,null===(n=l.controls)||void 0===n?void 0:n.call(l)))});function C_(e){return iw(kb,e)}function E_(e){return iw($b,e)}function R_({slide:e,offset:t}){const n=de(null),{currentIndex:r,slides:o}=jw(),{slideRect:i,focus:s}=x_(),{render:a,carousel:{imageFit:l,imageProps:c},on:{click:u},styles:{slide:d},labels:f}=Dw(),{getOwnerDocument:p}=Tw(),h=0!==t;return ce(()=>{var e;h&&(null===(e=n.current)||void 0===e?void 0:e.contains(p().activeElement))&&s()},[h,s,p]),b("div",{ref:n,className:nw(rw(E_()),!h&&rw(E_("current")),rw(Db)),...(g=h,{inert:xw?g:g?"":void 0}),style:d,role:"group","aria-roledescription":aw(f,"Slide"),"aria-label":lw(f,o,r+t)},(()=>{var n,o,s,d;let f=null===(n=a.slide)||void 0===n?void 0:n.call(a,{slide:e,offset:t,rect:i});return!f&&fw(e)&&(f=b(g_,{slide:e,offset:t,render:a,rect:i,imageFit:l,imageProps:c,onClick:h?void 0:()=>null==u?void 0:u({index:r})})),f?b(x,null,null===(o=a.slideHeader)||void 0===o?void 0:o.call(a,{slide:e}),(null!==(s=a.slideContainer)&&void 0!==s?s:({children:e})=>e)({slide:e,children:f}),null===(d=a.slideFooter)||void 0===d?void 0:d.call(a,{slide:e})):null})());var g}function I_(){const e=Dw().styles.slide;return b("div",{className:rw($b),style:e})}const P_=Cw(kb,function({carousel:e,labels:t}){const{slides:n,currentIndex:r,globalIndex:o}=jw(),{setCarouselRef:i}=x_(),{autoPlaying:s,focusWithin:a}=kw(),l=hw(e.spacing),c=hw(e.padding),u=function(e,t,n=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),n))}(e,n,1),d=[];if(vw(n))for(let t=r-u;t<=r+u;t+=1){const i=yw(n,t),s=o-r+t,a=e.finite&&(t<0||t>n.length-1);d.push(a?{key:s}:{key:[`${s}`,ww(i)].filter(Boolean).join("|"),offset:t-r,slide:i})}return b("div",{ref:i,className:nw(rw(C_()),d.length>0&&rw(C_("with_slides"))),style:{[`${ow(C_("slides_count"))}`]:d.length,[`${ow(C_("spacing_px"))}`]:l.pixel||0,[`${ow(C_("spacing_percent"))}`]:l.percent||0,[`${ow(C_("padding_px"))}`]:c.pixel||0,[`${ow(C_("padding_percent"))}`]:c.percent||0},role:"region","aria-live":s&&!a?"off":"polite","aria-roledescription":aw(t,"Carousel"),"aria-label":aw(t,"Photo gallery")},d.map(({key:e,slide:t,offset:n})=>t?b(R_,{key:e,slide:t,offset:n}):b(I_,{key:e})))});function k_(){const{carousel:e}=Dw(),{slides:t,currentIndex:n}=jw();return{prevDisabled:0===t.length||e.finite&&0===n,nextDisabled:0===t.length||e.finite&&n===t.length-1}}function O_({label:e,icon:t,renderIcon:n,action:r,onClick:o,disabled:i,style:s}){return b(Kw,{label:e,icon:t,renderIcon:n,className:rw(`navigation_${r}`),disabled:i,onClick:o,style:s,...u_(x_().focus,i)})}const M_=Cw("navigation",function({render:{buttonPrev:e,buttonNext:t,iconPrev:n,iconNext:r},styles:o}){const{prev:i,next:s,subscribeSensors:a}=x_(),{prevDisabled:l,nextDisabled:c}=k_();return function(e){var t;const n=d_(),{publish:r}=Nw(),{animation:o}=Dw(),{prevDisabled:i,nextDisabled:s}=k_(),a=(null!==(t=o.navigation)&&void 0!==t?t:o.swipe)/2,l=f_(()=>r(jb),a),c=f_(()=>r(qb),a),u=a_(e=>{switch(e.key){case"Escape":r(Wb);break;case"ArrowLeft":(n?s:i)||(n?c:l)();break;case"ArrowRight":(n?i:s)||(n?l:c)()}});ce(()=>e(Qb,u),[e,u])}(a),b(x,null,e?e():b(O_,{label:"Previous",action:jb,icon:Jw,renderIcon:n,style:o.navigationPrev,disabled:l,onClick:i}),t?t():b(O_,{label:"Next",action:qb,icon:Yw,renderIcon:r,style:o.navigationNext,disabled:c,onClick:s}))}),T_=rw("no_scroll"),A_=rw(Vb);function F_(e){return"style"in e}function N_(e,t,n){const r=window.getComputedStyle(e),o=n?"padding-left":"padding-right",i=n?r.paddingLeft:r.paddingRight,s=e.style.getPropertyValue(o);return e.style.setProperty(o,`${(pw(i)||0)+t}px`),()=>{s?e.style.setProperty(o,s):e.style.removeProperty(o)}}const z_=Cw("no-scroll",function({noScroll:{disabled:e},children:t}){const n=d_(),{getOwnerDocument:r,getOwnerWindow:o}=Tw();return ce(()=>{if(e)return()=>{};const t=[],i=o(),{body:s,documentElement:a}=r(),l=Math.round(i.innerWidth-a.clientWidth);if(l>0){t.push(N_(s,l,n));const e=s.getElementsByTagName("*");for(let r=0;r<e.length;r+=1){const o=e[r];F_(o)&&"fixed"===i.getComputedStyle(o).getPropertyValue("position")&&!o.classList.contains(A_)&&t.push(N_(o,l,n))}}return s.classList.add(T_),()=>{s.classList.remove(T_),t.forEach(e=>e())}},[n,e,r,o]),b(x,null,t)});function L_(e){return iw(Mb,e)}function D_(e,t,n){const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}const V_=Cw(Mb,function({children:e,animation:t,styles:n,className:r,on:o,portal:i,close:s,labels:a}){const[l,c]=ae(!1),[u,d]=ae(!1),f=de([]),p=de(null),{setTimeout:h}=Gw(),{subscribe:g}=Nw(),m=r_()?0:t.fade;ce(()=>(c(!0),()=>{c(!1),d(!1)}),[]);const v=a_(()=>{f.current.forEach(e=>e()),f.current=[]}),y=a_(()=>{var e;d(!1),v(),null===(e=o.exiting)||void 0===e||e.call(o),h(()=>{var e;null===(e=o.exited)||void 0===e||e.call(o),s()},m)});ce(()=>g(Wb,y),[g,y]);const w=a_(e=>{var t,n,r;!function(e){e.scrollTop}(e),d(!0),null===(t=o.entering)||void 0===t||t.call(o);const i=null!==(r=null===(n=e.parentNode)||void 0===n?void 0:n.children)&&void 0!==r?r:[];for(let t=0;t<i.length;t+=1){const n=i[t];-1===["TEMPLATE","SCRIPT","STYLE"].indexOf(n.tagName)&&n!==e&&(f.current.push(D_(n,"inert","")),f.current.push(D_(n,"aria-hidden","true")))}f.current.push(()=>{var e,t;null===(t=null===(e=p.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}),h(()=>{var e;null===(e=o.entered)||void 0===e||e.call(o)},m)}),_=he(e=>{e?w(e):v()},[w,v]);return l?Xe(b(m_,{ref:_,className:nw(r,rw(L_()),rw(Vb),u&&rw(L_("open"))),"aria-modal":!0,role:"dialog","aria-label":aw(a,"Lightbox"),style:{...t.fade!==Sw.animation.fade?{[ow("fade_animation_duration")]:`${m}ms`}:null,...t.easing.fade!==Sw.animation.easing.fade?{[ow("fade_animation_timing_function")]:t.easing.fade}:null,...n.root},onFocus:e=>{p.current||(p.current=e.relatedTarget)}},e),i.root||document.body):null}),$_=Cw("root",function({children:e}){return b(x,null,e)}),j_=Cw(Tb,function({toolbar:{buttons:e},render:{buttonClose:t,iconClose:n},styles:r}){const{close:o,setToolbarWidth:i}=x_(),{setContainerRef:s,containerRect:a}=i_();return n_(()=>{i(null==a?void 0:a.width)},[i,null==a?void 0:a.width]),b("div",{ref:s,style:r.toolbar,className:rw(iw(Tb,undefined))},null==e?void 0:e.map(e=>e===Wb?t?t():b(Kw,{key:Wb,label:"Close",icon:Xw,renderIcon:n,onClick:o}):e))});function q_(e,t){var n;return b(e.module.component,{key:e.module.name,...t},null===(n=e.children)||void 0===n?void 0:n.map(e=>q_(e,t)))}function H_(e,t={}){const{easing:n,...r}=e,{easing:o,...i}=t;return{easing:{...n,...o},...r,...i}}function W_({carousel:e,animation:t,render:n,toolbar:r,controller:o,noScroll:i,on:s,plugins:a,slides:l,index:c,...u}){const{animation:d,carousel:f,render:p,toolbar:h,controller:g,noScroll:m,on:v,slides:y,index:w,plugins:_,...x}=Sw,{config:S,augmentation:C}=function(e,t=[],n=[]){let r=e;const o=e=>{const t=[...r];for(;t.length>0;){const n=t.pop();if((null==n?void 0:n.module.name)===e)return!0;(null==n?void 0:n.children)&&t.push(...n.children)}return!1},i=(e,t)=>{r=""!==e?Iw(r,e,e=>[Ew(t,[e])]):[Ew(t,r)]},s=(e,t)=>{r=Iw(r,e,e=>[Ew(e.module,[Ew(t,e.children)])])},a=(e,t,n)=>{r=Iw(r,e,e=>{var r;return[Ew(e.module,[...n?[Ew(t)]:[],...null!==(r=e.children)&&void 0!==r?r:[],...n?[]:[Ew(t)]])]})},l=(e,t,n)=>{r=Iw(r,e,e=>[...n?[Ew(t)]:[],e,...n?[]:[Ew(t)]])},c=e=>{s(Ob,e)},u=(e,t)=>{r=Iw(r,e,e=>[Ew(t,e.children)])},d=e=>{r=Iw(r,e,e=>e.children)},f=e=>{n.push(e)};return t.forEach(e=>{e({contains:o,addParent:i,append:s,addChild:a,addSibling:l,addModule:c,replace:u,remove:d,augment:f})}),{config:r,augmentation:e=>n.reduce((e,t)=>t(e),e)}}([Ew(V_,[Ew(z_,[Ew(S_,[Ew(P_),Ew(j_),Ew(M_)])])])],a||_),E=C({animation:H_(d,t),carousel:{...f,...e},render:{...p,...n},toolbar:{...h,...r},controller:{...g,...o},noScroll:{...m,...i},on:{...v,...s},...x,...u});return E.open?b(Vw,{...E},b(Uw,{slides:l||y,index:pw(c||w)},b(Zw,null,b(zw,null,b(Ow,null,q_(Ew($_,S),E)))))):null}const U_={auto:!1,ref:null},B_=e=>({...U_,...e}),G_=B(null),Z_=uw("useFullscreen","FullscreenContext",G_);function K_({fullscreen:e,on:t,children:n}){const{auto:r,ref:o}=B_(e),i=de(null),[s,a]=ae(),[l,c]=ae(!1),u=de(!1),{getOwnerDocument:d}=Tw();n_(()=>{var e,t,n,r;const o=d();a(!(null!==(r=null!==(n=null!==(t=null!==(e=o.fullscreenEnabled)&&void 0!==e?e:o.webkitFullscreenEnabled)&&void 0!==t?t:o.mozFullScreenEnabled)&&void 0!==n?n:o.msFullscreenEnabled)&&void 0!==r&&r))},[d]);const f=he(()=>{var e;const t=d(),n=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return(null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.fullscreenElement)||n},[d]),p=he(()=>{const e=i.current;try{e.requestFullscreen?e.requestFullscreen().catch(()=>{}):e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}catch(e){}},[]),h=he(()=>{if(!f())return;const e=d();try{e.exitFullscreen?e.exitFullscreen().catch(()=>{}):e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen()}catch(e){}},[f,d]);ce(()=>{const e=d(),t=()=>{c(f()===i.current)};return cw(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(n=>(e.addEventListener(n,t),()=>e.removeEventListener(n,t))))},[f,d]);const g=a_(()=>{var e;return null===(e=t.enterFullscreen)||void 0===e?void 0:e.call(t)}),m=a_(()=>{var e;return null===(e=t.exitFullscreen)||void 0===e?void 0:e.call(t)});ce(()=>{l&&(u.current=!0),u.current&&(l?g:m)()},[l,g,m]);const v=a_(()=>{var e;return null===(e=r?p:null)||void 0===e||e(),h});ce(v,[v]);const y=pe(()=>({fullscreen:l,disabled:s,enter:p,exit:h}),[l,s,p,h]);return fe(o,()=>y,[y]),b("div",{ref:i,className:nw(rw(Ab),rw("fullsize"))},b(G_.Provider,{value:y},n))}const Q_=Qw("EnterFullscreen",b("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),X_=Qw("ExitFullscreen",b("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function J_(){var e;const{fullscreen:t,disabled:n,enter:r,exit:o}=Z_(),{render:i}=Dw();return n?null:i.buttonFullscreen?b(x,null,null===(e=i.buttonFullscreen)||void 0===e?void 0:e.call(i,{fullscreen:t,disabled:n,enter:r,exit:o})):b(Kw,{disabled:n,label:t?"Exit Fullscreen":"Enter Fullscreen",icon:t?X_:Q_,renderIcon:t?i.iconExitFullscreen:i.iconEnterFullscreen,onClick:t?o:r})}function Y_({augment:e,contains:t,addParent:n}){e(({fullscreen:e,toolbar:t,...n})=>({toolbar:_w(t,Ab,b(J_,null)),fullscreen:B_(e),...n})),n(t(Fb)?Fb:Ob,Cw(Ab,K_))}function ex({isOpen:e,imageUrl:t,caption:n,enableFullscreen:r=!0,onClose:o}){const{i18n:i}=Lr();if(ce(()=>{if(!e)return;const t=e=>{"Escape"===e.key&&o()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,o]),!e||!t)return null;const s={src:t,alt:n||i.image,title:n||void 0};return yr(W_,{open:e,close:o,slides:[s],plugins:r?[Y_]:[],render:{slideFooter:n?()=>yr("div",{className:"yarl__caption",children:yr("div",{className:"yarl__caption_container",children:n})}):void 0,buttonPrev:()=>null,buttonNext:()=>null},carousel:{finite:!0},controller:{closeOnBackdropClick:!0},styles:{root:{"--yarl__color_backdrop":"rgba(0, 0, 0, 0.9)"}}})}const tx=({thumbnailUrl:e,largeImageUrl:t,alt:n="",caption:r,width:o=70,height:i=70,className:s=""})=>{const{i18n:a}=Lr(),[l,c]=ae(!1),u=t||e,d=n||a.image,f=e=>{e.stopPropagation(),u&&c(!0)};return yr(x,{children:[yr("span",{className:`clickable-lightbox-image ${s}`,onClick:f,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),f(e))},"aria-label":a.openLightboxFor({label:d}),style:{cursor:"pointer",display:"inline-block"},children:yr("img",{src:e,alt:n,loading:"lazy",width:o,height:i,style:{display:"block",maxWidth:"100%",height:"auto"}})}),l&&yr(ex,{isOpen:l,imageUrl:u,caption:r||n,onClose:()=>{c(!1)}})]})},nx=({data:e,columnId:t,clickToFilter:n=!1,filterOptions:r=[],onFilterChange:o,currentFilterValue:i})=>{const{i18n:s}=Lr(),{separator:a,items:l}=e;if(!l||0===l.length)return null;const c=a.replace(/\s+$/,""),u=pe(()=>(e=>{const t=[],n=e=>{for(const r of e)t.push(r),r.children&&n(r.children)};return n(e),t})(r),[r]),d=pe(()=>{if(!i)return new Set;const e=Array.isArray(i)?i:[i];return new Set(e)},[i]);return yr(x,{children:l.map((e,r)=>{const i=r===l.length-1,a=n?((e,t)=>t.find(t=>t.value===e.slug)||t.find(t=>t.label.toLowerCase()===e.name.toLowerCase()))(e,u):void 0,f=!!a&&d.has(a.value);let p;return p=a&&o&&!f?yr("a",{href:e.link||Rb(t,a.value),rel:e.link?"tag":void 0,className:"clickable-filter-term",onClick:e=>{e.preventDefault(),o(t,a.value)},"aria-label":s.filterByTerm({term:e.name}),children:e.name}):n?yr("span",{children:e.name}):e.link?yr("a",{href:e.link,rel:"tag",children:e.name}):yr("span",{children:e.name}),yr(x,{children:[yr("span",{className:"taxonomy-term-group",children:[p,!i&&yr("span",{className:"taxonomy-separator",dangerouslySetInnerHTML:{__html:c}})]}),!i&&" "]},e.id)})})},rx=({isExpanded:e,onClick:t,type:n,hasHiddenColumns:r})=>{const{i18n:o}=Lr();return r?yr("button",{type:"button",className:Ar("responsive-control",n,e&&"expanded"),onClick:e=>{e.stopPropagation(),t()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t())},"aria-expanded":e,"aria-label":e?o.collapseRowDetails:o.expandRowDetails,tabIndex:0,children:yr("span",{className:"responsive-control-icon","aria-hidden":"true",children:yr("svg",e?{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:yr("path",{d:"M3 8h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:yr("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})})})}):null},ox="__responsive_control__",ix={width:70,height:70},sx=e=>"object"==typeof e&&null!==e&&"dataType"in e&&"string"==typeof e.dataType,ax=e=>!(!e||"object"!=typeof e)&&(sx(e)&&"image"===e.dataType?"thumbnail"in e:"thumbnail"in e&&"string"==typeof e.thumbnail),lx=e=>sx(e)&&"taxonomy"===e.dataType&&"items"in e&&Array.isArray(e.items),cx=e=>e?ax(e)?e.thumbnail:"string"==typeof e?e:null:null,ux=e=>ax(e)&&e.alt||"",dx={text:e=>e||"",number:e=>(e=>{if(null==e)return"";const t=Number(e);return isNaN(t)?String(e):t.toLocaleString("en-US")})(e),date:e=>(e=>{if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return String(e)}})(e),html:e=>yr("div",{dangerouslySetInnerHTML:{__html:e||""}}),image:(e,t)=>{const n=cx(e);if(!n)return null;const r=t?.imageSize||ix,o=yr("img",{src:n,alt:ux(e),style:{width:`${r.width}px`,height:`${r.height}px`,objectFit:"contain"}}),i=(e=>{if(ax(e))return e.link})(e);return i?yr("a",{href:i,children:o}):o},button:e=>yr("div",{dangerouslySetInnerHTML:{__html:e||""}})},fx=e=>{const t=(e=>e&&"auto"!==e?"number"==typeof e?{type:"pixel",value:e,original:e}:"string"==typeof e&&e.endsWith("%")?{type:"percentage",value:parseFloat(e.slice(0,-1)),original:e}:"string"==typeof e&&e.endsWith("px")?{type:"pixel",value:parseFloat(e.slice(0,-2)),original:e}:{type:"auto",value:0,original:e}:{type:"auto",value:0,original:e})(e);return"pixel"===t.type?t.value:150},px=(e,t)=>e?.find(e=>e.id===t||e.columnId===t),hx=(e,t)=>e?.find(e=>e.id===t)?.value,gx=[{name:"customRenderer",shouldApply:e=>!!e.customRenderer,createRenderer:e=>t=>yr(e.customRenderer,{value:t.getValue(),row:t.row.original,column:e})},{name:"structuredTaxonomy",shouldApply:e=>("image"!==e.dataType||!e.lightbox)&&!1!==e.filterable,createRenderer:(e,t)=>{const n=!!e.clickToFilter&&!1!==t.allowClickToFilter,r="object"==typeof e.clickToFilter?e.clickToFilter:{},o=r.filterTarget||e.id;return i=>{const s=i.getValue();if(!lx(s)){if(n&&t.filters&&t.onFilterChange){const e=px(t.filters,o),n=e?.options||[],i=e?.id??o;if(n.length>0){const e=hx(t.currentFilters,i);return yr(Pb,{value:s,filterOptions:n,filterId:i,onFilterClick:e=>t.onFilterChange(i,e),valueParser:r.valueParser,currentFilterValue:e})}}return(0,dx[e.dataType])(s,e)}const a=px(t.filters,o),l=a?.options||[],c=a?.id??o,u=hx(t.currentFilters,c);return yr(nx,{data:s,columnId:c,clickToFilter:n,filterOptions:l,onFilterChange:n?t.onFilterChange:void 0,currentFilterValue:u})}}},{name:"clickToFilter",shouldApply:(e,t)=>{if(!e.clickToFilter||!t.filters||!t.onFilterChange||!1===t.allowClickToFilter)return!1;const n=("object"==typeof e.clickToFilter?e.clickToFilter:{}).filterTarget||e.id,r=px(t.filters,n);return(r?.options||[]).length>0},createRenderer:(e,t)=>n=>{const r=n.getValue(),o="object"==typeof e.clickToFilter?e.clickToFilter:{},i=o.filterTarget||e.id,s=o.valueParser,a=px(t.filters,i),l=a?.options||[],c=a?.id??i,u=hx(t.currentFilters,c);return yr(Pb,{value:r,filterOptions:l,filterId:c,onFilterClick:e=>t.onFilterChange(c,e),valueParser:s,currentFilterValue:u})}},{name:"lightbox",shouldApply:e=>"image"===e.dataType&&!!e.lightbox,createRenderer:e=>t=>{const n=t.getValue(),r=cx(n);if(!r)return null;const o="object"==typeof e.lightbox?e.lightbox:{},i=e.imageSize||ix,s=(e=>ax(e)?e.large||e.thumbnail:cx(e))(n)||o.getLargeImageUrl?.(t.row.original)||r,a=(e=>{if(ax(e))return e.caption})(n)||o.getCaption?.(t.row.original),l=ux(n);return yr(tx,{thumbnailUrl:r,largeImageUrl:s,alt:l,caption:a,width:i.width,height:i.height})}},{name:"default",shouldApply:()=>!0,createRenderer:e=>t=>(0,dx[e.dataType])(t.getValue(),e)}],mx=(e,t)=>{const n=(e=>e??{})(t);for(const t of gx)if(t.shouldApply(e,n))return t.createRenderer(e,n);return()=>null},vx=(e,t)=>!(e.id!==ox&&!t.has(e.id))||"button"===e.dataType||"image"===e.dataType;function yx({columns:e,data:t,containerRef:n,containerWidth:r,responsiveConfig:o,loading:i,dataStateKey:s}){const a=null!==o,[l,c]=ae({}),u=de({key:"",passes:0});ce(()=>{c({}),u.current={key:"",passes:0}},[pe(()=>e.map(e=>`${e.id}:${e.width??"auto"}`).join("|"),[e])]);const{naturalWidths:d,headerIntrinsicWidths:f,legacyFitWidths:p,responsiveFitWidths:h,cellPadding:g,borderOverhead:m,ready:v,noExpandColumnIds:y}=gb(e,t,n,r),b=pe(()=>Object.keys(p).length>0?p:d,[p,d]),w=pe(()=>{const e=Object.keys(l).length>0,t=y.size>0&&Object.keys(d).length>0;if(!e&&!t)return b;const n={...b};return t&&y.forEach(e=>{const t=d[e];t>0&&n[e]>t&&(n[e]=t)}),e&&Object.entries(l).forEach(([e,t])=>{n[e]=Math.max(n[e]||0,t)}),n},[b,l,y,d]),{widths:_}=vb(e,r,w,y,g,m),x="column"===o?.control?Math.max(0,r-50):r,S=(e=>{const{config:t,columns:n,columnWidths:r,measuredWidths:o={},containerWidth:i,data:s}=e,a=pe(()=>{return e=t?.breakpoints,{...yb,...e};var e},[t?.breakpoints]),[l,c]=ae(()=>{const e=Eb();return bb(e,a)}),[u,d]=ae(new Set),f=de(a);ce(()=>{f.current=a},[a]);const p=pe(()=>{const e=n.map((e,t)=>({column:e,index:t}));return e.map(e=>({...e,priority:e.column.responsive?.priority??1e4})).sort((e,t)=>e.priority-t.priority)},[n]),{visibleColumns:h,hiddenColumns:g,neverColumns:m}=pe(()=>{const e=10*Math.round(i/10),s=Cb(n,l,e,r,a,o);if("inline"!==t?.control||0===s.hiddenColumns.size)return s;const c=Math.max(0,e-36);return c===e?s:Cb(n,l,c,r,a,o)},[n,l,i,r,a,o,t?.control,p]),v=g.size>0,y=he(()=>{const e=Eb(),t=bb(e,f.current);c(e=>t!==e?t:e)},[]),b=pe(()=>(e=>{let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{e(...n)},150)}})(y),[y]);ce(()=>(y(),window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}),[b,y]);const w=he(e=>{d(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_=he(e=>"childRowVisible"===t?.display||u.has(e),[u,t?.display]),x=pe(()=>{const e=[];return n.forEach((t,n)=>{g.has(t.id)&&!m.has(t.id)&&e.push({id:t.id,index:n,header:t.header,accessor:t.accessor})}),e},[n,g,m]),S=pe(()=>{const e=[];return n.forEach((t,n)=>{m.has(t.id)||"__responsive_control__"===t.id||e.push({id:t.id,index:n,header:t.header,accessor:t.accessor})}),e},[n,m]),C=he((e,t)=>x.map(t=>{const n=t.accessor?e[t.accessor]:e[t.id];return{columnId:t.id,columnIndex:t.index,title:t.header,data:n}}),[x]),E=he((e,t)=>S.map(t=>{const n=t.accessor?e[t.accessor]:e[t.id];return{columnId:t.id,columnIndex:t.index,title:t.header,data:n}}),[S]),R=v;return ce(()=>{if("childRowVisible"===t?.display&&v){const e=s.map((e,t)=>String(e&&"object"==typeof e&&"id"in e?e.id:t));d(t=>{const n=new Set(t);return e.forEach(e=>n.add(e)),n})}else"childRowVisible"!==t?.display&&d(new Set)},[t?.display,v,s]),{responsiveState:{currentBreakpoint:l,visibleColumns:h,hiddenColumns:g,neverColumns:m,expandedRows:u,isResponsiveMode:v},toggleRow:w,isRowExpanded:_,getHiddenColumnsForRow:C,getAllColumnsForRow:E,shouldShowControl:R}})({config:o,columns:e,columnWidths:_,measuredWidths:h,containerWidth:x,data:t}),C=pe(()=>{let t=[...e];return t=t.filter(e=>!1!==e.visible),a&&(t=t.filter(e=>S.responsiveState.visibleColumns.has(e.id)),"column"===o?.control&&S.shouldShowControl&&(t=[{id:"__responsive_control__",header:"",dataType:"html",width:50,sortable:!1,filterable:!1,searchable:!1},...t])),t},[e,a,o,S.responsiveState.visibleColumns,S.shouldShowControl]),E=pe(()=>{if(!o||"inline"!==o.control||!S.shouldShowControl)return w;const e=C.find(e=>"__responsive_control__"!==e.id);if(!e)return w;const t=w[e.id]||0,n=(l[e.id]||0)>0;let r=t+36;if("image"===e.dataType&&!n){const t=d[e.id]||0,n=e.imageSize?.width?e.imageSize.width+g:0,o=Math.max(t,n);o>0&&(r=o+36+8)}return{...w,[e.id]:r}},[w,o,S.shouldShowControl,C,l,d,g]),{widths:R}=vb(C,r,E,y,g,m),I=pe(()=>{const e={...f,...h};if("inline"===o?.control&&S.shouldShowControl){const t=C.find(e=>"__responsive_control__"!==e.id);if(t){const n=e[t.id]||0;e[t.id]=n+36}}return((e,t,n,r,o,i={})=>{if(n<=0||0===e.length)return t;const s=Math.max(0,n-r),a=e.reduce((e,n)=>{const r=i[n.id]||0,s=vx(n,o)?t[n.id]||0:50;return e+Math.max(s,r)},0)<=s+.5,l={...t};a&&e.forEach(e=>{const t=i[e.id]||0;t>0&&(l[e.id]=Math.max(l[e.id]||0,t))});let c=e.reduce((e,t)=>e+(l[t.id]||0),0)-s;if(c<=.5)return l;const u=e.filter(e=>!vx(e,o)).map(e=>({id:e.id,capacity:Math.max(0,(l[e.id]||0)-(a?Math.max(50,i[e.id]||0):50))})).filter(e=>e.capacity>0);if(0===u.length)return l;let d=u;for(;c>.5&&d.length>0;){const e=d.reduce((e,t)=>e+t.capacity,0);if(e<=0)break;let t=0;const n=[];if(d.forEach(r=>{const o=c*r.capacity/e,i=Math.min(r.capacity,o);l[r.id]-=i,t+=i;const s=r.capacity-i;s>.5&&n.push({id:r.id,capacity:s})}),t<=0)break;c-=t,d=n}return l})(C,R,r,m,y,e)},[C,R,r,m,y,f,h,o,S.shouldShowControl]),P=pe(()=>JSON.stringify({dataStateKey:s,visibleColumns:C.map(e=>e.id),dataLength:t.length}),[s,C,t.length]);ce(()=>{if(!v||i||0===t.length||!n.current)return;if(u.current.key!==P&&(u.current={key:P,passes:0}),u.current.passes>=2)return;const e=n.current.querySelectorAll("tbody td.table-cell[data-column-id] .cell-content"),r={};e.forEach(e=>{const t=e.closest("td[data-column-id]"),n=t?.getAttribute("data-column-id");if(!t||!n||n===ox)return;const o=e.scrollWidth-e.clientWidth,i=Xy(e),s=Math.max(o,i);if(s<=1)return;const a=I[n]||t.getBoundingClientRect().width,l=Math.ceil(a+s+4);r[n]=Math.max(r[n]||0,l)}),0!==Object.keys(r).length?(u.current.passes+=1,c(e=>{const t={...e};let n=!1;return Object.entries(r).forEach(([e,r])=>{r>(t[e]||0)&&(t[e]=r,n=!0)}),n?t:e})):u.current.passes=2},[v,i,t.length,I,P]);const k=S.responsiveState.hiddenColumns.size>0;return{visibleColumnConfigs:C,columnWidths:I,widthsReady:v,responsiveState:S.responsiveState,responsiveEnabled:a,hasHiddenColumns:k,shouldShowControl:S.shouldShowControl,isRowExpanded:S.isRowExpanded,toggleRow:S.toggleRow,getHiddenColumnsForRow:S.getHiddenColumnsForRow,getAllColumnsForRow:S.getAllColumnsForRow,responsiveConfig:o}}function bx({enabled:e,offset:t=0,targetRef:n,stateKey:r,loading:o=!1}){const i=de(r),s=de(!0);ce(()=>{if(s.current)return s.current=!1,void(i.current=r);if(!e)return;if(i.current===r)return;if(i.current=r,o)return;if(!n?.current)return;const a=n.current.getBoundingClientRect();if(!(a.top>=t)){const e=window.pageYOffset+a.top-t;window.scrollTo({top:Math.max(0,e),behavior:"smooth"})}},[r,o,e,t,n])}function wx({columnId:e,label:t}){const{i18n:n}=Lr(),{containerRef:r,selectedItems:o,selectAll:i,deselectAll:s,isActionLoading:a}=ge(Dr),[l,c]=ae(new Map),u=de(null),d=he(()=>{const t=r?.current;c(t?((e,t)=>{const n=new Map;return e.querySelectorAll(Nv).forEach(e=>{if(e.disabled)return;const r=e.closest("td[data-column-id]");if(!r||r.getAttribute("data-column-id")!==t)return;const o=e.getAttribute(Fv);o&&!n.has(o)&&n.set(o,{id:o,attributes:zv(e)})}),n})(t,e):new Map)},[r,e]);ce(()=>{d()},[d]),ce(()=>{const e=r?.current;if(!e)return;let t=null;const n=()=>{null!==t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=null,d()})},o=new MutationObserver(n);return o.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","data-column-id",Fv]}),n(),()=>{o.disconnect(),null!==t&&cancelAnimationFrame(t)}},[r,d]);const f=pe(()=>Array.from(l.keys()),[l]),p=pe(()=>f.reduce((e,t)=>e+(o.has(t)?1:0),0),[f,o]),h=f.length,g=h>0&&p===h,m=p>0&&p<h;ce(()=>{u.current&&(u.current.indeterminate=m)},[m]);const v=he(e=>{e.currentTarget.checked?0!==l.size&&i(Array.from(l.values())):s()},[s,i,l]),y=he(e=>{e.stopPropagation()},[]),b=pe(()=>"dv-select-all"+(a?" is-disabled":""),[a]);return 0===h?null:yr("label",{className:b,onClick:y,children:[yr("span",{className:"dv-select-all__text",children:t??n.selectAll}),yr("span",{className:"dv-select-all__toggle",children:yr("input",{ref:u,type:"checkbox",className:"dv-select-all__input",checked:g,onClick:y,onChange:v,disabled:a})})]})}const xx=B(void 0);function Sx(e){const t=ge(xx);if(void 0===t&&!e)throw new Error(nc(33));return t}const Cx=B(void 0);function Ex(e){const t=ge(Cx);if(void 0===t&&!e)throw new Error(nc(36));return t}const Rx=B(void 0);function Ix(e=!0){const t=ge(Rx);if(void 0===t&&!e)throw new Error(nc(25));return t}const Px={type:"regular-item"},kx=B(void 0),Ox=Le(function(e,t){const{render:n,className:r,...o}=e,[i,s]=ae(void 0),a=pe(()=>({setLabelId:s}),[s]),l=ip("div",e,{ref:t,props:{role:"group","aria-labelledby":i,...o}});return Cr.jsx(kx.Provider,{value:a,children:l})}),Mx=Le(function(e,t){const{className:n,render:r,id:o,...i}=e,s=Yh(o),{setLabelId:a}=function(){const e=ge(kx);if(void 0===e)throw new Error(nc(31));return e}();return Hl(()=>(a(s),()=>{a(void 0)}),[a,s]),ip("div",e,{ref:t,props:{id:s,role:"presentation",...i}})}),Tx=Le(function(e,t){const{render:n,className:r,id:o,label:i,nativeButton:s=!1,disabled:a=!1,closeOnClick:l=!0,...c}=e,u=ym({label:i}),d=Sx(!0),f=Yh(o),{store:p}=Ex(),h=p.useState("isActive",u.index),g=p.useState("itemProps"),{getItemProps:m,itemRef:v}=function(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:o,store:i,nativeButton:s,itemMetadata:a,nodeId:l}=e,c=de(null),u=Ix(!0),d=void 0!==u,{events:f}=i.useState("floatingTreeRoot"),{getButtonProps:p,buttonRef:h}=Vg({disabled:n,focusableWhenDisabled:!0,native:s}),g=he(e=>Xf({id:o,role:"menuitem",tabIndex:r?0:-1,onMouseMove(e){l&&f.emit("itemhover",{nodeId:l,target:e.currentTarget})},onMouseEnter(){"submenu-trigger"===a.type&&a.setActive()},onKeyUp(e){" "===e.key&&i.context.typingRef.current&&e.preventBaseUIHandler()},onClick(e){t&&f.emit("close",{domEvent:e,reason:Cf})},onMouseUp(e){if(u){const t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1)return}!c.current||!i.context.allowMouseUpTriggerRef.current||d&&2!==e.button||"regular-item"===a.type&&c.current.click()}},e,p),[o,r,p,t,f,i,d,u,a,l]),m=Jl(c,h);return pe(()=>({getItemProps:g,itemRef:m}),[g,m])}({closeOnClick:l,disabled:a,highlighted:h,id:f,store:p,nativeButton:s,nodeId:d?.nodeId,itemMetadata:Px});return ip("div",e,{state:pe(()=>({disabled:a,highlighted:h}),[a,h]),props:[g,c,m],ref:[v,t,u.ref]})}),Ax={...kg,...bg},Fx=Le(function(e,t){const{render:n,className:r,finalFocus:o,...i}=e,{store:s}=Ex(),{side:a,align:l}=Sx(),c=null!=dv(),u=s.useState("open"),d=s.useState("transitionStatus"),f=s.useState("popupProps"),p=s.useState("mounted"),h=s.useState("instantType"),g=s.useState("activeTriggerElement"),m=s.useState("parent"),v=s.useState("lastOpenChangeReason"),y=s.useState("rootId"),b=s.useState("floatingRootContext"),w=s.useState("floatingTreeRoot"),_=s.useState("closeDelay"),x=s.useState("activeTriggerElement");oh({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}}),ce(()=>{function e(e){s.setOpen(!1,Ff(e.reason,e.domEvent))}return w.events.on("close",e),()=>{w.events.off("close",e)}},[w.events,s]);const S=s.useState("hoverEnabled"),C=s.useState("disabled");!function(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),i=n.useState("domReferenceElement"),{dataRef:s}=n.context,{enabled:a=!0,closeDelay:l=0,externalTree:c}=t,{pointerTypeRef:u,interactedInsideRef:d,handlerRef:f,performedPointerEventsMutationRef:p,unbindMouseMoveRef:h,restTimeoutPendingRef:g,openChangeTimeout:m,handleCloseOptionsRef:v}=gh(n),y=df(c),b=uf(),w=Kl(()=>!!d.current||!!s.current.openEvent&&mh.has(s.current.openEvent.type)),_=Kl(()=>{const e=s.current.openEvent?.type;return e?.includes("mouse")&&"mousedown"!==e}),x=he((e,t=!0)=>{const r=(o=l,(i=u.current)&&!Zu(i)?0:"function"==typeof o?o():o);var o,i;r&&!f.current?m.start(r,()=>n.setOpen(!1,Ff(_f,e))):t&&(m.clear(),n.setOpen(!1,Ff(_f,e)))},[l,f,n,u,m]),S=Kl(()=>{h.current(),f.current=void 0}),C=Kl(()=>{if(p.current){const e=Vu(o).body;e.style.pointerEvents="",e.removeAttribute(ph),p.current=!1}}),E=Kl(e=>{var t;(t=Lu(e))&&Boolean(t.closest(hh))?d.current=!0:d.current=!1});Hl(()=>{r||(u.current=void 0,g.current=!1,d.current=!1,S(),C())},[r,u,g,d,S,C]),ce(()=>()=>{S()},[S]),ce(()=>C,[C]),Hl(()=>{if(a&&r&&v.current?.blockPointerEvents&&_()&&Zc(i)&&o){p.current=!0;const e=Vu(o).body;e.setAttribute(ph,"");const t=i,n=o,r=y?.nodesRef.current.find(e=>e.id===b)?.context?.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="none",t.style.pointerEvents="auto",n.style.pointerEvents="auto",()=>{e.style.pointerEvents="",t.style.pointerEvents="",n.style.pointerEvents=""}}},[a,r,i,o,v,_,y,b,p]),ce(()=>{if(!a)return;function e(e){if(w()||!s.current.floatingContext||!n.select("open"))return;const t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(C(),S(),w()||x(e))}function t(e){m.clear(),C(),f.current?.(e),S()}function r(e){w()||x(e,!1)}const i=o;return i&&(i.addEventListener("mouseleave",e),i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",r),i.addEventListener("pointerdown",E,!0)),()=>{i&&(i.removeEventListener("mouseleave",e),i.removeEventListener("mouseenter",t),i.removeEventListener("mouseleave",r),i.removeEventListener("pointerdown",E,!0))}})}(b,{enabled:S&&!C&&"context-menu"!==m.type&&"menubar"!==m.type,closeDelay:_});const E=ip("div",e,{state:pe(()=>({transitionStatus:d,side:a,align:l,open:u,nested:"menu"===m.type,instant:h}),[d,a,l,u,m.type,h]),ref:[t,s.context.popupRef],stateAttributesMapping:Ax,props:[f,{onKeyDown(e){c&&wv.has(e.key)&&e.stopPropagation()}},hm(d),i,{"data-rootownerid":y}]});let R=void 0===m.type||"context-menu"===m.type;return(g||"menubar"===m.type&&v!==Sf)&&(R=!0),Cr.jsx(gp,{context:b,modal:!1,disabled:!p,returnFocus:void 0===o?R:o,initialFocus:"menu"!==m.type,restoreFocus:!0,externalTree:"menubar"!==m.type?w:void 0,previousFocusableElement:x,nextFocusableElement:void 0===m.type?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===m.type?s.context.beforeContentFocusGuardRef:void 0,children:E})}),Nx=B(void 0),zx=Le(function(e,t){const{keepMounted:n=!1,...r}=e,{store:o}=Ex();return o.useState("mounted")||n?Cr.jsx(Nx.Provider,{value:n,children:Cr.jsx(cp,{ref:t,...r})}):null}),Lx=Le(function(e,t){const{anchor:n,positionMethod:r="absolute",className:o,render:i,side:s,align:a,sideOffset:l=0,alignOffset:c=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=mf,...m}=e,{store:v}=Ex(),y=function(){const e=ge(Nx);if(void 0===e)throw new Error(nc(32));return e}(),b=Ix(!0),w=v.useState("parent"),_=v.useState("floatingRootContext"),x=v.useState("floatingTreeRoot"),S=v.useState("mounted"),C=v.useState("open"),E=v.useState("modal"),R=v.useState("activeTriggerElement"),I=v.useState("lastOpenChangeReason"),P=v.useState("floatingNodeId"),k=v.useState("floatingParentNodeId");let O=n,M=l,T=c,A=a,F=g;"context-menu"===w.type&&(O=n??w.context?.anchor,A=A??"start",s||"center"===A||(T=e.alignOffset??2,M=e.sideOffset??-5));let N=s,z=A;"menu"===w.type?(N=N??"inline-end",z=z??"start",F=e.collisionAvoidance??vf):"menubar"===w.type&&(N=N??"bottom",z=z??"start");const L="context-menu"===w.type,D=um({anchor:O,floatingRootContext:_,positionMethod:b?"fixed":r,mounted:S,side:N,sideOffset:M,align:z,alignOffset:T,arrowPadding:L?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:h,collisionAvoidance:F,shiftCrossAxis:L,externalTree:x}),V=pe(()=>{const e={};return C||(e.pointerEvents="none"),{role:"presentation",hidden:!S,style:{...D.positionerStyles,...e}}},[C,S,D.positionerStyles]);ce(()=>{function e(e){e.open?(e.parentNodeId===P&&v.set("hoverEnabled",!1),e.nodeId!==P&&e.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,Ff(Tf))):e.parentNodeId===P&&e.reason!==Tf&&v.set("hoverEnabled",!0)}return x.events.on("menuopenchange",e),()=>{x.events.off("menuopenchange",e)}},[v,x.events,P]),ce(()=>{if(null!=v.select("floatingParentNodeId"))return x.events.on("menuopenchange",e),()=>{x.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==v.select("floatingParentNodeId"))return;const t=e.reason??Tf;v.setOpen(!1,Ff(t))}},[x.events,v]),ce(()=>{function e(e){C&&e.nodeId===v.select("floatingParentNodeId")&&e.target&&R&&R!==e.target&&v.setOpen(!1,Ff(Tf))}return x.events.on("itemhover",e),()=>{x.events.off("itemhover",e)}},[x.events,C,R,v]),ce(()=>{const e={open:C,nodeId:P,parentNodeId:k,reason:v.select("lastOpenChangeReason")};x.events.emit("menuopenchange",e)},[x.events,C,v,P,k]);const $=pe(()=>({open:C,side:D.side,align:D.align,anchorHidden:D.anchorHidden,nested:"menu"===w.type}),[C,D.side,D.align,D.anchorHidden,w.type]),j=pe(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,nodeId:D.context.nodeId}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.context.nodeId]),q=ip("div",e,{state:$,stateAttributesMapping:kg,ref:[t,v.useStateSetter("positionerElement")],props:[V,m]}),H=S&&"menu"!==w.type&&("menubar"!==w.type&&E&&I!==_f||"menubar"===w.type&&w.context.modal);let W=null;return"menubar"===w.type?W=w.context.contentElement:void 0===w.type&&(W=R),Cr.jsxs(xx.Provider,{value:j,children:[H&&Cr.jsx(fm,{ref:"context-menu"===w.type||"nested-context-menu"===w.type?w.context.internalBackdropRef:null,inert:Yg(!C),cutout:W}),Cr.jsx(pf,{id:P,children:Cr.jsx(Bg,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:q})})]})}),Dx=B(null);function Vx(e){return ge(Dx)}const $x={...ch,disabled:fc(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:fc(e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0)),allowMouseEnter:fc(e=>"menu"===e.parent.type?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:fc(e=>e.stickIfOpen),parent:fc(e=>e.parent),rootId:fc(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:fc(e=>e.activeIndex),isActive:fc((e,t)=>e.activeIndex===t),hoverEnabled:fc(e=>e.hoverEnabled),instantType:fc(e=>e.instantType),lastOpenChangeReason:fc(e=>e.openChangeReason),floatingTreeRoot:fc(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:fc(e=>e.floatingNodeId),floatingParentNodeId:fc(e=>e.floatingParentNodeId),itemProps:fc(e=>e.itemProps),closeDelay:fc(e=>e.closeDelay),keyboardEventRelay:fc(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};class jx extends Tc{constructor(e){super({...{...lh(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new af,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Mc,keyboardEventRelay:void 0,closeDelay:0},...e},{positionerRef:_(),popupRef:_(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:_(),beforeContentFocusGuardRef:_(),onOpenChangeComplete:void 0,triggerElements:new ah},$x),this.observe(fc(e=>e.allowMouseEnter),(e,t)=>{"menu"===this.state.parent.type&&e!==t&&this.state.parent.store.set("allowMouseEnter",e)}),this.unsubscribeParentListener=this.observe("parent",e=>{if(this.unsubscribeParentListener?.(),"menu"===e.type)return this.unsubscribeParentListener=e.store.subscribe(()=>{this.notifyAll()}),void(this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef);void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){return Bl(()=>e??new jx(t)).current}unsubscribeParentListener=null}const qx=B(void 0);function Hx(e){const{children:t,open:n,onOpenChange:r,onOpenChangeComplete:o,defaultOpen:i=!1,disabled:s=!1,modal:a,loopFocus:l=!0,orientation:c="vertical",actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:h=null,highlightItemOnHover:g=!0}=e,m=Ix(!0),v=Ex(!0),y=Vx(),b=ge(qx),w=pe(()=>b&&v?{type:"menu",store:v.store}:y?{type:"menubar",context:y}:m&&!v?{type:"context-menu",context:m}:{type:void 0},[m,v,y,b]),_=jx.useStore(f?.store,{parent:w}),x=_.useState("floatingTreeRoot"),S=ff(x),C=uf();Hl(()=>{m&&!v?_.update({parent:{type:"context-menu",context:m},floatingNodeId:S,floatingParentNodeId:C}):v&&_.update({floatingNodeId:S,floatingParentNodeId:C})},[m,v,S,C,_]),_.useControlledProp("open",n,i),_.useControlledProp("activeTriggerId",p,h),_.useContextCallback("onOpenChangeComplete",o);const E=_.useState("open"),R=_.useState("activeTriggerElement"),I=_.useState("positionerElement"),P=_.useState("hoverEnabled"),k=_.useState("modal"),O=_.useState("disabled"),M=_.useState("lastOpenChangeReason"),T=_.useState("parent"),A=_.useState("activeIndex"),F=_.useState("payload"),N=_.useState("floatingParentNodeId"),z=de(null),L=null!=N;let D;_.useSyncedValues({disabled:s,modal:void 0===T.type?a:void 0,rootId:of()});const{openMethod:V,triggerProps:$,reset:j}=ug(E);ih(_);const{forceUnmount:q}=sh(E,_,()=>{_.update({allowMouseEnter:!1,stickIfOpen:!0}),j()}),H=de("context-menu"!==T.type),W=$c();ce(()=>{if(E||(z.current=null),"context-menu"===T.type)return E?void W.start(500,()=>{H.current=!0}):(W.clear(),void(H.current=!1))},[W,E,T.type]),om(E&&k&&M!==_f&&"touch"!==V,I),Hl(()=>{E||P||_.set("hoverEnabled",!0)},[E,P,_]);const U=de(!0),B=$c(),G=Kl((e,t)=>{const n=t.reason;if(E===e&&t.trigger===R)return;if(t.preventUnmountOnClose=()=>{_.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||(t.trigger=R??void 0),r?.(e,t),t.isCanceled)return;const o={open:e,nativeEvent:t.event,reason:t.reason,nested:L};D?.emit("openchange",o);const i=t.event;if(!1===e&&"click"===i?.type&&"touch"===i.pointerType&&!U.current)return;if(!e&&null!==A){const e=_.context.itemDomElements.current[A];queueMicrotask(()=>{e?.setAttribute("tabindex","-1")})}e&&n===xf?(U.current=!1,B.start(300,()=>{U.current=!0})):(U.current=!0,B.clear());const s=(n===wf||n===Cf)&&0===i.detail&&i?.isTrusted,a=!e&&(n===kf||null==n);function l(){const r={open:e,openChangeReason:n};z.current=t.event??null;const o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),_.update(r)}n===_f?Ct(l):l(),"menubar"!==T.type||n!==xf&&n!==Pf&&n!==_f&&n!==Of&&n!==Tf?s||a?_.set("instantType",s?"click":"dismiss"):_.set("instantType",void 0):_.set("instantType","group")}),Z=he(e=>{const t=Ff(e);return t.preventUnmountOnClose=()=>{_.set("preventUnmountingOnClose",!0)},t},[_]),K=he(()=>{_.setOpen(!1,Z(Af))},[_,Z]);let Q;fe(u,()=>({unmount:q,close:K}),[q,K]),"context-menu"===T.type&&(Q=T.context),fe(Q?.positionerRef,()=>I,[I]),fe(Q?.actionsRef,()=>({setOpen:G}),[G]);const X=dh({popupStore:_,onOpenChange:G});D=X.context.events,ce(()=>{const e=({open:e,eventDetails:t})=>G(e,t);return D.on("setOpen",e),()=>{D?.off("setOpen",e)}},[D,G]);const J=eh(X,{enabled:!O,bubbles:d&&"menu"===T.type,outsidePress:()=>"context-menu"!==T.type||"contextmenu"===z.current?.type||H.current,externalTree:L?x:void 0}),Y=Ih(X,{role:"menu"}),ee=Fg(),te=he(e=>{_.select("activeIndex")!==e&&_.set("activeIndex",e)},[_]),ne=Eh(X,{enabled:!O,listRef:_.context.itemDomElements,activeIndex:A,nested:void 0!==T.type,loopFocus:l,orientation:c,parentOrientation:"menubar"===T.type?T.context.orientation:void 0,rtl:"rtl"===ee,disabledIndices:Oc,onNavigate:te,openOnArrowKeyDown:"context-menu"!==T.type,externalTree:L?x:void 0,focusItemOnHover:g}),re=he(e=>{_.context.typingRef.current=e},[_]),oe=Ph(X,{listRef:_.context.itemLabels,activeIndex:A,resetMs:500,onMatch:e=>{E&&e!==A&&_.set("activeIndex",e)},onTypingChange:re}),{getReferenceProps:ie,getFloatingProps:se,getItemProps:ae,getTriggerProps:le}=bh([J,Y,ne,oe]),ue=pe(()=>{const e=Xf(ie(),{onMouseEnter(){_.set("hoverEnabled",!0)},onMouseMove(){_.set("allowMouseEnter",!0)}},$);return delete e.role,e},[ie,_,$]),me=pe(()=>{const e=le();if(!e)return e;const t=Xf(e,$);return delete t.role,delete t["aria-controls"],t},[le,$]),ve=Dc(),ye=pe(()=>se({onMouseEnter(){"menu"===T.type&&ve.request(()=>_.set("hoverEnabled",!1))},onMouseMove(){_.set("allowMouseEnter",!0)},onClick(){_.select("hoverEnabled")&&_.set("hoverEnabled",!1)},onKeyDown(e){const t=_.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}}),[se,T.type,ve,_]),be=pe(()=>ae(),[ae]);_.useSyncedValues({floatingRootContext:X,activeTriggerProps:ue,inactiveTriggerProps:me,popupProps:ye,itemProps:be});const we=pe(()=>({store:_,parent:w}),[_,w]),_e=Cr.jsx(Cx.Provider,{value:we,children:"function"==typeof t?t({payload:F}):t});return void 0===T.type||"context-menu"===T.type?Cr.jsx(hf,{externalTree:x,children:_e}):_e}function Wx(e){const{render:t,className:n,state:r=Mc,props:o=Oc,refs:i=Oc,metadata:s,stateAttributesMapping:a,tag:l="div",...c}=e,{compositeProps:u,compositeRef:d}=function(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Dg(),{ref:o,index:i}=ym(e),s=n===i,a=de(null),l=Jl(o,a);return{compositeProps:pe(()=>({tabIndex:s?0:-1,onFocus(){r(i)},onMouseMove(){const e=a.current;if(!t||!e)return;const n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;s||n||e.focus()}}),[s,r,i,t]),compositeRef:l,index:i}}({metadata:s});return ip(l,e,{state:r,ref:[...i,d],props:[u,...o,c],stateAttributesMapping:a})}function Ux(e){return Kc(e)&&e.hasAttribute("data-rootownerid")?e.getAttribute("data-rootownerid")??void 0:cu(e)?void 0:Ux(fu(e))}const Bx=Le(function(e,t){const{render:n,className:r,disabled:o=!1,nativeButton:i=!0,id:s,openOnHover:a,delay:l=100,closeDelay:c=0,handle:u,payload:d,...f}=e,p=Ex(!0),h=u?.store??p?.store;if(!h)throw new Error(nc(85));const g=Yh(s),m=h.useState("isTriggerActive",g),v=h.useState("floatingRootContext"),y=h.useState("isOpenedByTrigger",g),b=de(null),w=function(){const e=Ix(!0),t=Ex(!0),n=Vx();return pe(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}(),_=Dg(!0),S=df(),C=pe(()=>S??new af,[S]),E=ff(C),R=uf(),{registerTrigger:I,isMountedByThisTrigger:P}=function(e,t,n,r){const o=n.useState("isMountedByTrigger",e),i=function(e,t){const n=de(null);return he(r=>{void 0!==e&&(null!==n.current&&(t.context.triggerElements.delete(n.current),n.current=null),null!==r&&(n.current=e,t.context.triggerElements.add(e,r)))},[t,e])}(e,n),s=Kl(t=>{i(t),null!==t&&n.select("open")&&null==n.select("activeTriggerId")&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Hl(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:o}}(g,b,h,{payload:d,closeDelay:c,parent:w,floatingTreeRoot:C,floatingNodeId:E,floatingParentNodeId:R,keyboardEventRelay:_?.relayKeyboardEvent}),k=h.useState("disabled"),O=o||k||"menubar"===w.type&&w.context.disabled,{getButtonProps:M,buttonRef:T}=Vg({disabled:O,native:i});ce(()=>{y||void 0!==w.type||(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,w.type]);const A=de(null),F=$c(),N=Kl(e=>{if(!A.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;const t=e.target;if(zu(A.current,t)||zu(h.select("positionerElement"),t)||t===A.current)return;if(null!=t&&Ux(t)===h.select("rootId"))return;const n=$g(A.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||C.events.emit("close",{domEvent:e,reason:Mf})});ce(()=>{y&&h.select("lastOpenChangeReason")===_f&&Df(A.current).addEventListener("mouseup",N,{once:!0})},[y,N,h]);const z="menubar"===w.type&&w.context.hasSubmenuOpen,L=function(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:i=!0,delay:s=0,handleClose:a=null,mouseOnly:l=!1,restMs:c=0,move:u=!0,triggerElementRef:d=yh,externalTree:f,isActiveTrigger:p=!0}=t,h=df(f),{pointerTypeRef:g,interactedInsideRef:m,handlerRef:v,blockMouseMoveRef:y,performedPointerEventsMutationRef:b,unbindMouseMoveRef:w,restTimeoutPendingRef:_,openChangeTimeout:x,restTimeout:S,handleCloseOptionsRef:C}=gh(n),E=jc(a),R=jc(s),I=jc(c);p&&(C.current=E.current?.__options);const P=Kl(()=>!!m.current||!!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type)),k=he((e,t=!0)=>{const r=Lf(R.current,"close",g.current);r&&!v.current?x.start(r,()=>n.setOpen(!1,Ff(_f,e))):t&&(x.clear(),n.setOpen(!1,Ff(_f,e)))},[R,v,n,g,x]),O=Kl(()=>{w.current(),v.current=void 0}),M=Kl(()=>{if(b.current){const e=Vu(n.select("domReferenceElement")).body;e.style.pointerEvents="",e.removeAttribute(ph),b.current=!1}});ce(()=>{if(i)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){e.open||(x.clear(),S.clear(),y.current=!0,_.current=!1)}},[i,o,x,S,y,_]);const T=Kl(e=>{if(P())return;if(!r.current.floatingContext)return;const t=n.context.triggerElements;if(e.relatedTarget&&t.hasElement(e.relatedTarget))return;const o=d.current;E.current?.({...r.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){M(),O(),P()||o!==n.select("domReferenceElement")||k(e)}})(e)});return ce(()=>{if(!i)return;const e=d.current??(p?n.select("domReferenceElement"):null);if(Zc(e))return n.select("open")&&e.addEventListener("mouseleave",s),u&&e.addEventListener("mousemove",t,{once:!0}),e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("mouseleave",s),u&&e.removeEventListener("mousemove",t),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",o)};function t(e){if(x.clear(),y.current=!1,l&&!Zu(g.current))return;if(vh(I.current)>0&&!Lf(R.current,"open"))return;const t=Lf(R.current,"open",g.current),r=n.select("domReferenceElement"),o=n.context.triggerElements,i=(o.hasElement(e.target)||o.hasMatchingElement(t=>zu(t,e.target)))&&(!r||!zu(r,e.target)),s=e.currentTarget??null,a=!n.select("open")||i;t?x.start(t,()=>{a&&n.setOpen(!0,Ff(_f,e,s))}):a&&n.setOpen(!0,Ff(_f,e,s))}function o(e){if(P())return void M();w.current();const t=Vu(n.select("domReferenceElement"));S.clear(),_.current=!1;const o=n.context.triggerElements;if(!e.relatedTarget||!o.hasElement(e.relatedTarget)){if(E.current&&r.current.floatingContext){n.select("open")||x.clear();const o=d.current;v.current=E.current({...r.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){M(),O(),P()||o!==n.select("domReferenceElement")||k(e,!0)}});const i=v.current;return i(e),t.addEventListener("mousemove",i),void(w.current=()=>{t.removeEventListener("mousemove",i)})}("touch"!==g.current||!zu(n.select("floatingElement"),e.relatedTarget))&&k(e)}}function s(e){T(e)}},[O,M,y,r,R,k,n,i,E,T,p,P,l,u,g,I,S,_,x,d,h,w,v]),pe(()=>{function e(e){g.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e,r=e.currentTarget,o=n.select("domReferenceElement"),i=n.context.triggerElements,s=n.select("open"),a=(i.hasElement(e.target)||i.hasMatchingElement(t=>zu(t,e.target)))&&(!o||!zu(o,e.target));function c(){y.current||s&&!a||n.setOpen(!0,Ff(_f,t,r))}l&&!Zu(g.current)||s&&!a||0===vh(I.current)||!a&&_.current&&e.movementX**2+e.movementY**2<2||(S.clear(),"touch"===g.current?Ct(()=>{c()}):a&&s?c():(_.current=!0,S.start(vh(I.current),c)))}}},[y,l,n,g,I,S,_])}(v,{enabled:(a??z??!1)&&!O&&"context-menu"!==w.type&&("menubar"!==w.type||z&&!P),handleClose:Oh({blockPointerEvents:"menubar"!==w.type}),mouseOnly:!0,move:!1,restMs:void 0===w.type?l:void 0,delay:{close:c},triggerElementRef:b,externalTree:C,isActiveTrigger:m}),D=function(e,t){const n=$c(),[r,o]=ae(!1);return Hl(()=>{e&&"trigger-hover"===t?(o(!0),n.start(500,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}(y,h.select("lastOpenChangeReason")),V=mp(v,{enabled:!O&&"context-menu"!==w.type,event:y&&"menubar"===w.type?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===w.type&&D}),$=function(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:o}=n.context,{enabled:i=!0,visibleOnly:s=!0}=t,a=de(!1),l=$c(),c=de(!0);ce(()=>{const e=n.select("domReferenceElement");if(!i)return;const t=Uc(e);function r(){!n.select("open")&&Kc(e)&&e===Nu(Vu(e))&&(a.current=!0)}function o(){c.current=!0}function s(){c.current=!1}return t.addEventListener("blur",r),fh&&(t.addEventListener("keydown",o,!0),t.addEventListener("pointerdown",s,!0)),()=>{t.removeEventListener("blur",r),fh&&(t.removeEventListener("keydown",o,!0),t.removeEventListener("pointerdown",s,!0))}},[n,i]),ce(()=>{if(i)return r.on("openchange",e),()=>{r.off("openchange",e)};function e(e){e.reason!==wf&&e.reason!==kf||(a.current=!0)}},[r,i]);const u=pe(()=>({onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=Lu(e.nativeEvent);if(s&&Zc(t))if(fh&&!e.relatedTarget){if(!c.current&&!$u(t))return}else if(!function(e){if(!e||Ru)return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;n.setOpen(!0,Ff(xf,e.nativeEvent,e.currentTarget))},onBlur(e){a.current=!1;const t=e.relatedTarget,r=e.nativeEvent,i=Zc(t)&&t.hasAttribute(zf("focus-guard"))&&"outside"===t.getAttribute("data-type");l.start(0,()=>{const s=n.select("domReferenceElement"),a=Nu(s?s.ownerDocument:document);(t||a!==s)&&(zu(o.current.floatingContext?.refs.floating.current,a)||zu(s,a)||i||n.context.triggerElements.hasElement(e.relatedTarget)||n.setOpen(!1,Ff(xf,r)))})}}),[o,n,s,l]);return pe(()=>i?{reference:u,trigger:u}:{},[i,u])}(v,{enabled:!O&&("menubar"!==w.type&&y||z)}),j=function(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=de(!1);return pe(()=>t?{onMouseDown:e=>{("open"===n&&!r||"close"===n&&r)&&(o.current=!0,Df(e.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:e=>{o.current&&(o.current=!1,e.preventBaseUIHandler())}}:Mc,[t,n,r])}({open:y,enabled:"menubar"===w.type,mouseDownAction:"open"}),q=bh([V,$]),H="menubar"===w.type,W=pe(()=>({disabled:O,open:y}),[O,y]),U=h.useState("triggerProps",P),B=[A,t,T,I,b],G=[q.getReferenceProps(),L??Mc,U,{"aria-haspopup":"menu",id:g,onMouseDown:e=>{h.select("open")||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Df(e.currentTarget).addEventListener("mouseup",N,{once:!0}))}},H?{role:"menuitem"}:{},j,f,M],Z=de(null),K=Kl(e=>{Ct(()=>{h.setOpen(!1,Ff(Pf,e.nativeEvent,e.currentTarget))});const t=Xd(Z.current,-1);t?.focus()}),Q=Kl(e=>{const t=h.select("positionerElement");if(t&&Jd(e,t))h.context.beforeContentFocusGuardRef.current?.focus();else{Ct(()=>{h.setOpen(!1,Ff(Pf,e.nativeEvent,e.currentTarget))});let n=Xd(b.current,1);for(;null!==n&&zu(t,n)||n?.hasAttribute("aria-hidden");){const e=n;if(n=Kd(n),n===e)break}n?.focus()}}),X=ip("button",e,{enabled:!H,stateAttributesMapping:Pg,state:W,ref:B,props:G});return H?Cr.jsx(Wx,{tag:"button",render:n,className:r,state:W,refs:B,props:G,stateAttributesMapping:Pg}):y?Cr.jsxs(x,{children:[Cr.jsx(Vf,{ref:Z,onFocus:K},`${g}-pre-focus-guard`),Cr.jsx(x,{children:X},g),Cr.jsx(Vf,{ref:h.context.triggerFocusTargetRef,onFocus:Q},`${g}-post-focus-guard`)]}):Cr.jsx(x,{children:X},g)}),Gx=({columnId:e,columnName:t,canSort:n,multiSortEnabled:r,sorting:o,onSortingChange:i})=>{const{i18n:s}=Lr(),a=pe(()=>o.find(t=>t.id===e),[o,e]),l=pe(()=>o.findIndex(t=>t.id===e),[o,e]),c=a&&!a.desc,u=a&&a.desc,d=o[0]?.columnName||"",f=o[1]?.columnName||"",p=he(n=>{const s=n?c:u,a={id:e,columnName:t,desc:n},l=r?2:1;if(n?u:c)i(o.filter(t=>t.id!==e));else if(s){const t=o.map(t=>t.id===e?{...t,desc:n}:t);i(t)}else{const e=r&&o.length>0?[o[0],a]:[a];i(((e,t)=>{const n=new Set,r=[];for(const o of e)if(!n.has(o.id)&&(n.add(o.id),r.push(o),r.length>=t))break;return r})(e,l))}},[e,t,o,i,c,u,r]),h=he(()=>{const n=a?.desc??!1;if(a&&1===l){const e=[...o],t=e[0];e[0]={...a,desc:n},e[1]=t,i(e)}else a||1!==o.length||i([{id:e,columnName:t,desc:!1},...o])},[e,t,a,l,o,i]),g=he(()=>{const n=a?.desc??!1;if(a&&0===l){const e=[...o],t=e[1];e[1]={...a,desc:n},e[0]=t,i(e)}else a||1!==o.length||i([...o,{id:e,columnName:t,desc:!1}])},[e,t,a,l,o,i]),m=he(()=>{const n=[...o];n[0]={id:e,columnName:t,desc:!1},i(n)},[e,t,o,i]),v=he(()=>{const n=[...o];n[1]={id:e,columnName:t,desc:!1},i(n)},[e,t,o,i]),y=pe(()=>r?0===o.length?{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:a?2===o.length?{switchToPrimary:1===l,switchToSecondary:0===l,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:1===o.length?{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!0,addAsSecondary:!0,replacePrimary:!1,replaceSecondary:!1}:2===o.length?{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!0,replaceSecondary:!0}:{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1},[a,r,l,o.length]);return n?yr(Ox,{className:"barn2-sort-section",children:[yr(Mx,{className:"barn2-sort-section-header",render:yr("div",{}),children:yr("span",{className:"barn2-sort-section-label",children:s.sort})}),yr(Tx,{className:Ar("barn2-sort-menu-item",c&&"barn2-sort-menu-item-active"),onClick:()=>p(!1),children:[yr("span",{children:s.sortAscending}),c&&yr(km,{className:"barn2-sort-menu-check"})]}),yr(Tx,{className:Ar("barn2-sort-menu-item",u&&"barn2-sort-menu-item-active"),onClick:()=>p(!0),children:[yr("span",{children:s.sortDescending}),u&&yr(km,{className:"barn2-sort-menu-check"})]}),y.switchToPrimary&&yr(Tx,{className:"barn2-sort-menu-item",onClick:h,children:yr("span",{children:s.switchToPrimarySort})}),y.switchToSecondary&&yr(Tx,{className:"barn2-sort-menu-item",onClick:g,children:yr("span",{children:s.switchToSecondarySort})}),y.addAsPrimary&&yr(Tx,{className:"barn2-sort-menu-item",onClick:h,children:yr("span",{children:s.setAsPrimarySort})}),y.addAsSecondary&&yr(Tx,{className:"barn2-sort-menu-item",onClick:g,children:yr("span",{children:s.setAsSecondarySort})}),y.replacePrimary&&yr(Tx,{className:"barn2-sort-menu-item",onClick:m,children:yr("span",{children:s.replacePrimarySort({columnName:d})})}),y.replaceSecondary&&yr(Tx,{className:"barn2-sort-menu-item",onClick:v,children:yr("span",{children:s.replaceSecondarySort({columnName:f})})})]}):null},Zx=({filter:e,value:t,onChange:n,filterCounts:r,showCounts:o=!0})=>{const{i18n:i}=Lr(),s=de(null),[a,l]=ae(""),c=!0===e.multiple,{sortedItems:u,selectedItems:d,selectedValues:f,firstUnselectedIndex:p,showSeparator:h}=Nm({options:e.options,filterCounts:r,value:t,multiple:!0}),g=he(e=>{l(""),e&&0!==e.length?n(e.map(e=>e.value)):n(null)},[n]),m=he(e=>{l(""),n(e?e.value:null)},[n]),v=he(e=>e?e.label||String(e.value):"",[]),y=he(e=>{e.preventDefault(),e.stopPropagation(),n(null)},[n]),b=he(e=>{e.stopPropagation()},[]),w=he(e=>{const t=u.some(t=>(t.label||String(t.value))===e);l(t?"":e)},[u]),_=f.size>0,S=u.length>9;if(c)return yr("div",{className:"barn2-filter-section",onKeyDown:b,ref:s,children:yr(gg,{multiple:!0,open:!0,items:u,value:d,onValueChange:g,itemToStringLabel:v,inputValue:a,onInputValueChange:w,children:[yr("div",{className:"barn2-filter-section-header",children:[yr("span",{className:"barn2-filter-section-label",children:i.filterBy({filterName:e.name})}),_&&yr("button",{type:"button",className:"barn2-filter-clear-btn",onClick:y,children:i.clear})]}),S&&yr("div",{className:"barn2-filter-search-wrapper",children:[yr(Tm,{className:"barn2-filter-search-icon"}),yr(zg,{className:"barn2-filter-search-input",placeholder:i.searchFilterPlaceholder({filterName:e.name}),"aria-label":i.searchFilter({filterName:e.name})})]}),yr("div",{className:"barn2-filter-options-list barn2-filter-popup--embedded",children:[yr(Em,{className:"barn2-filter-empty",children:i.noResultsFound}),yr(Qg,{className:"barn2-filter-list",children:(e,t)=>yr(x,{children:[t.index===p&&h&&yr(zm,{className:"barn2-filter-separator"}),yr(xm,{value:e,className:"barn2-filter-option",children:[yr("div",{className:"barn2-filter-checkbox",children:yr(Sm,{children:yr(km,{"aria-hidden":"true"})})}),yr(Lm,{item:e,className:"barn2-filter-option-text",prefixClassName:"barn2-filter-hierarchy-prefix",countClassName:"barn2-filter-item-count",showCounts:o})]},String(e.value))]})})]})]})});const C=d.length>0?d[0]:null;return yr("div",{className:"barn2-filter-section",onKeyDown:b,ref:s,children:yr(gg,{open:!0,items:u,value:C,onValueChange:m,itemToStringLabel:v,inputValue:a,onInputValueChange:w,children:[yr("div",{className:"barn2-filter-section-header",children:[yr("span",{className:"barn2-filter-section-label",children:i.filterBy({filterName:e.name})}),_&&yr("button",{type:"button",className:"barn2-filter-clear-btn",onClick:y,children:i.clear})]}),S&&yr("div",{className:"barn2-filter-search-wrapper",children:[yr(Tm,{className:"barn2-filter-search-icon"}),yr(zg,{className:"barn2-filter-search-input",placeholder:i.searchFilterPlaceholder({filterName:e.name}),"aria-label":i.searchFilter({filterName:e.name})})]}),yr("div",{className:"barn2-filter-options-list barn2-filter-popup--embedded",children:[yr(Em,{className:"barn2-filter-empty",children:i.noResultsFound}),yr(Qg,{className:"barn2-filter-list",children:(e,t)=>yr(x,{children:[t.index===p&&h&&yr(zm,{className:"barn2-filter-separator"}),yr(xm,{value:e,className:"barn2-filter-option",children:[yr(Sm,{className:"barn2-filter-indicator",children:yr(km,{"aria-hidden":"true"})}),yr(Lm,{item:e,className:"barn2-filter-option-text",prefixClassName:"barn2-filter-hierarchy-prefix",countClassName:"barn2-filter-item-count",showCounts:o})]},String(e.value))]})})]})]})})},Kx=({column:e,columnName:t,sorting:n,multiSortEnabled:r,onSortingChange:o,onSingleSortClick:i,inlineFilter:s,filterValue:a,onFilterChange:l,filterCounts:c,showCounts:u=!0})=>{const d=e.id,{displayMode:f,i18n:p}=Lr(),h=e.getCanSort(),g=pe(()=>n.find(e=>e.id===d),[n,d]),m=!!g,v=g?.desc?"desc":g?"asc":"none",y=r||s,b=he(e=>{e.stopPropagation()},[]),w=he(t=>{if(t.stopPropagation(),!h)return;if(!y&&i)return void i(d);const n=e.getToggleSortingHandler();n&&n(t)},[h,e,d,i,y]),_=h&&s;return yr("div",y?{className:"header-menu",onClick:b,children:yr(Hx,{modal:!1,children:[yr(Bx,{className:Ar("header-menu-trigger",m&&"header-menu-trigger-active"),"aria-label":p.columnOptionsFor({columnName:t}),children:yr(Qx,{direction:v})}),yr(zx,{children:yr(Lx,{className:"barn2-header-menu-positioner",positionMethod:"fixed",sideOffset:4,side:"bottom",align:"end",children:yr(Fx,{className:"barn2-header-menu-popup","data-display-mode":f,children:[h&&yr(Gx,{columnId:d,columnName:t,canSort:h,multiSortEnabled:r,sorting:n,onSortingChange:o}),_&&yr(Pm,{className:"barn2-header-menu-separator"}),s&&l&&yr(Zx,{filter:s,value:a??null,onChange:l,filterCounts:c,showCounts:u})]})})})]})}:{className:"header-menu",children:yr("button",{type:"button",className:Ar("header-menu-trigger","header-menu-trigger-indicator-only",m&&"header-menu-trigger-active"),onClick:w,"aria-label":p.sortByColumn({columnName:t}),children:yr(Qx,{direction:v})})})},Qx=({direction:e})=>yr("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Ar("header-menu-icon",`header-menu-icon-${e}`),"aria-hidden":"true",children:[yr("rect",{x:"1",y:"2.75",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),yr("rect",{x:"3",y:"6.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),yr("rect",{x:"5",y:"9.75",width:"4",height:"1.5",rx:"0.75",fill:"currentColor"})]});function Xx({header:e,columnWidths:t,shouldShowDropdown:n,getColumnName:r,sortItems:o,multiSortEnabled:i,onSortingChange:s,onSingleSortClick:a,inlineFilterMap:l,currentFilters:c,onFilterChange:u,filterCounts:d,showCounts:f}){const p=e.column.getCanSort(),h=e.column.id,g=l.get(h),m=n(h,p),v=t[h]||e.getSize(),y=g?c.find(e=>e.id===g.id)?.value:void 0,b=m&&(i||!!g),w=de(null),_=he(()=>{const e=w.current?.querySelector(".header-menu-trigger");e instanceof HTMLElement&&e.click()},[]),x=b?_:p?()=>a(h):void 0;return yr("th",{className:Ar("table-header-cell",p&&"sortable",h&&"__responsive_control__"!==h?`col-${h.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":h,style:{width:v,maxWidth:v},children:e.isPlaceholder?null:yr("div",{ref:m?w:void 0,className:m?"table-header-cell-wrapper":void 0,children:[yr("div",{className:Ar("table-header-content",(p||b)&&"clickable"),onClick:x,children:yr("span",{className:"table-header-label",children:Ay(e.column.columnDef.header,e.getContext())})}),m&&yr(Kx,{column:e.column,columnName:r(h),sorting:o,multiSortEnabled:i,onSortingChange:s,onSingleSortClick:a,inlineFilter:g,filterValue:y??null,onFilterChange:g?e=>u(g.id,e):void 0,filterCounts:g?Fm(d,g.id):void 0,showCounts:f})]})})}const Jx=Fe(function({headerGroups:e,hidden:t,isSticky:n,stickyEnabled:r,asFooter:o,columnWidths:i,shouldShowDropdown:s,getColumnName:a,sortItems:l,multiSortEnabled:c,onSortingChange:u,onSingleSortClick:d,inlineFilterMap:f,currentFilters:p,onFilterChange:h,filterCounts:g,showCounts:m,style:v,className:y}){if(t)return null;const b=yr(x,{children:e.map(e=>yr("tr",{className:"table-header-row",children:e.headers.map(e=>yr(Xx,{header:e,columnWidths:i,shouldShowDropdown:s,getColumnName:a,sortItems:l,multiSortEnabled:c,onSortingChange:u,onSingleSortClick:d,inlineFilterMap:f,currentFilters:p,onFilterChange:h,filterCounts:g,showCounts:m},e.id))},e.id))});return yr(o?"tfoot":"thead",{className:Ar("table-header",o&&"table-footer",!r&&"table-header-not-sticky",n&&"table-header-fixed",y),style:v,children:b})}),Yx=({value:e,rowData:t,className:n,columnConfig:r,filters:o,currentFilters:i,onFilterChange:s,allowClickToFilter:a=!0})=>{const l=pe(()=>r?mx(r,{filters:o,onFilterChange:s,currentFilters:i,allowClickToFilter:a}):null,[r,o,s,i,a]);if(null==e||""===e)return yr("div",{className:n,children:"—"});const c=l?l({getValue:()=>e,row:{original:t}}):(e=>{if("string"==typeof e)return yr("span",{dangerouslySetInnerHTML:{__html:e}});if(lx(e))return yr(nx,{data:e,columnId:"",clickToFilter:!1});if(ax(e)){const t=e;return t.thumbnail?yr("img",{src:t.thumbnail,alt:t.alt||"",style:{width:"70px",height:"70px",objectFit:"contain"}}):null}return"boolean"==typeof e?e?"true":"false":"number"==typeof e||"bigint"==typeof e||yt(e)?e:null})(e);return yr("div",null==c||""===c?{className:n,children:"—"}:{className:n,children:c})},eS=({hiddenColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,rowIndex:s})=>0===e.length?null:yr("ul",{className:"child-row-list","data-row-index":s,children:e.map(e=>yr("li",{className:Ar("child-row-item",e.columnId?`col-${e.columnId.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":e.columnId,children:[yr("span",{className:"child-row-title",children:e.title}),yr(Yx,{value:e.data,rowData:t,className:"child-row-data",columnConfig:n.get(e.columnId),filters:r,currentFilters:o,onFilterChange:i,allowClickToFilter:!0})]},e.columnId))}),tS=({hiddenColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,rowIndex:s,visibleColumnCount:a,isVisible:l,display:c,virtualStart:u,parentHeight:d=33})=>{const{i18n:f}=Lr();if(!l&&"childRowVisible"!==c)return null;if(0===e.length)return null;const p=void 0!==u?u+d:void 0,h=void 0!==p?{position:"absolute",transform:`translateY(${p}px)`,width:"100%"}:{};return yr("tr",{className:Ar("child-row","childRowVisible"===c&&"always-visible",l&&"shown"),"data-parent-row":s,role:"region","aria-label":f.additionalRowDetails,style:h,children:yr("td",{colSpan:a,className:"child-row-cell",children:yr("div",{className:"child-row-content",children:yr(eS,{hiddenColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,rowIndex:s})})})})},nS=B(void 0);function rS(e){const t=ge(nS);if(!1===e&&void 0===t)throw new Error(nc(27));return t}const oS={...kg,...bg},iS=Le(function(e,t){const{render:n,className:r,forceRender:o=!1,...i}=e,{store:s}=rS(),a=s.useState("open"),l=s.useState("nested"),c=s.useState("mounted"),u=s.useState("transitionStatus");return ip("div",e,{state:pe(()=>({open:a,transitionStatus:u}),[a,u]),ref:[s.context.backdropRef,t],stateAttributesMapping:oS,props:[{role:"presentation",hidden:!c,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:o||!l})}),sS=Le(function(e,t){const{render:n,className:r,disabled:o=!1,nativeButton:i=!0,...s}=e,{store:a}=rS(),l=a.useState("open"),{getButtonProps:c,buttonRef:u}=Vg({disabled:o,native:i});return ip("button",e,{state:pe(()=>({disabled:o}),[o]),ref:[t,u],props:[{onClick:function(e){l&&a.setOpen(!1,Ff("close-press",e.nativeEvent))}},s,c]})});let aS=function(e){return e.nestedDialogs="--nested-dialogs",e}({}),lS=function(e){return e[e.open=wg.open]="open",e[e.closed=wg.closed]="closed",e[e.startingStyle=wg.startingStyle]="startingStyle",e[e.endingStyle=wg.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({});const cS=B(void 0),uS={...kg,...bg,nestedDialogOpen:e=>e?{[lS.nestedDialogOpen]:""}:null},dS=Le(function(e,t){const{className:n,finalFocus:r,initialFocus:o,render:i,...s}=e,{store:a}=rS(),l=a.useState("descriptionElementId"),c=a.useState("disablePointerDismissal"),u=a.useState("floatingRootContext"),d=a.useState("popupProps"),f=a.useState("modal"),p=a.useState("mounted"),h=a.useState("nested"),g=a.useState("nestedOpenDialogCount"),m=a.useState("open"),v=a.useState("openMethod"),y=a.useState("titleElementId"),b=a.useState("transitionStatus"),w=a.useState("role");!function(){if(void 0===ge(cS))throw new Error(nc(26))}(),oh({open:m,ref:a.context.popupRef,onComplete(){m&&a.context.onOpenChangeComplete?.(!0)}});const _=void 0===o?function(e){return"touch"!==e||a.context.popupRef.current}:o,x=g>0,S=ip("div",e,{state:pe(()=>({open:m,nested:h,transitionStatus:b,nestedDialogOpen:x}),[m,h,b,x]),props:[d,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:w,tabIndex:-1,hidden:!p,onKeyDown(e){wv.has(e.key)&&e.stopPropagation()},style:{[aS.nestedDialogs]:g}},s],ref:[t,a.context.popupRef,a.useStateSetter("popupElement")],stateAttributesMapping:uS});return Cr.jsx(gp,{context:u,openInteractionType:v,disabled:!p,closeOnFocusOut:!c,initialFocus:_,returnFocus:r,modal:!1!==f,restoreFocus:"popup",children:S})}),fS=Le(function(e,t){const{keepMounted:n=!1,...r}=e,{store:o}=rS(),i=o.useState("mounted"),s=o.useState("modal");return i||n?Cr.jsx(cS.Provider,{value:n,children:Cr.jsxs(cp,{ref:t,...r,children:[i&&!0===s&&Cr.jsx(fm,{ref:o.context.internalBackdropRef,inert:Yg(!open)}),e.children]})}):null}),pS={...ch,modal:fc(e=>e.modal),nested:fc(e=>e.nested),nestedOpenDialogCount:fc(e=>e.nestedOpenDialogCount),disablePointerDismissal:fc(e=>e.disablePointerDismissal),openMethod:fc(e=>e.openMethod),descriptionElementId:fc(e=>e.descriptionElementId),titleElementId:fc(e=>e.titleElementId),viewportElement:fc(e=>e.viewportElement),role:fc(e=>e.role)};class hS extends Tc{constructor(e){super(function(e={}){return{...lh(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}(e),{popupRef:_(),backdropRef:_(),internalBackdropRef:_(),triggerElements:new ah,onOpenChange:void 0,onOpenChangeComplete:void 0},pS)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;const n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",n);const r={open:e},o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)}}function gS(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:i,disablePointerDismissal:s=!1,modal:a=!0,actionsRef:l,handle:c,triggerId:u,defaultTriggerId:d=null}=e,f=rS(!0),p=Boolean(f),h=Bl(()=>c?.store??new hS({open:n??r,activeTriggerId:void 0!==u?u:d,modal:a,disablePointerDismissal:s,nested:p})).current;h.useControlledProp("open",n,r),h.useControlledProp("activeTriggerId",u,d),h.useSyncedValues({disablePointerDismissal:s,nested:p,modal:a}),h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",i);const g=h.useState("payload");!function(e){const{store:t,parentContext:n,actionsRef:r}=e,o=t.useState("open"),i=t.useState("disablePointerDismissal"),s=t.useState("modal"),a=t.useState("popupElement"),{openMethod:l,triggerProps:c,reset:u}=ug(o);ih(t);const{forceUnmount:d}=sh(o,t,()=>{u()}),f=Kl(e=>{const n=Ff(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}),p=he(()=>{t.setOpen(!1,f(Af))},[t,f]);fe(r,()=>({unmount:d,close:p}),[d,p]);const h=dh({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,m]=ae(0),v=0===g,y=Ih(h),b=eh(h,{outsidePressEvent:()=>t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:"trap-focus"===s?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if("button"in e&&0!==e.button)return!1;if("touches"in e&&1!==e.touches.length)return!1;const n=Lu(e);if(v&&!i){const e=n;return!s||!t.context.internalBackdropRef.current&&!t.context.backdropRef.current||t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||zu(e,a)&&!e?.hasAttribute("data-base-ui-portal")}return!1},escapeKey:v});om(o&&!0===s,a);const{getReferenceProps:w,getFloatingProps:_,getTriggerProps:x}=bh([y,b]);t.useContextCallback("onNestedDialogOpen",e=>{m(e+1)}),t.useContextCallback("onNestedDialogClose",()=>{m(0)}),ce(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(g),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,g]);const S=pe(()=>w(c),[w,c]),C=pe(()=>x(c),[x,c]),E=pe(()=>_(),[_]);t.useSyncedValues({openMethod:l,activeTriggerProps:S,inactiveTriggerProps:C,popupProps:E,floatingRootContext:h,nestedOpenDialogCount:g})}({store:h,actionsRef:l,parentContext:f?.store.context});const m=pe(()=>({store:h}),[h]);return Cr.jsx(nS.Provider,{value:m,children:"function"==typeof t?t({payload:g}):t})}const mS=Le(function(e,t){const{render:n,className:r,id:o,...i}=e,{store:s}=rS(),a=Yh(o);return s.useSyncedValueWithCleanup("titleElementId",a),ip("h2",e,{ref:t,props:[{id:a},i]})}),vS=({allColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,allowClickToFilter:s=!1,isOpen:a,onClose:l,rowIndex:c=0,title:u})=>{const{displayMode:d,i18n:f}=Lr(),p=pe(()=>u?e.filter(e=>"title"!==e.columnId):e,[e,u]);return 0===e.length?null:yr(gS,{open:a,onOpenChange:e=>!e&&l(),children:yr(fS,{children:[yr(iS,{className:"barn2-responsive-modal-backdrop"}),yr(dS,{className:"barn2-responsive-modal-popup","data-display-mode":d,children:yr("div",{className:"barn2-responsive-modal-content",children:[yr("div",{className:"barn2-responsive-modal-header",children:[yr(mS,u?{className:"barn2-responsive-modal-title",dangerouslySetInnerHTML:{__html:u}}:{className:"barn2-responsive-modal-title",children:f.details}),yr(sS,{className:"barn2-responsive-modal-close","aria-label":f.close,children:yr(Om,{})})]}),yr("div",{className:"barn2-responsive-modal-body",children:yr("ul",{className:"modal-details-list","data-row-index":c,children:p.map(e=>yr("li",{className:Ar("modal-details-item",e.columnId?`col-${e.columnId.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":e.columnId,children:[yr("span",{className:"modal-details-title",children:e.title}),yr(Yx,{value:e.data,rowData:t,className:"modal-details-data",columnConfig:n.get(e.columnId),filters:r,currentFilters:o,onFilterChange:i,allowClickToFilter:s})]},e.columnId))})})]})})]})})};function yS({data:e,columns:t,features:n,state:r,totalPages:o,containerWidth:i,filters:s,filterCounts:a,onFilterChange:l,onSortingChange:c,onPaginationChange:u,onRowClick:d,wrapperRef:f,loading:p,rowSelection:h,infiniteScroll:g}){const{i18n:m}=Lr(),v=de(null),y=null!==h,b=!1!==h?.selectAll.enabled,w=h?.selectAll.label??void 0,_=pe(()=>JSON.stringify({pageIndex:r.pagination.pageIndex,sorting:r.sorting,filters:r.filters,search:r.search.query}),[r.pagination.pageIndex,r.sorting,r.filters,r.search.query]),S=n.header,C=n.scrollToTop,E=void 0!==g,{visibleColumnConfigs:R,columnWidths:I,widthsReady:P,responsiveEnabled:k,hasHiddenColumns:O,shouldShowControl:M,isRowExpanded:T,toggleRow:A,getHiddenColumnsForRow:F,getAllColumnsForRow:N,responsiveConfig:z}=yx({columns:t,data:e,containerRef:v,containerWidth:i,responsiveConfig:n.responsive,loading:p,dataStateKey:_}),{isSticky:L,stickyStyle:D}=function({enabled:e,offset:t=0,tableRef:n}){const[r,o]=ae(!1),[i,s]=ae({}),[a,l]=ae([]),c=de(null),u=he(()=>{if(!e||!n.current)return void o(!1);const r=n.current.querySelector("table"),i=r?.querySelector("thead");if(!r||!i)return void o(!1);c.current=i;const a=r.getBoundingClientRect(),l=i.getBoundingClientRect(),u=l.bottom<t&&a.bottom>t+l.height;o(u),u&&s({position:"fixed",top:t,left:a.left,width:a.width,zIndex:1e3})},[e,t,n]),d=he(()=>{if(!c.current)return;const e=c.current.querySelectorAll("th"),t=[];e.forEach(e=>{t.push(e.offsetWidth)}),l(t)},[]);return ce(()=>{if(!e||!n.current)return;u(),d();const t=()=>{u()},r=()=>{d(),u()};window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",r);const o=n.current.querySelector("table");let i=null;return o&&(i=new ResizeObserver(()=>{d(),u()}),i.observe(o)),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",r),i?.disconnect()}},[e,n,u,d]),ce(()=>{r&&d()},[r,d]),{isSticky:r,stickyStyle:i,columnWidths:a}}({enabled:S.sticky&&!S.hidden,offset:C?.offset??0,tableRef:v});bx({enabled:null!==C,offset:C?.offset??0,targetRef:f,stateKey:JSON.stringify({...!E&&{page:r.pagination.pageIndex},filters:r.filters,search:r.search.query}),loading:p});const[V,$]=ae(null),j=pe(()=>(e=>{const t=new Map;return e.forEach(e=>{t.set(e.id,e)}),t})(t),[t]),q=pe(()=>{if(!n.filtering.column||!s)return new Map;const e=new Map;return s.forEach(t=>{const n=t.columnId??t.id;j.has(n)&&e.set(n,t)}),e},[n.filtering.column,s,j]),H=he(e=>{const t=j.get(e);return t?.header||e},[j]),W=pe(()=>((e,t)=>e.map(e=>({id:e.id,columnName:t(e.id),desc:e.desc})))(r.sorting,H),[r.sorting,H]),U=he(e=>{c(e.map(({id:e,desc:t})=>({id:e,desc:t})))},[c]),B=he(e=>{const t=r.sorting.find(t=>t.id===e);c(t?[{id:e,desc:!t.desc}]:[{id:e,desc:!1}])},[c,r.sorting]),G=he((e,t)=>q.has(e)||t,[q]),Z=de(new Map),K=de(new Map),Q=(ne={count:e.length,estimateSize:()=>52,getScrollElement:()=>v.current,overscan:5,measureElement:"undefined"!=typeof window?e=>{if(!e)return 0;let t=e.getBoundingClientRect().height;const n=e.nextElementSibling;return n&&n.classList.contains("child-row")&&(t+=n.getBoundingClientRect().height),t}:void 0},function({useFlushSync:e=!0,...t}){const n=le(()=>({}),{})[1],r={...t,onChange:(r,o)=>{var i;e&&o?Ct(n):n(),null==(i=t.onChange)||i.call(t,r,o)}},[o]=ae(()=>new By(r));return o.setOptions(r),Zy(()=>o._didMount(),[]),Zy(()=>o._willUpdate()),o}({observeElementRect:$y,observeElementOffset:Hy,scrollToFn:Uy,...ne})),X=he(e=>{A(e),requestAnimationFrame(()=>{const t=Z.current.get(e);t&&Q.measureElement(t)})},[A,Q]),J=pe(()=>{if(!y||!b)return null;const t=R.filter(e=>e.id!==ox),n=Math.min(e.length,50);for(const r of t){const t=r.accessor||r.id;for(let o=0;o<n;o++){const n=e[o],i=n?.[t];if("string"==typeof i&&i.includes("data-dv-row-selection-id"))return r.id}}for(const e of["buy","link"])if(t.some(t=>t.id===e))return e;return null},[y,b,R,e]),Y=pe(()=>{const e=((e,t)=>e.map(e=>((e,t)=>{const n={id:e.id,header:e.header,size:fx(e.width),enableSorting:!1!==e.sortable,enableHiding:!0,meta:{dataType:e.dataType,filterable:!1!==e.filterable,searchable:!1!==e.searchable,...e.metadata}};return e.accessor?n.accessorKey=e.accessor:n.accessorKey=e.id,n.cell=mx(e,t),e.tanstackColumn&&Object.assign(n,e.tanstackColumn),n})(e,t)))(R.filter(e=>e.id!==ox),{filters:s,onFilterChange:l,currentFilters:r.filters}),t=y&&b&&J?e.map(e=>{if(e.id!==J)return e;const t=e.header,n=null!=t;return{...e,header:e=>yr("span",{className:Ar("dv-select-all-header",n&&"dv-select-all-header--with-title"),children:[n&&yr("span",{className:"dv-select-all-header__title",children:"function"==typeof t?t(e):t}),yr(wx,{columnId:J,label:w})]})}}):e,n=(e=>{const t=[],n=e.responsive;return n&&n.enabled&&"column"===n.controlType&&n.shouldShowControl&&t.push({id:ox,header:()=>null,cell:({row:e})=>yr(rx,{isExpanded:n.isRowExpanded(e.id),onClick:()=>{"modal"===n.displayMode?n.onOpenModal(e.index):n.onToggleRow(e.id)},type:"column",hasHiddenColumns:n.hasHiddenColumns}),size:50,enableSorting:!1,enableHiding:!1,meta:{isResponsiveControl:!0}}),t})({responsive:k?{enabled:k,controlType:z?.control??"inline",displayMode:z?.display??"childRow",shouldShowControl:M,hasHiddenColumns:O,isRowExpanded:T,onToggleRow:X,onOpenModal:$}:null});return n.length>0?[...n,...t]:t},[R,s,l,r.filters,y,b,w,J,k,z,M,T,O,X,$]),ee=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ae(()=>({current:Ty(t)})),[r,o]=ae(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{o(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:Y,getCoreRowModel:e=>$v(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,i){void 0===o&&(o=0);const s=[];for(let l=0;l<t.length;l++){const c=Bv(e,e._getRowId(t[l],l,i),t[l],l,o,0,null==i?void 0:i.id);var a;n.flatRows.push(c),n.rowsById[c.id]=c,s.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(a=c.originalSubRows)&&a.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return s};return n.rows=r(t),n},jv(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getSortedRowModel:e=>$v(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],i=r.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),s={};i.forEach(t=>{const n=e.getColumn(t.id);n&&(s[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});const a=e=>{const t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let r=0;r<i.length;r+=1){var n;const o=i[r],a=s[o.id],l=a.sortUndefined,c=null!=(n=null==o?void 0:o.desc)&&n;let u=0;if(l){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);if(n||r){if("first"===l)return n?-1:1;if("last"===l)return n?1:-1;u=n&&r?0:n?l:-l}}if(0===u&&(u=a.sortingFn(e,t,o.id)),0!==u)return c&&(u*=-1),a.invertSorting&&(u*=-1),u}return e.index-t.index}),t.forEach(e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))}),t};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},jv(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getFilteredRowModel:e=>$v(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach(t=>{var n;const r=e.getColumn(t.id);if(!r)return;const i=r.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})});const s=(null!=n?n:[]).map(e=>e.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());let c,u;r&&a&&l.length&&(s.push("__global__"),l.forEach(e=>{var t;i.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(r))?t:r})}));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(i.length){for(let e=0;e<i.length;e++){u=i[e];const t=u.id;if(u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var r;const o=[],i={},s=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,a=function(e,r){void 0===r&&(r=0);const l=[];for(let u=0;u<e.length;u++){var c;let d=e[u];const f=Bv(n,d.id,d.original,d.index,d.depth,0,d.parentId);if(f.columnFilters=d.columnFilters,null!=(c=d.subRows)&&c.length&&r<s){if(f.subRows=a(d.subRows,r+1),d=f,t(d)&&!f.subRows.length){l.push(d),i[d.id]=d,o.push(d);continue}if(t(d)||f.subRows.length){l.push(d),i[d.id]=d,o.push(d);continue}}else d=f,t(d)&&(l.push(d),i[d.id]=d,o.push(d))}return l};return{rows:a(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){var r;const o=[],i={},s=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,a=function(e,r){void 0===r&&(r=0);const l=[];for(let u=0;u<e.length;u++){let d=e[u];if(t(d)){var c;if(null!=(c=d.subRows)&&c.length&&r<s){const e=Bv(n,d.id,d.original,d.index,d.depth,0,d.parentId);e.subRows=a(d.subRows,r+1),d=e}l.push(d),o.push(d),i[d.id]=d}}return l};return{rows:a(e),flatRows:o,rowsById:i}}(e,t,n)}(t.rows,e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0},e)},jv(e.options,"debugTable",0,()=>e._autoResetPageIndex())),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableMultiSort:n.sorting.multi,maxMultiSortColCount:n.sorting.multi?2:1,pageCount:o,getRowId:(e,t)=>String(e&&"object"==typeof e&&"id"in e?e.id:t),state:{pagination:r.pagination,sorting:r.sorting.map(e=>({id:e.id,desc:e.desc}))},onSortingChange:e=>{const t=r.sorting.map(e=>({id:e.id,desc:e.desc})),n="function"==typeof e?e(t):e;c(n)},onPaginationChange:e=>{const t="function"==typeof e?e(r.pagination):e;u(t)}}),te=he(e=>{if(e&&E&&g?.fetchNextPage){const{scrollHeight:t,scrollTop:n,clientHeight:r}=e;t-n-r<500&&!g.isFetchingNextPage&&g.hasNextPage&&g.fetchNextPage()}},[g,E]);var ne;ce(()=>{if(!E)return;const e=v.current;if(!e)return;const t=()=>te(e);return e.addEventListener("scroll",t,{passive:!0}),()=>e.removeEventListener("scroll",t)},[E,te]),ce(()=>{e.length>0&&Q&&requestAnimationFrame(()=>{Z.current.forEach(e=>{Q.measureElement(e)})})},[e,Q]);const re=he(()=>{const{rows:e}=ee.getRowModel(),t=Q.getVirtualItems();return yr("tbody",{style:{height:`${Q.getTotalSize()}px`,position:"relative"},children:t.map(t=>{const n=e[t.index];if(!n)return null;const o=n.id,i=T(o),a=F(n.original,n.index),c=K.current.get(t.index)||33,u=n.original.rowClass||"",f=t.index%2==1;return yr(x,{children:[yr("tr",{"data-index":t.index,"data-row-id":n.original.id||n.id,ref:e=>{if(e){const n=e.getBoundingClientRect().height;n>0&&K.current.set(t.index,n),Z.current.set(o,e),Q.measureElement(e)}else Z.current.delete(o)},onClick:()=>d?.(n.original),className:Ar("table-row",f?"odd":"even",u,d&&"table-row-clickable",k&&O&&"responsive-parent",i&&"expanded"),style:{position:"absolute",transform:`translateY(${t.start}px)`,width:"100%"},children:n.getVisibleCells().map((e,t)=>{const r=0===t,s=k&&"inline"===z?.control&&r&&M;return yr("td",{className:Ar("table-cell",e.column.id&&"__responsive_control__"!==e.column.id?`col-${e.column.id.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":e.column.id,style:{width:I[e.column.id]||e.column.getSize(),maxWidth:I[e.column.id]||e.column.getSize()},children:yr("div",{className:Ar("cell-content",s&&"has-responsive-control"),children:[s&&yr(rx,{isExpanded:i,onClick:()=>{"modal"===z?.display?$(n.index):X(o)},type:"inline",hasHiddenColumns:O}),Ay(e.column.columnDef.cell,e.getContext())]})},e.id)})}),k&&z&&("childRow"===z.display||"childRowVisible"===z.display)&&yr(tS,{hiddenColumns:a,rowData:n.original,columnConfigById:j,filters:s,currentFilters:r.filters,onFilterChange:l,rowIndex:n.index,visibleColumnCount:n.getVisibleCells().length,isVisible:i,display:z?.display,virtualStart:t.start,parentHeight:c},`${n.id}-child`)]},n.id)})})},[ee,Q,T,F,O,M,k,z,I,d,X,j,s,r.filters,l]),oe=S.location,ie="top"===oe||"both"===oe,se="bottom"===oe||"both"===oe,ue=S.hidden,fe=pe(()=>({headerGroups:ee.getHeaderGroups(),hidden:ue,stickyEnabled:S.sticky,asFooter:!1,columnWidths:I,shouldShowDropdown:G,getColumnName:H,sortItems:W,multiSortEnabled:n.sorting.multi,onSortingChange:U,onSingleSortClick:B,inlineFilterMap:q,currentFilters:r.filters,onFilterChange:l,filterCounts:a,showCounts:n.filtering.showCounts}),[ee,ue,S.sticky,I,G,H,W,n.sorting.multi,U,B,q,r.filters,l,a,n.filtering.showCounts]),ge=pe(()=>({...fe,hidden:!1,asFooter:!0}),[fe]),me=he(()=>yr(x,{children:[yr("table",{className:"data-table",children:[ie&&yr(Jx,{...fe,isSticky:!1}),re(),se&&yr(Jx,{...ge,isSticky:!1})]}),L&&ie&&yr("div",{className:"barn2-table-header-fixed-wrapper is-visible",style:D,children:yr("table",{className:"data-table",children:yr(Jx,{...fe,isSticky:!0})})}),E&&yr("div",{className:"infinite-scroll-status",style:{textAlign:"center",padding:"20px",fontSize:"14px",color:"#666"},children:[g?.isFetchingNextPage&&yr("div",{children:m.loadingMoreItems}),!g?.hasNextPage&&!g?.isFetchingNextPage&&yr("div",{children:m.allItemsLoaded})]}),!p&&0===e.length&&yr("div",{className:"no-data",children:m.noDataAvailable})]}),[fe,ge,re,L,D,E,g,e.length,ie,se,m]),ve=he(()=>{if(!k||"modal"!==z?.display||null===V)return null;const t=e[V],n=t?.title?String(t.title):void 0;return yr(vS,{allColumns:N(t,V),rowData:t,columnConfigById:j,filters:s,currentFilters:r.filters,onFilterChange:l,allowClickToFilter:!1,isOpen:null!==V,onClose:()=>$(null),rowIndex:V,title:n})},[k,z,V,N,e,j,s,r.filters,l]);return{containerRef:v,renderContent:me,renderModal:ve,widthsReady:P}}const bS=({onLoadMore:e,hasMore:t,isLoading:n,loadingMessage:r,endMessage:o})=>{const{i18n:i}=Lr(),s=r??i.loadingMore,a=o??i.noMoreItemsToLoad,l=de(null);return ce(()=>{const r=l.current;if(!r)return;const o=new IntersectionObserver(r=>{r[0].isIntersecting&&t&&!n&&e()},{root:null,rootMargin:"500px",threshold:0});return o.observe(r),()=>{o.disconnect()}},[e,t,n]),yr("div",t||n?{ref:l,className:"infinite-scroll-trigger",style:{textAlign:"center",padding:"20px",minHeight:"1px",display:"block"},children:n&&yr("div",{className:"infinite-scroll-loading",style:{fontSize:"14px",color:"#666"},children:s})}:{className:"infinite-scroll-end",style:{textAlign:"center",padding:"20px",color:"#666",fontSize:"14px"},children:a})},wS={type:"full_numbers",perPageSelector:"bottom",documentCount:"bottom",pageNavigation:"bottom"},_S={adjacentPages:!0},xS={threshold:.8,pageSize:10,height:"70vh"},SS={control:"inline",display:"childRow",breakpoints:{}},CS={minCardWidth:226,gap:25,columns:"autosize"},ES={enabled:!0,offset:15};function RS(e){return!1===e?{adjacentPages:!1}:"object"==typeof e?{adjacentPages:e.adjacentPages??_S.adjacentPages}:{..._S}}function IS(e){const t=!1!==e?.stickyHeader,n=!0===e?.hideHeader,r=e?.headerLocation??"top";return{sticky:t&&"bottom"!==r,hidden:n,location:r}}function PS(e){return!1===e?null:void 0===e||!0===e?{...ES}:"object"==typeof e?!1===e.enabled?null:{enabled:!0,offset:e.offset??ES.offset}:{...ES}}function kS(e){return{enabled:!1!==e?.sorting,multi:!0===e?.multiSort}}function OS(e){const t=e?.filtering;if("object"!=typeof t)return{enabled:!1!==t,above:!1!==t,column:!1,showCounts:!0};const n=!1!==t.enabled;return{enabled:n,above:n&&(t.above??!0),column:n&&(t.column??!1),showCounts:!1!==t.showCounts}}function MS(e){return void 0===e||!1===e?null:"object"==typeof e?{enabled:!1!==e.enabled}:{enabled:!0}}function TS(e,t){if("grid"===t)return null;if(void 0===e||!1===e)return null;if(!0===e)return{enabled:!0,actionButton:null,selectAll:{enabled:!0,label:null}};if("object"==typeof e){if(!1===e.enabled)return null;const t=!1===e.selectAll?{enabled:!1,label:null}:!0===e.selectAll||void 0===e.selectAll?{enabled:!0,label:null}:{enabled:!1!==e.selectAll.enabled,label:e.selectAll.label??null};return{enabled:!0,actionButton:e.actionButton?{label:e.actionButton.label,position:e.actionButton.position??"top"}:null,selectAll:t}}return null}const AS=({config:e,className:t,containerStyle:n,onStateChange:r,onAction:o,actionLoading:i,initialSelections:s,onSelectionChange:a,actionButtonLabelOverride:l,features:c,onDisplayModeChange:u})=>{const d=de(null),{displayMode:f,infiniteScroll:p,grid:h,hasLightboxColumn:g,prefetch:m}=c,v=null!==p,y="grid"===f,[b,w]=ae(0),_=pe(()=>({pagination:e.defaultState?.pagination||{pageIndex:0,pageSize:p?.pageSize||10},sorting:e.defaultState?.sorting||[],filters:e.defaultState?.filters||[],search:e.defaultState?.search||{query:""}}),[e,p?.pageSize]),{data:x,cardHtml:S,loading:C,isFetching:E,error:R,totalRows:I,totalPages:P,state:k,setState:O,refetch:M,hasNextPage:T,fetchNextPage:A,isFetchingNextPage:F,filterCounts:N}=(e=>{const{serverUrl:t,fetchData:n,viewId:r,state:o,enabled:i=!0,refetchInterval:s,urlSync:a,infiniteScroll:l,prefetchAdjacentPages:c=!0,displayMode:u,extraRequestData:d}=e;if(l)return Ml(e);const[f,p]=ae(0),h=de(n);ce(()=>{h.current!==n&&(h.current=n,p(e=>e+1))},[n]);const g=n?"fetchData":t||"missing-data-source",m=de(o||{pagination:{pageIndex:0,pageSize:10},sorting:[],filters:[],search:{query:""}}),v=Rr(),y=pe(()=>{const e=m.current;if(!a?.enabled)return e;const t=Il();if(!t)return e;const n=a.syncParams||["page","pageSize","filters","search","sorting"],r=Rl(t,n,e);return{...e,...r,pagination:r.pagination?{...e.pagination,...r.pagination}:e.pagination,sorting:void 0!==r.sorting?r.sorting:e.sorting}},[]),[b,w]=ae(y);Pl(b,w,a||{enabled:!1,syncParams:[]},m.current);const _=he(e=>{w(t=>({...t,...e,pagination:e.filters||e.search||e.sorting?{...t.pagination,pageIndex:0,...e.pagination||{}}:{...t.pagination,...e.pagination||{}}}))},[]),{data:x,isLoading:S,isFetching:C,isPlaceholderData:E,error:R,refetch:I}=function(e){return Mr(e,Kn)}({queryKey:Al(g,f,b,u,r),queryFn:()=>Nl(Fl(b,u,r),n,t,d),enabled:i,refetchInterval:s,placeholderData:e=>e,refetchOnWindowFocus:!1,staleTime:6e4,gcTime:3e5});return ce(()=>{if(!b.pagination)return;const e=b.pagination.pageIndex;if((n||t)&&c){if(e<(x?.totalPages||0)-1){const o={...b,pagination:{...b.pagination,pageIndex:e+1}};v.prefetchQuery({queryKey:Al(g,f,o,u,r),queryFn:()=>Nl(Fl(o,u,r),n,t,d),staleTime:6e4})}if(e>0){const o={...b,pagination:{...b.pagination,pageIndex:e-1}};v.prefetchQuery({queryKey:Al(g,f,o,u,r),queryFn:()=>Nl(Fl(o,u,r),n,t,d),staleTime:6e4})}}},[b.pagination?.pageIndex,x?.totalPages,g,f,n,t,c,b,v,u,r,d]),pe(()=>({data:x?.data||[],cardHtml:x?.cardHtml,loading:S,isFetching:C,isPlaceholderData:E,error:R,totalRows:x?.totalRows||0,totalPages:x?.totalPages||0,state:b,setState:_,refetch:I,filterCounts:x?.filterCounts}),[x,S,C,E,R,b,_,I])})({serverUrl:e.serverUrl,fetchData:e.fetchData,viewId:e.viewId,state:_,enabled:!0,urlSync:e.urlSync,infiniteScroll:v,prefetchAdjacentPages:m.adjacentPages,displayMode:f,extraRequestData:e.extraRequestData});ce(()=>{r?.(k)},[k,r]);const z=he((e,t)=>{const n=[...k.filters],r=n.findIndex(t=>t.id===e);null==t||Array.isArray(t)&&0===t.length?r>=0&&n.splice(r,1):r>=0?n[r]={id:e,value:t}:n.push({id:e,value:t}),O({filters:n})},[O,k.filters]),L=he(e=>{O({search:{...k.search,query:e}})},[O,k.search]),D=he(()=>{M()},[M]),V=he(()=>{O({filters:[],search:{query:""}})},[O]),$=he((e,t)=>{const n=k.filters.map(n=>{if(n.id!==e)return n;if(Array.isArray(n.value)){const e=n.value.filter(e=>e!==t);return e.length>0?{...n,value:e}:null}return null}).filter(e=>null!==e);O({filters:n})},[k.filters,O]),j=he(()=>{O({search:{query:""}})},[O]),q=k.filters.length>0||k.search.query.length>0,H=null!==c.rowSelection,W=function({enabled:e,isActionLoading:t,initialSelections:n,onSelectionChange:r}){const[o,i]=ae(()=>n??new Map),s=de(r);s.current=r,ce(()=>{s.current?.(o)},[o]);const a=he(t=>{e&&i(e=>{const n=new Map(e);return n.set(t.id,t),n})},[e]),l=he(t=>{e&&i(e=>{const n=new Map(e);return n.delete(t),n})},[e]),c=he(t=>{e&&0!==t.length&&i(e=>{const n=new Map(e);return t.forEach(e=>{n.set(e.id,e)}),n})},[e]),u=he(()=>{e&&i(()=>new Map)},[e]),d=o.size;return pe(()=>({selectedItems:o,selectItem:a,deselectItem:l,selectAll:c,deselectAll:u,containerRef:null,selectedCount:d,isActionLoading:t}),[o,a,l,c,u,d,t])}({enabled:H,isActionLoading:i??!1,initialSelections:s,onSelectionChange:a}),U=he(()=>{if(o){const e=Array.from(W.selectedItems.values());o({items:e,count:e.length})}},[o,W.selectedItems]),B=he(e=>{O({sorting:e})},[O]),G=he(e=>{O({pagination:e})},[O]),Z=pe(()=>{if(y||!c.filtering.column||!e.filters)return new Map;const t=new Map,n=new Set(e.columns.map(e=>e.id));return e.filters.forEach(e=>{const r=e.columnId??e.id;n.has(r)&&t.set(r,e)}),t},[y,c.filtering.column,e.filters,e.columns]),K=pe(()=>({handleSearch:L,handleSearchExecute:D,handleFilterChange:z,handleResetFilters:V,handleRemoveFilterValue:$,handleClearSearch:j,setDisplayMode:u,setPageSize:e=>O({pagination:{pageIndex:0,pageSize:e}}),setPage:e=>O({pagination:{...k.pagination,pageIndex:e}}),handleActionClick:U}),[L,D,z,V,$,j,U,u,O,k.pagination]),Q=function({features:e,state:t,totalPages:n,totalRows:r,hasActiveFilters:o,filters:i,filterCounts:s,rowsPerPageOptions:a,customLayout:l,inlineFilterMap:c,rowSelection:u,selectedCount:d,isActionLoading:f,actionButtonLabelOverride:p,handlers:h}){return pe(()=>{const c=[],{pagination:g,viewSwitcherEnabled:m,displayMode:v}=e,y=null!==g,b=g?.perPageSelector??"bottom",w=g?.documentCount??"bottom",_=g?.pageNavigation??"bottom",x=(e,t,n,r,o)=>{!1!==n&&("both"!==n&&"top"!==n||c.push(Vl(`${e}-top`,t,"top",r,o)),"both"!==n&&"bottom"!==n||c.push(Vl(`${e}-bottom`,t,"bottom",r,o)))};if(e.searching&&c.push(Vl("search",jl,"top",1,{slot:"search",value:t.search.query,onChange:h.handleSearch,onSearch:h.handleSearchExecute})),e.filtering.above&&i&&i.forEach((n,r)=>{const o=n.multiple?Vm:Dm,i=Fm(s,n.id);c.push(Vl(`filter-${n.id}`,o,"top",2+r,{slot:"filters",filter:n,value:t.filters.find(e=>e.id===n.id)?.value,onChange:e=>h.handleFilterChange(n.id,e),onReset:()=>h.handleFilterChange(n.id,null),filterCounts:i,showCounts:e.filtering.showCounts}))}),m&&c.push(Vl("view-switcher",Tv,"top",99,{slot:"actions",currentView:v,onViewChange:h.setDisplayMode})),e.filtering.enabled&&o&&c.push(Vl("filter-reset",$m,"top",52,{slot:"reset",onReset:h.handleResetFilters,hasActiveFilters:o})),e.activeFilters?.enabled&&o&&c.push(Vl("active-filters",qm,"top",51,{slot:"active",filters:t.filters,search:t.search,filterConfigs:i||[],onRemoveFilter:h.handleRemoveFilterValue,onClearSearch:h.handleClearSearch})),y&&!1===b&&!1===w&&!1===_&&c.push(Vl("table-info",kv,"bottom",1,{currentPage:t.pagination.pageIndex,pageSize:t.pagination.pageSize,totalRows:r,rowsPerPageOptions:a,onPageSizeChange:h.setPageSize})),y&&g&&(x("per-page-selector",Rv,b,1,{pageSize:t.pagination.pageSize,rowsPerPageOptions:a,onPageSizeChange:h.setPageSize}),x("document-count",Iv,w,2,{currentPage:t.pagination.pageIndex,pageSize:t.pagination.pageSize,totalRows:r}),n>1&&x("page-navigation",Pv,_,3,{currentPage:t.pagination.pageIndex,totalPages:n,paginationType:g.type,onPageChange:h.setPage})),u?.actionButton&&"table"===v){const e=u.actionButton,t={slot:"actions",label:e.label,labelOverrideSignal:p,selectedCount:d??0,onClick:h.handleActionClick??(()=>{}),isLoading:f??!1};x("action-button",Av,e.position,100,t)}return{...Dl,...l,components:[...c,...l?.components||[]]}},[e,t,n,r,o,i,s,a,l,c,u,d,f,p,h])}({features:c,state:k,totalPages:P,totalRows:I,hasActiveFilters:q,filters:e.filters,filterCounts:N,rowsPerPageOptions:e.rowsPerPageOptions,customLayout:e.layout,inlineFilterMap:Z,rowSelection:c.rowSelection,selectedCount:W.selectedCount,isActionLoading:W.isActionLoading,actionButtonLabelOverride:l,handlers:K}),X=yS({data:x,columns:e.columns,features:c,state:k,totalPages:P,containerWidth:b,filters:e.filters,filterCounts:N,onFilterChange:z,onSortingChange:B,onPaginationChange:G,onRowClick:e.onRowClick,wrapperRef:d,loading:C,rowSelection:c.rowSelection,infiniteScroll:v?{hasNextPage:T??!1,isFetchingNextPage:F??!1,fetchNextPage:A??(()=>{})}:void 0}),J=function({cardHtml:e,config:t,loading:n,enableLightbox:r=!1,infiniteScroll:o,scrollToTop:i,wrapperRef:s,state:a}){const{i18n:l}=Lr(),c=de(null),u=t.gap??25,d=t.columns??"autosize",f=o?.enabled??!1;bx({enabled:null!=i,offset:i?.offset??0,targetRef:s??c,stateKey:a?JSON.stringify({...!f&&{page:a.pagination.pageIndex},filters:a.filters,search:a.search.query,sorting:a.sorting}):"",loading:n});const[p,h]=ae({isOpen:!1,imageUrl:null,caption:null}),g=he(()=>{o?.fetchNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[o]),m=he(e=>{if(!r)return;const t=e.target.closest("img");if(!t)return;const n=t.dataset.lightboxUrl||t.src,o=t.alt||"";h({isOpen:!0,imageUrl:n,caption:o})},[r]),v=he(()=>{h({isOpen:!1,imageUrl:null,caption:null})},[]),y=`grid-container dlp-grid-documents ${((e="autosize")=>"autosize"===e?"grid-autosize":`columns-${e}`)(d)}`,b=he(()=>n||0!==e.length?yr("div",{className:"grid-wrapper",children:[yr("div",{className:y,style:{gap:`${u}px`},onClick:m,children:e.map((e,t)=>yr("div",{className:"grid-card",dangerouslySetInnerHTML:{__html:e}},t))}),o?.enabled&&yr(bS,{onLoadMore:g,hasMore:o.hasNextPage,isLoading:o.isFetchingNextPage,loadingMessage:l.loadingMoreItems,endMessage:l.noMoreItemsToLoad}),p.isOpen&&yr(ex,{isOpen:p.isOpen,imageUrl:p.imageUrl,caption:p.caption,onClose:v})]}):yr("div",{className:"grid-empty",children:[yr("div",{className:"grid-empty-title",children:l.noItemsFound}),yr("div",{className:"grid-empty-message",children:l.adjustFiltersOrSearch})]}),[n,e,y,u,m,o,g,p,v,l]);return{containerRef:c,renderContent:b}}({cardHtml:S||[],config:h||{gap:25,columns:"autosize"},loading:C,enableLightbox:g,infiniteScroll:v?{enabled:!0,hasNextPage:T??!1,isFetchingNextPage:F??!1,fetchNextPage:A??(()=>{})}:void 0,scrollToTop:c.scrollToTop,wrapperRef:d,state:k}),Y=y?J:X,ee=pe(()=>({...W,containerRef:Y.containerRef}),[W,Y.containerRef]),te=C&&0===x.length||!y&&!X.widthsReady;!function({enabled:e,containerRef:t,selectedItems:n,onSelect:r,onDeselect:o,data:i,contentRendered:s}){const a=de(null),l=de(new Set),c=de(r);c.current=r;const u=de(o);u.current=o;const d=de(n);d.current=n,ce(()=>{l.current=new Set(n.keys())},[n]);const f=he(()=>{const e=t.current;e&&e.querySelectorAll(Nv).forEach(e=>{const t=e.getAttribute(Fv);if(!t)return;const n=d.current.has(t);e.checked!==n&&(e.checked=n,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))})},[t]),p=he((e,n)=>{const r=t.current;r&&r.querySelectorAll(Nv).forEach(t=>{t.getAttribute(Fv)===e&&(t.checked=n)})},[t]),h=he(e=>{if(!(e instanceof Element))return null;if(e instanceof HTMLInputElement&&e.matches(Nv))return e;const t=e.closest(Nv);if(t instanceof HTMLInputElement)return t;const n=e.closest("label");if(n){const e=n.querySelector(Nv);if(e)return e}const r=e.closest(".multi-cart-check, .wpt-multi-checkbox");return r?r.querySelector(Nv):null},[]),g=he(()=>{null!==a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{a.current=null,f()})},[f]),m=he(e=>{const t=e.getAttribute(Fv);if(!t)return;const n=e.checked;p(t,n),l.current.has(t)!==n&&(n?(l.current.add(t),c.current({id:t,attributes:zv(e)})):(l.current.delete(t),u.current(t)))},[p]);ce(()=>{if(e&&s)return g(),()=>{null!==a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[e,s,n,g,i]),ce(()=>{if(!e||!s)return;const n=t.current;if(!n)return void g();const r=e=>{const t=h(e.target);t&&n.contains(t)&&m(t)},o=e=>{const t=h(e.target);t&&n.contains(t)&&requestAnimationFrame(()=>{m(t)})},i=new MutationObserver(()=>{g()});return n.addEventListener("change",r,!0),n.addEventListener("input",r,!0),n.addEventListener("click",o,!0),i.observe(n,{childList:!0,subtree:!0}),g(),()=>{i.disconnect(),n.removeEventListener("change",r,!0),n.removeEventListener("input",r,!0),n.removeEventListener("click",o,!0),null!==a.current&&(cancelAnimationFrame(a.current),a.current=null)}},[e,s,t,g,m,h])}({enabled:H,containerRef:Y.containerRef,selectedItems:W.selectedItems,onSelect:W.selectItem,onDeselect:W.deselectItem,data:x,contentRendered:!te}),ce(()=>{if(te||E)return;const e=Y.containerRef.current;if(!e)return;let t=!1;const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{t||e.dispatchEvent(new CustomEvent("contentRendered",{bubbles:!0,detail:{container:e,displayMode:f,itemCount:x.length,state:k}}))})});return()=>{t=!0,cancelAnimationFrame(n)}},[te,E,Y.containerRef,f,x.length,k]);const ne=v?{maxHeight:p?.height??"70vh"}:null;if(ce(()=>{const e=Y.containerRef.current;if(!e)return;const t=e.offsetWidth;w(t);const n=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect.width;w(e)}});return n.observe(e),()=>{n.disconnect()}},[Y.containerRef]),ce(()=>{R&&console.warn("DataView: failed to load data",R)},[R]),R)return null;const re=E&&x.length>0,oe=te||re;return yr(Vr,{value:ee,children:yr("div",{ref:d,className:Ar("barn2-dataview","data-view",t),"data-display-mode":f,children:[yr(Ll,{config:Q,hideControls:te,children:yr("div",{ref:Y.containerRef,className:Ar("dataview-container",oe&&"loading",y&&"grid-mode",v&&"infinite-scroll-mode",!v&&!y&&"paginated-mode"),style:{...n,...ne,position:"relative"},children:[oe&&yr("div",{className:"data-view-loading-overlay",children:yr("div",{className:"loading-spinner dv-loading-spinner"})}),!te&&Y.renderContent()]})}),!y&&X.renderModal()]})})},FS=e=>{const{config:t}=e,n=t.features?.displayMode||"table",[r,o]=ae(n),i=pe(()=>function(e,t){const n=e.features||{},r=!0===n.viewSwitcher,o=n.displayMode||"table",i=r&&t?t:o,s=void 0===(a=n.grid)||!1===a?null:"object"==typeof a?{minCardWidth:a.minCardWidth??CS.minCardWidth,gap:a.gap??CS.gap,columns:a.columns??CS.columns}:{...CS};var a;const l=function(e){return void 0===e||!1===e?null:"object"==typeof e?{threshold:e.threshold??xS.threshold,pageSize:e.pageSize??xS.pageSize,height:e.height??xS.height}:{...xS}}(n.infiniteScroll),c=null!==l,u=function(e,t){return t||!1===e?null:"object"==typeof e?{type:e.type??wS.type,perPageSelector:e.perPageSelector??wS.perPageSelector,documentCount:e.documentCount??wS.documentCount,pageNavigation:e.pageNavigation??wS.pageNavigation}:{...wS}}(n.pagination,c),d=function(e,t){return"grid"===t||void 0===e||!1===e?null:"object"==typeof e?{control:e.control??SS.control,display:(n=e.display,n?{child_row:"childRow",childRow:"childRow",child_row_visible:"childRowVisible",childRowVisible:"childRowVisible",modal:"modal"}[n]??SS.display:SS.display),breakpoints:e.breakpoints??SS.breakpoints}:{...SS};var n}(n.responsive,i);return{displayMode:i,viewSwitcherEnabled:r&&null!==s,pagination:u,prefetch:RS(n.prefetch),infiniteScroll:l,responsive:d,grid:s,sorting:kS(n),filtering:OS(n),searching:!1!==n.searching,header:IS(n),scrollToTop:PS(n.scrollToTop),hasLightboxColumn:(f=e.columns,f.some(e=>"image"===e.dataType&&e.lightbox)),activeFilters:MS(n.activeFilters),rowSelection:TS(n.rowSelection,i)};var f}(t,r),[t,r]),s=pe(()=>(e=>{if(!e)return Fr;const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...Fr,...t}})(t.i18n),[t.i18n]);return yr(zr,{value:{displayMode:i.displayMode,i18n:s},children:yr(AS,{...e,features:i,onDisplayModeChange:o})})};class NS{constructor(e,t){if(this.mounted=!1,this.eventHandlers=new Map,this.selections=new Map,this.actionLoading=!1,this.actionButtonLabelOverride=Vt(null),this.contentRenderedListener=null,"string"==typeof e){const t=document.querySelector(e);if(!t)throw new Error(`Container not found: ${e}`);this.container=t}else this.container=e;this.id=t.id||this.generateId(),this.config=Vt(t),this.queryClient=new ur({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:6e4,gcTime:3e5}}}),this.mount(),NS.instances.set(this.id,this)}renderApp(){ot(b(Ir,{client:this.queryClient},b(FS,{config:this.config.value,onStateChange:e=>this.emit("stateChange",e),onAction:e=>this.emit("rowSelectionAction",e),actionLoading:this.actionLoading,initialSelections:this.selections,onSelectionChange:e=>{this.selections=e},actionButtonLabelOverride:this.actionButtonLabelOverride})),this.container)}mount(){try{this.renderApp(),this.mounted=!0,this.contentRenderedListener=e=>{this.emit("contentRendered",e.detail)},this.container.addEventListener("contentRendered",this.contentRenderedListener)}catch(e){throw this.emit("error",e),e}}updateConfig(e){this.config.value={...this.config.value,...e},this.emit("configUpdate",e),this.refresh()}setFilters(e){const t=this.config.value;this.config.value={...t,defaultState:{...t.defaultState,filters:Object.entries(e).map(([e,t])=>({id:e,value:t}))}}}refresh(){this.mounted&&(this.unmount(),this.mount())}setActionLoading(e){this.actionLoading!==e&&(this.actionLoading=e,this.mounted&&this.renderApp())}setActionButtonLabel(e){const t=null===e?null:String(e);this.actionButtonLabelOverride.value!==t&&(this.actionButtonLabelOverride.value=t)}destroy(){this.unmount(),this.queryClient.clear(),NS.instances.delete(this.id),this.eventHandlers.clear()}unmount(){this.mounted&&(this.contentRenderedListener&&(this.container.removeEventListener("contentRendered",this.contentRenderedListener),this.contentRenderedListener=null),ot(null,this.container),this.mounted=!1)}on(e,t){this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(t)}off(e,t){this.eventHandlers.get(e)?.delete(t)}emit(e,t){this.eventHandlers.get(e)?.forEach(e=>e(t))}generateId(){return`dataview-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}getId(){return this.id}getConfig(){return this.config.value}getContainer(){return this.container}static getInstance(e){return NS.instances.get(e)}static getAllInstances(){return Array.from(NS.instances.values())}static destroyAll(){NS.instances.forEach(e=>e.destroy())}}NS.instances=new Map;const zS=["show","perPage","firstPage","previousPage","nextPage","lastPage","tableView","gridView","selectAll","resetFilters","reset","searchPlaceholder","searchTableData","clearSearch","clearSelection","clearAllSelections","noResultsFound","clear","sort","sortAscending","sortDescending","switchToPrimarySort","switchToSecondarySort","setAsPrimarySort","setAsSecondarySort","loadingMore","loadingMoreItems","noMoreItemsToLoad","allItemsLoaded","noDataAvailable","noItemsFound","adjustFiltersOrSearch","details","close","additionalRowDetails","expandRowDetails","collapseRowDetails","image"],LS=(NS.getInstance,NS.getAllInstances,NS.destroyAll,window.wp.i18n);var DS;const VS=(({strings:e={},sprintf:t})=>{const n={};for(const t of zS){const r=e[t];void 0!==r&&(n[t]=r)}return void 0!==e.showingRangeOfTotal&&(n.showingRangeOfTotal=({start:n,end:r,total:o})=>t(e.showingRangeOfTotal,n,r,o)),void 0!==e.showingRangeToTotal&&(n.showingRangeToTotal=({start:n,end:r,total:o})=>t(e.showingRangeToTotal,n,r,o)),void 0!==e.itemsPerPageOption&&(n.itemsPerPageOption=({count:n})=>t(e.itemsPerPageOption,n)),void 0!==e.page&&(n.page=({page:n})=>t(e.page,n)),void 0!==e.selectFilter&&(n.selectFilter=({filterName:n})=>t(e.selectFilter,n)),void 0!==e.searchFilter&&(n.searchFilter=({filterName:n})=>t(e.searchFilter,n)),void 0!==e.searchFilterPlaceholder&&(n.searchFilterPlaceholder=({filterName:n})=>t(e.searchFilterPlaceholder,n)),void 0!==e.activeSearch&&(n.activeSearch=({query:n})=>t(e.activeSearch,n)),void 0!==e.removeActiveItem&&(n.removeActiveItem=({label:n})=>t(e.removeActiveItem,n)),void 0!==e.filterBy&&(n.filterBy=({filterName:n})=>t(e.filterBy,n)),void 0!==e.sortByColumn&&(n.sortByColumn=({columnName:n})=>t(e.sortByColumn,n)),void 0!==e.columnOptionsFor&&(n.columnOptionsFor=({columnName:n})=>t(e.columnOptionsFor,n)),void 0!==e.replacePrimarySort&&(n.replacePrimarySort=({columnName:n})=>t(e.replacePrimarySort,n)),void 0!==e.replaceSecondarySort&&(n.replaceSecondarySort=({columnName:n})=>t(e.replaceSecondarySort,n)),void 0!==e.openLightboxFor&&(n.openLightboxFor=({label:n})=>t(e.openLightboxFor,n)),void 0!==e.filterByTerm&&(n.filterByTerm=({term:n})=>t(e.filterByTerm,n)),n})({strings:null!==(DS=window.PostsTableProDVF?.i18n)&&void 0!==DS?DS:{},sprintf:LS.sprintf});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('.ptp-dataview[data-frontend="dataviews"]').forEach(e=>{const t=JSON.parse(e.dataset.config);t.i18n=VS,new NS(e,t)})})})();